mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #6722
6722: Add highlight color when hovering DDNet/KoG type/country filters r=def- a=Robyt3 ## Checklist - [X] 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
7b93e41d81
|
@ -775,7 +775,8 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
|
||||
CUIRect TypesRect, Left, Right;
|
||||
|
||||
static int s_aTypeButtons[64];
|
||||
static std::vector<unsigned char> s_vTypeButtons;
|
||||
s_vTypeButtons.resize(MaxTypes);
|
||||
|
||||
while(NumTypes > 0)
|
||||
{
|
||||
|
@ -801,7 +802,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
Rect.w = TypesWidth;
|
||||
Rect.h = TypesHeight;
|
||||
|
||||
int Click = UI()->DoButtonLogic(&s_aTypeButtons[TypeIndex], 0, &Rect);
|
||||
int Click = UI()->DoButtonLogic(&s_vTypeButtons[TypeIndex], 0, &Rect);
|
||||
if(Click == 1 || Click == 2)
|
||||
{
|
||||
// left/right click to toggle filter
|
||||
|
@ -849,7 +850,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
ServerBrowser()->Refresh(ServerBrowser()->GetCurrentType());
|
||||
}
|
||||
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, Active ? 1.0f : 0.2f);
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, (Active ? 0.9f : 0.2f) + (UI()->HotItem() == &s_vTypeButtons[TypeIndex] ? 0.1f : 0.0f));
|
||||
UI()->DoLabel(&Rect, pName, FontSize, TEXTALIGN_MC);
|
||||
TextRender()->TextColor(1.0, 1.0, 1.0, 1.0f);
|
||||
}
|
||||
|
@ -869,7 +870,8 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
|
||||
CUIRect FlagsRect;
|
||||
|
||||
static int s_aFlagButtons[64];
|
||||
static std::vector<unsigned char> s_vFlagButtons;
|
||||
s_vFlagButtons.resize(MaxFlags);
|
||||
|
||||
while(NumFlags > 0)
|
||||
{
|
||||
|
@ -896,7 +898,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
Rect.w = FlagWidth;
|
||||
Rect.h = FlagHeight;
|
||||
|
||||
int Click = UI()->DoButtonLogic(&s_aFlagButtons[CountryIndex], 0, &Rect);
|
||||
int Click = UI()->DoButtonLogic(&s_vFlagButtons[CountryIndex], 0, &Rect);
|
||||
if(Click == 1 || Click == 2)
|
||||
{
|
||||
// left/right click to toggle filter
|
||||
|
@ -944,7 +946,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
ServerBrowser()->Refresh(ServerBrowser()->GetCurrentType());
|
||||
}
|
||||
|
||||
m_pClient->m_CountryFlags.Render(FlagID, ColorRGBA(1.0f, 1.0f, 1.0f, Active ? 1.0f : 0.2f), Pos.x, Pos.y, FlagWidth, FlagHeight);
|
||||
m_pClient->m_CountryFlags.Render(FlagID, ColorRGBA(1.0f, 1.0f, 1.0f, (Active ? 0.9f : 0.2f) + (UI()->HotItem() == &s_vFlagButtons[CountryIndex] ? 0.1f : 0.0f)), Pos.x, Pos.y, FlagWidth, FlagHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue