mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-27 05:37:25 +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({});
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Id id = safeIdByKey(key);
|
||||
|
@ -126,11 +126,7 @@ namespace LuaUtil::InputTrigger
|
||||
return std::nullopt;
|
||||
return it->first;
|
||||
}
|
||||
std::optional<Info> operator[](std::string_view key)
|
||||
{
|
||||
Id id = safeIdByKey(key);
|
||||
return mInfo[id];
|
||||
}
|
||||
std::optional<Info> operator[](std::string_view key);
|
||||
void insert(Info info);
|
||||
void registerHandler(std::string_view key, const LuaUtil::Callback& callback);
|
||||
void activate(std::string_view key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user