Skip to content

Commit c60e8a4

Browse files
committed
Fix some miscellaneous bugs
1 parent 2b9de27 commit c60e8a4

File tree

9 files changed

+21
-14
lines changed

9 files changed

+21
-14
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
/.vs
22
/.vscode
33
/build
4+
/build-ninja
5+
6+
# clangd stuff
7+
/.cache
8+
/.clangd

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515

1616
- `RLDifficultyNode` wrong position when playing roulette
1717
- `RLLoadingCircle` wrong position for a split second when offline
18+
- Some miscellaneous bugs
1819

1920
## [2.0.4] - 2024-03-13
2021

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
77
project(GD-Roulette LANGUAGES CXX VERSION 1.0.0)
88

99
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
10-
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
11-
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1210

1311
file(GLOB_RECURSE SRC_MAIN
1412
"${SRC_DIR}/**.hpp"

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "2.0.0-beta.23",
2+
"geode": "2.0.0-beta.24",
33
"gd": {
44
"win": "2.204",
55
"android": "2.205",

src/custom_layers/base/BaseCustomAlertLayer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <Geode/cocos/include/ccTypes.h>
66
#include <Geode/cocos/cocoa/CCObject.h>
7+
#include <Geode/binding/FLAlertLayer.hpp>
78
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
89

910
using namespace geode::prelude;

src/custom_nodes/RLDifficultyNode.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,14 @@ void RLDifficultyNode::setDifficulty(const DifficultyInfo& di)
108108
m_feature_sprite = CCSprite::createWithSpriteFrameName(
109109
rl::constants::feature_state_to_sprite.at(di.feature_state).data()
110110
);
111+
m_feature_sprite->setID("feature-sprite");
112+
this->addChild(m_feature_sprite, -1);
111113
break;
112114

113115
default:
114116
m_feature_sprite = nullptr;
115117
break;
116118
}
117-
118-
if (m_feature_sprite)
119-
{
120-
m_feature_sprite->setID("feature-sprite");
121-
this->addChild(m_feature_sprite, -1);
122-
}
123119
}
124120

125121
m_difficulty_info = di;

src/roulette/layers/RLRouletteInfoLayer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "../../custom_nodes/RLDifficultyNode.hpp"
55
#include "../../utils.hpp"
66

7+
#include <functional>
78
#include <matjson/stl_serialize.hpp>
89
#include <Geode/Bindings.hpp>
910
#include <Geode/Geode.hpp>
@@ -128,13 +129,11 @@ void RLRouletteInfoLayer::onToggleButton(CCObject* sender)
128129
// yeah...
129130
auto changeListWrapper = [&](const std::function<void()>& f) {
130131
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(button->getTag()) = false;
131-
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(prevIdx) = false;
132132
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(0) = true;
133133

134134
f();
135135

136136
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(0) = false;
137-
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(prevIdx) = false;
138137
g_rouletteManager.getFromSaveContainer("selected-list-array").as_array().at(button->getTag()) = true;
139138
};
140139

src/roulette/layers/RLRouletteLayer.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ bool RLRouletteLayer::init()
128128
plusButton->setPosition({ 135.f, -20.f });
129129
plusButton->setSizeMult(1.2f);
130130
plusButton->setID("demon-plus-button");
131-
plusButton->setVisible(m_selected_difficulty >= GJDifficulty::Demon);
131+
plusButton->setVisible(
132+
rl::utils::getIndexOf(g_rouletteManager.getFromSaveContainer("selected-list-array").as_array(), true) != 0 ||
133+
m_selected_difficulty >= GJDifficulty::Demon
134+
);
132135
main_menu->addChild(plusButton);
133136

134137
auto startButtonText = CCLabelBMFont::create("Start", "bigFont.fnt");
@@ -733,7 +736,12 @@ CCMenuItemSpriteExtra* RLRouletteLayer::createDifficultyButton(
733736
this,
734737
menu_selector(RLRouletteLayer::onDifficultyButton)
735738
);
736-
if (m_selected_difficulty != difficulty)
739+
if (
740+
(
741+
rl::utils::getIndexOf(g_rouletteManager.getFromSaveContainer("selected-list-array").as_array(), true) != 0 &&
742+
m_selected_difficulty != difficulty
743+
) || m_selected_difficulty != difficulty
744+
)
737745
button->setColor({ 125, 125, 125 });
738746
button->setPosition(point);
739747
button->setTag(static_cast<int>(difficulty));

src/roulette/manager/RouletteManager.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22
#include <atomic>
3-
#include <array>
43
#include <matjson/stl_serialize.hpp>
54

65
#include <Geode/loader/Mod.hpp>

0 commit comments

Comments
 (0)