File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed
Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ bool FloatingUIButton::init()
3535 this ->scheduleUpdate ();
3636 this ->onEnter ();
3737
38- updateSprites ();
3938 return true ;
4039}
4140
@@ -91,12 +90,9 @@ void FloatingUIButton::updateSprites()
9190
9291 if (bg)
9392 {
94- if (!bg->getUserObject (" geode.texture-loader/fallback.png" ))
95- {
96- bg->setPosition (getContentSize () / 2 );
97- bg->setScale (scale);
98- this ->addChild (bg);
99- }
93+ bg->setPosition (getContentSize () / 2 );
94+ bg->setScale (scale);
95+ this ->addChild (bg);
10096 }
10197 }
10298
@@ -111,12 +107,9 @@ void FloatingUIButton::updateSprites()
111107
112108 if (ov)
113109 {
114- if (!ov->getUserObject (" geode.texture-loader/fallback.png" ))
115- {
116- ov->setPosition (getContentSize () / 2 );
117- ov->setScale ((ICON_SIZE / std::max<float >(ov->getContentWidth (), ov->getContentHeight ())) * scale);
118- this ->addChild (ov);
119- }
110+ ov->setPosition (getContentSize () / 2 );
111+ ov->setScale ((ICON_SIZE / std::max<float >(ov->getContentWidth (), ov->getContentHeight ())) * scale);
112+ this ->addChild (ov);
120113 }
121114 }
122115}
Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ void FloatingUIManager::visit()
6767
6868void FloatingUIDrawHook::visit ()
6969{
70- if (!AndroidUI::get ())
70+ if (!CCScene::get ())
71+ return ;
72+
73+ if (AndroidUI::get ())
74+ return ;
7175
7276 FloatingUIManager::get ()->visit ();
7377};
You can’t perform that action at this time.
0 commit comments