Skip to content

Commit fd56adf

Browse files
committed
just a smol change
1 parent 06f92cb commit fd56adf

60 files changed

Lines changed: 547 additions & 552 deletions

Some content is hidden

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

.clang-format

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# for clangd users
2+
BasedOnStyle: Google
3+
4+
NamespaceIndentation: All
5+
CommentPragmas: "^"
6+
FixNamespaceComments: false
7+
8+
SortIncludes: false
9+
IncludeBlocks: Preserve
10+
11+
IndentAccessModifiers: false
12+
13+
BinPackArguments: false
14+
BinPackParameters: false
15+
16+
BreakConstructorInitializers: AfterColon
17+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
18+
ConstructorInitializerIndentWidth: 4
19+
20+
AllowShortIfStatementsOnASingleLine: true
21+
AllowShortCaseLabelsOnASingleLine: true
22+
23+
IndentWidth: 4
24+
ColumnLimit: 0
25+
AccessModifierOffset: -4
26+
27+
BreakBeforeBraces: Attach
28+
PointerAlignment: Left
29+
30+
AlignAfterOpenBracket: DontAlign
31+
32+
AlwaysBreakAfterReturnType: None
33+
AlwaysBreakAfterDefinitionReturnType: None
34+
AlwaysBreakBeforeMultilineStrings: true

include/Horrible.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct HorribleOptionSave final {
3131
bool pin = false;
3232
};
3333

