Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
name_entry.c
Go to the documentation of this file.
1/* The keyboard for the player's name: the name entry STCRDDEK and STDGNAME
2 share */
3
4#include "menus/player_name.h"
5
6#define START_FADE OVL_NAME(startTween)
8#define UPDATE_FADE OVL_NAME(updateTween)
19
20/* Hides the name entry, putting its cursor after the name's last character, or
21 shows it again (name->hide) as the screen leaves or comes back to its page */
23 NameEntryWindows *windows = task->children;
24 s32 i;
25
26 if (hide != 0) {
27 task->state = TASK_DONE;
28 STPLNMET_showNameWindows(task, windows, 0);
29 for (i = task->maxLength - 1; i >= 0 && task->name[i] == SJIS_SPACE; i--) {
30 }
31 if (i == task->maxLength - 1) {
32 task->cursor = i;
33 } else {
34 task->cursor = i + 1;
35 }
36 } else {
37 task->state = TASK_RUN;
38 task->substate = 2;
39 STPLNMET_showNameWindows(task, windows, 1);
40 }
41}
42
43/* Creates the name entry (task) for the player's name, starting from name: up to
44 8 characters (5 in Japanese) */
47
49 task->hide = STPLNMET_hideNameEntry;
51 task->layer = 0x1001;
52 task->depth = 6;
53 task->mode = 0;
54 task->partner = -1;
55#if VERSION_US
56 task->maxLength = 8;
57#elif VERSION_EU || VERSION_JP
58 /* five full-width characters in Japanese */
59 if (LANGUAGE == 0) {
60 task->maxLength = 5;
61 } else {
62 task->maxLength = 8;
63 }
64#endif
65 STPLNMET_setName(task, name);
66 STPLNMET_setNameVram(task, 0x140, 0x100);
67 return task;
68}
signed int s32
Definition common.h:11
#define TASK_RUN
Definition task.h:35
#define TASK_DONE
Definition task.h:36
s32 LANGUAGE
The European version's settings, in the small data (.sdata) between file/file_table....
Definition eu_settings.c:13
NameEntry * STPLNMET_createNameEntry(char *name)
Creates the name entry (task) for the player's name, starting from name: up to 8 characters (5 in Jap...
Definition name_entry.c:45
void STPLNMET_hideNameEntry(NameEntry *task, s32 hide)
Hides the name entry, putting its cursor after the name's last character, or shows it again (name->hi...
Definition name_entry.c:22
#define SJIS_SPACE
full-width space, 0x81 0x40
Definition name_entry.h:17
STPLNMET.PRO: the player's name entry (MODE_PLAYER_NAME).
void STPLNMET_showNameWindows(NameEntry *task, NameEntryWindows *windows, s32 show)
void STPLNMET_setName(NameEntry *task, char *name)
void STPLNMET_closeNameEntry(NameEntry *task)
void STPLNMET_getName(NameEntry *task, char *out)
void STPLNMET_setNameVram(NameEntry *task, s32 x, s32 y)
void STPLNMET_updateNameEntry(NameEntry *task, NameEntryWindows *windows)
A name entry: the keyboard, the name typed so far and the panels that open and close.
Definition name_entry.h:95
void(* close)(NameEntry *task)
Definition name_entry.h:129
s32 substate
Definition name_entry.h:96
void * children
Definition name_entry.h:96
s32 maxLength
Definition name_entry.h:109
void(* getName)(NameEntry *task, char *out)
Definition name_entry.h:125
u16 name[12]
Definition name_entry.h:107
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105