Skip to content

Commit c0d7864

Browse files
committed
1.6.0-beta.1, actual usable mod now lol
1 parent feddd56 commit c0d7864

19 files changed

+302
-211
lines changed

CHANGELOG.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.6.0-beta.1] - 2024-02-04
9+
10+
### Added
11+
12+
- Android support (?)
13+
- Error text when ListFetcher fails to fetch a link
14+
- RouletteLayer pointer member to RouletteManager
15+
- Array verifier to assure selected difficulty/list is correct (cant select multiple at once, maybe for a future update?)
16+
- Choosing a list highlights a difficulty that matches said list
17+
18+
### Changed
19+
20+
- about.md
21+
- Logo
22+
- RouletteManager to be an inline global variable instead of that broken define system
23+
- Removed CustomDirector
24+
- Made selecting a list change the selected difficulty (only visual)
25+
- Renamed RouletteManagerStruct to RouletteManager
26+
- Renamed RouletteManager's variable name to g_rouletteManager
27+
- Cleaned up include directives
28+
29+
### Fixed
30+
31+
- Crash when clicking Reset after ListFetcher fails
32+
- Bugs
33+
834
## [1.5.0-beta] - 2024-02-03
935

1036
### Changed
@@ -75,7 +101,6 @@ Last update before 2.2. I might update this to 2.2 if I have enough free time.
75101

76102
- Fixed JsonManager overriding saved values
77103

78-
79104
## [1.2.0] - 2023-12-06
80105

81106
### Added
@@ -99,23 +124,3 @@ Last update before 2.2. I might update this to 2.2 if I have enough free time.
99124

100125
- Added a DEV_CONSOLE macro enabled only when compiling RelWithDebInfo
101126
- Added a check for MegaHack v7 to change the roulette button's position
102-
103-
<!-- maybe add the other versions here too -->
104-
<!--
105-
## [X.Y.Z] - YYYY-MM-DD
106-
107-
### Added
108-
- ...
109-
- ...
110-
- ...
111-
112-
### Changed
113-
- ...
114-
- ...
115-
- ...
116-
117-
### Fixed
118-
- ...
119-
- ...
120-
- ...
121-
-->

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif()
2828

2929
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
3030

31-
setup_geode_mod(${PROJECT_NAME})
31+
setup_geode_mod(${PROJECT_NAME} EXTERNALS geode.node-ids:1.1.4)
3232

3333
# Warnings as errors
3434
set_property(TARGET ${PROJECT_NAME} PROPERTY COMPILE_WARNING_AS_ERROR ON)

about.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
# GD-Roulette
22

3-
A Geometry Dash Roulette.
3+
A Geometry Dash Level Roulette.
4+
5+
## Features
6+
7+
- Normal List (regular levels ranging from Easy to Extreme Demon)
8+
- Demon List
9+
- Challenge List
10+
- Skip levels you can't beat
11+
12+
## How To Play
13+
14+
Simply choose the list you want to play levels from (the default is normal list), select a difficulty, and press Start!
15+
A random level of the chosen difficulty will be given to you and you will need to achieve a certain percentage in said level (starts from 1%, and increments by 1 after each level beaten).
16+
Normally, you're supposed to get to get the goal percentage, and not higher. Unfortunately, some levels don't have a way to die at said percentage, so the goal will automatically be your death percentage + 1.
17+
18+
If a level is too hard, you can click on the Skip button, which will subtract 1 skip from your skips. You can set the number of skips you are allowed to use during a round of roulette in the roulette's settings (accessible from the info icon in the roulette while not playing it, or from the Geode mod settings).
19+
20+
And that's pretty much it! Have fun rouletting!

logo.png

45.4 KB
Loading

