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

Private Member Functions

override string GetFileName ()
 
string GetPathScenes ()
 
override string GetFileName ()
 
override void OnInit ()
 
TStringArray GetSceneList ()
 
void SceneSave (SceneData scene)
 

Private Attributes

const string FILE_ROOT = "$saves:"
 
const string FILE_ROOT_SCENES = "Scenes"
 
const string PARAM_MISSION = "Mission"
 
const string PARAM_TIME = "InitTime"
 
const string PARAM_RAIN = "InitWeatherRain"
 
const string PARAM_FOG = "InitWeatherFog"
 
const string PARAM_OBJ_COUNT = "SceneObjectsCount"
 
const string PARAM_OBJ_NAME = "SceneObject"
 
string m_FileSceneName
 

Detailed Description

Definition at line 1 of file PluginAdditionalInfo.c.

Member Function Documentation

◆ GetFileName() [1/2]

override string PluginLocalProfile::GetFileName ( )
inlineprivate

Definition at line 3 of file PluginAdditionalInfo.c.

4 {
6 }
const string CFG_FILE_ADDITIONAL_INFO
Definition constants.c:238

References CFG_FILE_ADDITIONAL_INFO.

Referenced by PluginFileHandler::LoadConfigFile().

◆ GetFileName() [2/2]

override string PluginLocalProfile::GetFileName ( )
inlineprivate

Definition at line 42 of file PluginLocalProfileScene.c.

43 {
44 string file_name = GetPathScenes() + "\\" + m_FileSceneName;
45 return file_name;
46 }

◆ GetPathScenes()

string PluginLocalProfile::GetPathScenes ( )
inlineprivate

Definition at line 34 of file PluginLocalProfileScene.c.

35 {
36 return FILE_ROOT + "\\" + FILE_ROOT_SCENES;
37 }

◆ GetSceneList()

TStringArray PluginLocalProfile::GetSceneList ( )
inlineprivate

Definition at line 59 of file PluginLocalProfileScene.c.

60 {
63
64 string file_name;
65 int file_attr;
66 int flags;
68
69 string path_find_pattern = GetPathScenes() + "/*.scene";
71
72 bool found = true;
73 while (found)
74 {
75 list.Insert(file_name);
76
78 }
79
80 return list;
81 }
array< string > TStringArray
Definition EnScript.c:666
proto native bool MakeDirectory(string name)
Makes a directory.
enum FindFileFlags FindFile(string pattern, out string fileName, out FileAttr fileAttributes, FindFileFlags flags)
proto bool FindNextFile(FindFileHandle handle, out string fileName, out FileAttr fileAttributes)
proto bool FileExist(string name)
Check existence of file.

References FileExist(), FindFile(), FindNextFile(), and MakeDirectory().

◆ OnInit()

override void PluginLocalProfile::OnInit ( )
inlineprivate

Definition at line 51 of file PluginLocalProfileScene.c.

52 {
53 super.OnInit();
54 }

◆ SceneSave()

void PluginLocalProfile::SceneSave ( SceneData scene)
inlineprivate

Definition at line 86 of file PluginLocalProfileScene.c.

87 {
88 m_FileSceneName = scene.GetNameScene() + ".scene";
89
90 array<ref SceneObject> objects = scene.GetSceneObjects();
91
92 // Save Mission Name
93 SetParameterString(PARAM_MISSION, scene.GetNameMission(), false);
94 //Save Init Time
95 SetParameterFloat(PARAM_TIME, scene.GetInitTime(), false);
96 //Save Init Weather Rain
97 SetParameterFloat(PARAM_RAIN, scene.GetInitRain(), false);
98 //Save Init Weather Rain
99 SetParameterFloat(PARAM_FOG, scene.GetInitFog(), false);
100 // Save Count Of missions
101 SetParameterInt(PARAM_OBJ_COUNT, objects.Count(), false);
102
103
104 for (int i = 0; i < objects.Count(); ++i)
105 {
106 SceneObject obj = objects.Get(i);
107
108 string param_name = PARAM_OBJ_NAME + "_" + i.ToString();
110 SetSubParameterInArray(param_name, 0, "ClassName", obj.GetTypeName(), false);
111 }
112
113
114 SaveConfigToFile();
115 }
string GetTypeName()
proto void Print(void var)
Prints content of variable to console/log.

References SceneObject::GetTypeName(), and Print().

Member Data Documentation

◆ FILE_ROOT

const string PluginLocalProfile::FILE_ROOT = "$saves:"
private

Definition at line 20 of file PluginLocalProfileScene.c.

◆ FILE_ROOT_SCENES

const string PluginLocalProfile::FILE_ROOT_SCENES = "Scenes"
private

Definition at line 21 of file PluginLocalProfileScene.c.

◆ m_FileSceneName

string PluginLocalProfile::m_FileSceneName
private

Definition at line 29 of file PluginLocalProfileScene.c.

◆ PARAM_FOG

const string PluginLocalProfile::PARAM_FOG = "InitWeatherFog"
private

Definition at line 25 of file PluginLocalProfileScene.c.

◆ PARAM_MISSION

const string PluginLocalProfile::PARAM_MISSION = "Mission"
private

Definition at line 22 of file PluginLocalProfileScene.c.

◆ PARAM_OBJ_COUNT

const string PluginLocalProfile::PARAM_OBJ_COUNT = "SceneObjectsCount"
private

Definition at line 26 of file PluginLocalProfileScene.c.

◆ PARAM_OBJ_NAME

const string PluginLocalProfile::PARAM_OBJ_NAME = "SceneObject"
private

Definition at line 27 of file PluginLocalProfileScene.c.

◆ PARAM_RAIN

const string PluginLocalProfile::PARAM_RAIN = "InitWeatherRain"
private

Definition at line 24 of file PluginLocalProfileScene.c.

◆ PARAM_TIME

const string PluginLocalProfile::PARAM_TIME = "InitTime"
private

Definition at line 23 of file PluginLocalProfileScene.c.


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