mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
Added custom event registry
This commit is contained in:
@@ -47,4 +47,19 @@ namespace hex {
|
||||
return *SharedData::get().settingsJson;
|
||||
}
|
||||
|
||||
|
||||
/* Events */
|
||||
|
||||
auto ContentRegistry::Events::get(std::string_view name) {
|
||||
auto &customEvents = *SharedData::get().customEvents;
|
||||
auto &lastId = *SharedData::get().customEventsLastId;
|
||||
|
||||
if (!customEvents.contains(name.data())) {
|
||||
customEvents[name.data()] = static_cast<hex::Events>(lastId);
|
||||
lastId++;
|
||||
}
|
||||
|
||||
return customEvents[name.data()];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user