34-
template<>
34+
template <>
3535
struct matjson::Serialize<HorribleOptionSave> final {
3636
static geode::Result<HorribleOptionSave> fromJson(matjson::Value const& value);
3737
static matjson::Value toJson(HorribleOptionSave const& value);
@@ -42,16 +42,16 @@ namespace horrible {
4242
// Mod option manager for Horrible Ideas
4343
class AWCW_HORRIBLE_API_DLL OptionManager final : public cocos2d::CCObject {
4444
private:
45-
std::vector<Option> m_options; // Array of registered options
46-
std::vector<std::string> m_categories; // Array of auto-registered categories
45+
std::vector<Option> m_options; // Array of registered options
46+
std::vector<std::string> m_categories; // Array of auto-registered categories
4747

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
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
4949

5050
protected:
51-
OptionManager() = default; // Default constructor
51+
OptionManager() = default; // Default constructor
5252

53-
OptionManager(const OptionManager&) = delete; // No copying
54-
OptionManager& operator=(const OptionManager&) = delete; // No copy assignment
53+
OptionManager(const OptionManager&) = delete; // No copying
54+
OptionManager& operator=(const OptionManager&) = delete; // No copy assignment
5555

5656
/**
5757
* Register a category if not already registered
@@ -167,13 +167,13 @@ namespace horrible {
167167
};
168168

169169
// Statically register an option
170-
#define HORRIBLE_REGISTER_OPTION(opt) \
171-
$execute { \
172-
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
173-
}
170+
#define HORRIBLE_REGISTER_OPTION(opt) \
171+
$execute { \
172+
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
173+
}
174174

175175
// Delegate hooks to OptionManager for dynamic toggling
176-
#define HORRIBLE_DELEGATE_HOOKS(optID) \
177-
static void onModify(auto& self) { \
178-
horrible::delegateHooks(optID, self.m_hooks); \
179-
}
176+
#define HORRIBLE_DELEGATE_HOOKS(optID) \
177+
static void onModify(auto& self) { \
178+
horrible::delegateHooks(optID, self.m_hooks); \
179+
}

include/Option.hpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#include "Horrible.hpp"
4-
53
#include <Geode/platform/platform.hpp>
64

75
// Container for Horrible Ideas API
@@ -11,23 +9,23 @@ namespace horrible {
119

1210
// How silly an option is
1311
enum class SillyTier : unsigned int {
14-
None = 0, // Null
15-
Low = 1, // Not so silly
16-
Medium = 2, // Somewhat silly
17-
High = 3 // Very silly
12+
None = 0, // Null
13+
Low = 1, // Not so silly
14+
Medium = 2, // Somewhat silly
15+
High = 3 // Very silly
1816
};
1917

2018
// A horrible option
2119
struct Option final {
22-
std::string id; // Unique ID of the option
23-
std::string name; // Name of the option
24-
std::string description; // Description of the option
25-
std::string category; // Name of the category this option should be under
26-
SillyTier silly; // How silly the option is
27-
bool restart; // If the option requires a restart to take effect
28-
std::vector<Platform> platforms; // Platforms that the option supports
20+
std::string id; // Unique ID of the option
21+
std::string name; // Name of the option
22+
std::string description; // Description of the option
23+
std::string category; // Name of the category this option should be under
24+
SillyTier silly; // How silly the option is
25+
bool restart; // If the option requires a restart to take effect
26+
std::vector<Platform> platforms; // Platforms that the option supports
2927

30-
Option() = default; // Default constructor
28+
Option() = default; // Default constructor
3129

3230
// Constructor
3331
Option(
@@ -37,8 +35,8 @@ namespace horrible {
3735
std::string category,
3836
SillyTier silly = SillyTier::Low,
3937
bool restart = false,
40-
std::vector<Platform> platforms = { Platform::Desktop, Platform::Mobile }
41-
) : id(std::move(id)),
38+
std::vector<Platform> platforms = {Platform::Desktop, Platform::Mobile}) :
39+
id(std::move(id)),
4240
name(std::move(name)),
4341
description(std::move(description)),
4442
category(std::move(category)),

include/OptionalAPI.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace horrible {
1919

2020
class OptionManagerV2 final {
2121
public:
22-
static geode::Result<> registerOption(Option const& option)
22+
static geode::Result<> registerOption(Option option)
2323
GEODE_EVENT_EXPORT(&OptionManagerV2::registerOption, (option));
2424

2525
[[nodiscard]] static geode::Result<bool> isEnabled(std::string_view id)

include/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ A plethora of ways to ruin your gaming experience...
55
Let's start off by adding this mod as a dependency in your `mod.json`!
66
```jsonc
77
"dependencies": {
8-
"arcticwoof.horribleideas": {
9-
"importance": "required",
10-
"version": ">=1.0.0"
11-
}
8+
"arcticwoof.horribleideas": ">=1.0.0"
129
}
1310
```
1411

src/Utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace horrible {
4444
if (auto fmod = FMODAudioEngine::sharedEngine()) (void)fmod->playEffectAsync(file);
4545
};
4646

47-
namespace str = geode::utils::string; // Shortcut for geode::utils::string
47+
namespace str = geode::utils::string; // Shortcut for geode::utils::string
4848

4949
// Default option categories
5050
namespace category {

src/hooks/Achievement.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ inline static constexpr auto id = "achieve";
1313
inline static Option const o = {
1414
id,
1515
"Random Achievements",
16-
"Randomly play the achievement sound when clicking buttons.\n<cy>Credit: Cheeseworks</c>",
16+
"Randomly play the achievement sound when clicking buttons.\n<cl>Credit: Cheeseworks</c>",
1717
category::randoms,
18-
SillyTier::Low
19-
};
18+
SillyTier::Low};
2019
HORRIBLE_REGISTER_OPTION(o);
2120

2221
class $modify(AchievementCCMenuItem, CCMenuItem) {

src/hooks/Dementia.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline static constexpr auto id = "dementia";
1313
inline static Option const o = {
1414
id,
1515
"Dementia",
16-
"Chance for the player to occasionally randomly teleport a few steps back while playing a level.\n<cy>Credit: imdissapearinghelp</c>",
16+
"Chance for the player to occasionally randomly teleport a few steps back while playing a level.\n<cl>Credit: imdissapearinghelp</c>",
1717
category::misc,
1818
SillyTier::Medium,
1919
};
@@ -25,10 +25,10 @@ class $modify(DementiaPlayerObject, PlayerObject) {
2525
struct Fields {
2626
int chance = options::getChance(id);
2727

28-
int lastMusicTime = 0; // last music time in milliseconds
28+
int lastMusicTime = 0; // last music time in milliseconds
2929

30-
float lastX = 0.f; // last recorded X position
31-
float lastY = 0.f; // last recorded Y position
30+
float lastX = 0.f; // last recorded X position
31+
float lastY = 0.f; // last recorded Y position
3232
};
3333

3434
bool pushButton(PlayerButton p0) {
@@ -47,14 +47,14 @@ class $modify(DementiaPlayerObject, PlayerObject) {
4747
auto onGround = m_isOnGround || m_isOnGround2 || m_isOnGround3 || m_isOnGround4;
4848
// dementia
4949
if (rnd <= f->chance) {
50-
setPosition({ f->lastX, f->lastY });
50+
setPosition({f->lastX, f->lastY});
5151
log::trace("player has dementia to ({}, {}), play time {}", f->lastX, f->lastY, f->lastMusicTime);
5252

5353
// set the music time back to the last recorded time
5454
if (musicChannel) musicChannel->setPosition(f->lastMusicTime, FMOD_TIMEUNIT_MS);
5555

5656
return PlayerObject::pushButton(p0);
57-
} else if (onGround) { // save the position only if on ground
57+
} else if (onGround) { // save the position only if on ground
5858
f->lastX = getPositionX();
5959
f->lastY = getPositionY();
6060

@@ -75,7 +75,7 @@ class $modify(DementiaEnhancedGameObject, EnhancedGameObject) {
7575
return false;
7676
};
7777

78-
bool hasBeenActivatedByPlayer(PlayerObject * p0) {
78+
bool hasBeenActivatedByPlayer(PlayerObject* p0) {
7979
return false;
8080
};
8181
};

src/hooks/GJBaseGameLayer/FakeCrash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inline static constexpr auto id = "fake_crash";
1212
inline static Option const o = {
1313
id,
1414
"Random Fake Crash",
15-
"While playing a level, there's a chance your game will fake a crash.\n<cy>Credit: Timered</c>",
15+
"While playing a level, there's a chance your game will fake a crash.\n<cl>Credit: Timered</c>",
1616
category::randoms,
1717
SillyTier::Medium,
1818
};

src/hooks/GJBaseGameLayer/RandomNoJump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inline static constexpr auto id = "no_jump";
1212
inline static Option const o = {
1313
id,
1414
"Randomly Don't Jump",
15-
"When making an input in a level, there's a chance the player does not respond to it.\n<cy>Credit: GilanyKing12</c>",
15+
"When making an input in a level, there's a chance the player does not respond to it.\n<cl>Credit: GilanyKing12</c>",
1616
category::randoms,
1717
SillyTier::Low,
1818
};

0 commit comments

Comments
 (0)