mod.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
{
2-
"geode": "2.0.0-beta.12",
2+
"geode": "2.0.0-beta.14",
33
"gd": {
44
"win": "2.204",
55
"android": "2.205"
66
},
7-
"version": "v1.5.0-beta",
7+
"version": "v1.6.0-beta.1",
88
"id": "spaghettdev.gd-roulette",
99
"name": "GD-Roulette",
1010
"developer": "SpaghettDev",
1111
"description": "An in-game level roulette.",
1212
"repository": "https://github.com/SpaghettDev/GD-Roulette",
1313
"issues": {
14-
"info": "Report any bugs/suggestions.",
14+
"info": "Report any bugs/suggestions here.",
1515
"url": "https://github.com/SpaghettDev/GD-Roulette/issues"
1616
},
1717
"resources": {
1818
"sprites": [
1919
"resources/*.png"
2020
]
2121
},
22+
"dependencies": [
23+
{
24+
"id": "geode.node-ids",
25+
"version": "v1.1.4",
26+
"importance": "required"
27+
}
28+
],
2229
"tags": [
2330
"level", "roulette"
2431
],

src/custom_layers/CustomDirector.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/custom_layers/base/BaseCustomLayer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "BaseCustomLayer.hpp"
2-
#include "../CustomDirector.hpp"
32

43
bool BaseCustomLayer::createBasics(CCPoint contentSize, SEL_MenuHandler onClose, float closeBtnScale, const ccColor4B& color)
54
{
@@ -20,26 +19,26 @@ bool BaseCustomLayer::createBasics(CCPoint contentSize, SEL_MenuHandler onClose,
2019
CCSize winSize = director->getWinSize();
2120
extension::CCScale9Sprite* bg = extension::CCScale9Sprite::create("GJ_square01.png", { .0f, .0f, 80.f, 80.f });
2221
bg->setContentSize(alertSize);
23-
bg->setPosition({ winSize.width / 2, winSize.height / 2 });
22+
bg->setPosition({ winSize.width / 2.f, winSize.height / 2.f });
2423
m_mainLayer->addChild(bg, -1);
2524

2625
m_buttonMenu = CCMenu::create();
2726
m_mainLayer->addChild(m_buttonMenu, 10);
2827

29-
closeBtn = createButton("GJ_closeBtn_001.png", { -((alertSize.x) / 2) + 9.5f, (alertSize.y / 2) - 10 }, onClose, -1, closeBtnScale);
28+
closeBtn = createButton("GJ_closeBtn_001.png", { -((alertSize.x) / 2) + 9.5f, (alertSize.y / 2) - 10.f }, onClose, -1, closeBtnScale);
3029

3130
return true;
3231
}
3332

3433
void BaseCustomLayer::createTitle(std::string text, float separatorScale, float usernameScale)
3534
{
3635
auto userName = CCLabelBMFont::create(text.c_str(), "bigFont.fnt");
37-
userName->setPosition({ 0, (alertSize.y / 2) - 22 });
36+
userName->setPosition({ .0f, (alertSize.y / 2.f) - 22.f });
3837
userName->setScale(usernameScale);
3938
m_buttonMenu->addChild(userName);
4039

4140
auto separator = CCSprite::createWithSpriteFrameName("floorLine_001.png");
42-
separator->setPosition({ 0, (alertSize.y / 2) - 46 });
41+
separator->setPosition({ .0f, (alertSize.y / 2.f) - 46.f });
4342
separator->setScaleX(separatorScale);
4443
separator->setOpacity(100);
4544
m_buttonMenu->addChild(separator);

src/custom_layers/base/BaseCustomLayer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class BaseCustomLayer : public FLAlertLayer
1010
CCPoint alertSize{};
1111
CCMenuItemSpriteExtra* closeBtn{};
1212

13-
bool createBasics(CCPoint, SEL_MenuHandler, float = 1, const ccColor4B& = { 0x00, 0x00, 0x00, 0x4B });
14-
void createTitle(std::string, float = .75f, float = 1);
15-
CCMenuItemSpriteExtra* createButton(const char*, CCPoint, SEL_MenuHandler, int = -1, float = 1.0f, float = 1.2f);
13+
bool createBasics(CCPoint, SEL_MenuHandler, float = 1.f, const ccColor4B& = { 0x00, 0x00, 0x00, 0x4B });
14+
void createTitle(std::string, float = .75f, float = 1.f);
15+
CCMenuItemSpriteExtra* createButton(const char*, CCPoint, SEL_MenuHandler, int = -1, float = 1.f, float = 1.2f);
1616
virtual void onClose(CCObject*) = 0;
1717
static cocos2d::CCScene* scene();
1818
void keyDown(enumKeyCodes);

src/layers/CreatorLayer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define DECLAREROULETTEMANAGER
21
#include "../roulette/manager/RouletteManager.hpp"
32
#include "../roulette/layers/RouletteLayer.hpp"
43

@@ -11,7 +10,9 @@ class $modify(RouletteButton, CreatorLayer)
1110
{
1211
void onRouletteButton(CCObject*)
1312
{
14-
RouletteLayer::create()->show();
13+
g_rouletteManager.rouletteLayer = RouletteLayer::create();
14+
if (g_rouletteManager.rouletteLayer)
15+
g_rouletteManager.rouletteLayer->show();
1516
}
1617

1718
bool init()

src/layers/LevelInfoLayer.cpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#define DECLAREROULETTEMANAGER
21
#include "../roulette/manager/RouletteManager.hpp"
32
#include "../roulette/layers/RouletteLayer.hpp"
4-
#include "../custom_layers/CustomDirector.hpp"
53

64
#include <Geode/Geode.hpp>
75
#include <Geode/modify/LevelInfoLayer.hpp>
@@ -14,20 +12,23 @@ class $modify(LevelInfoLayer)
1412
{
1513
if (!LevelInfoLayer::init(level, p1)) return false;
1614

17-
if (RouletteManager.isPlayingRoulette)
15+
if (g_rouletteManager.isPlayingRoulette)
1816
{
1917
CCLabelBMFont* normalPercentageLabel = static_cast<CCLabelBMFont*>(this->getChildByID("normal-mode-percentage"));
2018
float goalOffset = .0f;
2119

20+
// wtf v2
2221
if (this->m_level->m_normalPercent < 10)
2322
goalOffset = 24.f;
24-
else if (this->m_level->m_normalPercent <= 100)
23+
else if (this->m_level->m_normalPercent < 100)
2524
goalOffset = 31.f;
25+
else
26+
goalOffset = 39.f;
2627

2728
if (normalPercentageLabel == nullptr) return true;
2829

2930
auto goalPercentage = CCLabelBMFont::create(
30-
fmt::format("({}%)", static_cast<int>(RouletteManager.levelPercentageGoal)).c_str(),
31+
fmt::format("({}%)", static_cast<int>(g_rouletteManager.levelPercentageGoal)).c_str(),
3132
"bigFont.fnt"
3233
);
3334
goalPercentage->setPosition({ normalPercentageLabel->getPositionX() + goalOffset, normalPercentageLabel->getPositionY() });
@@ -42,21 +43,11 @@ class $modify(LevelInfoLayer)
4243

4344
void onBack(CCObject* sender)
4445
{
45-
CustomDirector* director = static_cast<CustomDirector*>(CCDirector::sharedDirector());
46-
47-
if (RouletteManager.isPlayingRoulette && this->m_level->m_levelID == RouletteManager.lastLevelID)
46+
if (g_rouletteManager.rouletteLayer)
4847
{
49-
if (
50-
CCScene* prevScene = director->getPreviousScene();
51-
prevScene->getChildrenCount() == 2
52-
) {
53-
if (auto rouletteLayer = typeinfo_cast<RouletteLayer*>(prevScene->getChildren()->objectAtIndex(1)))
54-
{
55-
static_cast<CCLabelBMFont*>(
56-
rouletteLayer->m_pPlayingMenu->getChildByTag(20)
57-
)->setString(fmt::format("{}%", RouletteManager.levelPercentageGoal).c_str());
58-
}
59-
}
48+
static_cast<CCLabelBMFont*>(
49+
g_rouletteManager.rouletteLayer->m_pPlayingMenu->getChildByTag(20)
50+
)->setString(fmt::format("{}%", g_rouletteManager.levelPercentageGoal).c_str());
6051
}
6152

6253
LevelInfoLayer::onBack(sender);

0 commit comments

Comments
 (0)