Skip to content

Commit 2886261

Browse files
committed
sutff
1 parent c83c799 commit 2886261

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/GUI/FloatingButton/FloatingUIButton.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff 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
}

src/GUI/FloatingButton/FloatingUIManager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ void FloatingUIManager::visit()
6767

6868
void 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
};

0 commit comments

Comments
 (0)