From bb6293950fe94dfedbc743d11720528f940afa0e Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:08:38 -0400 Subject: [PATCH] Add in-game options button To trigger the in-game options / pause menu --- data/base/images/intfac.img | 2 + .../intfac/image_ingameoptions_down.png | Bin 0 -> 6759 bytes .../images/intfac/image_ingameoptions_up.png | Bin 0 -> 6319 bytes src/hci.cpp | 114 ++++++++++++++++++ src/hci.h | 1 + src/intfac.h | 4 +- src/loadsave.cpp | 1 + src/mission.cpp | 3 +- src/multiopt.cpp | 1 + 9 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 data/base/images/intfac/image_ingameoptions_down.png create mode 100644 data/base/images/intfac/image_ingameoptions_up.png diff --git a/data/base/images/intfac.img b/data/base/images/intfac.img index b8397e597a8..5bbf14fe5e5 100644 --- a/data/base/images/intfac.img +++ b/data/base/images/intfac.img @@ -450,3 +450,5 @@ 0,0,image_indicator_dot.png 0,0,image_indicator_dot_expand.png 0,0,image_sidebar_list.png +0,0,image_ingameoptions_up.png +0,0,image_ingameoptions_down.png diff --git a/data/base/images/intfac/image_ingameoptions_down.png b/data/base/images/intfac/image_ingameoptions_down.png new file mode 100644 index 0000000000000000000000000000000000000000..8a1d8a5727d3ad0414cad271572bdfa666bad6d4 GIT binary patch literal 6759 zcmV-t8kpsYP)+oT<}D6pgn+5|MnP3`u5J#f>6k zNfF0G98ZmVso%J}&U&RTXz98ja@bLK z)xY-k!Ec6PP+S-E>U!*VV4EJFFDQEArxov3?Jg}<7Yn-ly3@xN6y`Ut3tIn`i3<4k>*d^V$6x?NL|uASzln<$tUPqdr?=#Y?Bv)jmAr6x zuNxXRZg607{?V*OES$F#fH*G0NsMEZjU#Lv0R|h#{xibHS&WVRaWyus2CVz7h`+a* zI4Z|_W?2$u1^%80YqIXCne-nP&i$H?W-UtB+puwiP8VL@>-yc<^DZ;&q8JYmH+Lv1gK3S>x2x7{^ExSG!MQFa~3?x!+pr zq|a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7QH)pVRN|ZTm(n z7Mb?>Dp6EajYxP>XV5aa8r)1Y!j#`#U1p&QD76A0A|!24s1-!98sSB)dg#d}S_exM z3;7HMAp}&+&*{CQgKm7ufrnyoQ7wEvKVq@)RCjOtH&<%^ioXdmH5mxno!*JO+|oO| z-cs~*9{^PxdUzzsWWpFjWV|p$iLvy+jHFC-Nk$P$sRWvXrBF+9uA~ajRZ>OO&t(v4 zO^rc~&tm5_pM%9>Lu>niM_XH--}hGs3;>4C9zR}EvT;{hny1w6aA9De1$IX|%n{DP zlCP=o0tuL*p+l_B5K0V>p@!HeUsL&4zahjV)yOY7NQqhIE~b0;{OlmsufGYNoMN0i zH~5!#-}&K+y$iU4?@M+BS{_o>M5Mf|5jojDL?g3F-~dv&V0v33J~Rxb79qcIDaHsd zMX!3Y5`q!oS#m!~W30j}O-;2R&s0?JNO%f4+4(3hYlNyMA{~L2hcDOe%l^LP#JP^C zRCh7)

}?$5V{%ZZ2u_)w76`3W);vq zR-9kcVu*ytu=ASxV7ECD=sxl<%}1Vj`Eu>PqHpA$86N!inc0bUcWM^uYIh(sKc?pt zX_S0S>LPW68eSq-y+JrwGK@e3Z6OjY&ZYEfm_!@oTw)PLXmg?980uYHPcs=T9zdabg)^Rm zma?DZc)a~Fz?V(7ezU-HXgoFtmoo)*wcEiM)7m5efHg^tre(UMUG#T+zhzyVIlRr2fqUHz*L@k;*@ZaWck=Of-u}=3|9`^( z@PG8NZPN{%PNzG6HRfCG5f0A{?LYKR-KoIt*(;rERsJ)|^ki35vE}p?_{#5Djrmr4 lw6yMhpyTBKoLG&y{tpY$vq;R9VQT;Y002ovPDHLkV1jqZ`&R$} literal 0 HcmV?d00001 diff --git a/src/hci.cpp b/src/hci.cpp index bef0b7548a9..490ebf68765 100644 --- a/src/hci.cpp +++ b/src/hci.cpp @@ -2148,9 +2148,123 @@ bool intShowGroupSelectionMenu() return true; } +class W_INGAMEOPTIONS_BUTTON : public W_BUTTON +{ +protected: + W_INGAMEOPTIONS_BUTTON() + { } + void initialize(); +public: + static std::shared_ptr make(); + + void display(int xOffset, int yOffset) override; + std::string getTip() override; +}; + +std::shared_ptr W_INGAMEOPTIONS_BUTTON::make() +{ + class make_shared_enabler: public W_INGAMEOPTIONS_BUTTON {}; + auto widget = std::make_shared(); + widget->initialize(); + return widget; +} + +void W_INGAMEOPTIONS_BUTTON::initialize() +{ + id = IDRET_OPTIONS; + setGeometry(0, 0, RET_BUTWIDTH, RET_BUTHEIGHT); +} + +void W_INGAMEOPTIONS_BUTTON::display(int xOffset, int yOffset) +{ + const int x0 = xOffset + x(); + const int y0 = yOffset + y(); + bool butDisabled = getState() & WBUT_DISABLE; + + if (butDisabled) + { + iV_DrawImage2("image_reticule_grey.png", x0, y0, width(), height()); + return; + } + + bool Down = getState() & (WBUT_DOWN | WBUT_CLICKLOCK); + if (Down) + { + iV_DrawImage2("image_ingameoptions_down.png", x0, y0, width(), height()); + } + else + { + iV_DrawImage2("image_ingameoptions_up.png", x0, y0, width(), height()); + } + + bool highlighted = ((getState() & WBUT_HIGHLIGHT) != 0) || InGameOpUp; + if (highlighted) + { + iV_DrawImage2("image_reticule_hilight.png", x0, y0, width(), height()); + } +} + +std::string W_INGAMEOPTIONS_BUTTON::getTip() +{ + if (!InGameOpUp) + { + return _("Open In-Game Options"); + } + else + { + return _("Close In-Game Options"); + } +} + +bool intAddInGameOptionsButton() +{ + auto psExistingBut = widgGetFromID(psWScreen, IDRET_OPTIONS); + if (psExistingBut != nullptr) + { + psExistingBut->show(); + return false; + } + + auto button = W_INGAMEOPTIONS_BUTTON::make(); + if (!button) + { + debug(LOG_ERROR, "Failed to create in game options button"); + } + else + { + psWScreen->psForm->attach(button); + setReticuleButtonDimensions(*button, "image_ingameoptions_up.png"); + button->setCalcLayout(LAMBDA_CALCLAYOUT_SIMPLE({ + int w = psWidget->width(); + int h = psWidget->height(); + int x0 = screenWidth - (w + 16); + int y0 = 18; + psWidget->setGeometry(x0, y0, w, h); + })); + button->addOnClickHandler([](W_BUTTON&) { + widgScheduleTask([](){ + kf_addInGameOptions(); + }); + }); + } + + return true; +} + +void intHideInGameOptionsButton() +{ + auto psOptionsBut = widgGetFromID(psWScreen, IDRET_OPTIONS); + if (psOptionsBut != nullptr) + { + psOptionsBut->hide(); + } +} + /* Add the reticule widgets to the widget screen */ bool intAddReticule() { + intAddInGameOptionsButton(); + if (ReticuleUp) { return true; // all fine diff --git a/src/hci.h b/src/hci.h index 6edd2c49422..712282c6020 100644 --- a/src/hci.h +++ b/src/hci.h @@ -300,6 +300,7 @@ bool intAddReticule(); bool intShowGroupSelectionMenu(); bool intAddPower(); void intRemoveReticule(); +void intHideInGameOptionsButton(); void setReticuleStats(int ButId, std::string tip = std::string(), std::string filename = std::string(), std::string filenameDown = std::string(), const playerCallbackFunc& callbackFunc = nullptr); void setReticulesEnabled(bool enabled); void setReticuleFlash(int ButId, bool flash); diff --git a/src/intfac.h b/src/intfac.h index 8bff05fbe22..8eb64595f5d 100644 --- a/src/intfac.h +++ b/src/intfac.h @@ -483,7 +483,9 @@ enum INTFAC_TYPE IMAGE_BUT_INNER_GLOW, IMAGE_INDICATOR_DOT, IMAGE_INDICATOR_DOT_EXPAND, - IMAGE_INTFAC_SIDEBAR_LIST + IMAGE_INTFAC_SIDEBAR_LIST, + IMAGE_INGAMEOPTIONS_UP, + IMAGE_INGAMEOPTIONS_DOWN, }; #endif //__INCLUDED_SRC_INTFAC_H__ diff --git a/src/loadsave.cpp b/src/loadsave.cpp index 708fefe5841..c87fff6d510 100644 --- a/src/loadsave.cpp +++ b/src/loadsave.cpp @@ -254,6 +254,7 @@ bool addLoadSave(LOADSAVE_MODE savemode, const char *title) forceHidePowerBar(); intRemoveReticule(); + intHideInGameOptionsButton(); intHideGroupSelectionMenu(); } diff --git a/src/mission.cpp b/src/mission.cpp index 507869203e7..4c513f5b95f 100644 --- a/src/mission.cpp +++ b/src/mission.cpp @@ -1933,7 +1933,7 @@ bool intAddMissionTimer() sFormInit.x = (SWORD)(RADTLX + RADWIDTH - sFormInit.width); sFormInit.y = (SWORD)TIMER_Y; sFormInit.calcLayout = LAMBDA_CALCLAYOUT_SIMPLE({ - psWidget->move((SWORD)(RADTLX + RADWIDTH - psWidget->width()), TIMER_Y); + psWidget->move((SWORD)(RADTLX + RADWIDTH - psWidget->width() - 18), TIMER_Y); }); sFormInit.UserData = PACKDWORD_TRI(0, IMAGE_MISSION_CLOCK, IMAGE_MISSION_CLOCK_UP); sFormInit.pDisplay = intDisplayMissionClock; @@ -2287,6 +2287,7 @@ static void missionResetInGameState() intRemoveReticule(); intRemoveMissionTimer(); intRemoveTransporterTimer(); + intHideInGameOptionsButton(); intHideGroupSelectionMenu(); } diff --git a/src/multiopt.cpp b/src/multiopt.cpp index 3b1f9c62e71..88ea5dbedf0 100644 --- a/src/multiopt.cpp +++ b/src/multiopt.cpp @@ -675,6 +675,7 @@ bool multiStartScreenInit() bDisplayMultiJoiningStatus = 1; // always display this gameTimeStop(); intHideInterface(true); + intHideInGameOptionsButton(); createGameStartScreen([] { // on game start overlay screen close... bDisplayMultiJoiningStatus = 0;