Batch #3543 by bigodeira: 0 byte-identical, 1 confirmed by peer review. - fn_24224 sub_E489C0: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
82 lines
2.1 KiB
C++
82 lines
2.1 KiB
C++
#include "Contents/ClientState.h"
|
|
|
|
#include "Client/Session.h"
|
|
#include "Contents/MessageTable.h"
|
|
#include "UI/Window/UIWindow.h"
|
|
#include "UI/Window/UIWindowMgr.h"
|
|
|
|
#include <cstdint>
|
|
|
|
// GLOBAL: gl_24492
|
|
bool g_homunculusAutoFeed;
|
|
|
|
// GLOBAL: gl_24493
|
|
bool g_petAutoFeed;
|
|
|
|
// OFFSET: 0x00E488C0
|
|
// FUNCTION: fn_24221
|
|
void CSession::UpdateBodyStyle(int job, int style, int renderJob) {
|
|
if (style >= 2 || this->IsSecondJob(renderJob)) {
|
|
this->m_bodyStyle = style;
|
|
} else if (static_cast<unsigned>(job - 4001) <= 21) {
|
|
this->m_bodyStyle = job <= 4007;
|
|
} else {
|
|
this->m_bodyStyle = static_cast<unsigned>(job - 4001) <= 6;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00E48930
|
|
// FUNCTION: fn_24222
|
|
void CSession::SetHomunculusAutoFeed(bool enabled) {
|
|
int message;
|
|
if (enabled == true) {
|
|
this->m_homunculusAutoFeed = true;
|
|
message = 3282;
|
|
} else {
|
|
g_homunculusAutoFeed = false;
|
|
message = 3283;
|
|
}
|
|
|
|
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(message)), 0x64FFFF, 0, 0, 0);
|
|
}
|
|
|
|
// OFFSET: 0x00E48980
|
|
// FUNCTION: fn_24223
|
|
void CSession::SetPetAutoFeed(bool enabled) {
|
|
g_petAutoFeed = enabled == true;
|
|
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(enabled ? 2579 : 2580)), 0x64FFFF, 0, 0, 0);
|
|
}
|
|
|
|
extern "C" void __cdecl sub_6C2A80(int id, bool value);
|
|
|
|
struct UIWindowMgrHelper {
|
|
void sub_AAB070(int id);
|
|
};
|
|
|
|
// OFFSET: 0x00E489C0
|
|
// FUNCTION: fn_24224
|
|
void __stdcall sub_E489C0(bool enabled) {
|
|
std::string notice = LookupMessage(enabled ? 4357 : 4379);
|
|
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(notice.c_str()), 0x64FFFF, 0, 0, 0);
|
|
sub_6C2A80(0x128, enabled);
|
|
reinterpret_cast<UIWindowMgrHelper*>(&g_windowMgr)->sub_AAB070(0x128);
|
|
}
|
|
|
|
// OFFSET: 0x00E48B00
|
|
// FUNCTION: fn_24225
|
|
void CSession::CollectCardItems() {
|
|
this->m_cardItems.clear();
|
|
for (const ITEM_INFO& item : this->m_inventoryItems) {
|
|
if (item.unknown_0000[0] == 6) {
|
|
this->m_cardItems.push_back(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00E48B70
|
|
// FUNCTION: fn_24226
|
|
void RequestBasicInfoRefresh() {
|
|
if (g_windowMgr.unknown_01E0 != nullptr) {
|
|
g_windowMgr.unknown_01E0->SendMsg(nullptr, 106, 575, 0, 0, 0);
|
|
}
|
|
}
|