rodecomp/Source/Contents/Configuration/GameSettingsMgr.h
ragnarok-clanker f8d3e8622d Maintenance: Rename placeholder sub_XXXXXX functions to evidence-based names (Lua registration strings, log/error strings, packet ids
Batch #13412 by ragnarok-clanker: no function's compiled code changes; checked with 592 compiled unit(s), including every includer of Source/Client/Mode/CGameMode.h, Source/Client/Session.h, Source/Contents/Actors/GameActor.h, Source/Contents/CashEmotionMgr.h, Source/Contents/ClientItemLists.h, Source/Contents/ClientState.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/Items/ItemInfo.h, Source/Contents/NavigationManager.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/Schedule/TimeScheduler.h, Source/Contents/WorldView/WorldViewData.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UITagListBox.h, Source/UI/Quest/UIOngoingQuestInfo.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Text/UIAchWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UIIngredientInfoWnd.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/Utility/JsonCppLoader.h.
2026-11-06 16:30:12 +00:00

61 lines
1.8 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_CONFIGURATION_GAMESETTINGSMGR_H
#define RAGNAROK_SOURCE_CONTENTS_CONFIGURATION_GAMESETTINGSMGR_H
#include "Contents/Skills/PlayerSkillBundle.h"
#include "Script/LuaInstance.h"
#include "Utility/Singleton.h"
#include <cstddef>
#include <cstdint>
#include <functional>
#include <list>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
struct GameSettingsOption {
/* 0000 */ int id = 300;
/* 0004 */ int tab;
/* 0008 */ int type;
/* 000C */ std::string title;
/* 0024 */ std::string tooltip;
/* 003C */ int tipBoxId = 0;
/* 0040 */ std::string description;
/* 0058 */ unsigned char defaultValue;
/* 0059 */ unsigned char unknown_0059[3];
/* 005C */ int unknown_005c = 4698;
/* 0060 */ int unknown_0060 = 4698;
};
class CGameSettingsMgr : public Singleton<CGameSettingsMgr>, public CLuaInstance {
public:
CGameSettingsMgr();
~CGameSettingsMgr() override;
/* 000C */ std::vector<GameSettingsOption> options;
/* 0018 */ std::unordered_map<std::uint32_t, std::function<void(int, unsigned char, bool, int, int)>, SkillIdHash> actions;
/* 0038 */ std::unordered_map<std::uint32_t, std::function<void()>, SkillIdHash> functions;
bool Load();
bool LoadSettings();
bool ReadOptionTable();
void ResetToDefaults();
void ToggleOption(int id);
void SetOption(int id, unsigned char value, bool notify);
void ApplyScriptOption(int id, const char* key);
bool RunFunction(int id);
std::optional<GameSettingsOption*> FindOption(int id);
std::list<int> GetOptionIds(int tab);
};
using GameSettings = CGameSettingsMgr;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(GameSettingsOption) == 0x64);
static_assert(offsetof(GameSettingsOption, defaultValue) == 0x58);
static_assert(offsetof(GameSettings, options) == 0x0C);
static_assert(sizeof(GameSettings) == 0x58);
#endif
#endif