@@ -26,6 +26,8 @@ class $modify(MyPlayLayer, PlayLayer){
2626 return false ;
2727 }
2828
29+ if (!Loader::get ()->isModLoaded (" geode.node-ids" )) return true ;
30+
2931 CCConfiguration* config = CCConfiguration::sharedConfiguration ();
3032 CCDictionary* dict = public_cast (config, m_pValueDict);
3133
@@ -93,7 +95,7 @@ class $modify(MyPlayLayer, PlayLayer){
9395 addChild (m_fields->leftDebugNode );
9496 addChild (m_fields->rightDebugNode );
9597
96- schedule (schedule_selector (MyPlayLayer::updateDebugLabels));
98+ schedule (schedule_selector (MyPlayLayer::updateDebugLabels), 1 / 60 );
9799 setFPS (0 );
98100 schedule (schedule_selector (MyPlayLayer::setFPS), 1 );
99101
@@ -106,15 +108,14 @@ class $modify(MyPlayLayer, PlayLayer){
106108 if (CCLabelBMFont* debugText = typeinfo_cast<CCLabelBMFont*>(getChildByID (" debug-text" ))) {
107109 m_fields->debugText = debugText;
108110
109- if (strcmp (debugText->getString (), " Ignore Damage" ) == 0 ) { // hacky fix for wrong node IDs
111+ if (strcmp (debugText->getString (), " Ignore Damage" ) == 0 || strcmp (debugText-> getString (), " Testmode " ) == 0 ) { // hacky fix for wrong node IDs
110112 if (CCNode* node = getChildByID (" percentage-label" )){
111113 m_fields->debugText = typeinfo_cast<CCLabelBMFont*>(node);
112114 }
113115 else if (CCNode* node = getChildByID (" time-label" )){
114116 m_fields->debugText = typeinfo_cast<CCLabelBMFont*>(node);
115117 }
116118 }
117-
118119 m_fields->debugText ->setOpacity (0 );
119120 }
120121 }
@@ -233,25 +234,36 @@ class $modify(MyPlayLayer, PlayLayer){
233234
234235 std::string getFromPos (int pos, std::vector<std::string> values){
235236
236- std::string value = values.at (pos);
237- std::string splitValue = Utils::splitString (value, " :" ).at (1 );
238- Utils::trim (splitValue);
237+ std::string ret = " " ;
238+
239+ if (pos < values.size ()){
240+
241+ std::string value = values.at (pos);
242+ std::vector<std::string> splitValue = Utils::splitString (value, " :" );
239243
240- return splitValue;
244+ if (splitValue.size () > 0 ){
245+ ret = splitValue.at (1 );
246+ }
247+ Utils::trim (ret);
248+ }
249+ return ret;
241250 }
242251};
243252
244253class $modify(MyCCKeyboardDispatcher, CCKeyboardDispatcher) {
245254
246255 bool dispatchKeyboardMSG (enumKeyCodes key, bool down, bool arr) {
247256
248- if (MyPlayLayer* playLayer = static_cast <MyPlayLayer*>(PlayLayer::get ())){
249- if (key == KEY_F3 && down && !arr){
250- GameManager* gm = GameManager::get ();
251- if (playLayer->m_fields ->debugText ){
252- bool isVisible = playLayer->m_fields ->debugText ->isVisible ();
253- playLayer->m_fields ->debugText ->setVisible (!isVisible);
254- gm->setGameVariable (" 0109" , !isVisible);
257+ if (Loader::get ()->isModLoaded (" geode.node-ids" )) {
258+
259+ if (MyPlayLayer* playLayer = static_cast <MyPlayLayer*>(PlayLayer::get ())){
260+ if (key == KEY_F3 && down && !arr){
261+ GameManager* gm = GameManager::get ();
262+ if (playLayer->m_fields ->debugText ){
263+ bool isVisible = playLayer->m_fields ->debugText ->isVisible ();
264+ playLayer->m_fields ->debugText ->setVisible (!isVisible);
265+ gm->setGameVariable (" 0109" , !isVisible);
266+ }
255267 }
256268 }
257269 }
0 commit comments