You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/Horrible.hpp
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -39,13 +39,16 @@ struct matjson::Serialize<HorribleOptionSave> final {
39
39
40
40
// Container for Horrible Ideas API functions
41
41
namespacehorrible {
42
+
// Type alias for `geode::Function<void(bool)>`, used in hook delegation
43
+
using HookToggleCallback = geode::Function<void(bool)>;
44
+
42
45
// Option manager for Horrible Ideas
43
46
classAWCW_HORRIBLE_API_DLL OptionManager final : public cocos2d::CCObject {
44
47
private:
45
48
std::vector<Option> m_options; // Array of registered options
46
49
std::vector<std::string> m_categories; // Array of auto-registered categories
47
50
48
-
std::unordered_map<std::string_view, std::vector<geode::Function<void(bool)>>> m_delegates; // Map of option ID to array of delegates to call when that option is toggled
51
+
std::unordered_map<std::string_view, std::vector<HookToggleCallback>> m_delegates; // Map of option ID to array of delegates to call when that option is toggled
49
52
50
53
protected:
51
54
OptionManager() = default; // Default constructor
@@ -147,7 +150,7 @@ namespace horrible {
147
150
* @param id The ID of the option to set the delegate for
148
151
* @param callback The hook callback to register for this option's delegate
0 commit comments