feat(Core/Player): Implement player specific settings (#9483)

This commit is contained in:
Skjalf
2021-12-26 08:39:15 -03:00
committed by GitHub
parent d2950b21b9
commit 58302e4196
19 changed files with 381 additions and 8 deletions

View File

@@ -31,6 +31,7 @@
#include "ObjectMgr.h"
#include "Optional.h"
#include "PetDefines.h"
#include "PlayerSettings.h"
#include "PlayerTaxi.h"
#include "QuestDef.h"
#include "SpellMgr.h"
@@ -875,6 +876,7 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS = 32,
PLAYER_LOGIN_QUERY_LOAD_BREW_OF_THE_MONTH = 34,
PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION = 35,
PLAYER_LOGIN_QUERY_LOAD_CHARACTER_SETTINGS = 36,
MAX_PLAYER_LOGIN_QUERY
};
@@ -2598,6 +2600,10 @@ public:
std::string GetPlayerName();
// Settings
[[nodiscard]] PlayerSetting GetPlayerSetting(std::string source, uint8 index);
void UpdatePlayerSetting(std::string source, uint8 index, uint32 value);
protected:
// Gamemaster whisper whitelist
WhisperListContainer WhisperList;
@@ -2680,6 +2686,7 @@ public:
void _LoadTalents(PreparedQueryResult result);
void _LoadInstanceTimeRestrictions(PreparedQueryResult result);
void _LoadBrewOfTheMonth(PreparedQueryResult result);
void _LoadCharacterSettings(PreparedQueryResult result);
/*********************************************************/
/*** SAVE SYSTEM ***/
@@ -2703,6 +2710,7 @@ public:
void _SaveStats(CharacterDatabaseTransaction trans);
void _SaveCharacter(bool create, CharacterDatabaseTransaction trans);
void _SaveInstanceTimeRestrictions(CharacterDatabaseTransaction trans);
void _SavePlayerSettings(CharacterDatabaseTransaction trans);
/*********************************************************/
/*** ENVIRONMENTAL SYSTEM ***/
@@ -2955,6 +2963,8 @@ private:
WorldLocation _corpseLocation;
Optional<float> _farSightDistance = { };
PlayerSettingMap m_charSettingsMap;
};
void AddItemsSetItem(Player* player, Item* item);