Skip to content

Commit 2b7751e

Browse files
committed
MacOS will be fixed later
1 parent 9199b1d commit 2b7751e

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
- Made the difficulty buttons in RLDifficultySelectLayer in another menu
2020
- Refactored RLDifficultySelectLayer.cpp
2121
- Use structured bindings (i forgor they existed)
22+
- `RLDifficultyNode` now inherits from CCNodeRGBA (rookie mistake)
2223

2324
### Fixed
2425

src/custom_nodes/RLDifficultyNode.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RLDifficultyNode* RLDifficultyNode::create(GJDifficulty difficulty, bool feature
1818

1919
bool RLDifficultyNode::init(GJDifficulty difficulty, bool featured, bool epic)
2020
{
21-
if (!CCNode::init()) return false;
21+
if (!CCNodeRGBA::init()) return false;
2222

2323
m_difficulty_info = { difficulty, featured, epic };
2424
m_color = { 255, 255, 255 };
@@ -55,6 +55,7 @@ bool RLDifficultyNode::init(GJDifficulty difficulty, bool featured, bool epic)
5555

5656
void RLDifficultyNode::setColor(const ccColor3B& color)
5757
{
58+
log::debug("called with r:{} g:{} b:{}", color.r, color.g, color.b);
5859
m_difficulty_sprite->setColor(color);
5960
if (m_featured_sprite)
6061
m_featured_sprite->setColor(color);
@@ -64,7 +65,7 @@ void RLDifficultyNode::setColor(const ccColor3B& color)
6465
m_color = color;
6566
}
6667

67-
// basically RLDifficultyNode::init but without the call to CCNode::init and some extra checks
68+
// basically RLDifficultyNode::init but without the call to CCNodeRGBA::init and some extra checks
6869
void RLDifficultyNode::setDifficulty(GJDifficulty difficulty, bool featured, bool epic)
6970
{
7071
if (m_difficulty_info == DifficultyInfo{ difficulty, featured, epic }) return;

src/custom_nodes/RLDifficultyNode.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#pragma once
2-
3-
#include <Geode/Bindings.hpp>
2+
// #include <Geode/cocos/base_nodes/CCNode.h>
3+
// #include <Geode/cocos/sprite_nodes/CCSprite.h>
4+
// #include <Geode/cocos/include/ccTypes.h>
5+
#include <Geode/Geode.hpp>
46

57
using namespace geode::prelude;
68

7-
// TODO: mfw CCNodeRGBA
8-
class RLDifficultyNode : public CCNode
9+
class RLDifficultyNode : public CCNodeRGBA
910
{
1011
private:
1112
struct DifficultyInfo
@@ -26,8 +27,9 @@ class RLDifficultyNode : public CCNode
2627
static RLDifficultyNode* create(GJDifficulty, bool = false, bool = false);
2728
bool init(GJDifficulty, bool = false, bool = false);
2829

29-
void setColor(const ccColor3B&);
30+
// TODO: fix this setColor fuckery
31+
void setColor(const ccColor3B&) override;
3032

3133
void setDifficulty(GJDifficulty, bool = false, bool = false);
32-
DifficultyInfo getDifficultyInfo() const { return m_difficulty_info; };
34+
const DifficultyInfo& getDifficultyInfo() const { return m_difficulty_info; };
3335
};

src/roulette/layers/RLRouletteLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ std::string RLRouletteLayer::m_list_fetcher_error;
1919

2020
RLRouletteLayer* RLRouletteLayer::create()
2121
{
22-
auto ret = new RLRouletteLayer();
22+
auto* ret = new RLRouletteLayer();
2323
m_list_fetcher.init();
2424

2525
if (ret && ret->init())

src/roulette/layers/RLRouletteLayer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class RLRouletteLayer : public BaseCustomAlertLayer
5252
void onNextLevel(bool = false, bool = false, float = -175.f);
5353

5454
void registerWithTouchDispatcher() override;
55+
5556
CCMenuItemSpriteExtra* getDifficultyButton(GJDifficulty);
5657
void setDifficultyButtonColor(GJDifficulty, const ccColor3B&);
5758

0 commit comments

Comments
 (0)