Skip to content

Commit

Permalink
girl what did you do!?!
Browse files Browse the repository at this point in the history
  • Loading branch information
vani11agirl committed Nov 23, 2024
1 parent c7dc987 commit 30d7b76
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 72 deletions.
37 changes: 3 additions & 34 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@
"description": "How fast the color updates. The higher the value the faster the speed.",
"default": 0.123456,
"min": 0,
"max": 1,
"controls": {
"arrows": false,
"big-arrows": false,
"slider": true,
"input": false
}
"max": 1
},
"practice-mode-title": {
"type": "title",
Expand Down Expand Up @@ -99,12 +93,6 @@
"default": 0.123456,
"min": 0,
"max": 1,
"controls": {
"arrows": false,
"big-arrows": false,
"slider": true,
"input": false
},
"enable-if": "practice-mode-toggle"
},
"new-best-title": {
Expand Down Expand Up @@ -143,26 +131,7 @@
"description": "How fast the color updates. The higher the value the faster the speed.",
"default": 0.123456,
"min": 0,
"max": 1,
"controls": {
"arrows": false,
"big-arrows": false,
"slider": true,
"input": false
}
},
"haha": {
"type": "title",
"name": "haha",
"description": "hri3eoij2rk3jkfejkjjrlkwfm"
},
"product-key": {
"type": "string",
"description": "The product key. Click the support button (gold gift icon) to learn more about obtaining one.\n\n<cy>pffft just read the source code and make a keygen lmao</c>",
"name": "Product Key",
"match": "^[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}$",
"filter": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345689-",
"default": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
"max": 1
}
},
"resources": {
Expand All @@ -175,7 +144,7 @@
"community": "https://discord.gg/uFj8SSUhRa"
},
"issues": {
"info": "Please report any problem you have to this mod's GitHub repository by making an issue!",
"info": "Please report any problems or suggestions you have to this mod's GitHub repository by making an issue!",
"url": "https://github.com/AnhNguyenlost13/progress-bar-thingy/issues"
}
}
114 changes: 77 additions & 37 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,95 @@
#include <Geode/modify/PlayLayer.hpp>
#define updateProgressBar updateProgressbar // sorry RobTop

#include "util/color.hpp" // Never thought I would see this day.
#include "util/color.hpp" // Thanks TheSillyDoggo

using namespace geode::prelude;

ccColor3B paint() {
auto gm = GameManager::sharedState(); // For convenience
auto ms = Mod::get()->getSettingValue<int64_t>("mode"); // This is stupid.
/**
* Options:
* - Default (vanilla behavior): P1 color
* I know it's quite weird to make a mod that doesn't do its job at first
* - Case 1: P2 color
* - Case 2: Player glow color
* - Case 3: Manual (user)
*
* Special cases:
* - Case 4: RGB
* - Case 5: Pastel
*/
switch(ms){
case 1:
auto pm = GJBaseGameLayer::get();
auto pl = PlayLayer::get();
auto mg = Mod::get();

auto meow = mg->getSettingValue<std::string>("normal-working-mode");
auto uwu = mg->getSettingValue<std::string>("practice-working-mode");
auto nyaa = mg->getSettingValue<std::string>("enby-working-mode");
auto pt = mg->getSettingValue<bool>("practice-mode-toggle");
auto po = mg->getSettingValue<bool>("practice-override");

auto lp = as<float>(PlayLayer::get()->getCurrentPercentInt());
auto lb = pl->m_level->m_normalPercent;

// hello yanderedev
if (lp > lb) {
if (pm->m_isPracticeMode && po) {
if (uwu == "Player Col 1") {
return gm->colorForIdx(gm->getPlayerColor());
} else if (uwu == "Player Col 2") {
return gm->colorForIdx(gm->getPlayerColor2());
case 2:
} else if (uwu == "Player Glow") {
return gm->colorForIdx(gm->getPlayerGlowColor());
case 3:
} else if (uwu == "Chroma") {
return colorutil::getChromaColour();
} else if (uwu == "Pastel") {
return colorutil::getPastelColour();
} else if (uwu == "Custom") {
return Mod::get()->getSettingValue<ccColor3B>("color");
case 4:
} else if (uwu == "Gradient") {
// Placeholder
}
} else {
if (nyaa == "Player Col 1") {
return gm->colorForIdx(gm->getPlayerColor());
} else if (nyaa == "Player Col 2") {
return gm->colorForIdx(gm->getPlayerColor2());
} else if (nyaa == "Player Glow") {
return gm->colorForIdx(gm->getPlayerGlowColor());
} else if (nyaa == "Chroma") {
return colorutil::getChromaColour();
} else if (nyaa == "Pastel") {
return colorutil::getPastelColour();
} else if (nyaa == "Custom") {
return Mod::get()->getSettingValue<ccColor3B>("color");
} else if (nyaa == "Gradient") {
// Placeholder
}
}
} else {
if (pm->m_isPracticeMode && pt) {
if (uwu == "Player Col 1") {
return gm->colorForIdx(gm->getPlayerColor());
} else if (uwu == "Player Col 2") {
return gm->colorForIdx(gm->getPlayerColor2());
} else if (uwu == "Player Glow") {
return gm->colorForIdx(gm->getPlayerGlowColor());
} else if (uwu == "Chroma") {
return colorutil::getChromaColour();
case 5:
} else if (uwu == "Pastel") {
return colorutil::getPastelColour();
case 6:
// Placeholder: Custom gradient mode, this may come at one point(TM)
default:
} else if (uwu == "Custom") {
return Mod::get()->getSettingValue<ccColor3B>("color");
} else if (uwu == "Gradient") {
// Placeholder
}
} else {
if (meow == "Player Col 1") {
return gm->colorForIdx(gm->getPlayerColor());
} else if (meow == "Player Col 2") {
return gm->colorForIdx(gm->getPlayerColor2());
} else if (meow == "Player Glow") {
return gm->colorForIdx(gm->getPlayerGlowColor());
} else if (meow == "Chroma") {
return colorutil::getChromaColour();
} else if (meow == "Pastel") {
return colorutil::getPastelColour();
} else if (meow == "Custom") {
return Mod::get()->getSettingValue<ccColor3B>("color");
} else if (meow == "Gradient") {
// Placeholder
}
}
}
}

class $modify(PlayLayer) {
Expand All @@ -49,26 +103,12 @@ class $modify(PlayLayer) {

void updateProgressBar() {
PlayLayer::updateProgressBar();
// Please kill me.
colorutil::update(Mod::get()->getSettingValue<double_t>("speed"));
// colorutil::va += CCDirector::get()->getDeltaTime();
// colorutil::update(CCDirector::get()->getDeltaTime());
if (!m_level->isPlatformer() && m_progressFill) {
m_progressFill->setColor(paint());
}

float uwu = static_cast<float>(PlayLayer::getCurrentPercentInt());
if (uwu > (m_level->m_normalPercent)) {
// later
}
}

void togglePracticeMode(bool practiceMode) {
PlayLayer::togglePracticeMode(practiceMode);
if (practiceMode == true) {
// hi
} else {
// meow
}
}
};
4 changes: 3 additions & 1 deletion support.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
I would be really glad if you can buy me a pair of thigh highs or arm sleeves, but unfortunately I probably can't accept anything from strangers.
I would be really glad if you can buy me a pair of thigh highs or arm sleeves, but unfortunately I probably can't accept anything from strangers.

A kind "meow" to me is also sufficient to make my day! I would really appreciate it if you can contribute to the code. If you have ideas, you can either open an issue on the GitHub repository or join the Discord server.

0 comments on commit 30d7b76

Please sign in to comment.