Skip to content

Commit 8102feb

Browse files
authored
Extra Visual Indication for Scramble Missions (scp-fs2open#6720)
* Extra Visual Indication for `Scramble` Missions Currently, if a mission is set as scramble then there is no visual way for the player to see that the Ship Selection and Weapon Loadout screens are locked, instead the player has to click on the buttons and hear the fail sounds or assess that the hover states are not triggering. This PR adds a text line right below the words Weapons Loadout that states "Ships/Weapons Locked" (XSTR 749) if the mission is scramble thus the player can easily see this right away and not have to check the buttons on every mission. Tested and works as expected. Happy to put behind a flag if desired. * whitespace * incorporate feedback
1 parent 4b7817e commit 8102feb

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

code/localization/localize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bool *Lcl_unexpected_tstring_check = nullptr;
6464
// NOTE: with map storage of XSTR strings, the indexes no longer need to be contiguous,
6565
// but internal strings should still increment XSTR_SIZE to avoid collisions.
6666
// retail XSTR_SIZE = 1570
67-
// #define XSTR_SIZE 1882 // This is the next available ID
67+
// #define XSTR_SIZE 1883 // This is the next available ID
6868

6969
// struct to allow for strings.tbl-determined x offset
7070
// offset is 0 for english, by default

code/missionui/missionscreencommon.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ void common_buttons_init(UI_WINDOW *ui_window)
283283
if ( brief_only_allow_briefing() ) {
284284
Common_buttons[Current_screen-1][gr_screen.res][COMMON_SS_REGION].button.disable();
285285
Common_buttons[Current_screen-1][gr_screen.res][COMMON_WEAPON_REGION].button.disable();
286+
if (Show_locked_status_scramble_missions) {
287+
ui_window->add_XSTR("Ships/Weapons Are Locked For This Mission", 1882, Common_buttons[Current_screen-1][gr_screen.res][COMMON_WEAPON_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_WEAPON_BUTTON].yt + 30, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_WEAPON_BUTTON].button, UI_XSTR_COLOR_GREEN);
288+
}
286289
}
287290
}
288291

code/mod_table/mod_table.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ bool Preload_briefing_icon_models;
165165
EscapeKeyBehaviorInOptions escape_key_behavior_in_options;
166166
bool Fix_asteroid_bounding_box_check;
167167
bool Disable_intro_movie;
168+
bool Show_locked_status_scramble_missions;
168169

169170

170171
#ifdef WITH_DISCORD
@@ -1504,6 +1505,10 @@ void parse_mod_table(const char *filename)
15041505
stuff_boolean(&Disable_intro_movie);
15051506
}
15061507

1508+
if (optional_string("$Show locked status for scramble missions:")) {
1509+
stuff_boolean(&Show_locked_status_scramble_missions);
1510+
}
1511+
15071512
// end of options ----------------------------------------
15081513

15091514
// if we've been through once already and are at the same place, force a move
@@ -1733,6 +1738,7 @@ void mod_table_reset()
17331738
escape_key_behavior_in_options = EscapeKeyBehaviorInOptions::DEFAULT;
17341739
Fix_asteroid_bounding_box_check = false;
17351740
Disable_intro_movie = false;
1741+
Show_locked_status_scramble_missions = false;
17361742
}
17371743

17381744
void mod_table_set_version_flags()

code/mod_table/mod_table.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ extern bool Preload_briefing_icon_models;
180180
extern EscapeKeyBehaviorInOptions escape_key_behavior_in_options;
181181
extern bool Fix_asteroid_bounding_box_check;
182182
extern bool Disable_intro_movie;
183+
extern bool Show_locked_status_scramble_missions;
183184

184185
void mod_table_init();
185186
void mod_table_post_process();

0 commit comments

Comments
 (0)