Batch #15141 by ragnarok-clanker: no function's compiled code changes; checked with 537 compiled unit(s), including every includer of Source/Client/Input/LanguageTC.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Contents/AchievementMgr.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/Pc.h, Source/Contents/EnchantMgr.h, Source/Contents/GuildInfo.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Schedule/TimeScheduler.h, Source/Contents/Sound/SoundMgr.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TableMng.h, Source/Contents/World/SkyBox.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIReplayRECControlWnd.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl.
98 lines
3.2 KiB
C++
98 lines
3.2 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_ACHIEVEMENTMGR_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_ACHIEVEMENTMGR_H
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
struct lua_State;
|
|
|
|
struct AchievementReward {
|
|
// INLINED
|
|
AchievementReward(std::string text, int unknown0018, int unknown001C) {
|
|
this->text = text;
|
|
this->targetCount = unknown0018;
|
|
this->conditionId = unknown001C;
|
|
}
|
|
|
|
/* 0000 */ std::string text;
|
|
/* 0018 */ int targetCount;
|
|
/* 001C */ int conditionId;
|
|
};
|
|
|
|
struct AchievementInfo {
|
|
// INLINED
|
|
AchievementInfo() {
|
|
}
|
|
// INLINED
|
|
AchievementInfo(std::string title, std::string unknown0018, std::string description, int points)
|
|
: title(title), summaryText(unknown0018), description(description), points(points) {
|
|
}
|
|
|
|
/* 0000 */ std::string title;
|
|
/* 0018 */ std::string summaryText;
|
|
/* 0030 */ std::string description;
|
|
/* 0048 */ int points;
|
|
/* 004C */ int rewardItemId = -1;
|
|
/* 0050 */ int rewardTitleId = -1;
|
|
/* 0054 */ int rewardBuffId = -1;
|
|
/* 0058 */ std::vector<AchievementReward> rewards;
|
|
/* 0064 */ int progressMode;
|
|
/* 0068 */ std::string iconName;
|
|
};
|
|
|
|
static_assert(sizeof(AchievementInfo) == 0x80);
|
|
|
|
class CAchievementMgr {
|
|
public:
|
|
// INLINED
|
|
CAchievementMgr() : enabled(true), groupWidth(10) {
|
|
}
|
|
// INLINED
|
|
virtual ~CAchievementMgr() {
|
|
this->achievements.clear();
|
|
this->groups.clear();
|
|
}
|
|
|
|
static bool CreateInstance();
|
|
static void DestroyInstance();
|
|
bool LoadAchievementInfo();
|
|
|
|
/* 0004 */ bool enabled;
|
|
/* 0008 */ int groupWidth;
|
|
/* 000C */ std::map<int, AchievementInfo> achievements;
|
|
/* 0014 */ std::map<int, std::vector<int>> groups;
|
|
|
|
bool GetAchievement(AchievementInfo& out, int id);
|
|
std::string GetIconName(int id);
|
|
bool GetGroupAchievements(std::map<int, AchievementInfo>& out, int group, int index);
|
|
int GetPoints(int id);
|
|
std::string GetSummaryText(int id);
|
|
int GetRewardTitleId(int id);
|
|
int GetAchievementCount(int group, int index);
|
|
int GetCompletedCount(int group, int index);
|
|
bool FindTab(int id, int& group, int& index);
|
|
std::pair<bool, std::string> InsertAchieveInfo(int id, std::string title, std::string unknown0018, std::string description, int points);
|
|
std::pair<bool, std::string> InsertAchieveResource(int id, std::string text, int unknown0018, int unknown001C);
|
|
std::pair<bool, std::string> InsertAchieveRewardBuff(int id, int value);
|
|
std::pair<bool, std::string> InsertAchieveRewardItem(int id, int value);
|
|
std::pair<bool, std::string> InsertAchieveRewardTitle(int id, int value);
|
|
std::pair<bool, std::string> InsertAchieveUIType(int id, int type, std::string text);
|
|
bool HasReward(int id);
|
|
std::pair<bool, std::string> SetAchieveTab(int id, int group, int index);
|
|
|
|
static int L_InsertAchieveInfo(lua_State* state);
|
|
static int L_InsertAchieveResource(lua_State* state);
|
|
static int L_InsertAchieveRewardBuff(lua_State* state);
|
|
static int L_InsertAchieveRewardItem(lua_State* state);
|
|
static int L_InsertAchieveRewardTitle(lua_State* state);
|
|
static int L_InsertAchieveUIType(lua_State* state);
|
|
static int L_SetAchieveIDByTab(lua_State* state);
|
|
};
|
|
|
|
static_assert(sizeof(CAchievementMgr) == 0x1C);
|
|
|
|
extern CAchievementMgr* g_achievementMgr;
|
|
|
|
#endif
|