|
21 | 21 | #include "io/timer.h" |
22 | 22 | #include "mission/missionparse.h" |
23 | 23 | #include "mission/missionbriefcommon.h" |
| 24 | +#include "mission/missiontraining.h" |
24 | 25 | #include "missionui/missioncmdbrief.h" |
25 | 26 | #include "missionui/missionscreencommon.h" |
26 | 27 | #include "missionui/missionshipchoice.h" |
@@ -191,6 +192,11 @@ static int Uses_scroll_buttons = 0; |
191 | 192 |
|
192 | 193 | int Cmd_brief_overlay_id; |
193 | 194 |
|
| 195 | +// -------------------------------------------------------------------------------------- |
| 196 | +// Forward declarations |
| 197 | +// -------------------------------------------------------------------------------------- |
| 198 | +void cmd_brief_replace_stage_text(cmd_brief_stage &stage); |
| 199 | + |
194 | 200 | void cmd_brief_init_voice() |
195 | 201 | { |
196 | 202 | int i; |
@@ -562,16 +568,13 @@ void cmd_brief_init(int team) |
562 | 568 | Cmd_brief_inited = 0; |
563 | 569 | Cur_cmd_brief = &Cmd_briefs[team]; |
564 | 570 |
|
565 | | - // Goober5000 - replace any variables (probably persistent variables) with their values |
566 | | - // karajorma/jg18 - replace container references as well |
567 | | - for (i = 0; i < Cur_cmd_brief->num_stages; i++) { |
568 | | - sexp_replace_variable_names_with_values(Cur_cmd_brief->stage[i].text); |
569 | | - sexp_container_replace_refs_with_values(Cur_cmd_brief->stage[i].text); |
570 | | - } |
571 | | - |
572 | 571 | if (Cur_cmd_brief->num_stages <= 0) |
573 | 572 | return; |
574 | 573 |
|
| 574 | + for (i = 0; i < Cur_cmd_brief->num_stages; i++) { |
| 575 | + cmd_brief_replace_stage_text(Cur_cmd_brief->stage[i]); |
| 576 | + } |
| 577 | + |
575 | 578 | // for multiplayer, change the state in my netplayer structure |
576 | 579 | if (Game_mode & GM_MULTIPLAYER) { |
577 | 580 | Net_player->state = NETPLAYER_STATE_CMD_BRIEFING; |
@@ -779,3 +782,13 @@ int mission_has_cmd_brief() |
779 | 782 | { |
780 | 783 | return (Cur_cmd_brief != NULL && Cur_cmd_brief->num_stages > 0); |
781 | 784 | } |
| 785 | + |
| 786 | +// Goober5000 - replace any variables (probably persistent variables) with their values |
| 787 | +// karajorma/jg18 - replace container references as well |
| 788 | +// Goober5000 - replace keybinds also |
| 789 | +void cmd_brief_replace_stage_text(cmd_brief_stage &stage) |
| 790 | +{ |
| 791 | + sexp_replace_variable_names_with_values(stage.text); |
| 792 | + sexp_container_replace_refs_with_values(stage.text); |
| 793 | + message_translate_tokens(stage.text); |
| 794 | +} |
0 commit comments