Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6108 from Goober5000/no_escort_callsigns
Browse files Browse the repository at this point in the history
add flag to not show callsigns in escort list
  • Loading branch information
Goober5000 authored Apr 22, 2024
2 parents 1bd6519 + 148efb4 commit f3c6b0f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
25 changes: 14 additions & 11 deletions code/hud/hudescort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,19 +359,22 @@ void HudGaugeEscort::renderIcon(int x, int y, int index)
{
hud_stuff_ship_name(buf, sp);

// maybe concatenate the callsign
if (*buf)
if (!Dont_show_callsigns_in_escort_list)
{
char callsign[NAME_LENGTH];
// maybe concatenate the callsign
if (*buf)
{
char callsign[NAME_LENGTH];

hud_stuff_ship_callsign(callsign, sp);
if (*callsign)
sprintf(&buf[strlen(buf)], " (%s)", callsign);
}
// maybe substitute the callsign
else
{
hud_stuff_ship_callsign(buf, sp);
hud_stuff_ship_callsign(callsign, sp);
if (*callsign)
sprintf(&buf[strlen(buf)], " (%s)", callsign);
}
// maybe substitute the callsign
else
{
hud_stuff_ship_callsign(buf, sp);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions code/mod_table/mod_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ bool Calculate_subsystem_hitpoints_after_parsing;
bool Disable_internal_loadout_restoration_system;
bool Contrails_use_absolute_speed;
bool Lua_API_returns_nil_instead_of_invalid_object;
bool Dont_show_callsigns_in_escort_list;

static auto DiscordOption __UNUSED = options::OptionBuilder<bool>("Game.Discord",
std::pair<const char*, int>{"Discord Presence", 1754},
Expand Down Expand Up @@ -445,6 +446,10 @@ void parse_mod_table(const char *filename)
stuff_boolean(&HUD_shadows);
}

if (optional_string("$Don't show callsigns in the escort list:")) {
stuff_boolean(&Dont_show_callsigns_in_escort_list);
}

optional_string("#SEXP SETTINGS");

if (optional_string("$Loop SEXPs Then Arguments:")) {
Expand Down Expand Up @@ -1582,6 +1587,7 @@ void mod_table_reset()
Disable_internal_loadout_restoration_system = false;
Contrails_use_absolute_speed = false;
Lua_API_returns_nil_instead_of_invalid_object = false;
Dont_show_callsigns_in_escort_list = false;
}

void mod_table_set_version_flags()
Expand Down
1 change: 1 addition & 0 deletions code/mod_table/mod_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ extern bool Calculate_subsystem_hitpoints_after_parsing;
extern bool Disable_internal_loadout_restoration_system;
extern bool Contrails_use_absolute_speed;
extern bool Lua_API_returns_nil_instead_of_invalid_object;
extern bool Dont_show_callsigns_in_escort_list;

void mod_table_init();
void mod_table_post_process();
Expand Down

0 comments on commit f3c6b0f

Please sign in to comment.