mirror of
https://github.com/zeldaret/ss
synced 2026-09-01 17:39:55 -04:00
Implement the last function
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#ifndef D_LYT_DEPOSIT_H
|
||||
#define D_LYT_DEPOSIT_H
|
||||
|
||||
class dLytDeposit_c {
|
||||
public:
|
||||
static dLytDeposit_c *GetInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private:
|
||||
static dLytDeposit_c *sInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -268,6 +268,7 @@ private:
|
||||
|
||||
class dLytMapMain_c : public m2d::Base_c {
|
||||
friend class dLytMap_c;
|
||||
|
||||
public:
|
||||
dLytMapMain_c();
|
||||
virtual ~dLytMapMain_c();
|
||||
@@ -342,7 +343,7 @@ private:
|
||||
/* 0x8904 */ mVec3_c field_0x8904;
|
||||
/* 0x8910 */ mVec3_c field_0x8910;
|
||||
/* 0x891C */ mVec3_c field_0x891C;
|
||||
|
||||
|
||||
/* 0x8928 */ u8 _0x8928[0x8930 - 0x8928];
|
||||
|
||||
/* 0x8930 */ mVec3_c field_0x8930;
|
||||
@@ -350,7 +351,7 @@ private:
|
||||
|
||||
/* 0x8948 */ u8 idkfixmelater[0x4BC0];
|
||||
/* 0x8C94 */ s32 field_0x8C94;
|
||||
|
||||
|
||||
// ...
|
||||
|
||||
/* 0x8CC4 */ mVec3_c field_0x8CC4;
|
||||
@@ -411,16 +412,13 @@ public:
|
||||
|
||||
void build();
|
||||
|
||||
static bool isValid(s32 val) {
|
||||
if (val >= 2 && val < 7) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
bool isSomeMapFieldEq2Or4Or5Or6() const {
|
||||
return mMapMain.field_0x8C94 == 2 || mMapMain.field_0x8C94 == 4 || mMapMain.field_0x8C94 == 5 ||
|
||||
mMapMain.field_0x8C94 == 6;
|
||||
}
|
||||
|
||||
bool unkMeterCheck() const {
|
||||
s32 val = mMapMain.field_0x8C94;
|
||||
return isValid(val) && ((1 << (val - 2)) & 0x1D);
|
||||
bool isSomeMapFieldEq10() const {
|
||||
return mMapMain.field_0x8C94 == 10;
|
||||
}
|
||||
|
||||
void lightPillarRelated(s32 p1, s32 p2, s32 p3) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef D_LYT_SHOP_H
|
||||
#define D_LYT_SHOP_H
|
||||
|
||||
class dLytShop_c {
|
||||
public:
|
||||
static dLytShop_c *GetInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private:
|
||||
static dLytShop_c *sInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,13 @@
|
||||
|
||||
#ifndef EVENT_MANAGER_H
|
||||
#define EVENT_MANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "f/f_base.h"
|
||||
#include "sized_string.h"
|
||||
#include "toBeSorted/event.h"
|
||||
|
||||
class dAcBase_c;
|
||||
class dAcObjBase_c;
|
||||
|
||||
class EventManager {
|
||||
public:
|
||||
@@ -53,7 +52,6 @@ public:
|
||||
static bool FUN_800a0ba0();
|
||||
|
||||
private:
|
||||
|
||||
/* 0x000 */ u8 _000[0x084 - 0x000];
|
||||
/* 0x084 */ Event mCurrentEvent;
|
||||
/* 0x0C4 */ u8 _0C4[0x184 - 0x0C4];
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef EVENT_MANAGER_UTIL_H
|
||||
#define EVENT_MANAGER_UTIL_H
|
||||
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/lyt/d_lyt_deposit.h"
|
||||
#include "d/lyt/d_lyt_map.h"
|
||||
#include "d/lyt/d_lyt_shop.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
|
||||
// Pulling these functions out into a separate file to avoid circular dependencies
|
||||
|
||||
inline bool EventManagerNotDrawControl0x80() {
|
||||
return EventManager::isInEvent() && (dBase_c::s_DrawControlFlags & 0x80) == 0;
|
||||
}
|
||||
|
||||
inline bool EventManagerNotSkyKeepPuzzle() {
|
||||
return EventManager::isInEvent() && !checkIsInSkykeepPuzzle();
|
||||
}
|
||||
|
||||
inline bool EventManagerNotInShop() {
|
||||
return EventManager::isInEvent() && dLytShop_c::GetInstance() == nullptr;
|
||||
}
|
||||
|
||||
inline bool EventManagerNotInDeposit() {
|
||||
return EventManager::isInEvent() && dLytDeposit_c::GetInstance() == nullptr;
|
||||
}
|
||||
|
||||
inline bool EventManagerIsInMap() {
|
||||
return EventManager::isInEvent() && dLytMap_c::GetInstance() != nullptr;
|
||||
}
|
||||
|
||||
inline bool EventManagerIsMapOpen() {
|
||||
return EventManagerIsInMap() && dLytMap_c::GetInstance()->isOpenMaybe();
|
||||
}
|
||||
|
||||
inline bool EventManagerIsMapOpenAndMessage() {
|
||||
return EventManagerIsMapOpen() && !dMessage_c::getInstance()->getField_0x328();
|
||||
}
|
||||
|
||||
inline bool EventManagerIsMapOpenAnd0x9008Eq10() {
|
||||
return EventManagerIsMapOpen() && dLytMap_c::GetInstance()->isSomeMapFieldEq10();
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user