DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PluginLocalProfileScene.c
См. документацию.
1/*
2//Mission = "ChernarusPlus"
3typedef CfgParamString DefCfgParamString
4
5//InitTime = 220
6typedef CfgParamInt DefCfgParamInt
7
8//InitWeatherRain = 0.5
9typedef CfgParamFloat DefCfgParamFloat
10
11//InitWeatherFog = 0.3
12typedef CfgParamFloat DefCfgParamFloat
13
14//SceneObjectsCount = 1
15typedef CfgParamInt DefCfgParamInt
16*/
17
18class PluginLocalProfileScene extends PluginLocalProfile
19{
20 private const string FILE_ROOT = "$saves:";
21 private const string FILE_ROOT_SCENES = "Scenes";
22 private const string PARAM_MISSION = "Mission";
23 private const string PARAM_TIME = "InitTime";
24 private const string PARAM_RAIN = "InitWeatherRain";
25 private const string PARAM_FOG = "InitWeatherFog";
26 private const string PARAM_OBJ_COUNT = "SceneObjectsCount";
27 private const string PARAM_OBJ_NAME = "SceneObject";
28
29 private string m_FileSceneName;
30
31 //========================================
32 // GetPathScenes
33 //========================================
35 {
36 return FILE_ROOT+"\\"+FILE_ROOT_SCENES;
37 }
38
39 //========================================
40 // GetFileName
41 //========================================
42 override string GetFileName()
43 {
44 string file_name = GetPathScenes()+"\\"+m_FileSceneName;
45 return file_name;
46 }
47
48 //========================================
49 // OnInit
50 //========================================
51 override void OnInit()
52 {
53 super.OnInit();
54 }
55
56 //========================================
57 // GetSceneList
58 //========================================
60 {
61 if ( !FileExist( GetPathScenes() ) )
62 {
64 }
65
66 string file_name;
67 int file_attr;
68 int flags;
69 TStringArray list = new TStringArray;
70
71 string path_find_pattern = GetPathScenes()+"/*.scene";
72 FindFileHandle file_handler = FindFile(path_find_pattern, file_name, file_attr, flags);
73
74 bool found = true;
75 while ( found )
76 {
77 list.Insert(file_name);
78
79 found = FindNextFile(file_handler, file_name, file_attr);
80 }
81
82 return list;
83 }
84
85 //========================================
86 // SceneSave
87 //========================================
88 void SceneSave(SceneData scene)
89 {
90 m_FileSceneName = scene.GetNameScene()+".scene";
91
93
94 // Save Mission Name
95 SetParameterString(PARAM_MISSION, scene.GetNameMission(), false);
96 //Save Init Time
97 SetParameterFloat(PARAM_TIME, scene.GetInitTime(), false);
98 //Save Init Weather Rain
99 SetParameterFloat(PARAM_RAIN, scene.GetInitRain(), false);
100 //Save Init Weather Rain
101 SetParameterFloat(PARAM_FOG, scene.GetInitFog(), false);
102 // Save Count Of missions
103 SetParameterInt(PARAM_OBJ_COUNT, objects.Count(), false);
104
105
106 for ( int i = 0; i < objects.Count(); ++i )
107 {
108 SceneObject obj = objects.Get(i);
109
110 string param_name = PARAM_OBJ_NAME+"_"+i.ToString();
111 Print(param_name);
112 SetSubParameterInArray (param_name, 0, "ClassName", obj.GetTypeName(), false);
113 }
114
115
116 SaveConfigToFile();
117 }
118}
TStringArray GetSceneList()
Определения PluginLocalProfileScene.c:59
string m_FileSceneName
Определения PluginLocalProfileScene.c:29
const string PARAM_OBJ_COUNT
Определения PluginLocalProfileScene.c:26
const string FILE_ROOT
Определения PluginLocalProfileScene.c:20
const string PARAM_MISSION
Определения PluginLocalProfileScene.c:22
string GetPathScenes()
Определения PluginLocalProfileScene.c:34
const string PARAM_RAIN
Определения PluginLocalProfileScene.c:24
override void OnInit()
Определения PluginLocalProfileScene.c:51
const string PARAM_OBJ_NAME
Определения PluginLocalProfileScene.c:27
const string PARAM_FOG
Определения PluginLocalProfileScene.c:25
const string FILE_ROOT_SCENES
Определения PluginLocalProfileScene.c:21
const string PARAM_TIME
Определения PluginLocalProfileScene.c:23
override string GetFileName()
Определения PluginLocalProfileScene.c:42
void SceneSave(SceneData scene)
Определения PluginLocalProfileScene.c:88
DEPRECATED.
Определения PluginAdditionalInfo.c:3
float GetInitRain()
Определения SceneData.c:225
string GetNameMission()
Определения SceneData.c:90
array< ref SceneObject > GetSceneObjects()
Определения SceneData.c:33
float GetInitTime()
Определения SceneData.c:106
float GetInitFog()
Определения SceneData.c:242
string GetNameScene()
Определения SceneData.c:74
Определения SceneData.c:2
string GetTypeName()
Определения SceneObject.c:375
Определения SceneObject.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
Определения EnScript.c:685
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)
int[] FindFileHandle
Определения EnSystem.c:503
proto bool FileExist(string name)
Check existence of file.