Make input.triggers[] consistent with input.actions[]

qt6_macos
uramer 5 months ago
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…
Cancel
Save