Skip to content

Commit 3751e7e

Browse files
committed
cleaner headers
1 parent a96f3d1 commit 3751e7e

46 files changed

Lines changed: 22 additions & 154 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/Events.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
#include "Horrible.hpp"
44

5-
#include <Geode/Geode.hpp>
6-
7-
using namespace geode::prelude;
5+
#include <Geode/loader/Event.hpp>
86

97
// Container for Horrible Ideas API
108
namespace horrible {
119
// Event for option toggles
12-
class HorribleOptionEvent : public Event {
10+
class HorribleOptionEvent : public geode::Event {
1311
private:
1412
const std::string m_id; // Unique ID of the option
1513
const bool m_toggled; // Toggle boolean of the option
@@ -22,20 +20,20 @@ namespace horrible {
2220
};
2321

2422
// Filter for option toggle event
25-
class AWCW_HORRIBLE_API_DLL HorribleOptionEventFilter : public EventFilter<HorribleOptionEvent> {
23+
class AWCW_HORRIBLE_API_DLL HorribleOptionEventFilter : public geode::EventFilter<HorribleOptionEvent> {
2624
private:
2725
const std::vector<std::string> m_ids; // Unique ID of the options to listen to
2826

2927
public:
30-
using Callback = ListenerResult(HorribleOptionEvent*);
28+
using Callback = geode::ListenerResult(HorribleOptionEvent*);
3129

3230
/**
3331
* Event handler
3432
*
3533
* @param fn Callback function containing a pointer to the event that fired
3634
* @param event Pointer to the event that fired
3735
*/
38-
ListenerResult handle(std::function<Callback> fn, HorribleOptionEvent* event);
36+
geode::ListenerResult handle(std::function<Callback> fn, HorribleOptionEvent* event);
3937

4038
HorribleOptionEventFilter() = default; // Constructor
4139
HorribleOptionEventFilter(std::string_view id); // Constructor (listens to one option's toggle)

include/Horrible.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717
#include "Events.hpp"
1818
#include "Option.hpp"
1919

20-
#include <Geode/Geode.hpp>
21-
22-
using namespace geode::prelude;
20+
#include <cocos2d.h>
2321

2422
// Container for Horrible Ideas API functions
2523
namespace horrible {
2624
// Mod option manager for Horrible Ideas
27-
class AWCW_HORRIBLE_API_DLL OptionManager : public CCObject {
25+
class AWCW_HORRIBLE_API_DLL OptionManager : public cocos2d::CCObject {
2826
private:
2927
class Impl; // PImpl class
3028
std::unique_ptr<Impl> m_impl; // PImpl pointer

include/Option.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#include <Geode/Geode.hpp>
66

7-
using namespace geode::prelude;
8-
97
// Container for Horrible Ideas API
108
namespace horrible {
119
// How silly a mod option is
@@ -24,7 +22,7 @@ namespace horrible {
2422
std::string category; // Name of the category this option should be under
2523
SillyTier silly; // How silly the option is
2624
bool restart; // If the option requires a restart to take effect
27-
std::vector<PlatformID> platforms; // Platforms that the option supports
25+
std::vector<geode::PlatformID> platforms; // Platforms that the option supports
2826

2927
Option() = default; // Default constructor
3028

@@ -36,7 +34,7 @@ namespace horrible {
3634
std::string_view category,
3735
SillyTier silly = SillyTier::Low,
3836
bool restart = false,
39-
std::vector<PlatformID> const& platforms = { PlatformID::Desktop, PlatformID::Mobile }
37+
std::vector<geode::PlatformID> const& platforms = { geode::PlatformID::Desktop, geode::PlatformID::Mobile }
4038
) : id(id),
4139
name(name),
4240
description(description),

include/OptionalAPI.hpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22

33
#include "Horrible.hpp"
44

5-
#include <Geode/Geode.hpp>
6-
5+
#include <Geode/loader/Event.hpp>
76
#include <Geode/loader/Dispatch.hpp>
87

98
#ifdef MY_MOD_ID
109
#undef MY_MOD_ID
1110
#endif
1211
#define MY_MOD_ID "arcticwoof.horrible_ideas"
1312

14-
using namespace geode::prelude;
15-
1613
namespace horrible {
17-
class HorribleOptionEventV2 : public Event {
14+
class HorribleOptionEventV2 : public geode::Event {
1815
private:
1916
const std::string m_id;
2017
const bool m_toggled;
@@ -27,19 +24,19 @@ namespace horrible {
2724
bool getToggled() const { return m_toggled; };
2825
};
2926

30-
class HorribleOptionEventFilterV2 : public EventFilter<HorribleOptionEventV2> {
27+
class HorribleOptionEventFilterV2 : public geode::EventFilter<HorribleOptionEventV2> {
3128
private:
3229
const std::vector<std::string> m_ids;
3330

3431
public:
35-
using Callback = ListenerResult(HorribleOptionEventV2*);
32+
using Callback = geode::ListenerResult(HorribleOptionEventV2*);
3633

37-
ListenerResult handle(std::function<Callback> fn, HorribleOptionEventV2* event) {
34+
geode::ListenerResult handle(std::function<Callback> fn, HorribleOptionEventV2* event) {
3835
for (auto const& id : m_ids) {
3936
if (event->getId() == id) return fn(event);
4037
};
4138

42-
return ListenerResult::Propagate;
39+
return geode::ListenerResult::Propagate;
4340
};
4441

4542
HorribleOptionEventFilterV2() = default;
@@ -49,13 +46,13 @@ namespace horrible {
4946

5047
class OptionManagerV2 {
5148
public:
52-
static Result<> registerOption(Option const& option)
49+
static geode::Result<> registerOption(Option const& option)
5350
GEODE_EVENT_EXPORT(&OptionManagerV2::registerOption, (option));
5451

55-
static Result<bool> getOption(std::string_view id)
52+
static geode::Result<bool> getOption(std::string_view id)
5653
GEODE_EVENT_EXPORT(&OptionManagerV2::getOption, (id));
5754

58-
static Result<bool> setOption(std::string_view id, bool enable)
55+
static geode::Result<bool> setOption(std::string_view id, bool enable)
5956
GEODE_EVENT_EXPORT(&OptionManagerV2::setOption, (id, enable));
6057
};
6158
};

src/Keybinds.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#if !defined(GEODE_IS_IOS)
22
#include <Utils.hpp>
33

4-
#include <Geode/Geode.hpp>
5-
64
#include <geode.custom-keybinds/include/Keybinds.hpp>
75

8-
using namespace geode::prelude;
96
using namespace horrible;
107
using namespace keybinds;
118

src/Utils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include <Geode/Geode.hpp>
88

9+
#include <Geode/loader/SettingV3.hpp>
10+
911
#include <classes/Colors.hpp>
1012
#include <classes/Jumpscares.hpp>
1113
#include <classes/Menu.hpp>

src/hooks/Achievement.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#include <Utils.hpp>
2-
3-
#include <Geode/Geode.hpp>
4-
52
#include <Geode/modify/CCMenuItem.hpp>
63

7-
using namespace geode::prelude;
84
using namespace horrible;
95

106
class $modify(AchievementCCMenuItem, CCMenuItem) {

src/hooks/Dementia.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#include <Utils.hpp>
22

3-
#include <Geode/Geode.hpp>
4-
53
#include <Geode/modify/PlayerObject.hpp>
64
#include <Geode/modify/EnhancedGameObject.hpp>
75

8-
using namespace geode::prelude;
96
using namespace horrible;
107

118
class $modify(DementiaPlayerObject, PlayerObject) {

src/hooks/GJBaseGameLayer/FakeCrash.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#include <Utils.hpp>
22

3-
#include <Geode/Geode.hpp>
4-
53
#include <Geode/modify/GJBaseGameLayer.hpp>
64

7-
using namespace geode::prelude;
85
using namespace horrible;
96

107
class $modify(FakeCrashGJBaseGameLayer, GJBaseGameLayer) {

src/hooks/GJBaseGameLayer/RandomNoJump.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#include <Utils.hpp>
22

3-
#include <Geode/Geode.hpp>
4-
53
#include <Geode/modify/GJBaseGameLayer.hpp>
64

7-
using namespace geode::prelude;
85
using namespace horrible;
96

107
class $modify(NoJumpGJBaseGameLayer, GJBaseGameLayer) {

0 commit comments

Comments
 (0)