Skip to content

Commit 525fc11

Browse files
committed
yippee
1 parent 2aaf77d commit 525fc11

13 files changed

Lines changed: 24 additions & 22 deletions

File tree

about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class $modify(MyPlayLayer, PlayLayer) {
7474
};
7575
```
7676
77-
> ![icon](frame:GJ_infoIcon_001.png?scale=0.5) <cj>*If you plan on publishing a mod that acts as an add-on to Horrible Ideas, all we ask is to please be sure to follow the safe code practices as instructed in the [documentation](https://github.com/DumbCaveSpider/HorribleIdeas/tree/main/include) to the best of your ability!*</c>
77+
> ![ℹ️](frame:GJ_infoIcon_001.png?scale=0.5) <cj>*If you plan on publishing a mod that acts as an add-on to Horrible Ideas, all we ask is to please be sure to follow the safe code practices as instructed in the [documentation](https://github.com/DumbCaveSpider/HorribleIdeas/tree/main/include) to the best of your ability!*</c>
7878
7979
---
8080

src/Utils.hpp

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

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

50-
// Default horrible categories
50+
// Default option categories
5151
namespace category {
5252
inline constexpr const char* playerlife = "Player Life";
5353
inline constexpr const char* jumpscares = "Jumpscares";

src/classes/ui/src/MathQuiz.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void MathQuiz::onAnswerClicked(CCObject* sender) {
279279
feedbackLabel->setScale(0.125f);
280280
feedbackLabel->setAnchorPoint({ 0.5, 0.5 });
281281
feedbackLabel->setAlignment(kCCTextAlignmentCenter);
282-
feedbackLabel->setPosition({ winSize.width / 2.f, winSize.height / 2.f });
282+
feedbackLabel->setPosition(winSize / 2.f);
283283
feedbackLabel->setColor(correct ? colors::green : colors::red);
284284

285285
addChild(feedbackLabel, 9);
@@ -366,7 +366,7 @@ void MathQuiz::update(float dt) {
366366
feedbackLabel->setID("feedback-label");
367367
feedbackLabel->setAnchorPoint({ 0.5, 0.5 });
368368
feedbackLabel->setAlignment(kCCTextAlignmentCenter);
369-
feedbackLabel->setPosition({ winSize.width / 2.f, winSize.height / 2.f });
369+
feedbackLabel->setPosition(winSize / 2.f);
370370
feedbackLabel->setScale(0.1f);
371371
feedbackLabel->setColor(colors::red);
372372

@@ -417,7 +417,7 @@ bool Richard::init() {
417417
addChild(m_impl->m_sprite);
418418

419419
setContentSize(m_impl->m_sprite->getScaledContentSize());
420-
m_impl->m_sprite->setPosition({ getScaledContentWidth() / 2.f, getScaledContentHeight() / 2.f });
420+
m_impl->m_sprite->setPosition(getScaledContentSize() / 2.f);
421421

422422
return true;
423423
};

src/classes/ui/src/SpamChallenge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void SpamChallenge::setSuccess(bool v) {
121121
auto symbol = CCSprite::createWithSpriteFrameName(v ? "GJ_completesIcon_001.png" : "GJ_deleteIcon_001.png");
122122
symbol->setID("success-icon");
123123
symbol->setScale(0.f);
124-
symbol->setPosition({ getScaledContentWidth() / 2.f, getScaledContentHeight() / 2.f });
124+
symbol->setPosition(getScaledContentSize() / 2.f);
125125

126126
addChild(symbol, 9);
127127
symbol->runAction(CCSequence::createWithTwoActions(

src/hooks/Mock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class $modify(MockMenuLayer, MenuLayer) {
6363

6464
auto percLabel = CCLabelBMFont::create(percLabelText.c_str(), "bigFont.fnt");
6565
percLabel->setID("percentage");
66-
percLabel->setPosition({ ss->getScaledContentWidth() / 2.f, ss->getScaledContentHeight() / 2.f });
66+
percLabel->setPosition(ss->getScaledContentSize() / 2.f);
6767
percLabel->setAlignment(CCTextAlignment::kCCTextAlignmentLeft);
6868
percLabel->ignoreAnchorPointForPosition(false);
6969
percLabel->setAnchorPoint({ 0, 0 });

src/hooks/PlayLayer/BlackScreen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class $modify(BlackScreenPlayLayer, PlayLayer) {
3737

3838
auto blackScreen = CCScale9Sprite::create("square02_001.png");
3939
blackScreen->setContentSize({ winSize.width + 10.f, winSize.height + 10.f });
40-
blackScreen->setPosition({ winSize.width / 2.f, winSize.height / 2.f });
40+
blackScreen->setPosition(winSize / 2.f);
4141
blackScreen->setID("black_screen"_spr);
4242

4343
m_uiLayer->addChild(blackScreen, 99);

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ static std::vector<Option> defOpts = {
299299
log::info("Done registering {} default options!", defOpts.size());
300300

301301
defOpts.clear();
302+
defOpts.shrink_to_fit();
303+
302304
log::debug("Cleaned up default option array");
303305
} else {
304306
log::error("Failed to get OptionManager");

src/menu/CategoryItem.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CategoryEvent : public Event {
1111
bool m_enabled;
1212

1313
public:
14-
CategoryEvent(std::string_view id, bool enabled = false);
14+
CategoryEvent(std::string id, bool enabled = false);
1515

1616
std::string const& getId() const;
1717
bool isEnabled() const;

src/menu/src/CategoryItem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using namespace geode::prelude;
88
using namespace horrible::prelude;
99

10-
CategoryEvent::CategoryEvent(std::string_view id, bool enabled) : m_id(id), m_enabled(enabled) {};
10+
CategoryEvent::CategoryEvent(std::string id, bool enabled) : m_id(std::move(id)), m_enabled(enabled) {};
1111

1212
std::string const& CategoryEvent::getId() const {
1313
return m_id;
@@ -39,15 +39,15 @@ bool CategoryItem::init(CCSize const& size, std::string_view category) {
3939

4040
if (!CCMenu::init()) return false;
4141

42-
setID(str::join(str::split(str::toLower(category.data()), " "), "-"));
43-
setScaledContentSize(size);
42+
setID(str::join(str::split(str::filter(str::toLower(category.data()), "abcdefghijklmnopqrstuvwxyz0123456789 "), " "), "-"));
43+
setContentSize(size);
4444
setAnchorPoint({ 0.5, 1 });
4545

4646
auto bg = CCScale9Sprite::create("square02_001.png");
4747
bg->setID("background");
4848
bg->setScale(0.2f);
4949
bg->setAnchorPoint({ 0, 0 });
50-
bg->setContentSize({ getScaledContentWidth() * 5.f, getScaledContentHeight() * 5.f });
50+
bg->setContentSize(getScaledContentSize() * 5.f);
5151
bg->setOpacity(40);
5252

5353
addChild(bg, -1);

src/menu/src/FloatingButton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool FloatingButton::init() {
5454

5555
setContentSize(m_impl->m_sprite->getScaledContentSize());
5656

57-
m_impl->m_sprite->setPosition({ getScaledContentWidth() / 2.f, getScaledContentHeight() / 2.f });
57+
m_impl->m_sprite->setPosition(getScaledContentSize() / 2.f);
5858

5959
setScale(m_impl->m_scale); // set initial scale
6060
setOpacity(m_impl->m_opacity); // set initial opacity

0 commit comments

Comments
 (0)