Proper fix for playerlist click detection
This commit is contained in:
parent
1c5d10ad80
commit
beac7a1243
@ -41,8 +41,6 @@ public:
|
|||||||
|
|
||||||
void emitSizeUpdate() override;
|
void emitSizeUpdate() override;
|
||||||
|
|
||||||
bool isHovered();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
void setColorText(const rgba_t *color);
|
void setColorText(const rgba_t *color);
|
||||||
|
@ -20,6 +20,8 @@ public:
|
|||||||
|
|
||||||
void setParent(BaseMenuObject *parent) override;
|
void setParent(BaseMenuObject *parent) override;
|
||||||
|
|
||||||
|
void updateIsHovered() override;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -31,20 +31,6 @@ void zerokernel::Text::set(std::string text)
|
|||||||
BaseMenuObject::emitSizeUpdate();
|
BaseMenuObject::emitSizeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zerokernel::Text::isHovered()
|
|
||||||
{
|
|
||||||
int mx{ 0 };
|
|
||||||
int my{ 0 };
|
|
||||||
|
|
||||||
if (Menu::instance)
|
|
||||||
{
|
|
||||||
mx = Menu::instance->mouseX;
|
|
||||||
my = Menu::instance->mouseY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bb.contains(mx, my);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool zerokernel::Text::handleSdlEvent(SDL_Event *event)
|
bool zerokernel::Text::handleSdlEvent(SDL_Event *event)
|
||||||
{
|
{
|
||||||
if (!isHidden())
|
if (!isHidden())
|
||||||
|
@ -6,6 +6,16 @@
|
|||||||
Created on 08.07.18.
|
Created on 08.07.18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void zerokernel::TRow::updateIsHovered()
|
||||||
|
{
|
||||||
|
BaseMenuObject::updateIsHovered();
|
||||||
|
|
||||||
|
for (auto it = objects.rbegin(); it != objects.rend(); ++it)
|
||||||
|
{
|
||||||
|
(*it)->updateIsHovered();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void zerokernel::TRow::reorderElements()
|
void zerokernel::TRow::reorderElements()
|
||||||
{
|
{
|
||||||
Container::reorderElements();
|
Container::reorderElements();
|
||||||
|
Reference in New Issue
Block a user