summaryrefslogtreecommitdiff
path: root/src/d/lyt
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-05-09 18:28:45 +0200
committerrobojumper <robojumper@gmail.com>2025-05-10 22:20:16 +0200
commit4c5dede891ea0934d77bfcee8f50f9702c949031 (patch)
treeffac19613501deb82a6bdced221111510fe6feb4 /src/d/lyt
parent378c19269740113da8ca3fc4579ea6fd1d6d946e (diff)
d_message OK (via dFlow_c)
Diffstat (limited to 'src/d/lyt')
-rw-r--r--src/d/lyt/d_lyt_demo_dowsing.cpp9
-rw-r--r--src/d/lyt/meter/d_lyt_meter.cpp4
-rw-r--r--src/d/lyt/meter/d_lyt_meter_rupy.cpp18
-rw-r--r--src/d/lyt/msg_window/d_lyt_msg_window.cpp14
4 files changed, 26 insertions, 19 deletions
diff --git a/src/d/lyt/d_lyt_demo_dowsing.cpp b/src/d/lyt/d_lyt_demo_dowsing.cpp
new file mode 100644
index 00000000..cc70a09c
--- /dev/null
+++ b/src/d/lyt/d_lyt_demo_dowsing.cpp
@@ -0,0 +1,9 @@
+#include "d/lyt/d_lyt_demo_dowsing.h"
+
+#include "f/f_profile.h"
+#include "s/s_State.hpp"
+
+SPECIAL_BASE_PROFILE(LYT_DEMO_DOWSING, dLytDemoDowsing_c, fProfile::LYT_DEMO_DOWSING, 0x2AA, 0x6F9);
+
+STATE_DEFINE(dLytDemoDowsing_c, Wait);
+STATE_DEFINE(dLytDemoDowsing_c, Start);
diff --git a/src/d/lyt/meter/d_lyt_meter.cpp b/src/d/lyt/meter/d_lyt_meter.cpp
index 39c92069..676251e4 100644
--- a/src/d/lyt/meter/d_lyt_meter.cpp
+++ b/src/d/lyt/meter/d_lyt_meter.cpp
@@ -1564,8 +1564,8 @@ bool dLytMeterMain_c::execute() {
if (dMessage_c::getInstance()->getField_0x2FC() != 0) {
rupeePos = 3;
- if (dLytMsgWindow_c::getInstance() != nullptr && (dLytMsgWindow_c::getInstance()->fn_800D7B40() == 0x9E02 ||
- dLytMsgWindow_c::getInstance()->fn_800D7B40() == 0x768C)) {
+ if (dLytMsgWindow_c::getInstance() != nullptr && (dLytMsgWindow_c::getInstance()->fn_800D7B40() == 40450 ||
+ dLytMsgWindow_c::getInstance()->fn_800D7B40() == 30348)) {
s32 off = -(mHeart.getCurrentHealthCapacity() / 4 <= 10);
rupeePos = 6 + off;
}
diff --git a/src/d/lyt/meter/d_lyt_meter_rupy.cpp b/src/d/lyt/meter/d_lyt_meter_rupy.cpp
index 976ba037..889efecb 100644
--- a/src/d/lyt/meter/d_lyt_meter_rupy.cpp
+++ b/src/d/lyt/meter/d_lyt_meter_rupy.cpp
@@ -1,14 +1,12 @@
#include "d/lyt/meter/d_lyt_meter_rupy.h"
#include "c/c_math.h"
+#include "d/a/d_a_item.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_meter_configuration.h"
#include "nw4r/math/math_types.h"
#include "toBeSorted/small_sound_mgr.h"
-extern "C" s32 getRupeeCounter2();
-extern "C" u32 getCurrentWalletCapacity2();
-
STATE_DEFINE(dLytMeterRupyStart_c, Wait);
STATE_DEFINE(dLytMeterRupyStart_c, Start);
@@ -239,7 +237,7 @@ void dLytMeterRupy_c::executeState_Out() {
field_0x8AB = 0;
if (field_0x8AE == 0 && hasChangeInRupees()) {
- mDisplayedRupeeCount = getRupeeCounter2();
+ mDisplayedRupeeCount = dAcItem_c::getRupeeCounter();
updateDisplayedAmount(true);
}
@@ -290,7 +288,7 @@ bool dLytMeterRupy_c::build(d2d::ResAccIf_c *resAcc) {
mAnm[RUPY_ANIM_IN].setAnimEnable(false);
field_0x8AB = 0;
- mDisplayedRupeeCount = getRupeeCounter2();
+ mDisplayedRupeeCount = dAcItem_c::getRupeeCounter();
field_0x890 = -1;
mBlinkDelay = cM::rndF(10.0f);
for (int i = 0; i < RUPY_NUM_DIGITS; i++) {
@@ -362,7 +360,7 @@ bool dLytMeterRupy_c::execute() {
bool isMax = false;
u32 current = mDisplayedRupeeCount;
- u32 capacity = getCurrentWalletCapacity2();
+ u32 capacity = dAcItem_c::getCurrentWalletCapacity();
if (current != 0 && capacity == current) {
isMax = true;
};
@@ -375,7 +373,7 @@ bool dLytMeterRupy_c::execute() {
}
bool dLytMeterRupy_c::hasChangeInRupees() const {
- s32 amount = getRupeeCounter2();
+ s32 amount = dAcItem_c::getRupeeCounter();
if (amount > 9999) {
amount = 9999;
} else if (amount < 0) {
@@ -385,7 +383,7 @@ bool dLytMeterRupy_c::hasChangeInRupees() const {
}
s32 dLytMeterRupy_c::getRupeeDifference() const {
- return getRupeeCounter2() - mDisplayedRupeeCount;
+ return dAcItem_c::getRupeeCounter() - mDisplayedRupeeCount;
}
mVec3_c dLytMeterRupy_c::getLastVisibleDigitPosition() {
@@ -407,7 +405,7 @@ void dLytMeterRupy_c::setDigit(s32 index, s32 digit) {
}
bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) {
- s32 amount = getRupeeCounter2();
+ s32 amount = dAcItem_c::getRupeeCounter();
if (amount > 9999) {
amount = 9999;
} else if (amount < 0) {
@@ -512,7 +510,7 @@ bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) {
mPrevDigits[1] = mDisplayedDigits[1];
mPrevDigits[2] = mDisplayedDigits[2];
mPrevDigits[3] = mDisplayedDigits[3];
- } else if (field_0x8AD && amount == getCurrentWalletCapacity2()) {
+ } else if (field_0x8AD && amount == dAcItem_c::getCurrentWalletCapacity()) {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_MAX);
field_0x890 = 0;
field_0x8AD = 0;
diff --git a/src/d/lyt/msg_window/d_lyt_msg_window.cpp b/src/d/lyt/msg_window/d_lyt_msg_window.cpp
index 9dafff64..af85c022 100644
--- a/src/d/lyt/msg_window/d_lyt_msg_window.cpp
+++ b/src/d/lyt/msg_window/d_lyt_msg_window.cpp
@@ -33,7 +33,7 @@
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/event_manager.h"
-#include "toBeSorted/global_fi_context.h"
+#include "toBeSorted/fi_context.h"
#include "toBeSorted/lyt_related_floats.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/other_sound_stuff.h"
@@ -89,8 +89,8 @@ bool dLytMsgWindow_c::build() {
mpTagProcessor = new dTagProcessor_c();
mpMsgWindowUnk = new TextWindowUnk(mpTagProcessor);
- if (GLOBAL_FI_CONTEXT != nullptr) {
- fn_8016C9F0(GLOBAL_FI_CONTEXT);
+ if (FiContext::GetInstance() != nullptr) {
+ FiContext::GetInstance()->resetField_0x3C();
}
mpWindowTalk = nullptr;
@@ -514,8 +514,8 @@ void dLytMsgWindow_c::executeState_WaitKeySelectQuestion() {
field_0x824 = 0;
mTextOptionSelection = selection;
field_0x1220 = 0;
- if (GLOBAL_FI_CONTEXT != nullptr) {
- doFiThing = GLOBAL_FI_CONTEXT->mDoSpecialFiMenuHandling;
+ if (FiContext::GetInstance() != nullptr) {
+ doFiThing = FiContext::GetInstance()->getDoSpecialFiMenuHandling();
}
if (doFiThing) {
@@ -714,10 +714,10 @@ bool dLytMsgWindow_c::draw() {
return true;
}
-void dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) {
+bool dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) {
// TODO
mName = name;
- !std::strcmp(name, "FR_SIREN_04");
+ return !std::strcmp(name, "FR_SIREN_04");
}
bool dLytMsgWindow_c::isVisible() const {