Move character names to character struct

This commit is contained in:
MysterD 2021-08-18 21:51:55 -07:00
parent 8a40aeddea
commit d31eb41e7e
3 changed files with 8 additions and 2 deletions

View file

@ -14,6 +14,7 @@ extern Gfx luigi_cap_seg3_dl_03022F48[];
struct Character gCharacters[CT_MAX] = {
[CT_MARIO] = {
.name = "Mario",
.hudHead = ',',
.cameraHudHead = GLYPH_CAM_MARIO_HEAD,
.modelId = MODEL_MARIO,
@ -71,6 +72,7 @@ struct Character gCharacters[CT_MAX] = {
},
[CT_LUIGI] = {
.name = "Luigi",
.hudHead = '.',
.cameraHudHead = GLYPH_CAM_LUIGI_HEAD,
.modelId = MODEL_LUIGI,

View file

@ -12,6 +12,7 @@ enum CharacterType {
};
struct Character {
char* name;
char hudHead;
u32 cameraHudHead;
u32 modelId;

View file

@ -75,8 +75,11 @@ void djui_panel_player_create(struct DjuiBase* caller) {
djui_interactable_hook_focus(&inputbox1->base, NULL, NULL, djui_panel_player_name_on_focus_end);
}
char* modelChoices[2] = { "Mario", "Luigi" };
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(&body->base, "Model", modelChoices, 2, &configPlayerModel);
char* modelChoices[CT_MAX] = { 0 };
for (int i = 0; i < CT_MAX; i++) {
modelChoices[i] = gCharacters[i].name;
}
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(&body->base, "Model", modelChoices, CT_MAX, &configPlayerModel);
djui_base_set_size_type(&selectionbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&selectionbox1->base, 1.0f, 32);
djui_interactable_hook_value_change(&selectionbox1->base, djui_panel_player_value_changed);