Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
pluginmissionconfig.c
Go to the documentation of this file.
1class PluginMissionConfig extends PluginConfigHandler
2{
3 protected const string FILE_NAME = "scene_editor.cfg";
4 protected const string SCENE_EDITOR_SCENE = "scene_load";
5
6 //========================================
7 // GetInstance
8 //========================================
9 static PluginMissionConfig GetInstance()
10 {
11 return PluginMissionConfig.Cast( GetPlugin(PluginMissionConfig) );
12 }
13
14 //========================================
15 // OnInit
16 //========================================
17 override void OnInit()
18 {
19 super.OnInit();
20
21 CfgParamString cfg_scene_name = CfgParamString.Cast( GetParamByName( SCENE_EDITOR_SCENE, CFG_TYPE_STRING ) );
22
23 if ( cfg_scene_name.GetValue() == STRING_EMPTY )
24 {
25 cfg_scene_name.SetValue( PluginSceneManager.SCENE_DEFAULT_NAME );
26 SaveConfigToFile();
27 }
28 }
29
30 //========================================
31 // GetFileName
32 //========================================
33 override string GetFileName()
34 {
35 return g_Game.GetMissionFolderPath() +"\\"+ FILE_NAME;
36 }
37
38 //========================================
39 // GetSceneEditorName
40 //========================================
42 {
43 CfgParamString cfg_scene_name = CfgParamString.Cast( GetParamByName( SCENE_EDITOR_SCENE, CFG_TYPE_STRING ) );
44
45 if ( cfg_scene_name.GetValue() == STRING_EMPTY )
46 {
47 cfg_scene_name.SetValue( PluginSceneManager.SCENE_DEFAULT_NAME );
48 SaveConfigToFile();
49 }
50
51 return cfg_scene_name.GetValue();
52 }
53
54 //========================================
55 // SetSceneEditorName
56 //========================================
57 void SetSceneEditorName( string value )
58 {
59 CfgParamString cfg_scene_name = CfgParamString.Cast( GetParamByName( SCENE_EDITOR_SCENE, CFG_TYPE_STRING ) );
60 cfg_scene_name.SetValue( value );
61 SaveConfigToFile();
62 }
63}
const int CFG_TYPE_STRING
Definition cfgparam.c:1
override string GetFileName()
void SetSceneEditorName(string value)
static PluginMissionConfig GetInstance()
DayZGame g_Game
Definition dayzgame.c:3868
const string STRING_EMPTY
Definition constants.c:54
PluginBase GetPlugin(typename plugin_type)