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.
81 lines
2.4 KiB
C++
81 lines
2.4 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_REPUTEMGR_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_REPUTEMGR_H
|
|
|
|
#include "Contents/ReputeRecords.h"
|
|
#include "Script/LuaInstance.h"
|
|
#include "Utility/Singleton.h"
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
enum ReputeVisibility : std::int64_t {
|
|
REPUTE_VISIBLE = 0,
|
|
REPUTE_HIDDEN = 1,
|
|
REPUTE_VISIBLE_WITH_POINT = 2,
|
|
};
|
|
|
|
struct ReputeInfo {
|
|
/* 0000 */ std::string name;
|
|
/* 0018 */ std::uint64_t unknown_0018;
|
|
/* 0020 */ std::uint64_t unknown_0020;
|
|
/* 0028 */ ReputeVisibility visibility;
|
|
/* 0030 */ std::int64_t point;
|
|
/* 0038 */ bool updated;
|
|
};
|
|
|
|
struct ReputeGroup {
|
|
/* 0000 */ std::string name;
|
|
/* 0018 */ std::vector<std::uint64_t> reputes;
|
|
};
|
|
|
|
class CReputeMgr : public Singleton<CReputeMgr> {
|
|
friend class UIReputeWnd;
|
|
|
|
public:
|
|
CReputeMgr();
|
|
std::vector<std::string> GetGroupNames() const;
|
|
std::vector<const ReputeInfo*> GetGroupReputes(const std::string& groupName) const;
|
|
std::vector<const ReputeInfo*> GetAllReputes() const;
|
|
bool Load();
|
|
bool LoadReputeGroupData(std::map<std::uint64_t, ReputeGroup>& groups);
|
|
bool LoadReputeInfoData(std::map<std::uint64_t, ReputeInfo>& infos);
|
|
void OpenRepute(std::uint64_t groupId, std::uint64_t reputeId);
|
|
void SetPoint(std::uint64_t id, std::int64_t point);
|
|
std::vector<const ReputeInfo*> FindReputes(const std::string& keyword) const;
|
|
void SetPointsReceived(bool received);
|
|
|
|
struct GroupInserter {
|
|
/* 0000 */ CReputeMgr* manager;
|
|
/* 0004 */ std::map<std::uint64_t, ReputeGroup>* dest;
|
|
|
|
void operator()(const std::pair<const int, ReputeGroupRecord>& entry) const;
|
|
};
|
|
|
|
struct InfoInserter {
|
|
/* 0000 */ CReputeMgr* manager;
|
|
/* 0004 */ std::map<std::uint64_t, ReputeInfo>* dest;
|
|
|
|
void operator()(const std::pair<const int, ReputeInfoRecord>& entry) const;
|
|
};
|
|
|
|
protected:
|
|
/* 0004 */ std::map<std::uint64_t, ReputeInfo> m_infos;
|
|
/* 000C */ std::map<std::uint64_t, ReputeGroup> m_groups;
|
|
/* 0014 */ bool m_waitingForPoints = true;
|
|
/* 0018 */ CLuaInstance m_lua;
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(ReputeInfo) == 0x40);
|
|
static_assert(offsetof(ReputeInfo, visibility) == 0x28);
|
|
static_assert(offsetof(ReputeInfo, point) == 0x30);
|
|
static_assert(offsetof(ReputeInfo, updated) == 0x38);
|
|
static_assert(sizeof(ReputeGroup) == 0x24);
|
|
static_assert(sizeof(CReputeMgr) == 0x20);
|
|
#endif
|
|
|
|
#endif
|