- added graphics for the mouse back button and reactivated the code for it.

This commit is contained in:
Christoph Oelckers 2019-12-04 17:55:43 +01:00
parent 138326314e
commit dca118881a
6 changed files with 10 additions and 14 deletions

View file

@ -258,14 +258,13 @@ bool DMenu::MouseEventBack(int type, int x, int y)
{ {
if (m_show_backbutton >= 0) if (m_show_backbutton >= 0)
{ {
#if 0 FTexture* tex = TileFiles.GetTexture("demolition/graphics/m_back.png");
FTexture *tex = TexMan(gameinfo.mBackButton);
if (tex != NULL) if (tex != NULL)
{ {
if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetScaledWidth() * CleanXfac; if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetWidth() * CleanXfac;
if (m_show_backbutton&2) y -= screen->GetHeight() - tex->GetScaledHeight() * CleanYfac; if (m_show_backbutton&2) y -= screen->GetHeight() - tex->GetHeight() * CleanYfac;
mBackbuttonSelected = ( x >= 0 && x < tex->GetScaledWidth() * CleanXfac && mBackbuttonSelected = ( x >= 0 && x < tex->GetWidth() * CleanXfac &&
y >= 0 && y < tex->GetScaledHeight() * CleanYfac); y >= 0 && y < tex->GetHeight() * CleanYfac);
if (mBackbuttonSelected && type == MOUSE_Release) if (mBackbuttonSelected && type == MOUSE_Release)
{ {
if (m_use_mouse == 2) mBackbuttonSelected = false; if (m_use_mouse == 2) mBackbuttonSelected = false;
@ -273,7 +272,6 @@ bool DMenu::MouseEventBack(int type, int x, int y)
} }
return mBackbuttonSelected; return mBackbuttonSelected;
} }
#endif
} }
return false; return false;
} }
@ -314,24 +312,22 @@ void DMenu::Ticker ()
void DMenu::Drawer () void DMenu::Drawer ()
{ {
#if 0
if (this == DMenu::CurrentMenu && BackbuttonAlpha > 0 && m_show_backbutton >= 0 && m_use_mouse) if (this == DMenu::CurrentMenu && BackbuttonAlpha > 0 && m_show_backbutton >= 0 && m_use_mouse)
{ {
FTexture *tex = TexMan(gameinfo.mBackButton); FTexture* tex = TileFiles.GetTexture("demolition/graphics/m_back.png");
int w = tex->GetScaledWidth() * CleanXfac; int w = tex->GetWidth() * CleanXfac;
int h = tex->GetScaledHeight() * CleanYfac; int h = tex->GetHeight() * CleanYfac;
int x = (!(m_show_backbutton&1))? 0:screen->GetWidth() - w; int x = (!(m_show_backbutton&1))? 0:screen->GetWidth() - w;
int y = (!(m_show_backbutton&2))? 0:screen->GetHeight() - h; int y = (!(m_show_backbutton&2))? 0:screen->GetHeight() - h;
if (mBackbuttonSelected && (mMouseCapture || m_use_mouse == 1)) 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 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
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB