diff --git a/resources/VHud/text/english.ini b/resources/VHud/text/english.ini index 2fb7564..d79c2e0 100644 --- a/resources/VHud/text/english.ini +++ b/resources/VHud/text/english.ini @@ -455,6 +455,8 @@ H_DEL = Delete ~k~~MENU_DELETE_SAVE~ H_NOKEY = Unset ~k~~MENU_UNSETKEY~ HP_SEL = Select ~k~~PED_SPRINT~ HP_BAC = Back ~k~~VEHICLE_ENTER_EXIT~ +H_MLPREV = Previous Page ~k~~MENU_ML_PREVPAGE~ +H_MLNEXT = Next Page ~k~~MENU_ML_NEXTPAGE~ [VEHICLE] NORMAL = Normal diff --git a/resources/VHud/text/italian.ini b/resources/VHud/text/italian.ini index d15066a..093878d 100644 --- a/resources/VHud/text/italian.ini +++ b/resources/VHud/text/italian.ini @@ -456,6 +456,8 @@ H_DEL = Elimina ~k~~MENU_DELETE_SAVE~ H_NOKEY = Rimuovi tasto ~k~~MENU_UNSETKEY~ HP_SEL = Seleziona ~k~~PED_SPRINT~ HP_BAC = Indietro ~k~~VEHICLE_ENTER_EXIT~ +H_MLPREV = Pagina precedente ~k~~MENU_ML_PREVPAGE~ +H_MLNEXT = Pagina successiva ~k~~MENU_ML_NEXTPAGE~ [VEHICLE] NORMAL = Normal diff --git a/source/FontNew.cpp b/source/FontNew.cpp index e844c8f..bb82a22 100644 --- a/source/FontNew.cpp +++ b/source/FontNew.cpp @@ -381,7 +381,8 @@ void CFontNew::SetTokenToIgnore(char t1, char t2) { int CFontNew::PrintString(float x, float y, const char* s) { int n = 0; - if (*s != '*') { + + if (s && *s != '*') { if (Details.background) { CRect rect; x += Details.backgroundBorder.left; diff --git a/source/MenuNew.cpp b/source/MenuNew.cpp index 4ad149e..26fd445 100644 --- a/source/MenuNew.cpp +++ b/source/MenuNew.cpp @@ -116,6 +116,8 @@ auto HelpText_ShowHideLegend = []() { MenuNew.bShowLegend = MenuNew.bShowLegend auto HelpText_DeleteSave = []() { MenuNew.SetMenuMessage(MENUMESSAGE_DELETE_GAME); Audio.PlayChunk(CHUNK_MENU_SELECT, 1.0f); }; auto HelpText_ApplyChanges = []() { if (MenuNew.nMenuAlert == MENUALERT_PENDINGCHANGES) MenuNew.ApplyGraphicsChanges(); Audio.PlayChunk(CHUNK_MENU_SELECT, 1.0f); }; auto HelpText_UnSetKey = []() { MenuNew.SetMenuMessage(MENUMESSAGE_SETKEYTONULL); Audio.PlayChunk(CHUNK_MENU_SELECT, 1.0f); }; +auto HelpText_MLPrevPage = []() { MenuNew.ProcessOriginalOptions(MENUPAGE_MODLOADER_MODS, 11, false, true); MenuNew.SetInputTypeAndClear(MenuNew.nCurrentInputType); Audio.PlayChunk(CHUNK_MENU_SCROLL, 1.0f); }; +auto HelpText_MLNextPage = []() { MenuNew.ProcessOriginalOptions(MENUPAGE_MODLOADER_MODS, 9, false, true); MenuNew.SetInputTypeAndClear(MenuNew.nCurrentInputType); Audio.PlayChunk(CHUNK_MENU_SCROLL, 1.0f); }; static LateStaticInit InstallHooks([]() { patch::Set(0x53E797, 0xEB); @@ -1737,6 +1739,10 @@ void CMenuNew::Process() { } [[fallthrough]]; default: + if (nCurrentInputType == MENUINPUT_ENTRY && !faststrcmp(MenuScreen[nCurrentScreen].Tab[nCurrentTabItem].tabName, "FE_MODS")) { + AppendHelpText("H_MLPREV", HelpText_MLPrevPage); + AppendHelpText("H_MLNEXT", HelpText_MLNextPage); + } AppendHelpText("H_BAC", HelpText_GoBack); AppendHelpText("H_SEL", HelpText_GoThrough); break; @@ -2357,7 +2363,7 @@ void CMenuNew::ProcessEntryStuff(int enter, int input) { if (enter) process = true; - if (process) { + if (process && nCurrentEntryItem < 9) { page = MENUPAGE_MODLOADER_MODS; nPreviousScreen = nCurrentScreen; @@ -2365,6 +2371,15 @@ void CMenuNew::ProcessEntryStuff(int enter, int input) { bRequestScreenUpdate = true; SetInputTypeAndClear(MENUINPUT_TAB); } + + if (input > 0) { + ProcessOriginalOptions(MENUPAGE_MODLOADER_MODS, 11, false, true); + SetInputTypeAndClear(nCurrentInputType); + } + else if (input < 0) { + ProcessOriginalOptions(MENUPAGE_MODLOADER_MODS, 9, false, true); + SetInputTypeAndClear(nCurrentInputType); + } } else if (!faststrcmp(MenuScreen[nCurrentScreen].Tab[nCurrentTabItem].tabName, "FE_MLSET")) { process = true; @@ -3206,7 +3221,11 @@ void CMenuNew::DrawDefault() { const int entryType = MenuScreen[nCurrentScreen].Tab[nCurrentTabItem].Entries[i].type; switch (entryType) { case MENUENTRY_ORIGINAL: - leftText = OriginalLeftTextString[i]; + if (char* str = OriginalLeftTextString[i]) { + + if (str[0] != '\0') + leftText = OriginalLeftTextString[i]; + } break; case MENUENTRY_LOADGAME: leftText = nSaveSlots[i]; diff --git a/source/PadNew.cpp b/source/PadNew.cpp index 55405e9..bad3d3f 100644 --- a/source/PadNew.cpp +++ b/source/PadNew.cpp @@ -97,7 +97,9 @@ CControls Controls[NUM_CONTROL_ACTIONS] = { { "MENU_APPLY_CHANGES", KEY(' '), GAMEPAD_SQUARE, GAMEPAD_SQUARE }, { "MENU_BACK", KEY(rsESC), GAMEPAD_CIRCLE, GAMEPAD_CIRCLE }, { "MENU_SELECT", KEY(rsENTER), GAMEPAD_CROSS, GAMEPAD_CROSS }, - { "MENU_UNSETKEY", KEY(' '), GAMEPAD_SQUARE, GAMEPAD_SQUARE } + { "MENU_UNSETKEY", KEY(' '), GAMEPAD_SQUARE, GAMEPAD_SQUARE }, + { "MENU_ML_PREVPAGE", KEY(rsLEFT), GAMEPAD_DPADLEFT, GAMEPAD_DPADLEFT }, + { "MENU_ML_NEXTPAGE", KEY(rsRIGHT), GAMEPAD_DPADLEFT, GAMEPAD_DPADRIGHT } }; const char* controlKeysStrings[62] = { diff --git a/source/PadNew.h b/source/PadNew.h index f90829e..9f46d8b 100644 --- a/source/PadNew.h +++ b/source/PadNew.h @@ -98,6 +98,8 @@ enum eControlsActions { MENU_BACK, MENU_SELECT, MENU_UNSETKEY, + MENU_ML_PREVPAGE, + MENU_ML_NEXTPAGE, NUM_CONTROL_ACTIONS };