Skip to content

Commit

Permalink
updated for 2.206
Browse files Browse the repository at this point in the history
  • Loading branch information
Capeling committed Jun 3, 2024
1 parent 0e40ca4 commit 5fb1ee4
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ build-*/

# Workspace files are user-specific
*.sublime-workspace
*\.vs

# ILY vscode
**/.vscode
Expand Down
27 changes: 27 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Coloured Level Page
## v1.1.0
- 2.206 Update
- Added auto gradient
- Reduced insane brightness
## v1.0.0
- initial release
15 changes: 5 additions & 10 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"geode": "2.0.0-beta.15",
"geode": "2.0.0-beta.27",
"gd": {
"win": "2.204"
"win": "2.206",
"android": "2.206",
"mac": "2.206"
},
"dependencies": [
{
"id": "geode.node-ids",
"version": "v1.3.0",
"importance": "required"
}
],
"version": "v1.0.0",
"version": "v1.1.0",
"id": "capeling.colored_level_info_bg",
"name": "Coloured Level Page",
"developer": "Capeling",
Expand Down
21 changes: 16 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ using namespace geode::prelude;
ccColor3B diffToColor(int diff) {
switch(diff) {
default: return {0, 102, 255};
case -1: return { 255, 162, 48 };
case 0: return { 122, 122, 122 };
case 1: return { 4, 0, 255 };
case 2: return { 0, 180, 0 };
case 3: return { 255, 196, 0 };
case 4: return { 255, 115, 0 };
case 5: return { 255, 0, 234 };
case 5: return { 183, 0, 183 };
case 6: return { 204, 0, 255 };
case 7: return { 223, 0, 223 };
case 8:
Expand All @@ -25,10 +26,20 @@ class $modify(LevelInfoLayer) {
bool init(GJGameLevel* level, bool isGauntlet) {
if(!LevelInfoLayer::init(level, isGauntlet))
return false;
CCSprite* m_background = (CCSprite*)(this->getChildByID("background"));
auto color = diffToColor(level->getAverageDifficulty() + (level->m_demon.value() * 5));
log::info("{}", color);
m_background->setColor(color);

CCSprite* bg = getChildOfType<CCSprite>(this, 0);

int averageDiff = level->getAverageDifficulty();

if (level->m_autoLevel) {
auto autoGradient = CCLayerGradient::create({ 255, 235, 51, 255 }, { 0, 197, 227, 255 });
bg->setColor({ 138, 138, 138 });
addChild(autoGradient, -2);
}
else {
auto color = diffToColor(averageDiff + (level->m_demon.value() * 5));
bg->setColor(color);
}
return true;
}
};

0 comments on commit 5fb1ee4

Please sign in to comment.