pause: add heading text to submenus

This commit is contained in:
somewhatlurker
2019-10-23 22:20:11 +11:00
parent 73c3af7bc0
commit 9e800103f9
@@ -290,8 +290,12 @@ namespace TLAC::Components
dtParams.layer = contentLayer;
// selection cursor
int selectBoxOrigin = menuY - menuItemHeight * (menu[curMenuSet].items.size() / 2.0) - (menuItemHeight - menuTextSize) / 2;
int selectBoxPos = selectBoxOrigin + menuItemHeight * curMenuPos;
int menuOrigin = menuY - menuItemHeight * (menu[curMenuSet].items.size() / 2.0);
if (curMenuSet != MENUSET_MAIN)
{
menuOrigin += menuItemHeight * 0.4;
}
int selectBoxPos = menuOrigin - (menuItemHeight - menuTextSize) / 2 + menuItemHeight * curMenuPos;
const float selectBoxWidth = 200;
const float selectBoxHeight = menuItemHeight;
const float selectBoxThickness = 2;
@@ -307,10 +311,20 @@ namespace TLAC::Components
// menu
fontInfo.setSize(menuTextSize, menuTextSize);
dtParams.textCurrentLoc = { menuX, menuY - menuItemHeight * (menu[curMenuSet].items.size() / 2.0f) };
dtParams.textCurrentLoc = { menuX, (float)menuOrigin };
dtParams.lineOriginLoc = dtParams.textCurrentLoc;
if (curMenuSet != MENUSET_MAIN)
{
dtParams.textCurrentLoc.y -= menuItemHeight * 1.333f;
dtParams.lineOriginLoc.y = dtParams.textCurrentLoc.y;
dtParams.colour = 0xffffffff;
drawText(&dtParams, (drawTextFlags)(DRAWTEXT_ALIGN_CENTRE | DRAWTEXT_STROKE), menu[curMenuSet].name);
dtParams.textCurrentLoc.y += menuItemHeight * 1.333f;
dtParams.lineOriginLoc.y = dtParams.textCurrentLoc.y;
}
for (int i = 0; i < menu[curMenuSet].items.size(); i++)
{
if (i == curMenuPos)
@@ -327,7 +341,7 @@ namespace TLAC::Components
dtParams.textCurrentLoc.y += menuItemHeight;
dtParams.lineOriginLoc = dtParams.textCurrentLoc;
}
// key legend
destroyAetLayer(triangleAet);