DayZ 1.24
Loading...
Searching...
No Matches
MenuDefaultCharacterData Class Reference
Collaboration diagram for MenuDefaultCharacterData:
[legend]

Private Member Functions

void MenuDefaultCharacterData ()
 
void Init ()
 
void ClearAttachmentsMap ()
 
void SetDefaultAttachment (int slotID, string type)
 
void GenerateRandomEquip ()
 
void EquipDefaultCharacter (Man player)
 
void SerializeCharacterData (ParamsWriteContext ctx)
 serializes data into a param array to be used by "StoreLoginData(notnull array<ref Param> params);"
 
bool DeserializeCharacterData (ParamsReadContext ctx)
 
void SetCharacterName (string name)
 
string GetCharacterName ()
 
void SetCharacterType (string character_type)
 
string GetCharacterType ()
 
void SetRandomCharacterForced (bool state)
 
bool IsRandomCharacterForced ()
 
map< int, stringGetAttachmentMap ()
 
void DumpAttMapContents ()
 

Private Attributes

string m_CharacterName
 
string m_CharacterType
 
ref map< int, stringm_AttachmentsMap
 
bool m_ForceRandomCharacter
 

Detailed Description

Definition at line 945 of file gameplay.c.

Constructor & Destructor Documentation

◆ MenuDefaultCharacterData()

void MenuDefaultCharacterData::MenuDefaultCharacterData ( )
inlineprivate

Definition at line 955 of file gameplay.c.

956 {
957 Init();
958 }

References Init().

Member Function Documentation

◆ ClearAttachmentsMap()

void MenuDefaultCharacterData::ClearAttachmentsMap ( )
inlineprivate

Definition at line 967 of file gameplay.c.

968 {
969 m_AttachmentsMap.Clear();
970 }
ref map< int, string > m_AttachmentsMap
Definition gameplay.c:952

References m_AttachmentsMap.

Referenced by GenerateRandomEquip().

◆ DeserializeCharacterData()

bool MenuDefaultCharacterData::DeserializeCharacterData ( ParamsReadContext ctx)
inlineprivate

Definition at line 1038 of file gameplay.c.

1039 {
1040 if (!ctx.Read(m_CharacterType))
1041 return false;
1042 if (!ctx.Read(m_AttachmentsMap))
1043 return false;
1044 if (!ctx.Read(m_ForceRandomCharacter))
1045 return false;
1046 if (!ctx.Read(m_CharacterName))
1047 return false;
1048
1049 //DumpAttMapContents();
1050 return true;
1051 }

References m_AttachmentsMap, m_CharacterName, m_CharacterType, and m_ForceRandomCharacter.

◆ DumpAttMapContents()

void MenuDefaultCharacterData::DumpAttMapContents ( )
inlineprivate

Definition at line 1089 of file gameplay.c.

1090 {
1091 int debugID;
1092 string debugType;
1093 Print("-----------");
1094 Print("m_AttachmentsMap contents:");
1095 for (int j = 0; j < m_AttachmentsMap.Count(); j++)
1096 {
1097 debugID = m_AttachmentsMap.GetKey(j);
1098 debugType = m_AttachmentsMap.GetElement(j);
1099 Print("index " + j);
1100 Print("debugID: " + debugID);
1101 Print("debugType: " + debugType);
1102 }
1103 Print("-----------");
1104 }
proto void Print(void var)
Prints content of variable to console/log.

References m_AttachmentsMap, and Print().

◆ EquipDefaultCharacter()

void MenuDefaultCharacterData::EquipDefaultCharacter ( Man player)
inlineprivate

Definition at line 995 of file gameplay.c.

996 {
997 if (!player)
998 {
999 ErrorEx("WARNING - trying to equip non-existent object! | MenuDefaultCharacterData::EquipDefaultCharacter");
1000 return;
1001 }
1002
1003 int slot_ID;
1004 string attachment_type;
1007
1008 for (int i = 0; i < m_AttachmentsMap.Count(); i++)
1009 {
1010 attachment_type = "";
1012 slot_ID = m_AttachmentsMap.GetKey(i);
1013 attachment_type = m_AttachmentsMap.GetElement(i); //Get(i)
1014 current_attachment_object = player.GetInventory().FindAttachment(slot_ID);
1015
1019 {
1021 g_Game.ObjectDelete(current_attachment_object);
1022 if (attachment_type != "")
1023 player.GetInventory().CreateAttachmentEx(attachment_type, slot_ID);
1024 }
1025 }
1026 }
DayZGame g_Game
Definition DayZGame.c:3528
enum ShapeType ErrorEx

