File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ bool ModPlayLayer::init(
4343void ModPlayLayer::setupHasCompleted () {
4444 PlayLayer::setupHasCompleted ();
4545
46+ if (m_progressBar == nullptr )
47+ return ;
48+
4649 m_fields->m_pbCheckpointContainer = CCNodeRGBA::create ();
4750 m_fields->m_pbCheckpointContainer ->setPosition (
4851 ccp (0 .f , m_progressBar->getContentHeight () / 2 .f )
@@ -93,11 +96,6 @@ void ModPlayLayer::resetLevel() {
9396
9497 if (checkpoint != nullptr )
9598 m_checkpointArray->removeObject (checkpoint->m_checkpoint );
96-
97- // union {
98- // float f;
99- // uint32_t u;
100- // } percent = {.f = getCurrentPercent()};
10199}
102100
103101void ModPlayLayer::loadFromCheckpoint (CheckpointObject* checkpoint) {
@@ -213,11 +211,11 @@ void ModPlayLayer::registerKeybindListeners() {
213211}
214212
215213void ModPlayLayer::updateModUI () {
214+ static_cast <ModUILayer*>(m_uiLayer)->updateSwitcher ();
215+
216216 if (m_fields->m_pbCheckpointContainer == nullptr )
217217 return ;
218218
219- static_cast <ModUILayer*>(m_uiLayer)->updateSwitcher ();
220-
221219 if (m_isPlatformer)
222220 return ;
223221
Original file line number Diff line number Diff line change 44
55#include < Geode/modify/PlayLayer.hpp>
66#include < functional>
7- #include < variant>
87#include < optional>
8+ #include < variant>
99#ifndef GEODE_IS_IOS
1010#include < geode.custom-keybinds/include/Keybinds.hpp>
1111#endif
@@ -78,7 +78,6 @@ class $modify(ModPlayLayer, PlayLayer) {
7878
7979 void togglePracticeMode (bool enabled);
8080
81-
8281 // Custom
8382 void registerKeybindListeners ();
8483 void updateModUI ();
@@ -111,4 +110,9 @@ class $modify(ModPlayLayer, PlayLayer) {
111110 void removeCurrentSaveLayer ();
112111 void swapSaveLayers (unsigned int left, unsigned int right);
113112 void updateSaveLayerCount ();
113+
114+ static void onModify (auto & self) {
115+ if (!self.setHookPriorityPost (" PlayLayer::setupHasCompleted" , Priority::VeryLate))
116+ log::warn (" Failed to set PlayLayer::setupHasCompleted hook priority!" );
117+ }
114118};
You can’t perform that action at this time.
0 commit comments