From dca118881a46806e1ef54a2533ccce5ebbe2937c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 4 Dec 2019 17:55:43 +0100 Subject: [PATCH] - added graphics for the mouse back button and reactivated the code for it. --- source/common/menu/menu.cpp | 24 ++++++++---------- wadsrc/static/demolition/graphics/M_BACK.png | Bin 0 -> 1254 bytes .../ionfury/demolition/graphics/M_BACK.png | Bin 0 -> 1255 bytes .../filter/nam/demolition/graphics/M_BACK.png | Bin 0 -> 1254 bytes .../redneck/demolition/graphics/M_BACK.png | Bin 0 -> 1254 bytes .../ww2gi/demolition/graphics/M_BACK.png | Bin 0 -> 1254 bytes 6 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 wadsrc/static/demolition/graphics/M_BACK.png create mode 100644 wadsrc/static/filter/ionfury/demolition/graphics/M_BACK.png create mode 100644 wadsrc/static/filter/nam/demolition/graphics/M_BACK.png create mode 100644 wadsrc/static/filter/redneck/demolition/graphics/M_BACK.png create mode 100644 wadsrc/static/filter/ww2gi/demolition/graphics/M_BACK.png diff --git a/source/common/menu/menu.cpp b/source/common/menu/menu.cpp index 4bc9b1bf4..350b2cabd 100644 --- a/source/common/menu/menu.cpp +++ b/source/common/menu/menu.cpp @@ -258,14 +258,13 @@ bool DMenu::MouseEventBack(int type, int x, int y) { if (m_show_backbutton >= 0) { -#if 0 - FTexture *tex = TexMan(gameinfo.mBackButton); + FTexture* tex = TileFiles.GetTexture("demolition/graphics/m_back.png"); if (tex != NULL) { - if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetScaledWidth() * CleanXfac; - if (m_show_backbutton&2) y -= screen->GetHeight() - tex->GetScaledHeight() * CleanYfac; - mBackbuttonSelected = ( x >= 0 && x < tex->GetScaledWidth() * CleanXfac && - y >= 0 && y < tex->GetScaledHeight() * CleanYfac); + if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetWidth() * CleanXfac; + if (m_show_backbutton&2) y -= screen->GetHeight() - tex->GetHeight() * CleanYfac; + mBackbuttonSelected = ( x >= 0 && x < tex->GetWidth() * CleanXfac && + y >= 0 && y < tex->GetHeight() * CleanYfac); if (mBackbuttonSelected && type == MOUSE_Release) { if (m_use_mouse == 2) mBackbuttonSelected = false; @@ -273,7 +272,6 @@ bool DMenu::MouseEventBack(int type, int x, int y) } return mBackbuttonSelected; } -#endif } return false; } @@ -314,24 +312,22 @@ void DMenu::Ticker () void DMenu::Drawer () { -#if 0 if (this == DMenu::CurrentMenu && BackbuttonAlpha > 0 && m_show_backbutton >= 0 && m_use_mouse) { - FTexture *tex = TexMan(gameinfo.mBackButton); - int w = tex->GetScaledWidth() * CleanXfac; - int h = tex->GetScaledHeight() * CleanYfac; + FTexture* tex = TileFiles.GetTexture("demolition/graphics/m_back.png"); + int w = tex->GetWidth() * CleanXfac; + int h = tex->GetHeight() * CleanYfac; int x = (!(m_show_backbutton&1))? 0:screen->GetWidth() - w; int y = (!(m_show_backbutton&2))? 0:screen->GetHeight() - h; if (mBackbuttonSelected && (mMouseCapture || m_use_mouse == 1)) { - screen->DrawTexture(tex, x, y, DTA_CleanNoMove, true, DTA_ColorOverlay, MAKEARGB(40, 255,255,255), TAG_DONE); + DrawTexture(&twod, tex, x, y, DTA_CleanNoMove, true, DTA_ColorOverlay, MAKEARGB(40, 255,255,255), TAG_DONE); } else { - screen->DrawTexture(tex, x, y, DTA_CleanNoMove, true, DTA_Alpha, BackbuttonAlpha, TAG_DONE); + DrawTexture(&twod, tex, x, y, DTA_CleanNoMove, true, DTA_Alpha, BackbuttonAlpha, TAG_DONE); } } -#endif } diff --git a/wadsrc/static/demolition/graphics/M_BACK.png b/wadsrc/static/demolition/graphics/M_BACK.png new file mode 100644 index 0000000000000000000000000000000000000000..9d562600de6dc3f434b91efc41d3d5c7086865dc GIT binary patch literal 1254 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XAGmxB~Dklb{7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCW8>XKk!&}3jRWMBZwdoeHsFfc?hFk~?>6f-cCGB8v#Ff3zW zxXi$Cn}Ojw1H(U{o>4Fw0>dH%x&^oW0Ok{hk|4j}|05eP1b=5&1x6}ofkz}T<8upw zFk^j6{6wH&vZsq9{6&ZOT&SkD0}5qZw5ylUFnC=#yN-B;A*tzWUJ5$rckrA975* g<0X3T-GZb47;GY4_t?xW>;@$)Pgg&ebxsLQ00X&F4*&oF literal 0 HcmV?d00001 diff --git a/wadsrc/static/filter/ionfury/demolition/graphics/M_BACK.png b/wadsrc/static/filter/ionfury/demolition/graphics/M_BACK.png new file mode 100644 index 0000000000000000000000000000000000000000..84a57c49c0c1eb1225191e612dbc3cf49cfb4866 GIT binary patch literal 1255 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XAGmxB~Dklb{7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCXJV&`Gv6l4*QV-;3mmo(szHRDvU=2CIy(emTb4dvAf=QE5J za;z2)o+A;qNIG%5Ov-MVl)XTWqhK@yhI$Ar<({Gs%qI*bL4LviM>b#x{?4unj8D!2 zkH}&M25vzRW~@(%p9mC8@pN$vkqD1H?J0CXfx{&*N42oSdC&jY-iFm1ez@AUUd!jP z*<&4gV6w0u>xAsn8@Lp%*-Z-dE13H4T*gw~>#@h@ENANYbS#Xu;H7c|tC-C6V_~g- o)r%BX9}-jAIaTY;UB~XPjP{3Jk94Lf?F1z%Pgg&ebxsLQ0PXux^#A|> literal 0 HcmV?d00001 diff --git a/wadsrc/static/filter/nam/demolition/graphics/M_BACK.png b/wadsrc/static/filter/nam/demolition/graphics/M_BACK.png new file mode 100644 index 0000000000000000000000000000000000000000..32e49b8639f5732c23c43ab24b0f5e2d78cdd619 GIT binary patch literal 1254 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XAGmxB~Dklb{7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCXJV`b&!VCU!M5f?|5|@{eR8f@GQdiQ|RMFE?HPlge zv^EL$aSroyO^onMi4IJO2?S~!1*0J_)I&g1VcB$GK4B;c@(cbyvH?TzcXm}^d~z0e zL>4nJa0`MkV|_~eM4(`@r;B5VM0o6JPoV<}94>)5s)ZfF@9M*qA86^+1^O@iD$UIQ z-cR(yla^q{C%25&Fm-J0Pnjwlvvj|4ROaE*>xR!)GA!D&F_bap7e`nl>+z)k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCXJV`b&!VCU!M5f?|5|@{eR8f@GQdiQ|RMFE?HPlge zv^EL$aSroyO^onMi4IJO2?S~!1*0J_)I&g1VcB$GK4B;c@(cbyvH?TzcXm}^d~z0e zL>4nJa0`MkV|_~eM4(`@r;B5VM0o6JPoV<}94>)5s)ZfF@9M*qA86^+1^O@iD$UIQ z-cR(yla^q{C%25&Fm-J0Pnjwlvvj|4ROaE*>xR!)GA!D&F_bap7e`nl>+z)k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCXJV`b&!VCU!M5f?|5|@{eR8f@GQdiQ|RMFE?HPlge zv^EL$aSroyO^onMi4IJO2?S~!1*0J_)I&g1VcB$GK4B;c@(cbyvH?TzcXm}^d~z0e zL>4nJa0`MkV|_~eM4(`@r;B5VM0o6JPoV<}94>)5s)ZfF@9M*qA86^+1^O@iD$UIQ z-cR(yla^q{C%25&Fm-J0Pnjwlvvj|4ROaE*>xR!)GA!D&F_bap7e`nl>+z)