mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Add mission help screen
Initialise missions properly
This commit is contained in:
@@ -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<std::pair<UINT32,UINT32>> 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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user