References ErrorEx, g_Game, and m_AttachmentsMap.

◆ GenerateRandomEquip()

void MenuDefaultCharacterData::GenerateRandomEquip ( )
inlineprivate

Definition at line 977 of file gameplay.c.

978 {
980
981 int slot_ID;
982 string attachment_type;
983 for (int i = 0; i < DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Count(); i++)
984 {
985 slot_ID = DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Get(i);
986 if (DefaultCharacterCreationMethods.GetConfigArrayCountFromSlotID(slot_ID) > 0)
987 {
988 attachment_type = DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).GetRandomElement();
989 //if (attachment_type != "")
991 }
992 }
993 }
void SetDefaultAttachment(int slotID, string type)
Definition gameplay.c:972

References ClearAttachmentsMap(), Count, and SetDefaultAttachment().

◆ GetAttachmentMap()

map< int, string > MenuDefaultCharacterData::GetAttachmentMap ( )
inlineprivate

Definition at line 1083 of file gameplay.c.

1084 {
1085 return m_AttachmentsMap;
1086 }

References m_AttachmentsMap.

◆ GetCharacterName()

string MenuDefaultCharacterData::GetCharacterName ( )
inlineprivate

Definition at line 1058 of file gameplay.c.

1059 {
1060 return m_CharacterName;
1061 }

References m_CharacterName.

◆ GetCharacterType()

string MenuDefaultCharacterData::GetCharacterType ( )
inlineprivate

Definition at line 1068 of file gameplay.c.

1069 {
1070 return m_CharacterType;
1071 }

References m_CharacterType.

◆ Init()

void MenuDefaultCharacterData::Init ( )
inlineprivate

Definition at line 960 of file gameplay.c.

961 {
962 if (!GetGame().IsDedicatedServer())
963 GetGame().GetMenuData().LoadCharactersLocal();
965 }
proto native CGame GetGame()

References GetGame(), and m_AttachmentsMap.

Referenced by MenuDefaultCharacterData().

◆ IsRandomCharacterForced()

bool MenuDefaultCharacterData::IsRandomCharacterForced ( )
inlineprivate

Definition at line 1078 of file gameplay.c.

1079 {
1081 }

References m_ForceRandomCharacter.

◆ SerializeCharacterData()

void MenuDefaultCharacterData::SerializeCharacterData ( ParamsWriteContext ctx)
inlineprivate

serializes data into a param array to be used by "StoreLoginData(notnull array<ref Param> params);"

Definition at line 1029 of file gameplay.c.

1030 {
1031 ctx.Write(m_CharacterType);
1032 ctx.Write(m_AttachmentsMap);
1034 ctx.Write(m_CharacterName);
1035 //DumpAttMapContents();
1036 }

References m_AttachmentsMap, m_CharacterName, m_CharacterType, and m_ForceRandomCharacter.

Referenced by MenuData::OnSetDefaultCharacter(), and CGame::StoreLoginDataPrepare().

◆ SetCharacterName()

void MenuDefaultCharacterData::SetCharacterName ( string name)
inlineprivate

Definition at line 1053 of file gameplay.c.

1054 {
1056 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo

References m_CharacterName, and name.

◆ SetCharacterType()

void MenuDefaultCharacterData::SetCharacterType ( string character_type)
inlineprivate

Definition at line 1063 of file gameplay.c.

1064 {
1066 }

References m_CharacterType.

◆ SetDefaultAttachment()

void MenuDefaultCharacterData::SetDefaultAttachment ( int slotID,
string type )
inlineprivate

Definition at line 972 of file gameplay.c.

973 {
974 m_AttachmentsMap.Set(slotID, type); //using 'Set' instead of 'Insert' for convenience
975 }

References m_AttachmentsMap.

Referenced by GenerateRandomEquip().

◆ SetRandomCharacterForced()

void MenuDefaultCharacterData::SetRandomCharacterForced ( bool state)
inlineprivate

Definition at line 1073 of file gameplay.c.

1074 {
1076 }

References m_ForceRandomCharacter.

Member Data Documentation

◆ m_AttachmentsMap

◆ m_CharacterName

string MenuDefaultCharacterData::m_CharacterName
private

◆ m_CharacterType

string MenuDefaultCharacterData::m_CharacterType
private

◆ m_ForceRandomCharacter

bool MenuDefaultCharacterData::m_ForceRandomCharacter
private

The documentation for this class was generated from the following file: