From d0b73f9a9669dcf344f73d1217ba78ba5bc3716b Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Fri, 11 Jan 2019 18:09:15 +0100 Subject: [PATCH 1/2] Add hover effect using Oy's modified menu.png --- datasrc/content.py | 3 ++- datasrc/ui/icons/menu.png | Bin 584 -> 1364 bytes src/game/client/components/menus.cpp | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/datasrc/content.py b/datasrc/content.py index 2fb2c038e..bccb9a6e2 100644 --- a/datasrc/content.py +++ b/datasrc/content.py @@ -295,7 +295,7 @@ set_demobuttons = SpriteSet("demobuttons", image_demobuttons, 5, 1) set_fileicons = SpriteSet("fileicons", image_fileicons, 8, 1) set_guibuttons = SpriteSet("guibuttons", image_guibuttons, 12, 4) set_guiicons = SpriteSet("guiicons", image_guiicons, 8, 2) -set_menuicons = SpriteSet("menuicons", image_menuicons, 2, 2) +set_menuicons = SpriteSet("menuicons", image_menuicons, 4, 4) set_toolicons = SpriteSet("toolicons", image_toolicons, 4, 2) set_arrowicons = SpriteSet("arrowicons", image_arrowicons, 4, 3) set_friendicons = SpriteSet("friendicons", image_friendicons, 2, 2) @@ -488,6 +488,7 @@ container.sprites.Add(Sprite("guiicon_friend", set_guiicons, 4,0,4,2)) container.sprites.Add(Sprite("menu_checkbox_active", set_menuicons, 0,0,1,1)) container.sprites.Add(Sprite("menu_checkbox_inactive", set_menuicons, 0,1,1,1)) +container.sprites.Add(Sprite("menu_checkbox_hover", set_menuicons, 0,2,1,1)) container.sprites.Add(Sprite("menu_collapsed", set_menuicons, 1,0,1,1)) container.sprites.Add(Sprite("menu_expanded", set_menuicons, 1,1,1,1)) diff --git a/datasrc/ui/icons/menu.png b/datasrc/ui/icons/menu.png index 9445da6b494510dcf531c5f4b42d6bc0bd705705..af1b55f271379e7bce4cf819d31177fe90330a02 100644 GIT binary patch literal 1364 zcma)6do&Yz9RF>@W@V$&N``iOP@XsUSRNzHGb*izRHi%f$X-@kp3_4jy$(7O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a^UZAoI~C>)oKh@cmr~sqfwWhj}5k$EZO7Cs3o!il&=DfhxeSe!dj?LHuGG6&) zb>P^UUph<-uwY>1#Kc~q!-V$JGZLP9tt(+Go*i)r^7%LX9E@uN_WN|N_|!P6*!^$W ay8@rJW4I&I?boV4An+vmx|TVUFZ~0~sAOsY literal 584 zcmV-O0=NB%P)cc)=!_~T1eaKb- z8W(_};hDGHZnt|ckoz7obRJ|Ezm3t>(D2Oq`~Ci{K<<0UudZ)DmU zCTxvO()>m;{Q<L=s_3&0000TextureSet(g_pData->m_aImages[IMAGE_MENUICONS].m_Id); Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, UI()->HotItem() == pID ? 1.0f : 0.6f); + Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); + if(UI()->HotItem() == pID) + { + RenderTools()->SelectSprite(SPRITE_MENU_CHECKBOX_HOVER); + IGraphics::CQuadItem QuadItem(c.x, c.y, c.w, c.h); + Graphics()->QuadsDrawTL(&QuadItem, 1); + } if(Checked) RenderTools()->SelectSprite(SPRITE_MENU_CHECKBOX_ACTIVE); else From 152099433206543c392421a9a6ef8936a841ff8a Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Fri, 11 Jan 2019 18:34:05 +0100 Subject: [PATCH 2/2] Add hover effect to file dialog entry --- src/game/editor/editor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 38eab390f..88757bea9 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -566,6 +566,8 @@ int CEditor::DoButton_File(const void *pID, const char *pText, int Checked, cons { if(Checked) RenderTools()->DrawUIRect(pRect, GetButtonColor(pID, Checked), CUI::CORNER_ALL, 3.0f); + else if(UI()->HotItem() == pID) + RenderTools()->DrawUIRect(pRect, vec4(1,1,1,0.33f), CUI::CORNER_ALL, 3.0f); CUIRect t = *pRect; t.VMargin(5.0f, &t);