mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #5608
5608: Minor client refactorings r=heinrich5991 a=Robyt3 <!-- What is the motivation for the changes of this pull request --> ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
bf7dc6c555
|
@ -285,8 +285,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
r.Margin(0.5f, &r);
|
||||
RenderTools()->DrawUIElRect(*pItem->m_pUIElement->Get(0), &r, ColorRGBA(1, 1, 1, 0.5f), CUI::CORNER_ALL, 4.0f);
|
||||
}
|
||||
|
||||
if(!Selected && UI()->MouseHovered(&Row))
|
||||
else if(UI()->MouseHovered(&Row))
|
||||
{
|
||||
CUIRect r = Row;
|
||||
r.Margin(0.5f, &r);
|
||||
|
|
|
@ -9,7 +9,7 @@ CTooltips::CTooltips()
|
|||
|
||||
void CTooltips::OnReset()
|
||||
{
|
||||
HoverTime = -1;
|
||||
m_HoverTime = -1;
|
||||
m_Tooltips.clear();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ void CTooltips::SetActiveTooltip(CTooltip &Tooltip)
|
|||
return;
|
||||
|
||||
m_ActiveTooltip.emplace(Tooltip);
|
||||
HoverTime = time_get();
|
||||
m_HoverTime = time_get();
|
||||
}
|
||||
|
||||
inline void CTooltips::ClearActiveTooltip()
|
||||
|
@ -68,7 +68,7 @@ void CTooltips::OnRender()
|
|||
return;
|
||||
|
||||
// Delay tooltip until 1 second passed.
|
||||
if(HoverTime > time_get() - time_freq())
|
||||
if(m_HoverTime > time_get() - time_freq())
|
||||
return;
|
||||
|
||||
const float MARGIN = 5.0f;
|
||||
|
|
|
@ -25,7 +25,7 @@ class CTooltips : public CComponent
|
|||
{
|
||||
std::unordered_map<uintptr_t, CTooltip> m_Tooltips;
|
||||
std::optional<std::reference_wrapper<CTooltip>> m_ActiveTooltip;
|
||||
int64_t HoverTime;
|
||||
int64_t m_HoverTime;
|
||||
|
||||
/**
|
||||
* The passed tooltip is only actually set if there is no currently active tooltip.
|
||||
|
|
Loading…
Reference in a new issue