MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / refresh_prompts

Function refresh_prompts

src/SB/Game/zTalkBox.cpp:1018–1077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016 xSndStreamLock((U32)&shared.stream_locked[0], SND_CAT_DIALOG, true);
1017 shared.stream_locked[1] =
1018 xSndStreamLock((U32)&shared.stream_locked[1], SND_CAT_DIALOG, true);
1019 }
1020 static void unlock_stream()
1021 {
1022 xSndStreamUnlock((U32)&shared.stream_locked[0]);
1023 xSndStreamUnlock((U32)&shared.stream_locked[1]);
1024 shared.stream_locked[0] = 0;
1025 shared.stream_locked[1] = 0;
1026 }
1027 static void refresh_prompts()
1028 {
1029 ztalkbox& active = *shared.active;
1030
1031 if (active.prompt_box)
1032 {
1033 char* message;
1034
1035 if (shared.wait.type.prompt && shared.prompt_ready)
1036 {
1037 char* queries[2] = { (char*)active.prompt.skip, (char*)active.prompt.yesno };
1038 message = queries[shared.wait.query];
1039 }
1040 else
1041 {
1042 message = (char*)active.prompt.noskip;
1043 }
1044
1045 if (message)
1046 {
1047 active.prompt_box->set_text(message);
1048 if (active.flag.visible)
1049 {
1050 active.prompt_box->activate();
1051 }
1052 }
1053 else
1054 {
1055 active.prompt_box->deactivate();
1056 }
1057 }
1058
1059 if (active.quit_box)
1060 {
1061 if (shared.allow_quit && active.prompt.quit && shared.quit_ready)
1062 {
1063 active.quit_box->set_text(active.prompt.quit);
1064 if (active.flag.visible)
1065 {
1066 active.quit_box->activate();
1067 }
1068 }
1069 else if (((!shared.allow_quit) || (shared.quit_delay > 0.0f)) && (active.prompt.noquit))
1070 {
1071 active.quit_box->set_text(active.prompt.noquit);
1072
1073 if (active.flag.visible)
1074 {
1075 active.quit_box->activate();

Callers 4

update_prompt_statusFunction · 0.70
update_quit_statusFunction · 0.70
start_talkMethod · 0.70
startMethod · 0.70

Calls 3

set_textMethod · 0.45
activateMethod · 0.45
deactivateMethod · 0.45

Tested by

no test coverage detected