2020-08-04 08:49:11 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
ApiStatus _show_message(ScriptInstance* script, s32 isInitialCall, s32 arg2);
|
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SpeakToPlayer(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
return _show_message(script, isInitialCall, 0);
|
2020-08-15 22:11:31 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus EndSpeech(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
return _show_message(script, isInitialCall, 1);
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus ContinueSpeech(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
return _show_message(script, isInitialCall, 2);
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SpeakToNpc(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
return _show_message(script, isInitialCall, 3);
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
INCLUDE_ASM(ApiStatus, "code_f4c60_len_4300", _show_message, ScriptInstance* script, s32 isInitialCall, s32 arg2);
|
|
|
|
|
|
|
|
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtScreenPos, ScriptInstance* script, s32 isInitialCall);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtWorldPos, ScriptInstance* script, s32 isInitialCall);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
INCLUDE_ASM(s32, "code_f4c60_len_4300", CloseMessage, ScriptInstance* script, s32 isInitialCall);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
INCLUDE_ASM(s32, "code_f4c60_len_4300", SwitchMessage, ScriptInstance* script, s32 isInitialCall);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-09-26 03:51:54 +02:00
|
|
|
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowChoice, ScriptInstance* script, s32 isInitialCall);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus CloseChoice(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-15 23:51:44 +02:00
|
|
|
close_message(D_802DB268);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE1;
|
2020-08-15 23:51:44 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus CancelMessage(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-15 23:51:44 +02:00
|
|
|
cancel_message(gCurrentPrintContext);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 23:51:44 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus CancelMessageAndBlock(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-15 23:51:44 +02:00
|
|
|
cancel_message(gCurrentPrintContext);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_BLOCK;
|
2020-08-15 23:51:44 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SetMessageImages(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-15 22:54:06 +02:00
|
|
|
set_message_images(*script->ptrReadPos);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus func_802D0C94(ScriptInstance* script, s32 initialCall) {
|
2020-08-15 22:54:06 +02:00
|
|
|
if (get_variable(script, *script->ptrReadPos) == 0) {
|
|
|
|
D_8009A650[0] |= 0x10;
|
|
|
|
} else {
|
|
|
|
D_8009A650[0] &= ~0x10;
|
|
|
|
}
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SetMessageString(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-23 01:24:51 +02:00
|
|
|
Bytecode* args = script->ptrReadPos;
|
2020-09-26 03:51:54 +02:00
|
|
|
s32 string = get_variable(script, *args++);
|
|
|
|
s32 index = get_variable(script, *args++);
|
2020-08-15 22:54:06 +02:00
|
|
|
|
|
|
|
set_message_string(string, index);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SetMessageValue(ScriptInstance* script, s32 initialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-09-26 03:51:54 +02:00
|
|
|
s32 value = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 index = get_variable(script, *ptrReadPos);
|
2020-08-15 22:54:06 +02:00
|
|
|
|
|
|
|
set_message_value(value, index);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:54:06 +02:00
|
|
|
}
|