Skip to content

Commit 4b7817e

Browse files
authored
Fix highlighting color discrepancy for player ship in loadout screen (scp-fs2open#6716)
* Few Minor Visual Indicator Enhancements to Loadout This PR adds a few visual indicator tune-ups to the loadout screens. 1. 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. 2. Currently there is a nice orange coloration of the player ship icon in the Ship Selection wing loadout. This immediately shows the player which ship is theirs, but this usefulness does not translate to the Weapon Loadout screen. The player must select another ship, besides the player ship, to have the player ship show up as orange. This PR adds a bool `always_highlight_ply` which is specifically for the weapon `draw_wing_block` function when called as as part of the weapon loadout routine. Both PRs are tested and work as expected. I currently have these PRs on without a flag, but if folks really do not want the PRs or would prefer them to be behind a flag, then I'm happy to do that, too. * separate PRs
1 parent f1f9571 commit 4b7817e

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

code/missionui/missionshipchoice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ void ship_select_do(float frametime)
14751475

14761476
draw_ship_icons();
14771477
for ( int i = 0; i < MAX_WING_BLOCKS; i++ ) {
1478-
draw_wing_block(i, Hot_ss_slot, -1, Selected_ss_class);
1478+
draw_wing_block(i, Hot_ss_slot, -1, Selected_ss_class, true, false);
14791479
}
14801480
}
14811481

@@ -2142,7 +2142,7 @@ void pick_from_wing(int wb_num, int ws_num)
21422142
// hot_slot => index of slot that mouse is over
21432143
// selected_slot => index of slot that is selected
21442144
// class_select => all ships of this class are drawn selected (send -1 to not use)
2145-
void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection )
2145+
void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection, bool always_highlight_ply )
21462146
{
21472147
GR_DEBUG_SCOPE("Wing block");
21482148

@@ -2259,7 +2259,7 @@ void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_sele
22592259
}
22602260
}
22612261

2262-
if ( ws->status & WING_SLOT_IS_PLAYER && (selected_slot != slot_index) )
2262+
if ( ws->status & WING_SLOT_IS_PLAYER && (always_highlight_ply || (selected_slot != slot_index)) )
22632263
{
22642264
if(icon->model_index == -1)
22652265
bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_PLAYER];

code/missionui/missionshipchoice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ typedef struct ss_wing_info {
8282
extern ss_wing_info Ss_wings_teams[MAX_TVT_TEAMS][MAX_WING_BLOCKS];
8383
extern ss_wing_info* Ss_wings;
8484

85-
void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection = true);
85+
void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection = true, bool always_highlight_ply = false);
8686
void ship_select_init();
8787
void ship_select_do(float frametime);
8888
void ship_select_close();

code/missionui/missionweaponchoice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,7 +2836,7 @@ void weapon_select_do(float frametime)
28362836
wl_render_overhead_view(frametime);
28372837
wl_draw_ship_weapons(Selected_wl_slot);
28382838
for ( int i = 0; i < MAX_WING_BLOCKS; i++ ) {
2839-
draw_wing_block(i, Hot_wl_slot, Selected_wl_slot, -1, false);
2839+
draw_wing_block(i, Hot_wl_slot, Selected_wl_slot, -1, false, true);
28402840
}
28412841
common_render_selected_screen_button();
28422842
}

0 commit comments

Comments
 (0)