mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Merge pull request #2241 from Capostrophic/console
Use selected object local variables in the console (feature #3893)
This commit is contained in:
commit
f62c1c59b4
@ -44,6 +44,7 @@
|
|||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3442: Default values for fallbacks from ini file
|
Feature #3442: Default values for fallbacks from ini file
|
||||||
Feature #3610: Option to invert X axis
|
Feature #3610: Option to invert X axis
|
||||||
|
Feature #3893: Implicit target for "set" function in console
|
||||||
Feature #3980: In-game option to disable controller
|
Feature #3980: In-game option to disable controller
|
||||||
Feature #4209: Editor: Faction rank sub-table
|
Feature #4209: Editor: Faction rank sub-table
|
||||||
Feature #4673: Weapon sheathing
|
Feature #4673: Weapon sheathing
|
||||||
|
@ -11,10 +11,12 @@
|
|||||||
#include "../mwscript/extensions.hpp"
|
#include "../mwscript/extensions.hpp"
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
#include "../mwbase/scriptmanager.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
@ -173,6 +175,12 @@ namespace MWGui
|
|||||||
print("> " + command + "\n");
|
print("> " + command + "\n");
|
||||||
|
|
||||||
Compiler::Locals locals;
|
Compiler::Locals locals;
|
||||||
|
if (!mPtr.isEmpty())
|
||||||
|
{
|
||||||
|
std::string script = mPtr.getClass().getScript(mPtr);
|
||||||
|
if (!script.empty())
|
||||||
|
locals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
||||||
|
}
|
||||||
Compiler::Output output (locals);
|
Compiler::Output output (locals);
|
||||||
|
|
||||||
if (compile (command + "\n", output))
|
if (compile (command + "\n", output))
|
||||||
|
@ -951,7 +951,7 @@ namespace MWScript
|
|||||||
|
|
||||||
const std::string script = ptr.getClass().getScript(ptr);
|
const std::string script = ptr.getClass().getScript(ptr);
|
||||||
if(script.empty())
|
if(script.empty())
|
||||||
str<< ptr.getCellRef().getRefId()<<" does not have a script.";
|
str<< ptr.getCellRef().getRefId()<<" does not have a script.";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str<< "Local variables for "<<ptr.getCellRef().getRefId();
|
str<< "Local variables for "<<ptr.getCellRef().getRefId();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user