Name members for R actions in struct_0200AF00

This commit is contained in:
Catobat 2023-04-30 15:10:30 +02:00
parent d1d78ed018
commit 985eeb67a1
9 changed files with 41 additions and 41 deletions

View File

@ -117,10 +117,10 @@ typedef struct {
u8 filler22[0x2];
u8 ezloNagFuncIndex;
u8 filler25[7];
u8 unk_2c;
u8 unk_2d;
u8 unk_2e;
u8 unk_2f;
u8 rActionInteractObject; // used as R button UI frame index
u8 rActionInteractTile;
u8 rActionGrabbing;
u8 rActionPlayerState; // if not 0, overrides other R actions
u8 buttonText[3];
u8 unk_33;
UIElement elements[MAX_UI_ELEMENTS];

View File

@ -310,7 +310,7 @@ u32 UpdatePlayerCollision(void) {
if (gPlayerEntity.animationState != 0) {
return 0;
}
gUnk_0200AF00.unk_2d = 4;
gUnk_0200AF00.rActionInteractTile = 4;
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) {
return 0;
}
@ -324,7 +324,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerState.flags & 0x4080) != 0) {
return 0;
}
gUnk_0200AF00.unk_2d = 6;
gUnk_0200AF00.rActionInteractTile = 6;
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0) {
return 0;
}
@ -335,7 +335,7 @@ u32 UpdatePlayerCollision(void) {
if (HasDungeonSmallKey() == 0) {
return 0;
}
gUnk_0200AF00.unk_2d = 6;
gUnk_0200AF00.rActionInteractTile = 6;
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0) {
return 0;
}

View File

