mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Make input.triggers[] consistent with input.actions[]
This commit is contained in:
parent
5f2cbf810d
commit
1d8ee7984f
@ -265,6 +265,14 @@ namespace LuaUtil
|
|||||||
mHandlers.push_back({});
|
mHandlers.push_back({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<Info> Registry::operator[](std::string_view key)
|
||||||
|
{
|
||||||
|
auto iter = mIds.find(key);
|
||||||
|
if (iter == mIds.end())
|
||||||
|
return std::nullopt;
|
||||||
|
return mInfo[iter->second];
|
||||||
|
}
|
||||||
|
|
||||||
void Registry::registerHandler(std::string_view key, const LuaUtil::Callback& callback)
|
void Registry::registerHandler(std::string_view key, const LuaUtil::Callback& callback)
|
||||||
{
|
{
|
||||||
Id id = safeIdByKey(key);
|
Id id = safeIdByKey(key);
|
||||||
|
@ -126,11 +126,7 @@ namespace LuaUtil::InputTrigger
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
return it->first;
|
return it->first;
|
||||||
}
|
}
|
||||||
std::optional<Info> operator[](std::string_view key)
|
std::optional<Info> operator[](std::string_view key);
|
||||||
{
|
|
||||||
Id id = safeIdByKey(key);
|
|
||||||
return mInfo[id];
|
|
||||||
}
|
|
||||||
void insert(Info info);
|
void insert(Info info);
|
||||||
void registerHandler(std::string_view key, const LuaUtil::Callback& callback);
|
void registerHandler(std::string_view key, const LuaUtil::Callback& callback);
|
||||||
void activate(std::string_view key);
|
void activate(std::string_view key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user