From 9e800103f9dcff489c81d8f3f3420249cf311e3c Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Wed, 23 Oct 2019 22:20:11 +1100 Subject: [PATCH] pause: add heading text to submenus --- .../source/plugins/TLAC/Components/Pause.cpp | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/source-code/source/plugins/TLAC/Components/Pause.cpp b/source-code/source/plugins/TLAC/Components/Pause.cpp index db817a1..062cca1 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.cpp +++ b/source-code/source/plugins/TLAC/Components/Pause.cpp @@ -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);