mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 16:30:02 -05:00
sys: Replace the terrible event manager with a much better one
This commit is contained in:
@@ -17,7 +17,7 @@ namespace hex {
|
||||
io.link_detach_with_modifier_click.modifier = &always;
|
||||
}
|
||||
|
||||
View::subscribeEvent(Events::SettingsChanged, [](auto) {
|
||||
EventManager::subscribe<EventSettingsChanged>(this, [] {
|
||||
auto theme = ContentRegistry::Settings::getSetting("hex.builtin.setting.interface", "hex.builtin.setting.interface.color");
|
||||
|
||||
if (theme.is_number()) {
|
||||
@@ -38,7 +38,7 @@ namespace hex {
|
||||
}
|
||||
});
|
||||
|
||||
View::subscribeEvent(Events::FileLoaded, [this](auto) {
|
||||
EventManager::subscribe<EventFileLoaded>(this, [this](const std::string &path){
|
||||
for (auto &node : this->m_nodes) {
|
||||
node->setCurrentOverlay(nullptr);
|
||||
}
|
||||
@@ -50,6 +50,9 @@ namespace hex {
|
||||
for (auto &node : this->m_nodes)
|
||||
delete node;
|
||||
|
||||
EventManager::unsubscribe<EventSettingsChanged>(this);
|
||||
EventManager::unsubscribe<EventFileLoaded>(this);
|
||||
|
||||
imnodes::PopAttributeFlag();
|
||||
imnodes::PopAttributeFlag();
|
||||
imnodes::Shutdown();
|
||||
|
||||
Reference in New Issue
Block a user