1#ifndef _COMMON_KEY_CHOICE_
2#define _COMMON_KEY_CHOICE_
5#include "sprite/player.h"
8static s32 N(KeyItemChoiceList)[ITEM_NUM_KEYS + 1];
10#ifndef _CHOICE_SUPPORT_
11#define _CHOICE_SUPPORT_
13s32 N(ItemChoice_HasSelectedItem) = 0;
14s32 N(ItemChoice_SelectedItemID) = 0;
19API_CALLABLE(N(ItemChoice_WaitForSelection)) {
23 N(ItemChoice_HasSelectedItem) = FALSE;
26 if (N(ItemChoice_HasSelectedItem)) {
27 N(ItemChoice_HasSelectedItem) = FALSE;
35API_CALLABLE(N(ItemChoice_SaveSelected)) {
39 N(ItemChoice_HasSelectedItem) = TRUE;
45API_CALLABLE(N(BuildKeyItemChoiceList)) {
50 if (allowedItemList != NULL) {
51 for (i = 0; allowedItemList[i] != ITEM_NONE; i++) {
52 N(KeyItemChoiceList)[i] = allowedItemList[i];
54 N(KeyItemChoiceList)[i] = ITEM_NONE;
57 for (i = 0; i < NUM_ITEMS; i++) {
59 N(KeyItemChoiceList)[
pos++] = i;
62 N(KeyItemChoiceList)[
pos] = ITEM_NONE;
95 Call(N(ItemChoice_WaitForSelection),
LVar0)
100#define EVT_CHOOSE_ANY_KEY_ITEM() \
103 ExecWait(N(EVS_ChooseKeyItem))
105#define EVT_CHOOSE_KEY_ITEM_FROM(itemList) \
106 Set(LVar0, Ref(itemList)) \
108 ExecWait(N(EVS_ChooseKeyItem))
@ ITEM_SPAWN_MODE_DECORATION
s32 evt_get_variable(Evt *script, Bytecode var)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
ApiStatus CloseChoicePopup(Evt *script, b32 isInitialCall)
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
ApiStatus RemoveKeyItemAt(Evt *script, b32 isInitialCall)
ApiStatus ShowKeyChoicePopup(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
#define Ref(sym)
Address/pointer constant.
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Unbind
Unbinds the current thread from the trigger it was bound to, if any.
#define BindPadlock(EVT_SOURCE, TRIGGER, COLLIDER_ID, ITEM_LIST, UNK_A3, TRIGGER_PTR_OUTVAR)
Similar to BindTrigger, but also takes arguments for the item list to show.
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
#define ITEM_VIS_GROUP(itemID, visGroupID)
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define EndSwitch
Marks the end of a switch statement and any case.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define BitwiseOrConst(VAR, CONST)
VAR |= CONST, but CONST is treated as-is rather than dereferenced with evt_get_variable.
#define Return
Kills the current EVT thread.