Proper fix for playerlist click detection

This commit is contained in:
TotallyNotElite 2019-05-24 23:35:28 +02:00
parent 1c5d10ad80
commit beac7a1243
6 changed files with 15 additions and 19 deletions

View File

@ -41,8 +41,6 @@ public:
void emitSizeUpdate() override;
bool isHovered();
//
void setColorText(const rgba_t *color);

View File

@ -20,6 +20,8 @@ public:
void setParent(BaseMenuObject *parent) override;
void updateIsHovered() override;
//
//

View File

@ -31,20 +31,6 @@ void zerokernel::Text::set(std::string text)
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)
{
if (!isHidden())

View File

@ -6,6 +6,16 @@
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()
{
Container::reorderElements();