@@ -30,42 +30,42 @@ matjson::Value matjson::Serialize<HorribleOptionSave>::toJson(HorribleOptionSave
3030
3131Option::Option (std::string id, const Mod* integration) : m_id(std::move(id)), m_integration(integration) {};
3232
33- std::shared_ptr<Option> Option::setName (std::string name) & {
33+ std::shared_ptr<Option> Option::setName (std::string name) {
3434 m_name = std::move (name);
3535 return shared_from_this ();
3636};
3737
38- std::shared_ptr<Option> Option::setDescription (std::string description) & {
38+ std::shared_ptr<Option> Option::setDescription (std::string description) {
3939 m_description = std::move (description);
4040 return shared_from_this ();
4141};
4242
43- std::shared_ptr<Option> Option::setCategory (std::string category) & {
43+ std::shared_ptr<Option> Option::setCategory (std::string category) {
4444 m_category = std::move (category);
4545 return shared_from_this ();
4646};
4747
48- std::shared_ptr<Option> Option::setSillyTier (SillyTier tier) & {
48+ std::shared_ptr<Option> Option::setSillyTier (SillyTier tier) {
4949 m_silly = tier;
5050 return shared_from_this ();
5151};
5252
53- std::shared_ptr<Option> Option::setDefaultToggleState (bool state) & {
53+ std::shared_ptr<Option> Option::setDefaultToggleState (bool state) {
5454 m_default = state;
5555 return shared_from_this ();
5656};
5757
58- std::shared_ptr<Option> Option::setOnline (bool online) & {
58+ std::shared_ptr<Option> Option::setOnline (bool online) {
5959 m_online = online;
6060 return shared_from_this ();
6161};
6262
63- std::shared_ptr<Option> Option::setRequiresRestart (bool required) & {
63+ std::shared_ptr<Option> Option::setRequiresRestart (bool required) {
6464 m_restart = required;
6565 return shared_from_this ();
6666};
6767
68- std::shared_ptr<Option> Option::setSupportedPlatforms (std::vector<Platform> platforms) & {
68+ std::shared_ptr<Option> Option::setSupportedPlatforms (std::vector<Platform> platforms) {
6969 m_platforms = std::move (platforms);
7070 return shared_from_this ();
7171};
@@ -128,7 +128,7 @@ void Option::disable() {
128128 if (auto om = OptionManager::get ()) om->toggleOption (getID (), false );
129129};
130130
131- std::shared_ptr<Option> Option::autoRegister () & {
131+ std::shared_ptr<Option> Option::autoRegister () {
132132 if (auto om = OptionManager::get ()) om->registerOption (shared_from_this ());
133133 return shared_from_this ();
134134};
@@ -137,11 +137,11 @@ std::shared_ptr<Option> Option::create(std::string id, const Mod* integration) {
137137 return std::make_shared<Option>(std::move (id), integration);
138138};
139139
140- void OptionManager::registerCategory (std::string category) & {
140+ void OptionManager::registerCategory (std::string category) {
141141 if (!utils::string::containsAny (category, getCategories ())) m_categories.push_back (std::move (category));
142142};
143143
144- void OptionManager::registerMod (const Mod* mod) & {
144+ void OptionManager::registerMod (const Mod* mod) {
145145 if (!isModRegistered (mod->getID ())) {
146146 log::trace (" Attempting to register integrated mod {}..." , mod->getID ());
147147 if (mod->getID () == GEODE_MOD_ID) return ;
@@ -151,15 +151,15 @@ void OptionManager::registerMod(const Mod* mod) & {
151151 };
152152};
153153
154- bool OptionManager::doesOptionExist (ZStringView id) const & noexcept {
154+ bool OptionManager::doesOptionExist (ZStringView id) const noexcept {
155155 return m_options.find (id) != m_options.end ();
156156};
157157
158- bool OptionManager::isModRegistered (ZStringView id) const & noexcept {
158+ bool OptionManager::isModRegistered (ZStringView id) const noexcept {
159159 return m_integrations.find (id) != m_integrations.end ();
160160};
161161
162- void OptionManager::registerOption (std::shared_ptr<Option> option) & {
162+ void OptionManager::registerOption (std::shared_ptr<Option> option) {
163163 if (doesOptionExist (option->getID ())) {
164164 log::error (" Could not register option '{}' ({}) because it already exists!" , option->getName (), option->getID ());
165165 } else {
@@ -173,12 +173,12 @@ void OptionManager::registerOption(std::shared_ptr<Option> option) & {
173173 };
174174};
175175
176- void OptionManager::addDelegate (ZStringView id, Callback&& callback) & {
176+ void OptionManager::addDelegate (ZStringView id, Callback&& callback) {
177177 auto & thisDelegate = m_delegates[id];
178178 thisDelegate.push_back (std::move (callback));
179179};
180180
181- std::vector<std::weak_ptr<Option>> OptionManager::getOptions () const & {
181+ std::vector<std::weak_ptr<Option>> OptionManager::getOptions () const {
182182 std::vector<std::weak_ptr<Option>> out;
183183 out.reserve (m_options.size ());
184184
@@ -187,11 +187,11 @@ std::vector<std::weak_ptr<Option>> OptionManager::getOptions() const& {
187187 return out;
188188};
189189
190- std::span<const std::string> OptionManager::getCategories () const & noexcept {
190+ std::span<const std::string> OptionManager::getCategories () const noexcept {
191191 return m_categories;
192192};
193193
194- std::vector<const Mod*> OptionManager::getMods () const & {
194+ std::vector<const Mod*> OptionManager::getMods () const {
195195 std::vector<const Mod*> out;
196196 out.reserve (m_integrations.size ());
197197
@@ -200,42 +200,42 @@ std::vector<const Mod*> OptionManager::getMods() const& {
200200 return out;
201201};
202202
203- bool OptionManager::isEnabled (ZStringView id) const & {
203+ bool OptionManager::isEnabled (ZStringView id) const {
204204 return getOption (id).enabled ;
205205};
206206
207- bool OptionManager::isPinned (ZStringView id) const & {
207+ bool OptionManager::isPinned (ZStringView id) const {
208208 return getOption (id).pin ;
209209};
210210
211- bool OptionManager::isViewed (ZStringView id) const & {
211+ bool OptionManager::isViewed (ZStringView id) const {
212212 return getOption (id).viewed ;
213213};
214214
215- bool OptionManager::getDefaultToggleState (ZStringView id) const & noexcept {
215+ bool OptionManager::getDefaultToggleState (ZStringView id) const noexcept {
216216 if (auto o = getOptionInfo (id).lock ()) return o->getDefaultToggleState ();
217217 return false ;
218218};
219219
220- HorribleOptionSave OptionManager::getOption (ZStringView id) const & {
220+ HorribleOptionSave OptionManager::getOption (ZStringView id) const {
221221 return Mod::get ()->getSavedValue <HorribleOptionSave>(id, HorribleOptionSave{getDefaultToggleState (id)});
222222};
223223
224- std::weak_ptr<Option> OptionManager::getOptionInfo (ZStringView id) const & noexcept {
224+ std::weak_ptr<Option> OptionManager::getOptionInfo (ZStringView id) const noexcept {
225225 if (auto it = m_options.find (id); it != m_options.end ()) return it->second ;
226226 return std::weak_ptr<Option>();
227227};
228228
229- size_t OptionManager::getDelegateCount (std::string_view id) const & noexcept {
229+ size_t OptionManager::getDelegateCount (std::string_view id) const noexcept {
230230 if (auto it = m_delegates.find (id); it != m_delegates.end ()) return it->second .size ();
231231 return 0 ;
232232};
233233
234- void OptionManager::toggleOption (ZStringView id, bool enable) & {
234+ void OptionManager::toggleOption (ZStringView id, bool enable) {
235235 setOption (id, enable, isPinned (id));
236236};
237237
238- void OptionManager::setOption (ZStringView id, bool enable, bool pin, bool viewed) & {
238+ void OptionManager::setOption (ZStringView id, bool enable, bool pin, bool viewed) {
239239 auto it = m_delegates.find (id);
240240 if (it != m_delegates.end ()) {
241241 for (auto & cb : it->second ) cb (enable);
0 commit comments