Skip to content

Commit 0b17730

Browse files
committed
clean code
1 parent 9d36b1a commit 0b17730

8 files changed

Lines changed: 256 additions & 255 deletions

File tree

include/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ These classes mirror the main API but return `geode::Result` values so callers c
223223
#### class `horrible::OptionManagerV2`
224224
- `static Result<>` **`registerOption(Option const& option)`**
225225
- `static Result<bool>` **`getOption(std::string_view id)`**
226-
- `static Result<bool>` **`setOption(std::string const& id, bool enable)`**
226+
- `static Result<bool>` **`setOption(std::string_view id, bool enable)`**
227227

228228
#### Summary
229229
| Type | Name | Description |

src/Utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ namespace horrible {
4242
*
4343
* @param name Name of the audio file
4444
*/
45-
inline void playSfx(std::string_view name) {
46-
if (auto fmod = FMODAudioEngine::sharedEngine()) fmod->playEffectAsync(name.data());
45+
inline void playSfx(const char* file) {
46+
if (auto fmod = FMODAudioEngine::sharedEngine()) fmod->playEffectAsync(file);
4747
};
4848

4949
namespace str = utils::string; // Shortcut for geode::utils::string

src/hooks/Achievement.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <Utils.hpp>
2+
23
#include <Geode/modify/CCMenuItem.hpp>
34

45
using namespace horrible;

src/hooks/Mock.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if !defined(GEODE_IS_MACOS) && !defined(GEODE_IS_IOS) // not available for these platforms
12
#include <Utils.hpp>
23

34
#include <Geode/modify/MenuLayer.hpp>
@@ -115,7 +116,6 @@ class $modify(MockPlayLayer, PlayLayer) {
115116
log::info("Showing new best for level ID: {}", id);
116117
log::info("Level percentage: {}", percentage);
117118

118-
#if !defined(GEODE_IS_MACOS) && !defined(GEODE_IS_IOS) // not available for these platforms
119119
if (m_fields->enabled && percentage >= 90) {
120120
CCDirector* director = CCDirector::sharedDirector();
121121
CCScene* scene = CCScene::get();
@@ -173,7 +173,6 @@ class $modify(MockPlayLayer, PlayLayer) {
173173
log::error("Failed to create image from render texture");
174174
};
175175
};
176-
#endif
177176

178177
PlayLayer::showNewBest(newReward, orbs, diamonds, demonKey, noRetry, noTitle);
179178
};
@@ -203,4 +202,5 @@ class $modify(MockPlayLayer, PlayLayer) {
203202

204203
PlayLayer::levelComplete();
205204
};
206-
};
205+
};
206+
#endif

0 commit comments

Comments
 (0)