src/window/window_settings_menu.c
The window colours the player picks, the settings menu that picks them with the message speed, speech and auto-sleep, and the Pause menu. More…
Included by window.c.
Macros
| Name | Description | |
|---|---|---|
#define | WINDOW_SHADE (n) | The window colours the window colour settings set: WINDOW_PALETTE's colours from its background (shade 0, WINDOW_BACKGROUND_COLOR) to shade 6. |
#define | WINDOW_SHADE_SET (n, color) | |
#define | SLIDER_PALETTE 14 | The sprite palettes of the hue slider's ends and the brightness slider's. |
#define | BRIGHTNESS_SLIDER_PALETTE (SLIDER_PALETTE + 1) | |
#define | OPTION_WINDOW_X 2 | |
#define | OPTION_WINDOW_WIDTH 26 | |
#define | OPTION_DIVIDER_END 25 | |
#define | OPTION_SLIDER_X 100 | |
#define | OPTION_CHOICE_X 92 | |
#define | OPTION_SLIDER_WIDTH 60 | The pixels a settings slider's marker runs across, from OPTION_SLIDER_X. |
#define | SETTINGS_HELP_WINDOW_X 2 | |
#define | SETTINGS_HELP_WINDOW_WIDTH 26 | |
#define | CHOICE_X 168 | |
#define | CHOICE_RIGHT 192 | |
#define | FIRST_CHOICE_RIGHT 192 | |
#define | SETTINGS_HEADING | The heading above the settings window: Japanese shows the Settings heading; in every edition but the Japanese the screen shows the Pause heading the Pause menu also shows. |
#define | SETTINGS_PRESET_COUNT 6 | The colour presets SELECT steps through (SettingsMenuHuePresets). |
#define | PAUSE_MENU_ROWS 3 | Save your quest, Sleep and Change settings |
#define | PAUSE_MENU_DEBUG_ROWS 3 | the entries added in debug mode |
#define | PAUSE_MENU_ROW_HEIGHT 24 | pixels, 3 tiles |
#define | PAUSE_MENU_TEXT_X 48 | pixels into the window, after the icons |
#define | HEADING_Y WHEN(PAUSE_HEADING_LOWER, (-16), (-24)) | The heading's top, in pixels from the window's; in every edition but the Japanese it sits 8 pixels lower. |
Enumerations
| Name | Description | |
|---|---|---|
enum | SETTINGS_MENU_ROW { SETTINGS_ROW_WINDOW_COLOR, SETTINGS_ROW_WINDOW_BRIGHTNESS, S … } | The settings menu's rows, in the order of their help messages (MsgWindowColorHelp on) and of SETTINGS_MENU_STATE.option. |
Functions
| Name | Description | |
|---|---|---|
Uint16 | mnColorScaleComponents (Sint16 *rgb, FIXED redScale, FIXED greenScale, FIXED blueScale) | Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour. rgb holds three components, not an already packed palette word. |
void | mnWindowColorApply (Sint32 color, Sint32 brightness) | Sets the window colours (WINDOW_SHADE) for a window colour (0 to WINDOW_COLOR_COUNT - 1, a hue around the colour wheel) and brightness (0 to WINDOW_BRIGHTNESS_COUNT - 1, WINDOW_BRIGHTNESS_NEUTRAL the plain one). |
void | mnSettingsMenuAnimateCursors (void) | The settings menu's per-tick event: moves the cursor and the two slider markers, animates the marker of the slider in use, and pulses the chosen setting's icon. |
void | mnSettingsMenuInitState (void) | Allocates the settings menu's state, copies the settings into it with how many values each takes, and starts its per-tick event. |
void | mnSettingsMenuRelease (void) | Stops the settings menu's per-tick event and frees its state. |
WINDOW_SPR * | mnCommandIconCreate ( Sint32 icon, Sint32 remap, WINDOW *window, Sint32 x, Sint32 y) | Shows command icon icon (see mnCommandIconLoad) as a 32x32 256-colour sprite at (x, y) in window, at depth OAM_DEPTH_FRONT - 4. |
WINDOW * | mnSettingsMenuOpen (void) | Opens the settings menu's window: the labels, the hue and brightness sliders with their markers, the cursor and the setting icons. |
void | mnCommandIconLoad (Sint32 index, Sint32 value, Sint32 flag) | Decompresses command icon icon (a 32x32 picture of 256 colours, 1 KB) into VRAM slot slot, remapping the colours of its top three rows of tiles by table when remap is nonzero. |
Sint32 | mnSettingsMenuRun (void) | Runs the settings menu (window colour and brightness, message speed, speech, auto-sleep) until A or START keeps the settings (returns 0) or B drops them (returns -1). |
void | mnPauseMenuAnimateCursor (void) | The Pause menu's per-tick event: moves the cursor and pulses the chosen entry's icon. |
void | mnPauseMenuInit (void) | Allocates the Pause menu's state and starts its per-tick event. |
void | mnPauseMenuRelease (void) | Stops the Pause menu's per-tick event and frees its state. |
WINDOW * | mnPauseMenuOpen (void) | Opens the Pause menu's window with its entries (Save your quest, Sleep, Change settings, and the debug entries in debug mode; only Change settings while FLAG_IN_BATTLE_ARENA is set), their icons and the cursor. |
Sint32 | mnPauseMenuChoose (Sint32 init) | Runs the Pause menu until the player picks an entry (enum PAUSE_MENU_ENTRY) or cancels with B or START (-1). |
Variables
| Name | Description | |
|---|---|---|
extern const Uint8 | SettingsMenuSliderTiles [] | The hue and brightness sliders' picture and colours. |
extern const Uint16 | SettingsMenuSliderPalette [] | |
extern Sint8 | SettingsMenuSpeedIcons [] | The settings menu's command icons for each setting's choices: message speed Slow, Normal and Fast. |
extern Sint8 | SettingsMenuSpeechIcons [] | Speech Off and On. |
extern Sint8 | SettingsMenuSleepIcons [] | Auto-Sleep Off and On. |
extern Uint8 | MsgSpeechLabel [] | |
extern Uint8 | MsgAutoSleepLabel [] | |
extern Uint8 | MsgMessageSpeedSlow [], MsgSpeechOff[], MsgAutoSleepOff[], MsgWindowColorHelp[], MsgSleepModeHelp[] | |
extern Uint8 | MsgSaveYourQuest [] | |
extern Uint8 | MsgChangeSettings [] | |
extern Uint8 | MsgRoughMenu [] |
Description
The window colours the player picks, the settings menu that picks them with
the message speed, speech and auto-sleep, and the Pause menu. Part of
window.c.
Macros in detail
WINDOW_SHADE
#define WINDOW_SHADE(n)
The window colours the window colour settings set: WINDOW_PALETTE's colours
from its background (shade 0, WINDOW_BACKGROUND_COLOR) to shade 6.
Definition at line 40 of file window_settings_menu.c.
WINDOW_SHADE_SET
#define WINDOW_SHADE_SET(n, color)
Referenced by mnWindowColorApply().
Definition at line 42 of file window_settings_menu.c.
SLIDER_PALETTE
#define SLIDER_PALETTE 14
The sprite palettes of the hue slider's ends and the brightness slider's.
Referenced by mnSettingsMenuOpen().
Definition at line 195 of file window_settings_menu.c.
BRIGHTNESS_SLIDER_PALETTE
#define BRIGHTNESS_SLIDER_PALETTE (SLIDER_PALETTE + 1)
Referenced by mnSettingsMenuOpen().
Definition at line 196 of file window_settings_menu.c.
OPTION_WINDOW_X
#define OPTION_WINDOW_X 2
#define OPTION_WINDOW_X 1
Referenced by mnSettingsMenuOpen().
Definition at lines 202 and 208 of file window_settings_menu.c.
OPTION_WINDOW_WIDTH
#define OPTION_WINDOW_WIDTH 26
#define OPTION_WINDOW_WIDTH ENGLISH_OR(27, 28)
Referenced by mnSettingsMenuOpen().
Definition at lines 203 and 209 of file window_settings_menu.c.
OPTION_DIVIDER_END
#define OPTION_DIVIDER_END 25
#define OPTION_DIVIDER_END 26
Referenced by mnSettingsMenuOpen().
Definition at lines 204 and 210 of file window_settings_menu.c.
OPTION_SLIDER_X
#define OPTION_SLIDER_X 100
#define OPTION_SLIDER_X 140
Referenced by mnSettingsMenuOpen() and mnSettingsMenuRun().
Definition at lines 205 and 211 of file window_settings_menu.c.
OPTION_CHOICE_X
#define OPTION_CHOICE_X 92
#define OPTION_CHOICE_X 84
Referenced by mnSettingsMenuOpen().
Definition at lines 206 and 212 of file window_settings_menu.c.
OPTION_SLIDER_WIDTH
#define OPTION_SLIDER_WIDTH 60
The pixels a settings slider's marker runs across, from OPTION_SLIDER_X.
Referenced by mnSettingsMenuOpen() and mnSettingsMenuRun().
Definition at line 216 of file window_settings_menu.c.
SETTINGS_HELP_WINDOW_X
#define SETTINGS_HELP_WINDOW_X 2
#define SETTINGS_HELP_WINDOW_X 1
Referenced by mnSettingsMenuRun().
Definition at lines 354 and 360 of file window_settings_menu.c.
SETTINGS_HELP_WINDOW_WIDTH
#define SETTINGS_HELP_WINDOW_WIDTH 26
#define SETTINGS_HELP_WINDOW_WIDTH 28
Referenced by mnSettingsMenuRun().
Definition at lines 355 and 361 of file window_settings_menu.c.
CHOICE_X
#define CHOICE_X 168
#define CHOICE_X 160
Referenced by mnSettingsMenuRun().
Definition at lines 356 and 362 of file window_settings_menu.c.
CHOICE_RIGHT
#define CHOICE_RIGHT 192
#define CHOICE_RIGHT 184
Referenced by mnSettingsMenuRun().
Definition at lines 357 and 363 of file window_settings_menu.c.
FIRST_CHOICE_RIGHT
#define FIRST_CHOICE_RIGHT 192
#define FIRST_CHOICE_RIGHT 208
#define FIRST_CHOICE_RIGHT 200
Referenced by mnSettingsMenuRun().
Definition at lines 358, 367 and 369 of file window_settings_menu.c.
SETTINGS_HEADING
#define SETTINGS_HEADING
The heading above the settings window: Japanese shows the Settings heading; in every edition but the Japanese the screen shows the Pause heading the Pause menu also shows.
Referenced by mnSettingsMenuRun().
Definition at line 376 of file window_settings_menu.c.
SETTINGS_PRESET_COUNT
#define SETTINGS_PRESET_COUNT 6
The colour presets SELECT steps through (SettingsMenuHuePresets).
Referenced by mnSettingsMenuRun().
Definition at line 383 of file window_settings_menu.c.
PAUSE_MENU_ROWS
#define PAUSE_MENU_ROWS 3
Save your quest, Sleep and Change settings
Referenced by mnPauseMenuChoose() and mnPauseMenuOpen().
Definition at line 647 of file window_settings_menu.c.
PAUSE_MENU_DEBUG_ROWS
#define PAUSE_MENU_DEBUG_ROWS 3
the entries added in debug mode
Referenced by mnPauseMenuChoose() and mnPauseMenuOpen().
Definition at line 648 of file window_settings_menu.c.
PAUSE_MENU_ROW_HEIGHT
#define PAUSE_MENU_ROW_HEIGHT 24
pixels, 3 tiles
Referenced by mnPauseMenuOpen().
Definition at line 649 of file window_settings_menu.c.
PAUSE_MENU_TEXT_X
#define PAUSE_MENU_TEXT_X 48
pixels into the window, after the icons
Referenced by mnPauseMenuOpen().
Definition at line 650 of file window_settings_menu.c.
HEADING_Y
#define HEADING_Y WHEN(PAUSE_HEADING_LOWER, (-16), (-24))
The heading's top, in pixels from the window's; in every edition but the Japanese it sits 8 pixels lower.
Referenced by mnPauseMenuChoose().
Definition at line 730 of file window_settings_menu.c.
Enumerations in detail
SETTINGS_MENU_ROW
enum SETTINGS_MENU_ROW
The settings menu's rows, in the order of their help messages
(MsgWindowColorHelp on) and of SETTINGS_MENU_STATE.option.
| Enumerator | Value | Description |
|---|---|---|
SETTINGS_ROW_WINDOW_COLOR | 0 | |
SETTINGS_ROW_WINDOW_BRIGHTNESS | 1 | |
SETTINGS_ROW_MESSAGE_SPEED | 2 | |
SETTINGS_ROW_SPEECH | 3 | |
SETTINGS_ROW_AUTO_SLEEP | 4 | |
SETTINGS_ROW_COUNT | 5 |
Definition at line 9 of file window_settings_menu.c.
Functions in detail
mnColorScaleComponents
Uint16 mnColorScaleComponents(Sint16 *rgb, FIXED redScale, FIXED greenScale, FIXED blueScale)
Returns rgb with each channel scaled (16.16 fixed point) and clamped to 0 to 31, as a BGR555 colour. rgb holds three components, not an already packed palette word.
References Sint32.
Referenced by mnWindowColorApply().
Definition at line 22 of file window_settings_menu.c.
mnWindowColorApply
void mnWindowColorApply(Sint32 color, Sint32 brightness)
Sets the window colours (WINDOW_SHADE) for a window colour (0 to
WINDOW_COLOR_COUNT - 1, a hue around the colour wheel) and brightness (0 to
WINDOW_BRIGHTNESS_COUNT - 1, WINDOW_BRIGHTNESS_NEUTRAL the plain one).
References mnColorScaleComponents(), Sint32 and WindowColorWaveTable.
Referenced by mnFileListSelectFile(), mnNameEntryEditMemberName(), mnSettingsMenuRun(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockWhirlwindClearsWall(), scClearEnterPassword(), scFieldWindowColorApply() and scInit().
Definition at line 52 of file window_settings_menu.c.
mnSettingsMenuAnimateCursors
void mnSettingsMenuAnimateCursors(void)
The settings menu's per-tick event: moves the cursor and the two slider markers, animates the marker of the slider in use, and pulses the chosen setting's icon.
References mnCursorAdvanceStub(), mnCursorMoveTowardTargetStub(), mnWindowSpritePulse(), Sint32, syResourceGetTableEntry() and syVRAMCacheLoad().
Referenced by mnSettingsMenuInitState() and mnSettingsMenuRelease().
Definition at line 111 of file window_settings_menu.c.
mnSettingsMenuInitState
void mnSettingsMenuInitState(void)
Allocates the settings menu's state, copies the settings into it with how many values each takes, and starts its per-tick event.
References MainRoutineStateWork, mnSettingsMenuAnimateCursors(), syDMAXCopy(), syHeapSlotAllocateEWRAM() and sySetEvent().
Referenced by mnSettingsMenuRun().
Definition at line 159 of file window_settings_menu.c.
mnSettingsMenuRelease
void mnSettingsMenuRelease(void)
Stops the settings menu's per-tick event and frees its state.
References mnSettingsMenuAnimateCursors(), syCloseEvent() and syHeapSlotRelease().
Referenced by mnSettingsMenuRun().
Definition at line 188 of file window_settings_menu.c.
mnSettingsMenuOpen
WINDOW *mnSettingsMenuOpen(void)
Opens the settings menu's window: the labels, the hue and brightness sliders
with their markers, the cursor and the setting icons. Returns the window. Its
sprites belong to the window and go when it closes. A slider's marker stands
option * OPTION_SLIDER_WIDTH / count pixels right of OPTION_SLIDER_X.
References mnCommandIconCreate(), mnCursorSetPosImmediateStub(), mnPointingHandLoadIntoFreeSlot(), mnTextDrawMessageAsTiles(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate(), MsgAutoSleepLabel, MsgSpeechLabel, SettingsMenuSleepIcons, SettingsMenuSliderPalette, SettingsMenuSliderTiles, SettingsMenuSpeechIcons, SettingsMenuSpeedIcons, Sint32, syDMAXCopy(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().
Referenced by mnSettingsMenuRun().
Definition at line 235 of file window_settings_menu.c.
mnSettingsMenuRun
Sint32 mnSettingsMenuRun(void)
Runs the settings menu (window colour and brightness, message speed, speech, auto-sleep) until A or START keeps the settings (returns 0) or B drops them (returns -1).
References IdleSleepEnabled, MainRoutineStateWork, mnCommandIconLoad(), mnCursorSetStub(), mnFieldMessageShow(), mnIconShowStub(), mnSettingsMenuInitState(), mnSettingsMenuOpen(), mnSettingsMenuRelease(), mnTextDrawMessage(), mnTextDrawMessageAsTiles(), mnTitleBob(), mnTitleCreate(), mnWindowClearInteriorTiles(), mnWindowClose(), mnWindowColorApply(), mnWindowCreate(), mnWindowSpriteClearList(), MsgMessageSpeedSlow, PerWork, result, SettingsMenuBrightnessPresets, SettingsMenuHuePresets, SettingsMenuSleepIcons, SettingsMenuSpeechIcons, SettingsMenuSpeedIcons, Sint32, SleepDisabled, sySoundPlayStub() and sySynch().
Referenced by mnPauseMenuRun().
Definition at line 390 of file window_settings_menu.c.
mnPauseMenuAnimateCursor
void mnPauseMenuAnimateCursor(void)
The Pause menu's per-tick event: moves the cursor and pulses the chosen entry's icon.
References mnCursorAdvanceStub() and mnWindowSpritePulse().
Referenced by mnPauseMenuInit() and mnPauseMenuRelease().
Definition at line 616 of file window_settings_menu.c.
mnPauseMenuInit
void mnPauseMenuInit(void)
Allocates the Pause menu's state and starts its per-tick event. The Pause
menu shares the settings menu's heap slot: mnPauseMenuChoose frees it before
mnPauseMenuRun opens the settings menu.
References mnPauseMenuAnimateCursor(), syHeapSlotAllocateEWRAM() and sySetEvent().
Referenced by mnPauseMenuChoose().
Definition at line 627 of file window_settings_menu.c.
mnPauseMenuRelease
void mnPauseMenuRelease(void)
Stops the Pause menu's per-tick event and frees its state.
References mnPauseMenuAnimateCursor(), syCloseEvent() and syHeapSlotRelease().
Referenced by mnPauseMenuChoose().
Definition at line 637 of file window_settings_menu.c.
mnPauseMenuOpen
WINDOW *mnPauseMenuOpen(void)
Opens the Pause menu's window with its entries (Save your quest, Sleep,
Change settings, and the debug entries in debug mode; only Change settings
while FLAG_IN_BATTLE_ARENA is set), their icons and the cursor.
References DebugMode, mnCommandIconCreate(), mnPointingHandLoadIntoFreeSlot(), mnTextDrawMessage(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate(), MsgChangeSettings, MsgRoughMenu, MsgSaveYourQuest, PauseMenuIcons, Sint32 and syGameFlagGet().
Referenced by mnPauseMenuChoose().
Definition at line 655 of file window_settings_menu.c.
mnPauseMenuChoose
Sint32 mnPauseMenuChoose(Sint32 init)
Runs the Pause menu until the player picks an entry (enum PAUSE_MENU_ENTRY)
or cancels with B or START (-1). The result counts in the full entry table
even when only Change settings is shown. The menu's window and state are
freed before it returns; mnPauseMenuRun (screens_debug.c) acts on the result.
References DebugMode, mnCommandIconLoad(), mnCursorSetPosImmediateStub(), mnCursorSetStub(), mnIconShowStub(), mnPauseMenuInit(), mnPauseMenuOpen(), mnPauseMenuRelease(), mnTitleBob(), mnTitleCreate(), mnWindowClose(), PauseMenuIcons, PerWork, result, Sint32, syGameFlagGet(), sySoundPlayStub() and sySynch().
Referenced by mnPauseMenuRun().
Definition at line 736 of file window_settings_menu.c.
Variables in detail
SettingsMenuSliderTiles
extern const Uint8 SettingsMenuSliderTiles[]
The hue and brightness sliders' picture and colours.
Referenced by mnSettingsMenuOpen().
Definition at line 219 of file window_settings_menu.c.
SettingsMenuSliderPalette
extern const Uint16 SettingsMenuSliderPalette[]
Referenced by mnSettingsMenuOpen().
Definition at line 220 of file window_settings_menu.c.
MsgSpeechLabel
extern Uint8 MsgSpeechLabel[]
Referenced by mnSettingsMenuOpen().
Definition at line 225 of file window_settings_menu.c.
MsgAutoSleepLabel
extern Uint8 MsgAutoSleepLabel[]
Referenced by mnSettingsMenuOpen().
Definition at line 226 of file window_settings_menu.c.
MsgMessageSpeedSlow
extern Uint8 MsgMessageSpeedSlow[], MsgSpeechOff[], MsgAutoSleepOff[], MsgWindowColorHelp[], MsgSleepModeHelp[]
Referenced by mnSettingsMenuRun().
Definition at line 379 of file window_settings_menu.c.
MsgSaveYourQuest
extern Uint8 MsgSaveYourQuest[]
Referenced by mnPauseMenuOpen().
Definition at line 643 of file window_settings_menu.c.
MsgChangeSettings
extern Uint8 MsgChangeSettings[]
Referenced by mnPauseMenuOpen().
Definition at line 644 of file window_settings_menu.c.
MsgRoughMenu
extern Uint8 MsgRoughMenu[]
Referenced by mnPauseMenuOpen().
Definition at line 645 of file window_settings_menu.c.