|
|
|
@ -225,15 +225,13 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> InterpreterContext::getGlobals() const
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::string> ids;
|
|
|
|
|
|
|
|
|
|
const MWWorld::Store<ESM::Global>& globals =
|
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Global>();
|
|
|
|
|
|
|
|
|
|
for (MWWorld::Store<ESM::Global>::iterator iter = globals.begin(); iter!=globals.end();
|
|
|
|
|
++iter)
|
|
|
|
|
std::vector<std::string> ids;
|
|
|
|
|
for (auto& globalVariable : globals)
|
|
|
|
|
{
|
|
|
|
|
ids.push_back (iter->mId);
|
|
|
|
|
ids.emplace_back(globalVariable.mId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ids;
|
|
|
|
@ -245,22 +243,22 @@ namespace MWScript
|
|
|
|
|
return world->getGlobalVariableType(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string InterpreterContext::getActionBinding(const std::string& action) const
|
|
|
|
|
std::string InterpreterContext::getActionBinding(const std::string& targetAction) const
|
|
|
|
|
{
|
|
|
|
|
MWBase::InputManager* input = MWBase::Environment::get().getInputManager();
|
|
|
|
|
std::vector<int> actions = input->getActionKeySorting ();
|
|
|
|
|
for (std::vector<int>::const_iterator it = actions.begin(); it != actions.end(); ++it)
|
|
|
|
|
for (const int action : actions)
|
|
|
|
|
{
|
|
|
|
|
std::string desc = input->getActionDescription (*it);
|
|
|
|
|
std::string desc = input->getActionDescription (action);
|
|
|
|
|
if(desc == "")
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if(desc == action)
|
|
|
|
|
if(desc == targetAction)
|
|
|
|
|
{
|
|
|
|
|
if(input->joystickLastUsed())
|
|
|
|
|
return input->getActionControllerBindingName(*it);
|
|
|
|
|
return input->getActionControllerBindingName(action);
|
|
|
|
|
else
|
|
|
|
|
return input->getActionKeyBindingName (*it);
|
|
|
|
|
return input->getActionKeyBindingName(action);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|