diff --git a/src/main.cpp b/src/main.cpp index 61d071c..86dae02 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,52 +1,34 @@ -/** - * Include the Geode headers. - */ -#include "Geode/modify/Modify.hpp" -#include "ccTypes.h" #include -#include +#include -/** - * Brings cocos2d and all Geode namespaces to the current scope. - */ using namespace geode::prelude; - -#include - -ccColor3B paint(){ - ccColor3B uwu; - /** - * Options: - * - Default (vanilla behavior): P1 color - * - Case 1: P2 color - * - Case 2: Player glow color - * - Case 3: Manual (configure in settings) - */ - switch(Mod::get()->getSettingValue("mode")){ - case 1: - uwu = GameManager::sharedState()->colorForIdx(GameManager::sharedState()->getPlayerColor2()); - break; - case 2: - uwu = GameManager::sharedState()->colorForIdx(GameManager::sharedState()->getPlayerGlowColor()); - break; - case 3: - uwu = Mod::get()->getSettingValue("color"); - break; - default: - uwu = GameManager::sharedState()->colorForIdx(GameManager::sharedState()->getPlayerColor()); - break; - } - return uwu; +ccColor3B paint() { + auto gm = GameManager::sharedState(); // For convenience + /** + * Options: + * - Default (vanilla behavior): P1 color + * - Case 1: P2 color + * - Case 2: Player glow color + * - Case 3: Manual (configure in settings) + */ + switch(Mod::get()->getSettingValue("mode")){ + case 1: + return gm->colorForIdx(gameManager->getPlayerColor2()); + case 2: + return gm->colorForIdx(gameManager->getPlayerGlowColor()); + case 3: + return Mod::get()->getSettingValue("color"); + default: + return gm->colorForIdx(gameManager->getPlayerColor()); + } } class $modify(PlayLayer) { - void startGame() { - PlayLayer::startGame(); - if ((!m_level->isPlatformer()) && m_progressFill){ - ccColor3B nya = paint(); - // auto progress_bar = static_cast(m_progressFill); // fuuuuck // fuuuuuuck - m_progressFill->setColor(nya); - } - } + void startGame() { + PlayLayer::startGame(); + if (!m_level->isPlatformer() && m_progressFill) { + m_progressFill->setColor(paint()); + } + } };