@ -225,9 +225,9 @@ void PlayerUpdate(Entity* this) {
static void HandlePlayerLife(Entity* this) {
u32 temp;
gUnk_0200AF00.unk_2f = 0;
gUnk_0200AF00.unk_2d = 0;
gUnk_0200AF00.unk_2e = 0;
gUnk_0200AF00.rActionPlayerState = 0;
gUnk_0200AF00.rActionInteractTile = 0;
gUnk_0200AF00.rActionGrabbing = 0;
if ((gPlayerEntity.contactFlags & 0x80) && (gPlayerEntity.iframes > 0))
SoundReq(SFX_86);
@ -323,7 +323,7 @@ static void sub_080171F0(void) {
sub_080028E0(&gPlayerEntity);
if (gPlayerState.flags & PL_CLONING)
gUnk_0200AF00.unk_2f = 1;
gUnk_0200AF00.rActionPlayerState = 1;
sub_08078180();
gPlayerState.field_0x7 &= ~0x80;

View File

@ -95,7 +95,7 @@ void ItemPickupCheck(ItemBehavior* this, u32 index) {
carried->subAction = 5;
gPlayerState.framestate = PL_STATE_THROW;
sub_080762C4(this, carried, 2, index);
gUnk_0200AF00.unk_2e = 8;
gUnk_0200AF00.rActionGrabbing = 8;
SoundReq(SFX_102);
break;
case 1:

View File

@ -172,9 +172,9 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
this->unk_70 = ((super->x.HALF.HI + (s8)gUnk_08123184[tmp]) & -0x10) | 8;
this->unk_72 = ((super->y.HALF.HI + (s8)gUnk_08123184[(tmp) + 1]) & -0x10) | 8;
if (sub_080B1AB4(this->unk_70, this->unk_72, super->collisionLayer) == 0x19) {
gUnk_0200AF00.unk_2f = 3;
gUnk_0200AF00.rActionPlayerState = 3;
} else {
gUnk_0200AF00.unk_2f = 0;
gUnk_0200AF00.rActionPlayerState = 0;
}
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
if (GetTileUnderEntity(super) == 0x19) {
@ -184,7 +184,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) {
return;
}
if (gUnk_0200AF00.unk_2f != 3) {
if (gUnk_0200AF00.rActionPlayerState != 3) {
return;
}
gPlayerState.heldObject = 0;

View File

@ -85,7 +85,7 @@ void ItemForSale_Init(ItemForSaleEntity* this) {
void ItemForSale_Action1(ItemForSaleEntity* this) {
if (super->subAction != 0) {
super->action = 2;
gUnk_0200AF00.unk_2f = 2;
gUnk_0200AF00.rActionPlayerState = 2;
} else {
if (super->type == 0x36) {
if (super->interactType != 0) {
@ -102,7 +102,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
ResetActiveItems();
gPlayerState.heldObject = 4;
gNewPlayerEntity.unk_74 = super;
gUnk_0200AF00.unk_2f = 2;
gUnk_0200AF00.rActionPlayerState = 2;
MessageClose();
}
}
@ -112,14 +112,14 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
void ItemForSale_Action2(ItemForSaleEntity* this) {
void* ptr;
gUnk_0200AF00.unk_2f = 2;
gUnk_0200AF00.rActionPlayerState = 2;
super->spriteSettings.draw = gPlayerEntity.spriteSettings.draw;
if ((gPlayerState.heldObject == 0) || (super != gNewPlayerEntity.unk_74)) {
sub_080819B4(this);
} else {
ptr = sub_080784E4();
if (((*(int*)(ptr + 8) == 0) ||
((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.unk_2f = 7, (gPlayerState.playerInput.newInput &
((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.rActionPlayerState = 7, (gPlayerState.playerInput.newInput &
(PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) &&
((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) {
sub_080819B4(this);
@ -142,8 +142,8 @@ void sub_080819B4(ItemForSaleEntity* this) {
gNewPlayerEntity.unk_74 = 0;
ptr = &gUnk_0200AF00;
gRoomVars.shopItemType = 0;
ptr->unk_2c = 0;
ptr->unk_2f = 0;
ptr->rActionInteractObject = 0;
ptr->rActionPlayerState = 0;
gRoomVars.shopItemType2 = 0;
super->x.HALF.HI = this->unk_80 + gRoomControls.origin_x;
super->y.HALF.HI = this->unk_82 + gRoomControls.origin_y;

View File

@ -1830,7 +1830,7 @@ static void PlayerPull(Entity* this) {
gPlayerState.framestate = PL_STATE_PULL;
sPlayerPullStates[this->subAction](this);
gUnk_0200AF00.unk_2e = 8;
gUnk_0200AF00.rActionGrabbing = 8;
}
static void sub_08072214(Entity* this) {
@ -2756,7 +2756,7 @@ static void sub_08073584(Entity* this) {
return;
}
gUnk_0200AF00.unk_2f = 1;
gUnk_0200AF00.rActionPlayerState = 1;
if (sub_0807A2F8(0)) {
this->subAction++;
this->direction = 4 * (this->animationState & 6);

View File

@ -211,7 +211,7 @@ bool32 IsPreventedFromUsingItem(void) {
}
return FALSE;
default:
if ((((gUnk_0200AF00.unk_2c == 0xc) && (gPlayerState.field_0x1c == 0)) &&
if ((((gUnk_0200AF00.rActionInteractObject == 0xc) && (gPlayerState.field_0x1c == 0)) &&
(gPlayerState.floor_type != SURFACE_SWAMP)) &&
((((gPlayerState.playerInput.heldInput & PLAYER_INPUT_ANY_DIRECTION) != 0 &&
((gPlayerState.flags & (PL_BURNING | PL_ROLLING)) == 0)) &&
@ -976,21 +976,21 @@ void sub_08078180(void) {
u8 uVar3;
InteractableObject* ptr;
if (gUnk_0200AF00.unk_2f != 0)
if (gUnk_0200AF00.rActionPlayerState != 0)
return;
uVar1 = 0;
if ((gPlayerState.jump_status == 0) &&
((gPlayerState.flags & (PL_IN_HOLE | PL_FROZEN | PL_BURNING | PL_DISABLE_ITEMS | PL_DRUGGED)) == 0)) {
if ((u8)(gPlayerState.heldObject - 1) < 4) {
if (gUnk_0200AF00.unk_2e != 0) {
uVar1 = gUnk_0200AF00.unk_2e;
if (gUnk_0200AF00.rActionGrabbing != 0) {
uVar1 = gUnk_0200AF00.rActionGrabbing;
} else {
uVar1 = 3;
}
} else {
if (gUnk_0200AF00.unk_2d != 0) {
uVar1 = gUnk_0200AF00.unk_2d;
if (gUnk_0200AF00.rActionInteractTile != 0) {
uVar1 = gUnk_0200AF00.rActionInteractTile;
} else {
ptr = sub_080784E4();
if (ptr->entity->interactType == 0) {
@ -1040,7 +1040,7 @@ void sub_08078180(void) {
}
}
}
gUnk_0200AF00.unk_2c = uVar1;
gUnk_0200AF00.rActionInteractObject = uVar1;
}
bool32 sub_080782C0(void) {

View File

@ -739,30 +739,30 @@ void ItemUIElement(UIElement* element) {
void TextUIElement(UIElement* element) {
UIElement* buttonUIElement;
u32 tmp;
u32 frameIndex;
if (element->type2 == 9) {
tmp = gUnk_0200AF00.unk_2f;
if (tmp == 0) {
frameIndex = gUnk_0200AF00.rActionPlayerState;
if (frameIndex == 0) {
switch (gArea.portal_mode) {
case 2:
tmp = 0xb;
frameIndex = 0xb;
break;
case 3:
tmp = 0xa;
frameIndex = 0xa;
break;
default:
tmp = gUnk_0200AF00.unk_2c;
frameIndex = gUnk_0200AF00.rActionInteractObject;
break;
}
}
gUnk_0200AF00.buttonText[2] = tmp;
gUnk_0200AF00.buttonText[2] = frameIndex;
}
tmp = gUnk_0200AF00.buttonText[element->buttonElementId];
frameIndex = gUnk_0200AF00.buttonText[element->buttonElementId];
element->unk_0_1 = 0;
if (tmp != 0) {
tmp += gUnk_080C9044[((SaveHeader*)0x2000000)->language];
sub_0801CAFC(element, tmp);
if (frameIndex != 0) {
frameIndex += gUnk_080C9044[((SaveHeader*)0x2000000)->language];
sub_0801CAFC(element, frameIndex);
buttonUIElement = FindUIElement(element->buttonElementId);
if (buttonUIElement != NULL) {
element->x = buttonUIElement->x;