From affc2aec312a89a485cb7df785bf47b6ea10010e Mon Sep 17 00:00:00 2001 From: rftrdev <102184004+rftrdev@users.noreply.github.com> Date: Sun, 23 Oct 2022 01:27:13 -0700 Subject: [PATCH] Add mission help screen Initialise missions properly --- Strategic/Rebel Command.cpp | 50 ++++++++++++++++++++++++++++++++++--- Utils/_ChineseText.cpp | 5 +++- Utils/_DutchText.cpp | 5 +++- Utils/_EnglishText.cpp | 5 +++- Utils/_FrenchText.cpp | 5 +++- Utils/_GermanText.cpp | 5 +++- Utils/_ItalianText.cpp | 5 +++- Utils/_PolishText.cpp | 5 +++- Utils/_RussianText.cpp | 5 +++- 9 files changed, 79 insertions(+), 11 deletions(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index ece7f56e..3956b4b2 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -327,6 +327,9 @@ enum RebelCommandText // keep this synced with szRebelCommandText in the text fi RCT_MISSION_START_BUTTON, RCT_MISSION_VIEW_ACTIVE, RCT_MISSION_VIEW_LIST, + RCT_MISSION_HELP_1, + RCT_MISSION_HELP_2, + RCT_MISSION_HELP_3, RCT_MISSION_NEXT_AVAILABILITY, RCT_MISSION_ACTIVE_MISSIONS, RCT_MISSION_LIST_PREPARING, @@ -394,6 +397,7 @@ enum MissionOverviewSubview { MOS_MISSION_LIST, MOS_ACTIVE_MISSION_EFFECTS, + MOS_HELP, }; struct MissionFirstEvent @@ -2536,6 +2540,17 @@ void RenderMissionOverview() // title RenderHeader(RCT_AGENT_OVERVIEW); + // display help button + btnId = CreateTextButton(L"?", FONT12ARIAL, FONT_MCOLOR_WHITE, FONT_BLACK, BUTTON_USE_DEFAULT, WEBSITE_LEFT + 15, WEBSITE_TOP + 40, 30, 20, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, [](GUI_BUTTON* btn, INT32 reason) + { + ButtonHelper(btn, reason, []() + { + missionOverviewSubview = missionOverviewSubview == MOS_HELP ? MOS_MISSION_LIST : MOS_HELP; + }); + }); + + btnIds.push_back(btnId); + // toggle between mission picker and active mission effects switch (missionOverviewSubview) { @@ -2544,10 +2559,11 @@ void RenderMissionOverview() break; case MOS_ACTIVE_MISSION_EFFECTS: + case MOS_HELP: swprintf(sText, szRebelCommandText[RCT_MISSION_VIEW_LIST]); break; } - btnId = CreateTextButton(sText, FONT10ARIAL, FONT_MCOLOR_LTYELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, WEBSITE_LEFT + 15, WEBSITE_TOP + 40, 470, 20, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, [](GUI_BUTTON* btn, INT32 reason) + btnId = CreateTextButton(sText, FONT10ARIAL, FONT_MCOLOR_LTYELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, WEBSITE_LEFT + 50, WEBSITE_TOP + 40, 435, 20, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, [](GUI_BUTTON* btn, INT32 reason) { ButtonHelper(btn, reason, []() { @@ -2558,6 +2574,7 @@ void RenderMissionOverview() break; case MOS_ACTIVE_MISSION_EFFECTS: + case MOS_HELP: missionOverviewSubview = MOS_MISSION_LIST; break; } @@ -2645,6 +2662,17 @@ void RenderMissionOverview() } } break; + + case MOS_HELP: + { + UINT16 y = WEBSITE_TOP + 100; + y += DisplayWrappedString(WEBSITE_LEFT + 35, y, 400, 2, FONT12ARIAL, FONT_MCOLOR_BLACK, szRebelCommandText[RCT_MISSION_HELP_1], FONT_MCOLOR_BLACK, FALSE, 0); + y += 20; + y += DisplayWrappedString(WEBSITE_LEFT + 35, y, 400, 2, FONT12ARIAL, FONT_MCOLOR_BLACK, szRebelCommandText[RCT_MISSION_HELP_2], FONT_MCOLOR_BLACK, FALSE, 0); + y += 20; + DisplayWrappedString(WEBSITE_LEFT + 35, y, 400, 2, FONT12ARIAL, FONT_MCOLOR_BLACK, szRebelCommandText[RCT_MISSION_HELP_3], FONT_MCOLOR_BLACK, FALSE, 0); + } + break; } // "new missions every X hours" text @@ -3891,6 +3919,12 @@ void Init() rebelCommandSaveInfo.regions[a].actionLevels[b] = 0; } } + + // init missions + for (int i = 0; i < NUM_ARC_AGENT_SLOTS; ++i) + { + rebelCommandSaveInfo.availableMissions[i] = RCAM_NONE; + } } BOOLEAN Load(HWFILE file) @@ -3908,6 +3942,16 @@ BOOLEAN Load(HWFILE file) Init(); } + // missions update check + if (rebelCommandSaveInfo.availableMissions[0] == rebelCommandSaveInfo.availableMissions[1] && rebelCommandSaveInfo.availableMissions[0] != RCAM_NONE) + { + // init missions + for (int i = 0; i < NUM_ARC_AGENT_SLOTS; ++i) + { + rebelCommandSaveInfo.availableMissions[i] = RCAM_NONE; + } + } + // go through every strategic event to find active agent missions std::vector> missions = GetAllStrategicEventsOfType(EVENT_REBELCOMMAND); missionMap.clear(); @@ -4091,8 +4135,8 @@ void SetupInfo() // { new skill traits to check }, // { old skill traits to check. use -1 to not match against anything }, // { duration bonus for checked trait }, - // { float modifier for checked trait. either this line or the next is zeroed out. }, - // { int modifier for checked trait. either this line or the previous is zeroed out. }, + // { float modifier for checked trait }, + // { int modifier for checked trait }, // { value to place in extra bits, used to determine what bonus is applied. } // } //RCAM_DEEP_DEPLOYMENT diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 69766222..822eb169 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -11962,9 +11962,12 @@ STR16 szRebelCommandText[] = L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index f2557313..d5409d80 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -11972,9 +11972,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index da759cf2..4ff77784 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -11962,9 +11962,12 @@ STR16 szRebelCommandText[] = L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 1324f3dc..0ea13767 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -11954,9 +11954,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index b3eae88a..275ca0d0 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -11876,9 +11876,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index cbf94dc4..ad0d2c35 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -11963,9 +11963,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index a50c3982..ffe9bbf5 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -11976,9 +11976,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d", diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 968940e0..35edf34b 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -11957,9 +11957,12 @@ STR16 szRebelCommandText[] = // TODO.Translate L"Agent unavailable", L"Agent contract expiring", L"Battle in progress", - L"Start Mission (%d supplies)", + L"Prepare Mission (%d supplies)", L"View active mission effects", L"View available mission list", + L"You are able to prepare one of the two missions presented. Once an agent is dispatched, they will be unavailable for approximately 24 hours before becoming available again. A popup will notify you when preparations are complete. If preparations succeed, the mission's effects become active.", + L"A rebel agent can be sent to prepare a mission, but your mercenaries will be far more effective. Their experience level and skills can provide additional bonuses to missions.", + L"The cost of preparing a mission increases based on the number other missions either active or being prepared.", L"New missions will be available on Day %d at 00:00.", L"Active missions:", L"%s - Preparing - Ready on Day %d, %02d:%02d",