Maintenance: [forced, user-approved] Family G30: remove ModeBaseEvents, CharacterConfigSave, AccountConfigLoad. ModeBaseEvents::Send
Batch #10264 by ragnarok-clanker: forced by an admin (2 lower score(s), 29 changed function(s)); checked with 511 compiled unit(s), including every includer of Source/Client/Session.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Hotkeys/EmotionHotkeys.h, Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/CharacterLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Client/ModeBaseEvents.h, Source/Contents/UserData/AccountConfigLoad.h, Source/Contents/UserData/CharacterConfigSave.h. Deletes: Source/Client/ModeBaseEvents.h, Source/Contents/UserData/AccountConfigLoad.h, Source/Contents/UserData/CharacterConfigSave.h
This commit is contained in:
parent
643cf8e993
commit
749039eea6
28 changed files with 101 additions and 211 deletions
|
|
@ -12,7 +12,6 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Client/Replay.h"
|
||||
#include "Client/Input/InputCharset.h"
|
||||
#include "Client/ModeBaseEvents.h"
|
||||
#include "Client/Stove/StovePCSDK.h"
|
||||
#include "Contents/Async/AsyncWorkMgr.h"
|
||||
#include "Contents/Configuration/ServiceConfiguration.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "Client/ModeBaseEvents.h"
|
||||
#include "Client/Application/ApplicationWindow.h"
|
||||
#include "Client/Mode/ModeMgr.h"
|
||||
#include "Contents/Configuration/ServiceConfiguration.h"
|
||||
#include "Contents/Party/AdventurerAgencyMgr.h"
|
||||
|
|
@ -9,15 +9,15 @@
|
|||
|
||||
// OFFSET: 0x00AD7500
|
||||
// FUNCTION: fn_17849
|
||||
int ModeBaseEvents::Send(int event, const char* text, int, int, int) {
|
||||
int CMode::SendMsg(int event, int argument1, int, int, int) {
|
||||
if (event == 2) {
|
||||
g_accountLinkedUserDataMgr->Save(this->emotions, this->script, this->persistenceAccountId, this->renderSystem, this->token16, this->work);
|
||||
g_accountLinkedUserDataMgr->Save();
|
||||
if (g_modeMgr.state != 1) {
|
||||
if (g_modeMgr.gameMode) {
|
||||
g_modeMgr.gameMode->running = 0;
|
||||
}
|
||||
} else if (g_modeMgr.gameMode) {
|
||||
g_characterLinkedUserDataMgr->Save(this->characterSave, this->token16, this->work);
|
||||
g_characterLinkedUserDataMgr->Save();
|
||||
if (g_modeMgr.state != 1) {
|
||||
if (g_modeMgr.gameMode) {
|
||||
g_modeMgr.gameMode->running = 0;
|
||||
|
|
@ -31,13 +31,13 @@ int ModeBaseEvents::Send(int event, const char* text, int, int, int) {
|
|||
}
|
||||
|
||||
if (g_serviceType == 11) {
|
||||
ShellExecuteA(this->window, "open", "http://www.ragnarok.co.in/index.php", nullptr, nullptr, SW_SHOWNORMAL);
|
||||
ShellExecuteA(hWnd, "open", "http://www.ragnarok.co.in/index.php", nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
g_modeMgr.running = 0;
|
||||
} else if (event == 68) {
|
||||
this->transitionRequested = 1;
|
||||
if (text) {
|
||||
this->transitionName = text;
|
||||
this->screenshotRequested = 1;
|
||||
if (const char* text = reinterpret_cast<const char*>(argument1)) {
|
||||
this->screenshotName = text;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef RAGNAROK_SOURCE_CLIENT_MODEBASEEVENTS_H
|
||||
#define RAGNAROK_SOURCE_CLIENT_MODEBASEEVENTS_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
|
||||
class CAsyncWorkMgr;
|
||||
class CRenderSystemBase;
|
||||
class LuaScript;
|
||||
struct EmotionHotkeys;
|
||||
struct CharacterConfigSave;
|
||||
|
||||
struct ModeBaseEvents {
|
||||
int& transitionRequested;
|
||||
std::string& transitionName;
|
||||
EmotionHotkeys& emotions;
|
||||
LuaScript& script;
|
||||
const std::uint32_t& persistenceAccountId;
|
||||
CRenderSystemBase*& renderSystem;
|
||||
const char* token16;
|
||||
CAsyncWorkMgr& work;
|
||||
CharacterConfigSave& characterSave;
|
||||
HWND& window;
|
||||
|
||||
int Send(int event, const char* text, int argument2, int argument3, int argument4);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
#include "Render/Renderer.h"
|
||||
|
||||
#include "Contents/InstantVar.h"
|
||||
#include "Contents/Hotkeys/EmotionHotkeys.h"
|
||||
#include "Contents/Items/ItemInfo.h"
|
||||
#include "Contents/Messenger/MessengerMember.h"
|
||||
#include "Contents/Party/PartyBookingMgr.h"
|
||||
|
|
@ -276,7 +277,7 @@ public:
|
|||
/* 0FD8 */ std::vector<const char*> m_jobKeyNames;
|
||||
/* 0FE4 */ std::list<std::uint32_t> m_pingSamples;
|
||||
/* 0FEC */ std::vector<const char*> m_palJobNames;
|
||||
/* 0FF8 */ unsigned char unknown_0FF8[0x18];
|
||||
/* 0FF8 */ EmotionHotkeys m_emotionHotkeys;
|
||||
/* 1010 */ std::uint32_t unknown_1010;
|
||||
/* 1014 */ unsigned char unknown_1014[4];
|
||||
/* 1018 */ char unknown_1018[0x20];
|
||||
|
|
@ -881,6 +882,8 @@ public:
|
|||
void StoreEmblem(const void* data, std::size_t size, std::uint32_t guildId, int version);
|
||||
int MercSkillLevel(int skillId) const;
|
||||
int HomunSkillLevel(int skillId) const;
|
||||
__declspec(noinline) int UseLevel(int id) const;
|
||||
int SkillLevel(int id) const;
|
||||
CRenderObject* FindGameActor(std::uint32_t aid) const;
|
||||
int GetPetTargetAid() const;
|
||||
bool sub_E1DE30(std::uint32_t aid);
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ void CAsyncWorkMgr::Shutdown() {
|
|||
|
||||
// OFFSET: 0x00573DB0
|
||||
// FUNCTION: fn_02499
|
||||
void CAsyncWorkMgr::LoadAccount(std::uint32_t accountId, std::string world, std::string url, AccountConfigLoad& context) {
|
||||
void CAsyncWorkMgr::LoadAccount(std::uint32_t accountId, std::string world, std::string url) {
|
||||
NAsyncWorkPtr work(this->m_pools, "AccountLinkedUserData_Load");
|
||||
|
||||
if (work.Get()) {
|
||||
static_cast<CAccountLinkedUserDataLoadAsyncWork*>(work.Get())->Bind(accountId, world, url, context);
|
||||
static_cast<CAccountLinkedUserDataLoadAsyncWork*>(work.Get())->Bind(accountId, world, url);
|
||||
this->Submit(work);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ class CAsyncWorkRecycleObjectPoolMgr;
|
|||
class CConnection;
|
||||
class CEmblemDataMgr;
|
||||
#include "UI/Window/WindowManagerWindows.h"
|
||||
struct AccountConfigLoad;
|
||||
|
||||
class CAsyncWorkMgr : public NAsyncWorkMgr {
|
||||
public:
|
||||
|
|
@ -18,7 +17,7 @@ public:
|
|||
static bool Initialize(std::uint32_t workers);
|
||||
static void Shutdown();
|
||||
|
||||
void LoadAccount(std::uint32_t accountId, std::string world, std::string url, AccountConfigLoad& context);
|
||||
void LoadAccount(std::uint32_t accountId, std::string world, std::string url);
|
||||
void SaveAccount(std::uint32_t accountId, std::string world, std::string url, std::string token, std::string data);
|
||||
void ChangePartyMaster(
|
||||
std::uint32_t accountId, std::uint32_t characterId, std::string characterName, std::uint32_t targetAccountId, std::uint32_t targetCharacterId,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "Script/LuaInstance.h"
|
||||
|
||||
#include <direct.h>
|
||||
#include <json/value.h>
|
||||
#include <io.h>
|
||||
|
||||
// OFFSET: 0x005BC230
|
||||
|
|
@ -69,7 +70,7 @@ void EmotionHotkeys::Save(std::uint32_t accountId, CRenderSystemBase* renderSyst
|
|||
|
||||
// OFFSET: 0x00E3D4D0
|
||||
// FUNCTION: fn_24191
|
||||
bool EmotionHotkeys::LoadDefaults(std::uint32_t accountId, bool languagePrefix, int serviceType, std::uint16_t language) {
|
||||
bool EmotionHotkeys::LoadDefaults(std::uint32_t accountId) {
|
||||
this->current.clear();
|
||||
|
||||
for (int id : {544, 545, 546, 547, 549, 550, 551, 552, 553, 554}) {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <json/value.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class CRenderSystemBase;
|
||||
namespace Json {
|
||||
class Value;
|
||||
}
|
||||
|
||||
struct EmotionHotkeys {
|
||||
/* 0FF8 */ std::vector<std::string> current;
|
||||
|
|
@ -16,7 +18,7 @@ struct EmotionHotkeys {
|
|||
void Load(Json::Value& data);
|
||||
bool HasChanges() const;
|
||||
void Save(std::uint32_t accountId, CRenderSystemBase* renderSystem) const;
|
||||
bool LoadDefaults(std::uint32_t accountId, bool languagePrefix, int serviceType, std::uint16_t language);
|
||||
bool LoadDefaults(std::uint32_t accountId);
|
||||
void Export(Json::Value& data) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "Contents/Jobs/JobId.h"
|
||||
#include "Contents/Jobs/JobInheritance.h"
|
||||
#include "Contents/MapPropertyMgr.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Contents/World/World.h"
|
||||
#include "File/File.h"
|
||||
#include "Network/TextEncoding.h"
|
||||
|
|
@ -234,7 +233,7 @@ bool CSession::UpdateSkill(const CSkillInfo& value, unsigned char notify, unsign
|
|||
|
||||
if (grouped || snapshot.available) {
|
||||
if (CSkillInfo::UsesLevel(*this->m_hotkeyScript, static_cast<int>(snapshot.id)) && snapshot.level != 0) {
|
||||
const int saved = reinterpret_cast<const CharacterConfigSave*>(this)->UseLevel(static_cast<int>(snapshot.id));
|
||||
const int saved = this->UseLevel(static_cast<int>(snapshot.id));
|
||||
if (saved <= 0 || saved > snapshot.level) {
|
||||
this->m_skillBundle.SetUnknownValue(static_cast<int>(snapshot.id), snapshot.level);
|
||||
}
|
||||
|
|
@ -784,7 +783,7 @@ void CSession::ClearAdditionalShortcutSkills() {
|
|||
|
||||
// OFFSET: 0x00E089A0
|
||||
// FUNCTION: fn_23768
|
||||
int CharacterConfigSave::SkillLevel(int id) const {
|
||||
int CSession::SkillLevel(int id) const {
|
||||
if (id - 8000u <= 60u) {
|
||||
return g_session.HomunSkillLevel(id);
|
||||
}
|
||||
|
|
@ -793,7 +792,7 @@ int CharacterConfigSave::SkillLevel(int id) const {
|
|||
return g_session.MercSkillLevel(id);
|
||||
}
|
||||
|
||||
return this->UseLevel(id);
|
||||
return g_session.UseLevel(id);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00E094E0
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef RAGNAROK_SOURCE_CONTENTS_USERDATA_ACCOUNTCONFIGLOAD_H
|
||||
#define RAGNAROK_SOURCE_CONTENTS_USERDATA_ACCOUNTCONFIGLOAD_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct EmotionHotkeys;
|
||||
class LuaScript;
|
||||
class CRenderSystemBase;
|
||||
|
||||
struct AccountConfigLoad {
|
||||
EmotionHotkeys& emotions;
|
||||
LuaScript& script;
|
||||
const std::uint32_t& persistenceAccountId;
|
||||
CRenderSystemBase* const& renderSystem;
|
||||
const bool& languagePrefix;
|
||||
const int& serviceType;
|
||||
const std::uint16_t& language;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
#include "Contents/UserData/AccountConfigLoad.h"
|
||||
#include "Contents/UserData/AccountLinkedUserDataLoadAsyncWork.h"
|
||||
#include "Contents/UserData/AccountLinkedUserDataMgr.h"
|
||||
#include "Network/Http/CURLPostHander.h"
|
||||
|
|
@ -23,7 +22,7 @@ namespace {
|
|||
// OFFSET: 0x005B9E50
|
||||
// FUNCTION: fn_03440
|
||||
CAccountLinkedUserDataLoadAsyncWork::CAccountLinkedUserDataLoadAsyncWork()
|
||||
: NAsyncWork("AccountLinkedUserData_Load"), m_accountId(0), m_diagnostic(Diagnostic(false, "unknwon", 26)), m_context(nullptr) {
|
||||
: NAsyncWork("AccountLinkedUserData_Load"), m_accountId(0), m_diagnostic(Diagnostic(false, "unknwon", 26)) {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
|
|
@ -36,14 +35,13 @@ void CAccountLinkedUserDataLoadAsyncWork::Reset() {
|
|||
|
||||
// OFFSET: 0x005BA5D0
|
||||
// FUNCTION: fn_03445
|
||||
void CAccountLinkedUserDataLoadAsyncWork::Bind(std::uint32_t accountId, std::string accountName, std::string url, AccountConfigLoad& context) {
|
||||
void CAccountLinkedUserDataLoadAsyncWork::Bind(std::uint32_t accountId, std::string accountName, std::string url) {
|
||||
this->m_group = timeGetTime();
|
||||
this->m_accountId = accountId;
|
||||
this->m_key = 0;
|
||||
this->m_accountName = accountName;
|
||||
this->m_url = url;
|
||||
this->m_response.clear();
|
||||
this->m_context = &context;
|
||||
|
||||
AsyncDiagnostic diagnostic = Diagnostic(false, "unknwon", 50);
|
||||
this->m_diagnostic.MoveFrom(diagnostic);
|
||||
|
|
@ -73,7 +71,6 @@ bool CAccountLinkedUserDataLoadAsyncWork::Execute() {
|
|||
// FUNCTION: fn_03447
|
||||
void CAccountLinkedUserDataLoadAsyncWork::Complete() {
|
||||
g_accountLinkedUserDataMgr->CompleteLoad(
|
||||
this->m_diagnostic, this->m_accountId, this->m_accountName, this->m_response, this->m_context->emotions, this->m_context->script,
|
||||
this->m_context->persistenceAccountId, this->m_context->renderSystem
|
||||
this->m_diagnostic, this->m_accountId, this->m_accountName, this->m_response
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
#include "Utility/Async/AsyncDiagnostic.h"
|
||||
#include "Utility/Async/NAsyncWork.h"
|
||||
|
||||
struct AccountConfigLoad;
|
||||
|
||||
class alignas(8) CAccountLinkedUserDataLoadAsyncWork : public NAsyncWork {
|
||||
public:
|
||||
CAccountLinkedUserDataLoadAsyncWork();
|
||||
|
|
@ -13,7 +11,7 @@ public:
|
|||
void Reset() override;
|
||||
bool Execute() override;
|
||||
void Complete() override;
|
||||
void Bind(std::uint32_t accountId, std::string accountName, std::string url, AccountConfigLoad& context);
|
||||
void Bind(std::uint32_t accountId, std::string accountName, std::string url);
|
||||
|
||||
protected:
|
||||
/* 0028 */ std::uint32_t m_accountId;
|
||||
|
|
@ -21,8 +19,7 @@ protected:
|
|||
/* 0044 */ std::string m_url;
|
||||
/* 005C */ std::string m_response;
|
||||
/* 0074 */ AsyncDiagnostic m_diagnostic;
|
||||
|
||||
AccountConfigLoad* m_context;
|
||||
/* 00AC */ int unknown_00AC;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#include "Contents/UserData/AccountConfigLoad.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Render/DeviceContext/DCSurface.h"
|
||||
#include "Script/LuaScript.h"
|
||||
#include "Contents/UserData/AccountLinkedUserDataMgr.h"
|
||||
#include "Contents/UserData/AccountService.h"
|
||||
#include "Contents/UserData/AccountUserData.h"
|
||||
|
|
@ -68,8 +70,7 @@ std::string CAccountLinkedUserDataMgr::SaveUrl() const {
|
|||
// OFFSET: 0x005BC520
|
||||
// FUNCTION: fn_03465
|
||||
void CAccountLinkedUserDataMgr::CompleteLoad(
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::string accountName, std::string response, EmotionHotkeys& emotions, LuaScript& script,
|
||||
std::uint32_t persistenceAccountId, CRenderSystemBase* renderSystem
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::string accountName, std::string response
|
||||
) {
|
||||
if (diagnostic.success && this->m_accountId == 0) {
|
||||
Json::Value root;
|
||||
|
|
@ -78,8 +79,8 @@ void CAccountLinkedUserDataMgr::CompleteLoad(
|
|||
const int type = root["Type"].asInt();
|
||||
if (type == 1) {
|
||||
LoadWhisperBlockList(root["data"]);
|
||||
emotions.Load(root["data"]);
|
||||
g_userHotkeyMgr->LoadV2(script, root["data"]);
|
||||
g_session.m_emotionHotkeys.Load(root["data"]);
|
||||
g_userHotkeyMgr->LoadV2(*g_luaScript, root["data"]);
|
||||
}
|
||||
|
||||
if (type == 1 || type == 2) {
|
||||
|
|
@ -88,7 +89,7 @@ void CAccountLinkedUserDataMgr::CompleteLoad(
|
|||
this->m_accountId = accountId;
|
||||
this->m_accountName = accountName;
|
||||
this->m_loaded = true;
|
||||
emotions.Save(persistenceAccountId, renderSystem);
|
||||
g_session.m_emotionHotkeys.Save(g_session.m_aid, GetRenderSystemHolder()->system);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -106,12 +107,12 @@ void CAccountLinkedUserDataMgr::RefreshUrls(LuaScript& settings, LuaScript& tabl
|
|||
|
||||
// OFFSET: 0x005BD170
|
||||
// FUNCTION: fn_03470
|
||||
void CAccountLinkedUserDataMgr::Reset(EmotionHotkeys& emotions, LuaScript& script, const char* host, const char* port, const char* overrideKey) {
|
||||
void CAccountLinkedUserDataMgr::Reset(LuaScript& script, const char* host, const char* port, const char* overrideKey) {
|
||||
this->m_accountId = 0;
|
||||
this->m_accountName = "unknown";
|
||||
this->m_loaded = false;
|
||||
g_whisperBlockMgr->Reset();
|
||||
emotions.saved.clear();
|
||||
g_session.m_emotionHotkeys.saved.clear();
|
||||
g_userHotkeyMgr->Reset();
|
||||
this->RefreshUrls(script, script, host, port, overrideKey);
|
||||
}
|
||||
|
|
@ -124,11 +125,9 @@ void CAccountLinkedUserDataMgr::CompleteSave() {
|
|||
|
||||
// OFFSET: 0x005BCE50
|
||||
// FUNCTION: fn_03469
|
||||
void CAccountLinkedUserDataMgr::Save(
|
||||
EmotionHotkeys& emotions, LuaScript& script, std::uint32_t persistenceAccountId, CRenderSystemBase* renderSystem, const char* token16,
|
||||
CAsyncWorkMgr& workManager
|
||||
) {
|
||||
emotions.Save(persistenceAccountId, renderSystem);
|
||||
void CAccountLinkedUserDataMgr::Save() {
|
||||
EmotionHotkeys& emotions = g_session.m_emotionHotkeys;
|
||||
emotions.Save(g_session.m_aid, GetRenderSystemHolder()->system);
|
||||
if (!this->m_loaded) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -145,28 +144,28 @@ void CAccountLinkedUserDataMgr::Save(
|
|||
emotions.Export(data);
|
||||
}
|
||||
|
||||
if (g_userHotkeyMgr->HasChanges(script)) {
|
||||
g_userHotkeyMgr->Export(script, data);
|
||||
if (g_userHotkeyMgr->HasChanges(*g_luaScript)) {
|
||||
g_userHotkeyMgr->Export(*g_luaScript, data);
|
||||
}
|
||||
|
||||
if (!data.isNull()) {
|
||||
root["data"] = data;
|
||||
Json::StyledWriter writer;
|
||||
const std::string response = writer.write(root);
|
||||
workManager.SaveAccount(this->m_accountId, this->m_accountName, this->SaveUrl(), std::string(token16, 16), response);
|
||||
g_asyncWorkMgr->SaveAccount(this->m_accountId, this->m_accountName, this->SaveUrl(), std::string(reinterpret_cast<const char*>(&g_session.unknown_807C[0x08]), 16), response);
|
||||
++this->unknown_0028;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x005BCD80
|
||||
// FUNCTION: fn_03468
|
||||
void CAccountLinkedUserDataMgr::Load(std::uint32_t accountId, std::string accountName, CAsyncWorkMgr& workManager, AccountConfigLoad& context) {
|
||||
context.emotions.LoadDefaults(context.persistenceAccountId, context.languagePrefix, context.serviceType, context.language);
|
||||
void CAccountLinkedUserDataMgr::Load(std::uint32_t accountId, std::string accountName) {
|
||||
g_session.m_emotionHotkeys.LoadDefaults(g_session.m_aid);
|
||||
|
||||
if (this->m_accountId == accountId && this->m_accountName == accountName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string url = this->LoadUrl();
|
||||
workManager.LoadAccount(accountId, accountName, url, context);
|
||||
g_asyncWorkMgr->LoadAccount(accountId, accountName, url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
#include <string>
|
||||
|
||||
struct AsyncDiagnostic;
|
||||
struct EmotionHotkeys;
|
||||
struct AccountConfigLoad;
|
||||
class LuaScript;
|
||||
class CRenderSystemBase;
|
||||
class CAsyncWorkMgr;
|
||||
|
|
@ -25,16 +23,12 @@ public:
|
|||
void RefreshUrls(LuaScript& settings, LuaScript& tables, const char* host, const char* port, const char* overrideKey);
|
||||
|
||||
void CompleteLoad(
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::string accountName, std::string response, EmotionHotkeys& emotions, LuaScript& script,
|
||||
std::uint32_t persistenceAccountId, CRenderSystemBase* renderSystem
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::string accountName, std::string response
|
||||
);
|
||||
void Load(std::uint32_t accountId, std::string accountName, CAsyncWorkMgr& workManager, AccountConfigLoad& context);
|
||||
void Reset(EmotionHotkeys& emotions, LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
void Load(std::uint32_t accountId, std::string accountName);
|
||||
void Reset(LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
void CompleteSave();
|
||||
void Save(
|
||||
EmotionHotkeys& emotions, LuaScript& script, std::uint32_t persistenceAccountId, CRenderSystemBase* renderSystem, const char* token16,
|
||||
CAsyncWorkMgr& workManager
|
||||
);
|
||||
void Save();
|
||||
|
||||
protected:
|
||||
/* 0004 */ bool m_enabled;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Contents/Async/AsyncWorkMgr.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Contents/UserData/CharacterLinkedUserDataMgr.h"
|
||||
#include "Contents/UserData/NormalItemSlots.h"
|
||||
#include "Contents/Skills/PlayerSkillBundle.h"
|
||||
|
|
@ -12,19 +11,23 @@
|
|||
|
||||
// OFFSET: 0x00DE0E40
|
||||
// FUNCTION: fn_23474
|
||||
int CharacterConfigSave::UseLevel(int id) const {
|
||||
int CSession::UseLevel(int id) const {
|
||||
const auto key = static_cast<std::uint32_t>(id);
|
||||
|
||||
if (key - 1u <= 0x1F3D) {
|
||||
return this->useLevels[key];
|
||||
return this->m_skillBundle.unknown_0064[key];
|
||||
}
|
||||
|
||||
if (id > 10000) {
|
||||
return this->additionalLevels[key - 10000u];
|
||||
return this->unknown_0710[key - 10000u];
|
||||
}
|
||||
|
||||
if (key - 8000u <= 60) {
|
||||
return this->homunculusLevels[key - 8000u];
|
||||
if (this->IsHomunculusSkill(key)) {
|
||||
const int index = id - 8000;
|
||||
|
||||
if (index > -1) {
|
||||
return this->m_homunSkillLevels[index];
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -32,7 +35,7 @@ int CharacterConfigSave::UseLevel(int id) const {
|
|||
|
||||
// OFFSET: 0x005E6EF0
|
||||
// FUNCTION: fn_03933
|
||||
void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char* token16, CAsyncWorkMgr& workManager) {
|
||||
void CCharacterLinkedUserDataMgr::Save() {
|
||||
if (!this->m_loaded) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -44,14 +47,13 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
Json::Value values;
|
||||
|
||||
struct SaveUseSkillLevel {
|
||||
const CharacterConfigSave* context;
|
||||
Json::Value* values;
|
||||
|
||||
// OFFSET: 0x005E7AE0
|
||||
// FUNCTION: fn_03940
|
||||
bool operator()(CSkillInfo* skill) const {
|
||||
const int id = static_cast<int>(skill->id);
|
||||
const int level = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(id);
|
||||
const int level = g_session.UseLevel(id);
|
||||
if (level != 0) {
|
||||
Json::Value value;
|
||||
value["SKID"] = id;
|
||||
|
|
@ -63,17 +65,16 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
}
|
||||
};
|
||||
|
||||
context.skills.ForEachGrouped(SaveUseSkillLevel{&context, &values});
|
||||
g_session.m_skillBundle.ForEachGrouped(SaveUseSkillLevel{&values});
|
||||
data["UseSkillInfo"] = values;
|
||||
}
|
||||
|
||||
if (g_session.GetOption(8) != 0) {
|
||||
Json::Value values;
|
||||
|
||||
for (const CSkillInfo& skill : context.homunculusSkills) {
|
||||
for (const CSkillInfo& skill : g_session.m_homunSkills) {
|
||||
const int id = static_cast<int>(skill.id);
|
||||
const auto index = skill.id - 8000u;
|
||||
const int level = static_cast<int>(index) < 0 ? 0 : context.homunculusLevels[index];
|
||||
const int level = g_session.HomunSkillLevel(id);
|
||||
|
||||
if (level != 0) {
|
||||
Json::Value value;
|
||||
|
|
@ -86,17 +87,17 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
data["HomunSkillInfo"] = values;
|
||||
}
|
||||
|
||||
data["ItemComparison"] = context.serviceOptions.Get(264) != 0;
|
||||
data["SortPrivateTab"] = context.sortPrivate;
|
||||
ExportNormalItemSlots(data, context.items, context.saved, context.itemSlotActive);
|
||||
data["ItemComparison"] = g_serviceOptions.Get(264) != 0;
|
||||
data["SortPrivateTab"] = g_sortPrivateTab;
|
||||
this->ExportNormalItemSlots(data);
|
||||
|
||||
if (!data.isNull()) {
|
||||
root["data"] = data;
|
||||
Json::StyledWriter writer;
|
||||
const std::string response = writer.write(root);
|
||||
const std::string token(token16, 16);
|
||||
const std::string token(reinterpret_cast<const char*>(&g_session.unknown_807C[0x08]), 16);
|
||||
const std::string url = this->SaveUrl();
|
||||
workManager.SaveCharacter(this->m_accountId, this->m_characterId, this->m_accountName, url, token, response);
|
||||
g_asyncWorkMgr->SaveCharacter(this->m_accountId, this->m_characterId, this->m_accountName, url, token, response);
|
||||
|
||||
++this->m_pendingSaves;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef RAGNAROK_SOURCE_CONTENTS_USERDATA_CHARACTERCONFIGSAVE_H
|
||||
#define RAGNAROK_SOURCE_CONTENTS_USERDATA_CHARACTERCONFIGSAVE_H
|
||||
|
||||
#include "Contents/Skills/SkillInfo.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
class CPlayerSkillBundle;
|
||||
struct ServiceOptions;
|
||||
struct NormalItemSlot;
|
||||
struct NormalItemSlotWindow;
|
||||
|
||||
struct CharacterConfigSave {
|
||||
CPlayerSkillBundle& skills;
|
||||
const std::list<CSkillInfo>& homunculusSkills;
|
||||
const int* useLevels;
|
||||
const int* additionalLevels;
|
||||
const int* homunculusLevels;
|
||||
const ServiceOptions& serviceOptions;
|
||||
const bool& sortPrivate;
|
||||
const NormalItemSlot* items;
|
||||
const NormalItemSlotWindow& saved;
|
||||
const bool& itemSlotActive;
|
||||
|
||||
int UseLevel(int id) const;
|
||||
int SkillLevel(int id) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -9,7 +9,6 @@ struct AsyncDiagnostic;
|
|||
namespace Json {
|
||||
class Value;
|
||||
}
|
||||
struct CharacterConfigSave;
|
||||
class CAsyncWorkMgr;
|
||||
|
||||
class CCharacterLinkedUserDataMgr {
|
||||
|
|
@ -26,7 +25,8 @@ public:
|
|||
void LoadUseSkillLevels(Json::Value& data);
|
||||
void LoadHomunculusSkillLevels(Json::Value& data);
|
||||
void LoadNormalItemSlots(Json::Value& data);
|
||||
void Save(CharacterConfigSave& context, const char* token16, CAsyncWorkMgr& workManager);
|
||||
void Save();
|
||||
void ExportNormalItemSlots(Json::Value& data);
|
||||
void RefreshUrls(LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
void Reset(LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "Contents/UserData/NormalItemSlots.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Contents/UserData/CharacterLinkedUserDataMgr.h"
|
||||
#include "Contents/MapSkyMgr.h"
|
||||
#include "Render/Renderer.h"
|
||||
#include "UI/Navigation/UINavigationV4Wnd.h"
|
||||
|
|
@ -36,25 +37,25 @@ bool NormalItemSlotWindow::IsValid(int screenWidth, int screenHeight, bool activ
|
|||
|
||||
// OFFSET: 0x005E75A0
|
||||
// FUNCTION: fn_03935
|
||||
void ExportNormalItemSlots(Json::Value& data, const NormalItemSlot* slots, const NormalItemSlotWindow& window, bool active) {
|
||||
void CCharacterLinkedUserDataMgr::ExportNormalItemSlots(Json::Value& data) {
|
||||
Json::Value values;
|
||||
|
||||
for (int index = 0; index < 9; ++index) {
|
||||
Json::Value value;
|
||||
value["ItemID"] = Json::UInt(slots[index].itemId);
|
||||
value["ItemID"] = Json::UInt(g_session.m_normalItemSlots[index].itemId);
|
||||
value["SlotNum"] = index;
|
||||
values.append(value);
|
||||
}
|
||||
|
||||
Json::Value info;
|
||||
info["SlotX"] = window.x;
|
||||
info["SlotY"] = window.y;
|
||||
info["SlotWidth"] = window.width;
|
||||
info["SlotHeight"] = window.height;
|
||||
info["SlotShow"] = window.show;
|
||||
info["SlotX"] = g_windowMgr.m_normalItemSlotWindow.x;
|
||||
info["SlotY"] = g_windowMgr.m_normalItemSlotWindow.y;
|
||||
info["SlotWidth"] = g_windowMgr.m_normalItemSlotWindow.width;
|
||||
info["SlotHeight"] = g_windowMgr.m_normalItemSlotWindow.height;
|
||||
info["SlotShow"] = g_windowMgr.m_normalItemSlotWindow.show;
|
||||
data["SlotInfo"] = info;
|
||||
data["NormalItemSlot"] = values;
|
||||
data["ItemSlotActive"] = active;
|
||||
data["ItemSlotActive"] = g_session.ItemSlotActive();
|
||||
}
|
||||
|
||||
// OFFSET: 0x009A50E0
|
||||
|
|
|
|||
|
|
@ -399,6 +399,5 @@ static_assert(sizeof(UnusedWndInfoC) == 0x14);
|
|||
extern int g_defaultPlacementWidth;
|
||||
extern int g_defaultPlacementHeight;
|
||||
|
||||
void ExportNormalItemSlots(Json::Value& data, const NormalItemSlot* slots, const NormalItemSlotWindow& window, bool active);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@
|
|||
#include "Contents/Configuration/ServiceOptions.h"
|
||||
#include "Contents/Items/ItemNaming.h"
|
||||
#include "Contents/PlayerNameDictionary.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "UI/Edit/UIItemTagCtrl.h"
|
||||
#include "UI/Window/WindowBorder.h"
|
||||
#include "UI/Window/UINewSelectCharWnd.h"
|
||||
|
|
@ -4217,7 +4216,7 @@ void UISkillListWnd::Slot25(int x, int y) {
|
|||
if (mode) {
|
||||
mode->drag.BeginSkill(
|
||||
g_windowMgr, ResourceMgr::Instance(), 8, skill.id, skill.name,
|
||||
reinterpret_cast<CharacterConfigSave*>(&g_session)->SkillLevel(skill.id), -1
|
||||
g_session.SkillLevel(skill.id), -1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ UIBitmapButton* UIEmotionWnd::AddCloseButton(const char* tooltip, int width) {
|
|||
// FUNCTION: fn_11644
|
||||
void UIEmotionWnd::Slot15(int, int) {
|
||||
int y = 23;
|
||||
auto* emotions = reinterpret_cast<EmotionHotkeys*>(&g_session.unknown_0FF8);
|
||||
auto* emotions = &g_session.m_emotionHotkeys;
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
UIEditCtrl2* edit = new UIEditCtrl2();
|
||||
|
|
@ -172,7 +172,7 @@ void UIEmotionWnd::Slot11() {
|
|||
this->m_saved->height = this->geometry.height;
|
||||
}
|
||||
|
||||
std::string* macros = reinterpret_cast<std::string*>(reinterpret_cast<char*>(&g_session) + 0xFF8);
|
||||
std::string* macros = g_session.m_emotionHotkeys.current.data();
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
const char* text = this->m_edits[i]->Text();
|
||||
std::string value(text, std::strlen(text));
|
||||
|
|
@ -181,8 +181,5 @@ void UIEmotionWnd::Slot11() {
|
|||
}
|
||||
}
|
||||
|
||||
g_accountLinkedUserDataMgr->Save(
|
||||
*reinterpret_cast<EmotionHotkeys*>(&g_session.unknown_0FF8), *g_luaScript, g_session.m_aid, GetRenderSystemHolder()->system,
|
||||
reinterpret_cast<const char*>(&g_session.unknown_807C[8]), *g_asyncWorkMgr
|
||||
);
|
||||
g_accountLinkedUserDataMgr->Save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "Contents/Configuration/ServiceConfiguration.h"
|
||||
#include "Contents/GuildMgr.h"
|
||||
#include "Contents/MessageTable.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Contents/UserData/NormalItemSlots.h"
|
||||
#include "File/ShortcutFilename.h"
|
||||
#include "Resource/Bitmap/BitmapResource.h"
|
||||
|
|
@ -1617,7 +1616,7 @@ void UIGuildSkillWnd::Slot25(int x, int y) {
|
|||
if (skill.available != 0 && skill.level != 0 && skill.unknown_000C != 0) {
|
||||
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
|
||||
if (gameMode) {
|
||||
int level = reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill.id);
|
||||
int level = g_session.UseLevel(skill.id);
|
||||
if (level == 0) {
|
||||
level = skill.level;
|
||||
}
|
||||
|
|
@ -2109,7 +2108,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st
|
|||
case 259: {
|
||||
CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 253);
|
||||
if (skill.available != 0) {
|
||||
int level = reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill.id) - 1;
|
||||
int level = g_session.UseLevel(skill.id) - 1;
|
||||
if (level <= 0) {
|
||||
level = 1;
|
||||
}
|
||||
|
|
@ -2130,7 +2129,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st
|
|||
case 266: {
|
||||
CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 260);
|
||||
if (skill.available != 0) {
|
||||
int level = reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill.id) + 1;
|
||||
int level = g_session.UseLevel(skill.id) + 1;
|
||||
if (level <= 0) {
|
||||
level = 1;
|
||||
}
|
||||
|
|
@ -2229,7 +2228,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st
|
|||
case 58: {
|
||||
const CSkillInfo* skill = reinterpret_cast<const CSkillInfo*>(a1);
|
||||
if (skill->level != 0) {
|
||||
g_modeMgr.gameMode->SendMsg(113, a1, reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill->id), 0, 0);
|
||||
g_modeMgr.gameMode->SendMsg(113, a1, g_session.UseLevel(skill->id), 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include "Contents/Items/ItemNaming.h"
|
||||
#include "Contents/MessageTable.h"
|
||||
#include "Contents/PlayerNameDictionary.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "UI/UIBasicCtrl.h"
|
||||
#include "UI/Window/UINewSelectCharWnd.h"
|
||||
#include "UI/Window/UIWindowMgr.h"
|
||||
|
|
@ -231,7 +230,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen
|
|||
if (skill.available != 0 && skill.level != 0) {
|
||||
entry.id = skill.id;
|
||||
entry.skill = 1;
|
||||
if (reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(static_cast<int>(skill.id)) == 0) {
|
||||
if (g_session.UseLevel(static_cast<int>(skill.id)) == 0) {
|
||||
entry.count = static_cast<std::int16_t>(skill.level);
|
||||
} else {
|
||||
entry.count = source.unknown_0005;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Client/Input/Mouse.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Client/Mode/ModeDragState.h"
|
||||
#include "Client/Mode/ModeEvents.h"
|
||||
#include "Client/Mode/CMode.h"
|
||||
|
|
@ -414,7 +413,7 @@ int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::
|
|||
}
|
||||
}
|
||||
|
||||
if (skill.available != 0 && skill.level != 0 && reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(static_cast<int>(skill.id)) == 0) {
|
||||
if (skill.available != 0 && skill.level != 0 && g_session.UseLevel(static_cast<int>(skill.id)) == 0) {
|
||||
slot.unknown_0005 = static_cast<std::int16_t>(skill.level);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,20 +121,8 @@ int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen
|
|||
}
|
||||
|
||||
if (id == 0x173) {
|
||||
union SaveSlot {
|
||||
void (CCharacterLinkedUserDataMgr::*member)(CharacterConfigSave&, const char*, CAsyncWorkMgr&);
|
||||
void (__thiscall* function)(CCharacterLinkedUserDataMgr*);
|
||||
};
|
||||
SaveSlot saveSlot;
|
||||
saveSlot.member = &CCharacterLinkedUserDataMgr::Save;
|
||||
saveSlot.function(g_characterLinkedUserDataMgr);
|
||||
union StopSlot {
|
||||
void (CAdventurerAgencyMgr::*member)();
|
||||
void (__thiscall* function)(CAdventurerAgencyMgr*);
|
||||
};
|
||||
StopSlot stopSlot;
|
||||
stopSlot.member = static_cast<void (CAdventurerAgencyMgr::*)()>(&CAdventurerAgencyMgr::RequestStop);
|
||||
stopSlot.function(g_adventurerAgencyMgr);
|
||||
g_characterLinkedUserDataMgr->Save();
|
||||
g_adventurerAgencyMgr->RequestStop();
|
||||
mode->SendMsg(0x19, 1, 0, 0, 0);
|
||||
g_windowMgr.CloseWindow(0x9B);
|
||||
g_windowMgr.CloseWindow(0xA4);
|
||||
|
|
|
|||
|
|
@ -655,10 +655,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg
|
|||
break;
|
||||
}
|
||||
case 0xB9:
|
||||
g_accountLinkedUserDataMgr->Save(
|
||||
*reinterpret_cast<EmotionHotkeys*>(&g_session.unknown_0FF8), *g_luaScript, g_session.m_aid, GetRenderSystemHolder()->system,
|
||||
reinterpret_cast<const char*>(&g_session.unknown_807C[8]), *g_asyncWorkMgr
|
||||
);
|
||||
g_accountLinkedUserDataMgr->Save();
|
||||
if (g_loginModeFlag == 1) {
|
||||
if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) {
|
||||
static_cast<CMode*>(g_charViewMode)->SendMsg(0x271B, 0, 0, 0, 0);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "Contents/Skills/AutomaticSkills.h"
|
||||
#include "Contents/Hotkeys/HotkeyInfo.h"
|
||||
#include "Contents/Skills/SkillId.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Contents/UserData/NormalItemSlots.h"
|
||||
#include "Render/Renderer.h"
|
||||
#include "Resource/Bitmap/BitmapResource.h"
|
||||
|
|
@ -334,7 +333,7 @@ void UINewSkillListWnd::sub_9AF300() {
|
|||
|
||||
int levelX;
|
||||
if (usesLevel) {
|
||||
int useLevel = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(static_cast<int>(skill.id));
|
||||
int useLevel = g_session.UseLevel(static_cast<int>(skill.id));
|
||||
if (useLevel <= 0 || useLevel > skill.level) {
|
||||
useLevel = skill.level;
|
||||
}
|
||||
|
|
@ -355,7 +354,7 @@ void UINewSkillListWnd::sub_9AF300() {
|
|||
std::sprintf(text, LookupMessage(286));
|
||||
} else {
|
||||
int sp = static_cast<int>(skill.unknown_0014);
|
||||
const int useLevel = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(static_cast<int>(skill.id));
|
||||
const int useLevel = g_session.UseLevel(static_cast<int>(skill.id));
|
||||
bool found = false;
|
||||
if (usesLevel) {
|
||||
const std::uint32_t id = skill.id;
|
||||
|
|
@ -992,7 +991,7 @@ void UINewSkillListWnd::Slot25(int x, int y) {
|
|||
if (skill.available != 0 && skill.level != 0 && skill.unknown_000C != 0) {
|
||||
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
|
||||
if (gameMode) {
|
||||
int level = reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill.id);
|
||||
int level = g_session.UseLevel(skill.id);
|
||||
if (level == 0) {
|
||||
level = skill.level;
|
||||
}
|
||||
|
|
@ -1359,7 +1358,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s
|
|||
const unsigned int slot = offset > 41 ? static_cast<unsigned int>(a) : offset;
|
||||
CSkillInfo skill = this->SkillAt(this->m_columns * this->m_firstRow + slot, false);
|
||||
if (skill.available != 0) {
|
||||
const int current = reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill.id);
|
||||
const int current = g_session.UseLevel(skill.id);
|
||||
int level = offset > 41 ? current - 1 : current + 1;
|
||||
if (level <= 0) {
|
||||
level = 1;
|
||||
|
|
@ -1462,7 +1461,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s
|
|||
case 58: {
|
||||
const CSkillInfo* skill = reinterpret_cast<const CSkillInfo*>(a);
|
||||
if (skill->level != 0) {
|
||||
gameMode->SendMsg(113, a, reinterpret_cast<CharacterConfigSave*>(&g_session)->UseLevel(skill->id), 0, 0);
|
||||
gameMode->SendMsg(113, a, g_session.UseLevel(skill->id), 0, 0);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1690,7 +1689,7 @@ void UINewSkillListWnd::sub_9AF960() {
|
|||
const int width = this->TextWidth(text, 0, 0, 11, 1, 0);
|
||||
DrawOutlinedText(*this, (24 - width) / 2 + x + 4, textY, text, 0, (blue << 8 | green) << 8 | red, 0xFFFFFF, 0, 11, 1, 0);
|
||||
} else {
|
||||
int useLevel = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(static_cast<int>(skill.id));
|
||||
int useLevel = g_session.UseLevel(static_cast<int>(skill.id));
|
||||
if (useLevel <= 0 || useLevel > skill.level) {
|
||||
useLevel = skill.level;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1463,7 +1463,7 @@ bool UIWindowMgr::ProcessKeyDown(int key, int keyData, int pressed) {
|
|||
// FUNCTION: fn_17224
|
||||
void UIWindowMgr::SendEmotionHotkey(int index) {
|
||||
char text[256];
|
||||
const EmotionHotkeys* emotions = reinterpret_cast<const EmotionHotkeys*>(&g_session.unknown_0FF8);
|
||||
const EmotionHotkeys* emotions = &g_session.m_emotionHotkeys;
|
||||
std::strcpy(text, emotions->current[index].c_str());
|
||||
|
||||
if (g_windowMgr.unknown_01DC != nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue