CustomMessageBox Formatting

This commit is contained in:
Ricardo Luís Vaz Silva 2022-11-17 19:46:22 -03:00 committed by Christoph Oelckers
parent 724b89bb1d
commit 0f7e7744b0

View file

@ -124,7 +124,8 @@ class CustomMessageBoxMenuBase : Menu abstract
mMouseY = int(y); mMouseY = int(y);
let n = optionCount(); let n = optionCount();
for(uint i = 0; i < n; i++){ for(uint i = 0; i < n; i++)
{
screen.DrawText(textFont, messageSelection == i? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, (destWidth / 2) + OptionXOffset(i), y + (fontheight * i), Stringtable.Localize(optionName(i)), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true, DTA_ScaleX, NotifyFontScale, DTA_ScaleY, NotifyFontScale); screen.DrawText(textFont, messageSelection == i? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, (destWidth / 2) + OptionXOffset(i), y + (fontheight * i), Stringtable.Localize(optionName(i)), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true, DTA_ScaleX, NotifyFontScale, DTA_ScaleY, NotifyFontScale);
} }
@ -209,7 +210,7 @@ class CustomMessageBoxMenuBase : Menu abstract
if (mkey == MKEY_Up) if (mkey == MKEY_Up)
{ {
MenuSound("menu/cursor"); MenuSound("menu/cursor");
if(messageSelection == 0) messageSelection = optionCount(); if (messageSelection == 0) messageSelection = optionCount();
messageSelection--; messageSelection--;
return true; return true;
} }
@ -217,7 +218,7 @@ class CustomMessageBoxMenuBase : Menu abstract
{ {
MenuSound("menu/cursor"); MenuSound("menu/cursor");
messageSelection++; messageSelection++;
if(messageSelection == optionCount()) messageSelection = 0; if (messageSelection == optionCount()) messageSelection = 0;
return true; return true;
} }
else if (mkey == MKEY_Enter) else if (mkey == MKEY_Enter)