Maintenance: [forced, user-approved] Family V5: remove invented helper types that exist only to call real methods under old sub_ name
Batch #10281 by ragnarok-clanker: forced by an admin (1 lower score(s), 10 changed function(s)); checked with 6 compiled unit(s).
This commit is contained in:
parent
e83c4def7d
commit
ab4ef21fb8
6 changed files with 16 additions and 52 deletions
|
|
@ -988,17 +988,13 @@ void CSession::SetPetAutoFeed(bool enabled) {
|
|||
|
||||
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);
|
||||
g_windowMgr.sub_AAB070(0x128);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00E48B00
|
||||
|
|
|
|||
|
|
@ -739,14 +739,6 @@ void GameSettings::ToggleOption(int id) {
|
|||
}
|
||||
}
|
||||
|
||||
struct SessionCommandTarget {
|
||||
int sub_DE1010(const char* name, int* optionId, std::string* strings);
|
||||
};
|
||||
|
||||
struct ServiceOptionActorRefresh {
|
||||
void sub_CD6DD0(char all);
|
||||
};
|
||||
|
||||
// OFFSET: 0x006C29A0
|
||||
// FUNCTION: fn_06324
|
||||
int SetOption(const char* name, unsigned char value) {
|
||||
|
|
@ -756,7 +748,7 @@ int SetOption(const char* name, unsigned char value) {
|
|||
|
||||
int optionId = 3;
|
||||
std::string strings[3];
|
||||
reinterpret_cast<SessionCommandTarget*>(&g_session)->sub_DE1010(name, &optionId, strings);
|
||||
g_session.GetTalkType(name, &optionId, strings);
|
||||
if (optionId != 3) {
|
||||
g_serviceOptions.values[static_cast<std::uint32_t>(optionId)] = value;
|
||||
}
|
||||
|
|
@ -772,7 +764,7 @@ std::pair<int, unsigned char> FindServiceOption(const char* name) {
|
|||
|
||||
int optionId = 3;
|
||||
std::string strings[3];
|
||||
reinterpret_cast<SessionCommandTarget*>(&g_session)->sub_DE1010(name, &optionId, strings);
|
||||
g_session.GetTalkType(name, &optionId, strings);
|
||||
const auto entry = g_serviceOptions.values.find(static_cast<std::uint32_t>(optionId));
|
||||
if (entry == g_serviceOptions.values.end()) {
|
||||
return {3, 0};
|
||||
|
|
@ -1047,7 +1039,7 @@ void ApplyServiceOptionWithNotice(int id, unsigned char value, bool notify, int
|
|||
return;
|
||||
}
|
||||
|
||||
reinterpret_cast<ServiceOptionActorRefresh*>(g_modeMgr.GetGameMode())->sub_CD6DD0(0);
|
||||
static_cast<CGameMode*>(g_modeMgr.GetGameMode())->RefreshActorJobEffects(false);
|
||||
if (notify) {
|
||||
NotifyServiceOption(value, enabledMessage, disabledMessage, 0x64FFFF);
|
||||
}
|
||||
|
|
@ -1064,7 +1056,7 @@ void ApplyServiceOptionActorRefresh(int id, unsigned char value, bool notify, in
|
|||
}
|
||||
}
|
||||
|
||||
reinterpret_cast<ServiceOptionActorRefresh*>(g_modeMgr.GetGameMode())->sub_CD6DD0(0);
|
||||
static_cast<CGameMode*>(g_modeMgr.GetGameMode())->RefreshActorJobEffects(false);
|
||||
}
|
||||
|
||||
// OFFSET: 0x006C4750
|
||||
|
|
|
|||
|
|
@ -57,10 +57,6 @@ namespace {
|
|||
/* 0008 */ int size;
|
||||
};
|
||||
|
||||
struct SessionHelper {
|
||||
const char* sub_DDE770(const char* mapName);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
class UIDragMiniPartyWnd : public UIFrameWnd {
|
||||
|
|
@ -387,7 +383,7 @@ void UIDragMiniPartyWnd::Paint() {
|
|||
);
|
||||
}
|
||||
|
||||
const char* mapName = reinterpret_cast<SessionHelper&>(g_session).sub_DDE770(this->member.map.c_str());
|
||||
const char* mapName = g_session.GetMapDisplayName(this->member.map.c_str());
|
||||
char text[256];
|
||||
sprintf(text, "%d %s(%s)", this->member.level, this->member.name.c_str(), mapName);
|
||||
std::string clipped = this->sub_A80880(this->geometry.width - 0x43, text, 0, 12, 1);
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ void CSession::RemoveSkill(std::uint32_t id) {
|
|||
}
|
||||
|
||||
this->m_skillBundle.Remove(id);
|
||||
if (this->m_skillBundle.RemoveExtra(id, *reinterpret_cast<WindowManagerWindows*>(&g_windowMgr))) {
|
||||
if (this->m_skillBundle.RemoveExtra(id, g_windowMgr)) {
|
||||
this->NotifySkillWindows();
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ bool CSession::UpdateSkill(const CSkillInfo& value, unsigned char notify, unsign
|
|||
} else {
|
||||
snapshot.unknown_0024 = UINT32_MAX;
|
||||
snapshot.unknown_002C = 0;
|
||||
this->m_skillBundle.AddExtra(snapshot, *reinterpret_cast<WindowManagerWindows*>(&g_windowMgr));
|
||||
this->m_skillBundle.AddExtra(snapshot, g_windowMgr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,23 +26,6 @@
|
|||
#include <zlib.h>
|
||||
|
||||
namespace {
|
||||
struct UIWindowMgrHelper : public UIWindowMgr {
|
||||
int sub_A901E0(const char* text, int type, bool defaultAccept, bool replace, int timeout, const char* caption, int width, int height, unsigned char protect);
|
||||
};
|
||||
|
||||
struct UIComboBoxDefWndHelper : public UIComboBoxDefWnd {
|
||||
std::string sub_8A15A0();
|
||||
};
|
||||
|
||||
struct UIEditCtrlHelper : public UIEditCtrl {
|
||||
void sub_865E00(int red, int green, int blue);
|
||||
void sub_868570(int red, int green, int blue, std::uint32_t secondary);
|
||||
};
|
||||
|
||||
struct UIStaticTextHelper : public UIStaticText {
|
||||
void sub_868880(const char* text);
|
||||
};
|
||||
|
||||
struct CaptchaRegisterPacket {
|
||||
/* 0000 */ std::int16_t id;
|
||||
/* 0002 */ char text[16];
|
||||
|
|
@ -68,7 +51,7 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) {
|
|||
this->m_pathText = new UIStaticText();
|
||||
this->m_pathText->SetSize(240, 16);
|
||||
this->m_pathText->Move(25, 27);
|
||||
static_cast<UIStaticTextHelper*>(this->m_pathText)->sub_868880(directory.c_str());
|
||||
this->m_pathText->SetTextFitted(directory.c_str());
|
||||
this->AddChild(this->m_pathText);
|
||||
|
||||
std::list<std::string> files;
|
||||
|
|
@ -101,8 +84,8 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) {
|
|||
this->m_editCtrl->maximum = 16;
|
||||
this->m_editCtrl->Background(255, 255, 255);
|
||||
this->m_editCtrl->flat = 0;
|
||||
static_cast<UIEditCtrlHelper*>(this->m_editCtrl)->sub_865E00(0, 0, 0);
|
||||
static_cast<UIEditCtrlHelper*>(this->m_editCtrl)->sub_868570(0, 0, 0, 0xFFFFFFFF);
|
||||
this->m_editCtrl->Border(0, 0, 0);
|
||||
this->m_editCtrl->TextColor(RGB(0, 0, 0), 0xFFFFFFFF);
|
||||
this->m_editCtrl->preserveInput = 1;
|
||||
this->AddChild(this->m_editCtrl);
|
||||
|
||||
|
|
@ -135,14 +118,14 @@ int UICaptchaRegisterWnd::SendMsg(
|
|||
g_windowMgr.CloseWindow(284);
|
||||
} else if (a1 == 345) {
|
||||
if (this->m_editCtrl->Length() < 4) {
|
||||
static_cast<UIWindowMgrHelper*>(&g_windowMgr)->sub_A901E0(LookupMessage(2872), 0, 1, 0, 0, "Message", 280, 120, 0);
|
||||
g_windowMgr.Confirm(LookupMessage(2872), 0, 1, 0, 0, "Message", 280, 120, 0);
|
||||
} else if (this->m_selectedFile.empty()) {
|
||||
static_cast<UIWindowMgrHelper*>(&g_windowMgr)->sub_A901E0(LookupMessage(2874), 0, 1, 0, 0, "Message", 280, 120, 0);
|
||||
g_windowMgr.Confirm(LookupMessage(2874), 0, 1, 0, 0, "Message", 280, 120, 0);
|
||||
} else if (this->m_decompressedSize == 0) {
|
||||
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>("compress data size error"), 0xFF, 0, 0, 0);
|
||||
} else {
|
||||
std::string str = FormatOwnedString(LookupMessage(2873), this->m_editCtrl->Text());
|
||||
int result = static_cast<UIWindowMgrHelper*>(&g_windowMgr)->sub_A901E0(str.c_str(), 2, 0, 0, 0, "Message", 280, 120, 0);
|
||||
int result = g_windowMgr.Confirm(str.c_str(), 2, 0, 0, 0, "Message", 280, 120, 0);
|
||||
if (result != 188) {
|
||||
this->registerButton->SetDisabled(1);
|
||||
this->registerButton->Invalidate();
|
||||
|
|
@ -160,7 +143,7 @@ int UICaptchaRegisterWnd::SendMsg(
|
|||
}
|
||||
}
|
||||
} else if (message == 39 && sender == this->m_fileComboBox) {
|
||||
this->m_selectedFile = static_cast<UIComboBoxDefWndHelper*>(this->m_fileComboBox)->sub_8A15A0();
|
||||
this->m_selectedFile = this->m_fileComboBox->GetSelectedText();
|
||||
if (!this->m_selectedFile.empty()) {
|
||||
std::string fullPath = this->m_pathText->tooltip + this->m_selectedFile;
|
||||
CFile file;
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ static_assert(sizeof(AddFriendPacket) == 26);
|
|||
static_assert(offsetof(AddFriendPacket, name) == 2);
|
||||
}
|
||||
|
||||
struct SessionCommandTarget {
|
||||
int sub_DE1010(const char* name, int* optionId, std::string* strings);
|
||||
};
|
||||
|
||||
// GLOBAL: gl_24525
|
||||
CMiniPartyWndAreaMgr* g_miniPartyWndAreaMgr = nullptr;
|
||||
|
|
@ -1478,7 +1475,7 @@ void UIWindowMgr::SendEmotionHotkey(int index) {
|
|||
if (g_session.ProcessEmotionShortcut(text) == 0) {
|
||||
std::string parts[3];
|
||||
int talkType;
|
||||
const int offset = reinterpret_cast<SessionCommandTarget*>(&g_session)->sub_DE1010(text, &talkType, parts);
|
||||
const int offset = g_session.GetTalkType(text, &talkType, parts);
|
||||
if (offset != -1) {
|
||||
g_windowMgr.unknown_04DC = text + offset;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue