1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-14 18:18:05 +00:00

replaced hooks_startmenu and hooks_mainmenu with a general hooks_display_dialog

This commit is contained in:
Zeno Rogue
2019-09-08 10:08:05 +02:00
parent ca9a025e45
commit 8f8fb8a217
4 changed files with 16 additions and 8 deletions

View File

@@ -59,6 +59,12 @@ public:
explicit operator bool() const noexcept {
return ptr_ != nullptr;
}
template<class T> T* target() {
auto ptr = dynamic_cast<function_state<T, R, Args...>*> (ptr_);
if(!ptr) return nullptr;
return &ptr->t_;
}
};
} // namespace hr