diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2022-11-06 10:17:10 +0000 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2022-11-06 10:17:10 +0000 |
| commit | e4898c53d486bb4aa16dcbda74b310f18c39e02a (patch) | |
| tree | 8be04e8ad4fe29d087545b35780f6efac84daf96 /src | |
| parent | 5209d6af3ae4697c36c1d2ab557b80dcb00b7653 (diff) | |
Match CreateUIElement
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -592,27 +592,29 @@ void DrawKeys(void) { } } -NONMATCH("asm/non_matching/ui/CreateUIElement.inc", void CreateUIElement(u32 type, u32 type2)) { - u8 bVar1; +void CreateUIElement(u32 type, u32 type2) { u32 index; + UIElement* new_var; UIElement* element; - UIElementDefinition* definition; for (index = 0; index < MAX_UI_ELEMENTS; index++) { - element = &gUnk_0200AF00.elements[index]; - if (element->used == 0) { - definition = &gUIElementDefinitions[type]; - element->type = (u8)type; + + element = gUnk_0200AF00.elements; + element += index; + + if (!element->used) { + element->type = type; element->type2 = type2; element->frameIndex = 0xff; element->used = 1; - element->unk_1a = definition->unk_4; - element->buttonElementId = definition->buttonElementId; + element->unk_1a = gUIElementDefinitions[type].unk_4; + // Permuter trickery. TODO find something more senseful? + index = type; + element->buttonElementId = gUIElementDefinitions[index].buttonElementId; return; } } } -END_NONMATCH void sub_0801CAB8(UIElement* element, Frame* frame) { element->framePtr = frame; |
