-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some documentation on the window system
Unifies menus, dboxes, and portrait boxes into a single generic graphical window system. The central object in this system is the "window", which can be specialized into menus, text boxes, portraits, and more. On top of the previously known specializations, these additions identify many more window types. The full list (see window.h comments for in-game examples of the more esoteric types): - scroll box: formatted text box that scrolls up/down - dialogue box: scrolling message box, most commonly for character dialogue - portrait box: box with a character portrait (Kaomado) in it - text box: static text box - dynamic text box (?): text box with dynamically populated content - controls chart: for the "Controls" chart on the top screen - alert box: temporary popup message box in dungeons - advanced text box: marked-up (often colorful) and segmented text box - input lock box: screen-lock display in the Sky Jukebox - team info box: ground mode menu box showing team rank and money - simple menu/parent menu/team selection menu/playback controls menu: simple menus that just have a list of options, possibly leading to submenus; the listed variants are all slightly different, but seem to share a common underlying data structure - advanced menu: menu with complex layout and functionality - collection menu: like an advanced menu, but specifically for collections of objects - options menu: special menu for adjusting game options - debug menu: probably for the debug mode menu - jukebox track menu: Sky Jukebox track selection menu - inventory menu: menu for managing items The above list of window types should hopefully be exhaustive. They were tracked down by looking at all callers to the NewWindowScreenCheck function across all binaries, which also reveal the update function and the size of the contents structure stored in struct window_params. By looking at the update function pointer addresses in active windows in the WINDOW_LIST, and twiddling some data to observe live changes, it's possible to correlate different update functions with examples, which in turn allows the general purpose of each window type to be inferred. All windows share similar APIs for general manipulation (though each type may have additional specialized methods, which remain mostly undocumented): 1. A new window is create with the corresponding Create* function, which takes a window_params struct specifying generic parameters like the window position and size. A new window is added to the global WINDOW_LIST with a newly allocated window-type-dependent contents structure to hold all specialized data, and a corresponding update function to manage the data structure. The function returns a window ID (an index into WINDOW_LIST), which is used as a handle for all future manipulation. 2. The corresponding Update* function is (presumably periodically?) called to update the contents of the active window, if needed. This update function operates on the contents structure that was allocated when the window was created. 3. Presumably the code managing the window also does other stuff with the window, such as reading menu selections? The function GetWindowContents retrieves the specialized contents structure for an active window given its ID, and is used in many places. 4. There are presumably more functions for generic manipulation, like something to close a window, but these remain unknown for now. As part of unification under the generic window system, some old terminology has been changed. Among the most important: - "dialog boxes" are now called "windows" - "borders" are now called "window frames" - "normal menus" are now called "simple menus" - "dboxes" are now called "dialogue boxes" - `struct dbox_layout` has been renamed to `struct window_params`
- Loading branch information
1 parent
0a24709
commit 99a279c
Showing
19 changed files
with
1,358 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef HEADERS_FUNCTIONS_OVERLAY09_H_ | ||
#define HEADERS_FUNCTIONS_OVERLAY09_H_ | ||
|
||
int CreateJukeboxTrackMenu(struct window_params* params, uint32_t param_2, undefined* param_3, | ||
undefined* param_4, int param_5); | ||
void UpdateJukeboxTrackMenu(struct window* window); | ||
int CreatePlaybackControlsMenu(struct window_params* params, uint32_t param_2, undefined* param_3, | ||
undefined4 param_4, undefined* param_5, undefined* param_6); | ||
void UpdatePlaybackControlsMenu(struct window* window); | ||
int CreateInputLockBox(struct window_params* params, uint32_t param_2, undefined* param_3, | ||
undefined4 param_4, uint16_t param_5); | ||
void UpdateInputLockBox(struct window* window); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.