-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nya Meow <nyameowmeow@icloud.com>
- Loading branch information
1 parent
81dec5c
commit 38c25a6
Showing
1 changed file
with
26 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,34 @@ | ||
/** | ||
* Include the Geode headers. | ||
*/ | ||
#include "Geode/modify/Modify.hpp" | ||
#include "ccTypes.h" | ||
#include <Geode/Geode.hpp> | ||
#include <Geode/binding/GameManager.hpp> | ||
#include <Geode/modify/PlayLayer.hpp> | ||
|
||
/** | ||
* Brings cocos2d and all Geode namespaces to the current scope. | ||
*/ | ||
using namespace geode::prelude; | ||
|
||
|
||
#include <Geode/modify/PlayLayer.hpp> | ||
|
||
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<int64_t>("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<ccColor3B>("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<int64_t>("mode")){ | ||
case 1: | ||
return gm->colorForIdx(gameManager->getPlayerColor2()); | ||
case 2: | ||
return gm->colorForIdx(gameManager->getPlayerGlowColor()); | ||
case 3: | ||
return Mod::get()->getSettingValue<ccColor3B>("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<CCSprite* >(m_progressFill); // fuuuuck // fuuuuuuck | ||
m_progressFill->setColor(nya); | ||
} | ||
} | ||
void startGame() { | ||
PlayLayer::startGame(); | ||
if (!m_level->isPlatformer() && m_progressFill) { | ||
m_progressFill->setColor(paint()); | ||
} | ||
} | ||
}; |