implement instant text setting

This commit is contained in:
gymnast86
2026-04-17 01:30:08 -07:00
parent 363788accd
commit 5ba04524eb
7 changed files with 64 additions and 3 deletions
+21
View File
@@ -12,6 +12,10 @@
#include "d/d_lib.h"
#include "JSystem/JUtility/JUTFont.h"
#if TARGET_PC
#include "dusk/scope_guard.hpp"
#endif
#if REGION_JPN
#define CHAR_CODE_MALE_ICON 0x8189
#define CHAR_CODE_FEMALE_ICON 0x818A
@@ -1918,6 +1922,11 @@ void jmessage_tSequenceProcessor::do_begin(void const* pEntry, char const* pszTe
pReference->resetReference();
field_0xb5 = 0;
#if TARGET_PC
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
field_0xb2 = 1;
}
#endif
}
void jmessage_tSequenceProcessor::do_end() {
@@ -2154,6 +2163,18 @@ void jmessage_tSequenceProcessor::do_character(int iCharacter) {
bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_size) {
jmessage_tReference* pReference = (jmessage_tReference*)getReference();
#if TARGET_PC
// This class runs the lambda function when it goes out of scope. We want to run
// this code after the switch statement and this saves us from having to litter
// the switch statement with IF_DUSK before every return.
auto instantTextRun = SimpleScopeGuard([&]() {
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
field_0xb2 = 1;
pReference->setSendTimer(0);
}
});
#endif
switch (i_tag & 0xFF0000) {
case MSGTAG_GROUP(1): {
cXyz pos = pReference->getActorPos();
+10 -3
View File
@@ -28,6 +28,10 @@
#include "m_Do/m_Do_lib.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#if TARGET_PC
#include "dusk/settings.h"
#endif
static void dMsgObject_addFundRaising(s16 param_0);
static void dMsgObject_addTotalPayment(s16 param_0);
@@ -1566,7 +1570,8 @@ u8 dMsgObject_c::isSend() {
if (pRef->getSendFlag() == 5) {
if (getStatusLocal() == 21) {
setButtonStatusLocal();
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
return 2;
}
return 0;
@@ -1585,7 +1590,8 @@ u8 dMsgObject_c::isSend() {
}
if (pRef->getSendFlag() == 2) {
setButtonStatusLocal();
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
return 2;
}
}
@@ -1598,7 +1604,8 @@ u8 dMsgObject_c::isSend() {
return 2;
}
} else {
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
return 2;
}
if (mesgCancelButton) {