Skip to content

Commit 56744b6

Browse files
committed
guess im copying again
1 parent dda5cfe commit 56744b6

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

include/Horrible.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace horrible {
8989
*
9090
* @returns A result possibly containing the option object
9191
*/
92-
[[nodiscard]] geode::Result<horrible::Option> getOptionInfo(std::string_view id) const noexcept;
92+
[[nodiscard]] geode::Result<Option> getOptionInfo(std::string_view id) const noexcept;
9393

9494
/**
9595
* Returns the amount of delegate callbacks registered for an option
@@ -116,7 +116,7 @@ namespace horrible {
116116
* @param id The ID of the option to set the delegate for
117117
* @param callback The hook callback to register for this option's delegate
118118
*/
119-
void addDelegate(geode::ZStringView id, geode::Function<void(bool)>&& callback);
119+
void addDelegate(std::string id, geode::Function<void(bool)>&& callback);
120120

121121
/**
122122
* Returns a reference to the array of all registered categories
@@ -132,15 +132,16 @@ namespace horrible {
132132
* @param id The ID of the option to delegate for
133133
* @param hooks The map of hooks to delegate
134134
*/
135-
AWCW_HORRIBLE_API_DLL void delegateHooks(geode::ZStringView id, geode::utils::StringMap<std::shared_ptr<geode::Hook>>& hooks);
135+
AWCW_HORRIBLE_API_DLL void delegateHooks(std::string id, geode::utils::StringMap<std::shared_ptr<geode::Hook>>& hooks);
136136
};
137137

138138
// Statically register an option
139-
#define HORRIBLE_REGISTER_OPTION(opt) $execute {\
139+
#define HORRIBLE_REGISTER_OPTION(opt) \
140+
$execute { \
140141
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
141142
}
142143

143-
// Delegate registered hooks to OptionManager for dynamic toggling
144+
// Delegate hooks to OptionManager for dynamic toggling
144145
#define HORRIBLE_DELEGATE_HOOKS(id) \
145146
static void onModify(auto& self) { \
146147
horrible::delegateHooks(id, self.m_hooks); \

mod.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"resources/*.png"
3333
]
3434
},
35-
"dependencies": {
36-
"geode.node-ids": ">=1.22.0"
37-
},
3835
"api": {
3936
"include": [
4037
"include/*.hpp"

src/hooks/Dementia.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using namespace geode::prelude;
99
using namespace horrible::prelude;
1010

11-
static Option const o = {
11+
inline static Option const o = {
1212
"dementia",
1313
"Dementia",
1414
"Chance of the player randomly teleports back. This is more like player lagging to be honest!\n<cy>Credit: imdissapearinghelp</c>",

src/include/Horrible.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void OptionManager::registerOption(Option option) {
3030
};
3131
};
3232

33-
void OptionManager::addDelegate(ZStringView id, Function<void(bool)>&& callback) {
33+
void OptionManager::addDelegate(std::string id, Function<void(bool)>&& callback) {
3434
auto& thisDelegate = m_delegates[id];
3535
thisDelegate.push_back(std::move(callback));
3636
};
@@ -81,7 +81,7 @@ OptionManager* OptionManager::get() noexcept {
8181
return inst;
8282
};
8383

84-
void horrible::delegateHooks(ZStringView id, utils::StringMap<std::shared_ptr<Hook>>& hooks) {
84+
void horrible::delegateHooks(std::string id, utils::StringMap<std::shared_ptr<Hook>>& hooks) {
8585
if (auto om = OptionManager::get()) {
8686
auto value = om->getOption(id);
8787

@@ -95,7 +95,7 @@ void horrible::delegateHooks(ZStringView id, utils::StringMap<std::shared_ptr<Ho
9595
log::debug("Delegating {} hooks for {}", allHooks.size(), id);
9696

9797
om->addDelegate(
98-
id,
98+
std::move(id),
9999
[allHooks = std::move(allHooks)](bool value) {
100100
for (auto hook : allHooks) (void)hook->toggle(value);
101101
}

0 commit comments

Comments
 (0)