DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PluginConfigDebugProfile.c
См. документацию.
2{
3 string Name = "New Preset";
4 float FocusDistance = 1.0;
5 float FocusLength = 0.0;
6 float FocusLengthNear = -1.0;
7 float Blur = 0.0;
8 float FocusDepthOffset = 1.0;
9
10 void ScriptConsoleCameraDOFPreset(string name, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
11 {
12 Name = name;
13 FocusDistance = focusDistance;
14 FocusLength = focusLength;
15 FocusLengthNear = focusLengthNear;
16 Blur = blur;
17 FocusDepthOffset = focusDepthOffset;
18 }
19}
20
22{
23 string Name = "New Preset";
24 float WOvercast = overcast;
25 float WRain;
26 float WSnow;
27 float WFog;
29 float WWindDir;
30 float WVolFogDD;
31 float WVolFogHD;
32 float WVolFogHB;
33
34 void ScriptConsoleWeatherPreset(string name, float overcast, float rain, float snow, float fog, float windMagnitude, float windDir, float volFogDD, float volFogHD, float volFogHB)
35 {
36 Name = name;
37 WOvercast = overcast;
38 WRain = rain;
39 WSnow = snow;
40 WFog = fog;
41 WWindMagnitude = windMagnitude;
42 WWindDir = windDir;
43 WVolFogDD = volFogDD;
44 WVolFogHD = volFogHD;
45 WVolFogHB = volFogHB;
46 }
47}
48
49typedef Param3<string, bool, vector> LocationParams;// param1 - name, param2 - isCustom?, param3 - position
51{
52 protected const string SCENE_DRAW_SELECTION = "scene_editor_draw_selection";
53 protected const string SCENE_LOAD_PLAYER_POS = "scene_editor_load_player_pos";
54 protected const string SCENE_ROTATION_ANGLE = "scene_editor_rotation_angle";
55 protected const string ITEM_TAB_SELECTED = "console_TabSelected";
56 protected const string PRESET_LIST = "console_presets";
57 protected const string PRESET_DEFAULT = "console_preset_default";
58 protected const string ITEM_SEARCH = "console_ItemSearch";
59 protected const string SPAWN_DISTANCE = "console_SpawnDistance";
60 protected const string CHAR_STATS_VIS = "console_character_stats_visible";
61 protected const string CHAR_LEVELS_VIS = "console_character_levels_visible";
62 protected const string CHAR_MODIFIERS_VIS = "console_character_modifiers_visible";
63 protected const string CHAR_AGENTS_VIS = "console_character_agents_visible";
64 protected const string CHAR_DEBUG_VIS = "console_character_debug_visible";
65 protected const string CHAR_STOMACH_VIS = "console_character_stomach_visible";
66 protected const string FREE_CAMERA_CROSSHAIR = "console_free_camera_crosshair_visible";
67 protected const string VERSION_VIS = "console_version_visible";
68 protected const string MERGE_TYPE = "category_merge_type";
69 protected const string TEMP_VIS = "console_temperature_visible";
70 protected const string HEALTH_VIS = "console_health_visible";
71 protected const string HORTICULTURE_VIS = "console_horticulture_visible";
72 protected const string SUB_PARAM_ITEM = "item";
73 protected const string SUB_PARAM_ITEM_NAME = "name";
74 protected const string SUB_PARAM_ITEM_HEALTH = "health";
75 protected const string SUB_PARAM_ITEM_QUANTITY = "quantity";
76 protected const string SUB_PARAM_ITEM_WITH_PHYSICS = "with_physics";
77 protected const string LOGS_ENABLED = "logs_enabled";
78 protected const string CONFIG_CLASSES_FLAG = "toggled_config_classes_flag";
79 protected const string ITEM_CATEGORY_FLAG = "toggled_item_categories_flag";
80 protected const string ITEM_PREVIEW = "show_item_preview";
81 protected const string BATCH_RECT = "batch_spawn_rect";
82 protected const string BATCH_QUANT = "batch_spawn_quantity";
83 protected const string SOUNDFILTER = "soundset_editbox";
84 protected const string ITEMDEBUG = "item_debug";
85 protected const string SPAWN_LOC_INDEX = "spawn_loc_index";
86 protected const string FILTER_REVERSED = "filter_order_reversed";
87
88 protected const string CAMERA_PRESETS_LIST = "camera_presets";
89 protected const string WEATHER_PRESETS_LIST = "weather_presets";
90
93 protected const string POSITION_NAME_ROOT = "console_positions_";
94
97
98 //========================================
99 // GetInstance
100 //========================================
105
106 //========================================
107 // GetCfgParamArray
108 //========================================
109 protected CfgParamArray GetNewCfgParamArray( array<ref CfgParam> params )
110 {
111 CfgParamArray param = new CfgParamArray( "" );
112 param.SetParams( params );
113 return param;
114 }
115
116 //========================================
117 // GetCfgParamBool
118 //========================================
119 protected CfgParamBool GetNewCfgParamBool( bool value )
120 {
121 CfgParamBool param = new CfgParamBool( "" );
122 param.SetValue( value );
123 return param;
124 }
125
126 //========================================
127 // GetCfgParamFloat
128 //========================================
129 protected CfgParamFloat GetNewCfgParamFloat( float value )
130 {
131 CfgParamFloat param = new CfgParamFloat( "" );
132 param.SetValue( value );
133 return param;
134 }
135
136 //========================================
137 // GetCfgParamInt
138 //========================================
139 protected CfgParamInt GetNewCfgParamInt( int value )
140 {
141 CfgParamInt param = new CfgParamInt( "" );
142 param.SetValue( value );
143 return param;
144 }
145
146 //========================================
147 // GetCfgParamString
148 //========================================
149 protected CfgParamString GetNewCfgParamString( string value )
150 {
151 CfgParamString param = new CfgParamString( "" );
152 param.SetValue( value );
153 return param;
154 }
155
156 //========================================
157 // Array
158 //========================================
159 protected CfgParamArray SetArray( string key, array<ref CfgParam> params )
160 {
161 CfgParamArray param = CfgParamArray.Cast( GetParamByName( key, CFG_TYPE_ARRAY ) );
162 param.SetParams( params );
163 SaveConfigToFile();
164 return param;
165 }
166
167 protected array<ref CfgParam> GetArray( string key )
168 {
169 if ( ParamExist(key) )
170 {
171 CfgParamArray param = CfgParamArray.Cast( GetParamByName( key, CFG_TYPE_ARRAY ) );
172 return param.GetValues();
173 }
174 else
175 {
176 if ( m_DefaultValues.Contains(key) )
177 {
178 CfgParamArray default_param = CfgParamArray.Cast( m_DefaultValues.Get( key ) );
179 return SetArray( key, default_param.GetValues() ).GetValues();
180 }
181 else
182 {
183 return SetArray( key, new array<ref CfgParam> ).GetValues();
184 }
185 }
186 }
187
188 //========================================
189 // Bool
190 //========================================
191 protected CfgParamBool SetBool( string key, bool value )
192 {
193 CfgParamBool param = CfgParamBool.Cast( GetParamByName( key, CFG_TYPE_BOOL ) );
194 param.SetValue( value );
195 SaveConfigToFile();
196 return param;
197 }
198
199 protected bool GetBool( string key )
200 {
201 if ( ParamExist(key) )
202 {
203 CfgParamBool param = CfgParamBool.Cast( GetParamByName( key, CFG_TYPE_BOOL ) );
204 return param.GetValue();
205 }
206 else
207 {
208 if ( m_DefaultValues.Contains(key) )
209 {
210 CfgParamBool default_param = CfgParamBool.Cast( m_DefaultValues.Get( key ) );
211 return SetBool( key, default_param.GetValue() ).GetValue();
212 }
213 else
214 {
215 return SetBool( key, false ).GetValue();
216 }
217 }
218 }
219
220 //========================================
221 // Float
222 //========================================
223 protected CfgParamFloat SetFloat( string key, float value )
224 {
225 CfgParamFloat param = CfgParamFloat.Cast( GetParamByName( key, CFG_TYPE_FLOAT ) );
226 param.SetValue( value );
227 SaveConfigToFile();
228 return param;
229 }
230
231 protected float GetFloat( string key )
232 {
233 if ( ParamExist(key) )
234 {
235 CfgParamFloat param = CfgParamFloat.Cast( GetParamByName( key, CFG_TYPE_FLOAT ) );
236 return param.GetValue();
237 }
238 else
239 {
240 if ( m_DefaultValues.Contains(key) )
241 {
242 CfgParamFloat default_param = CfgParamFloat.Cast( m_DefaultValues.Get( key ) );
243 return SetFloat( key, default_param.GetValue() ).GetValue();
244 }
245 else
246 {
247 return SetFloat( key, 0.0 ).GetValue();
248 }
249 }
250 }
251
252 //========================================
253 // Int
254 //========================================
255 protected CfgParamInt SetInt( string key, int value )
256 {
257 CfgParamInt param = CfgParamInt.Cast( GetParamByName( key, CFG_TYPE_INT ) );
258 param.SetValue( value );
259 SaveConfigToFile();
260 return param;
261 }
262
263 protected int GetInt( string key )
264 {
265 if ( ParamExist(key) )
266 {
267 CfgParamInt param = CfgParamInt.Cast( GetParamByName( key, CFG_TYPE_INT ) );
268 return param.GetValue();
269 }
270 else
271 {
272 if ( m_DefaultValues.Contains(key) )
273 {
274 CfgParamInt default_param = CfgParamInt.Cast( m_DefaultValues.Get( key ) );
275 return SetInt( key, default_param.GetValue() ).GetValue();
276 }
277 else
278 {
279 return SetInt( key, 0 ).GetValue();
280 }
281 }
282 }
283
284 //========================================
285 // String
286 //========================================
287 protected CfgParamString SetString( string key, string value )
288 {
289 CfgParamString param = CfgParamString.Cast( GetParamByName( key, CFG_TYPE_STRING ) );
290 if(param)
291 {
292 param.SetValue( value );
293 SaveConfigToFile();
294 }
295 return param;
296 }
297
298 protected string GetString( string key )
299 {
300 CfgParamString param = CfgParamString.Cast( GetParamByName( key, CFG_TYPE_STRING ) );
301
302 if ( param && param.GetValue() != STRING_EMPTY )
303 {
304 return param.GetValue();
305 }
306 else
307 {
308 if ( m_DefaultValues.Contains(key) )
309 {
310 CfgParamString default_param = CfgParamString.Cast( m_DefaultValues.Get( key ) );
311 CfgParamString param_string = SetString( key, default_param.GetValue() );
312 if(param_string)
313 return param_string.GetValue();
314 }
315 else
316 {
317 return SetString( key, "" ).GetValue();
318 }
319 }
320 return "";
321 }
322
323 protected void GetSubParametersInStringArray( string setting_name, string sub_param_name, out TStringArray arr )
324 {
325 array<ref CfgParam> items = GetArray( setting_name );
326 for ( int i = 0; i < items.Count(); i++ )
327 {
328 CfgParamArray items_array = CfgParamArray.Cast( items.Get(i) );
329 array<ref CfgParam> item_params = items_array.GetValues();
330
331 for ( int j = 0; j < item_params.Count(); j++ )
332 {
333 if ( item_params.Get(j).GetName() == sub_param_name )
334 {
335 CfgParamString param_string = CfgParamString.Cast( item_params.Get( j ) );
336 arr.Insert( param_string.GetValue() );
337 }
338 }
339 }
340 }
341
342 //========================================
343 // PluginConfigDebugProfile
344 //========================================
346 {
377 }
378
380 {
382 CfgParamInt param1 = new CfgParamInt("");
383 param1.SetValue(5);
384 CfgParamInt param2 = new CfgParamInt("");
385 param2.SetValue(5);
386 CfgParamFloat param3 = new CfgParamFloat("");
387 param3.SetValue(1.0);
388 CfgParamFloat param4 = new CfgParamFloat("");
389 param4.SetValue(1.0);
390
391 params.Insert(param1);
392 params.Insert(param2);
393 params.Insert(param3);
394 params.Insert(param4);
395
396 return params;
397 }
398
400 {
402 CfgParamArray presetParam;
403 CfgParamString paramName;
404 CfgParamFloat paramFocusDistance, paramFocusLength, paramFocusLengthNear, paramBlur, paramFocusDepthOffset;
405
406 // 50m distance DOF (Buildings / action)
407 presetParam = new CfgParamArray("");
408 paramName = new CfgParamString("Name");
409 paramName.SetValue("50m distance DOF (Buildings / action)");
410
411 paramFocusDistance = new CfgParamFloat("FocusDistance");
412 paramFocusDistance.SetValue(50.0);
413
414 paramFocusLength = new CfgParamFloat("FocusLength");
415 paramFocusLength.SetValue(2450.0);
416
417 paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
418 paramFocusLengthNear.SetValue(750.0);
419
420 paramBlur = new CfgParamFloat("Blur");
421 paramBlur.SetValue(4.0);
422
423 paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
424 paramFocusDepthOffset.SetValue(8.0);
425
426 presetParam.InsertValue(paramName);
427 presetParam.InsertValue(paramFocusDistance);
428 presetParam.InsertValue(paramFocusLength);
429 presetParam.InsertValue(paramFocusLengthNear);
430 presetParam.InsertValue(paramBlur);
431 presetParam.InsertValue(paramFocusDepthOffset);
432 params.Insert(presetParam);
433
434 // 15m distance soft blur (close objects are blurred)
435 presetParam = new CfgParamArray("");
436 paramName = new CfgParamString("Name");
437 paramName.SetValue("15m distance soft blur (close objects are blurred)");
438
439 paramFocusDistance = new CfgParamFloat("FocusDistance");
440 paramFocusDistance.SetValue(15.0);
441
442 paramFocusLength = new CfgParamFloat("FocusLength");
443 paramFocusLength.SetValue(1050.0);
444
445 paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
446 paramFocusLengthNear.SetValue(500.0);
447
448 paramBlur = new CfgParamFloat("Blur");
449 paramBlur.SetValue(4.0);
450
451 paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
452 paramFocusDepthOffset.SetValue(10.0);
453
454 presetParam.InsertValue(paramName);
455 presetParam.InsertValue(paramFocusDistance);
456 presetParam.InsertValue(paramFocusLength);
457 presetParam.InsertValue(paramFocusLengthNear);
458 presetParam.InsertValue(paramBlur);
459 presetParam.InsertValue(paramFocusDepthOffset);
460 params.Insert(presetParam);
461
462 // Full Body Character
463 presetParam = new CfgParamArray("");
464 paramName = new CfgParamString("Name");
465 paramName.SetValue("Full Body Character");
466
467 paramFocusDistance = new CfgParamFloat("FocusDistance");
468 paramFocusDistance.SetValue(5.0);
469
470 paramFocusLength = new CfgParamFloat("FocusLength");
471 paramFocusLength.SetValue(1050.0);
472
473 paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
474 paramFocusLengthNear.SetValue(100.0);
475
476 paramBlur = new CfgParamFloat("Blur");
477 paramBlur.SetValue(4.0);
478
479 paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
480 paramFocusDepthOffset.SetValue(10.0);
481
482 presetParam.InsertValue(paramName);
483 presetParam.InsertValue(paramFocusDistance);
484 presetParam.InsertValue(paramFocusLength);
485 presetParam.InsertValue(paramFocusLengthNear);
486 presetParam.InsertValue(paramBlur);
487 presetParam.InsertValue(paramFocusDepthOffset);
488 params.Insert(presetParam);
489
490 // Close up
491 presetParam = new CfgParamArray("");
492 paramName = new CfgParamString("Name");
493 paramName.SetValue("Close up");
494
495 paramFocusDistance = new CfgParamFloat("FocusDistance");
496 paramFocusDistance.SetValue(1.0);
497
498 paramFocusLength = new CfgParamFloat("FocusLength");
499 paramFocusLength.SetValue(450.0);
500
501 paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
502 paramFocusLengthNear.SetValue(100.0);
503
504 paramBlur = new CfgParamFloat("Blur");
505 paramBlur.SetValue(4.0);
506
507 paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
508 paramFocusDepthOffset.SetValue(10.0);
509
510 presetParam.InsertValue(paramName);
511 presetParam.InsertValue(paramFocusDistance);
512 presetParam.InsertValue(paramFocusLength);
513 presetParam.InsertValue(paramFocusLengthNear);
514 presetParam.InsertValue(paramBlur);
515 presetParam.InsertValue(paramFocusDepthOffset);
516 params.Insert(presetParam);
517
518 // NEW Close up
519 presetParam = new CfgParamArray("");
520 paramName = new CfgParamString("Name");
521 paramName.SetValue("NEW Close up");
522
523 paramFocusDistance = new CfgParamFloat("FocusDistance");
524 paramFocusDistance.SetValue(2.0);
525
526 paramFocusLength = new CfgParamFloat("FocusLength");
527 paramFocusLength.SetValue(750.0);
528
529 paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
530 paramFocusLengthNear.SetValue(500.0);
531
532 paramBlur = new CfgParamFloat("Blur");
533 paramBlur.SetValue(4.0);
534
535 paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
536 paramFocusDepthOffset.SetValue(10.0);
537
538 presetParam.InsertValue(paramName);
539 presetParam.InsertValue(paramFocusDistance);
540 presetParam.InsertValue(paramFocusLength);
541 presetParam.InsertValue(paramFocusLengthNear);
542 presetParam.InsertValue(paramBlur);
543 presetParam.InsertValue(paramFocusDepthOffset);
544 params.Insert(presetParam);
545
546 return params;
547 }
548
550 {
552 CfgParamArray presetParam;
553 CfgParamString paramName;
554 CfgParamFloat paramOvercast, paramRain, paramSnow, paramFog, paramWindMagnitude, paramWindDirection, paramVolFogDD, paramVolFogHD, paramVolFogHB;
555
556 // Chernarus - Clear
557 presetParam = new CfgParamArray("");
558 paramName = new CfgParamString("Name");
559 paramName.SetValue("Chernarus - Clear");
560 paramOvercast = new CfgParamFloat("Overcast");
561 paramOvercast.SetValue(0);
562 paramRain = new CfgParamFloat("Rain");
563 paramRain.SetValue(0);
564 paramSnow = new CfgParamFloat("Snow");
565 paramSnow.SetValue(0);
566 paramFog = new CfgParamFloat("Fog");
567 paramFog.SetValue(0.04);
568 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
569 paramWindMagnitude.SetValue(10);
570 paramWindDirection = new CfgParamFloat("WindDirection");
571 paramWindDirection.SetValue(-1);
572 paramVolFogDD = new CfgParamFloat("VolFogDD");
573 paramVolFogDD.SetValue(0.005);
574 paramVolFogHD = new CfgParamFloat("VolFogHD");
575 paramVolFogHD.SetValue(0.9);
576 paramVolFogHB = new CfgParamFloat("VolFogHB");
577 paramVolFogHB.SetValue(50);
578
579 presetParam.InsertValue(paramName);
580 presetParam.InsertValue(paramOvercast);
581 presetParam.InsertValue(paramRain);
582 presetParam.InsertValue(paramSnow);
583 presetParam.InsertValue(paramFog);
584 presetParam.InsertValue(paramWindMagnitude);
585 presetParam.InsertValue(paramWindDirection);
586 presetParam.InsertValue(paramVolFogDD);
587 presetParam.InsertValue(paramVolFogHD);
588 presetParam.InsertValue(paramVolFogHB);
589 params.Insert(presetParam);
590
591 // Chernarus - Cloudy
592 presetParam = new CfgParamArray("");
593 paramName = new CfgParamString("Name");
594 paramName.SetValue("Chernarus - Cloudy");
595 paramOvercast = new CfgParamFloat("Overcast");
596 paramOvercast.SetValue(0.4);
597 paramRain = new CfgParamFloat("Rain");
598 paramRain.SetValue(0);
599 paramSnow = new CfgParamFloat("Snow");
600 paramSnow.SetValue(0);
601 paramFog = new CfgParamFloat("Fog");
602 paramFog.SetValue(0.04);
603 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
604 paramWindMagnitude.SetValue(10);
605 paramWindDirection = new CfgParamFloat("WindDirection");
606 paramWindDirection.SetValue(-2.2);
607 paramVolFogDD = new CfgParamFloat("VolFogDD");
608 paramVolFogDD.SetValue(0.013);
609 paramVolFogHD = new CfgParamFloat("VolFogHD");
610 paramVolFogHD.SetValue(0.94);
611 paramVolFogHB = new CfgParamFloat("VolFogHB");
612 paramVolFogHB.SetValue(50);
613
614 presetParam.InsertValue(paramName);
615 presetParam.InsertValue(paramOvercast);
616 presetParam.InsertValue(paramRain);
617 presetParam.InsertValue(paramSnow);
618 presetParam.InsertValue(paramFog);
619 presetParam.InsertValue(paramWindMagnitude);
620 presetParam.InsertValue(paramWindDirection);
621 presetParam.InsertValue(paramVolFogDD);
622 presetParam.InsertValue(paramVolFogHD);
623 presetParam.InsertValue(paramVolFogHB);
624 params.Insert(presetParam);
625
626 // Chernarus - Bad
627 presetParam = new CfgParamArray("");
628 paramName = new CfgParamString("Name");
629 paramName.SetValue("Chernarus - Bad");
630 paramOvercast = new CfgParamFloat("Overcast");
631 paramOvercast.SetValue(0.7);
632 paramRain = new CfgParamFloat("Rain");
633 paramRain.SetValue(0.3);
634 paramSnow = new CfgParamFloat("Snow");
635 paramSnow.SetValue(0);
636 paramFog = new CfgParamFloat("Fog");
637 paramFog.SetValue(0.04);
638 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
639 paramWindMagnitude.SetValue(12);
640 paramWindDirection = new CfgParamFloat("WindDirection");
641 paramWindDirection.SetValue(1.5);
642 paramVolFogDD = new CfgParamFloat("VolFogDD");
643 paramVolFogDD.SetValue(0.015);
644 paramVolFogHD = new CfgParamFloat("VolFogHD");
645 paramVolFogHD.SetValue(0.97);
646 paramVolFogHB = new CfgParamFloat("VolFogHB");
647 paramVolFogHB.SetValue(50);
648
649 presetParam.InsertValue(paramName);
650 presetParam.InsertValue(paramOvercast);
651 presetParam.InsertValue(paramRain);
652 presetParam.InsertValue(paramSnow);
653 presetParam.InsertValue(paramFog);
654 presetParam.InsertValue(paramWindMagnitude);
655 presetParam.InsertValue(paramWindDirection);
656 presetParam.InsertValue(paramVolFogDD);
657 presetParam.InsertValue(paramVolFogHD);
658 presetParam.InsertValue(paramVolFogHB);
659 params.Insert(presetParam);
660
661 // Chernarus - Storm
662 presetParam = new CfgParamArray("");
663 paramName = new CfgParamString("Name");
664 paramName.SetValue("Chernarus - Storm");
665 paramOvercast = new CfgParamFloat("Overcast");
666 paramOvercast.SetValue(0.9);
667 paramRain = new CfgParamFloat("Rain");
668 paramRain.SetValue(0.55);
669 paramSnow = new CfgParamFloat("Snow");
670 paramSnow.SetValue(0);
671 paramFog = new CfgParamFloat("Fog");
672 paramFog.SetValue(0.04);
673 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
674 paramWindMagnitude.SetValue(15);
675 paramWindDirection = new CfgParamFloat("WindDirection");
676 paramWindDirection.SetValue(1.2);
677 paramVolFogDD = new CfgParamFloat("VolFogDD");
678 paramVolFogDD.SetValue(0.011);
679 paramVolFogHD = new CfgParamFloat("VolFogHD");
680 paramVolFogHD.SetValue(0.99);
681 paramVolFogHB = new CfgParamFloat("VolFogHB");
682 paramVolFogHB.SetValue(50);
683
684 presetParam.InsertValue(paramName);
685 presetParam.InsertValue(paramOvercast);
686 presetParam.InsertValue(paramRain);
687 presetParam.InsertValue(paramSnow);
688 presetParam.InsertValue(paramFog);
689 presetParam.InsertValue(paramWindMagnitude);
690 presetParam.InsertValue(paramWindDirection);
691 presetParam.InsertValue(paramVolFogDD);
692 presetParam.InsertValue(paramVolFogHD);
693 presetParam.InsertValue(paramVolFogHB);
694 params.Insert(presetParam);
695
696 // Chernarus - Heavy Storm
697 presetParam = new CfgParamArray("");
698 paramName = new CfgParamString("Name");
699 paramName.SetValue("Chernarus - Heavy Storm");
700 paramOvercast = new CfgParamFloat("Overcast");
701 paramOvercast.SetValue(1);
702 paramRain = new CfgParamFloat("Rain");
703 paramRain.SetValue(0.9);
704 paramSnow = new CfgParamFloat("Snow");
705 paramSnow.SetValue(0);
706 paramFog = new CfgParamFloat("Fog");
707 paramFog.SetValue(0.04);
708 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
709 paramWindMagnitude.SetValue(17);
710 paramWindDirection = new CfgParamFloat("WindDirection");
711 paramWindDirection.SetValue(1.2);
712 paramVolFogDD = new CfgParamFloat("VolFogDD");
713 paramVolFogDD.SetValue(0.007);
714 paramVolFogHD = new CfgParamFloat("VolFogHD");
715 paramVolFogHD.SetValue(1);
716 paramVolFogHB = new CfgParamFloat("VolFogHB");
717 paramVolFogHB.SetValue(50);
718
719 presetParam.InsertValue(paramName);
720 presetParam.InsertValue(paramOvercast);
721 presetParam.InsertValue(paramRain);
722 presetParam.InsertValue(paramSnow);
723 presetParam.InsertValue(paramFog);
724 presetParam.InsertValue(paramWindMagnitude);
725 presetParam.InsertValue(paramWindDirection);
726 presetParam.InsertValue(paramVolFogDD);
727 presetParam.InsertValue(paramVolFogHD);
728 presetParam.InsertValue(paramVolFogHB);
729 params.Insert(presetParam);
730
731 //------------------------------------------------------------------------
732
733 // Livonia - Clear
734 presetParam = new CfgParamArray("");
735 paramName = new CfgParamString("Name");
736 paramName.SetValue("Livonia - Clear");
737 paramOvercast = new CfgParamFloat("Overcast");
738 paramOvercast.SetValue(0);
739 paramRain = new CfgParamFloat("Rain");
740 paramRain.SetValue(0);
741 paramSnow = new CfgParamFloat("Snow");
742 paramSnow.SetValue(0);
743 paramFog = new CfgParamFloat("Fog");
744 paramFog.SetValue(0.1);
745 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
746 paramWindMagnitude.SetValue(3);
747 paramWindDirection = new CfgParamFloat("WindDirection");
748 paramWindDirection.SetValue(-2);
749 paramVolFogDD = new CfgParamFloat("VolFogDD");
750 paramVolFogDD.SetValue(0.012);
751 paramVolFogHD = new CfgParamFloat("VolFogHD");
752 paramVolFogHD.SetValue(0.91);
753 paramVolFogHB = new CfgParamFloat("VolFogHB");
754 paramVolFogHB.SetValue(170);
755
756 presetParam.InsertValue(paramName);
757 presetParam.InsertValue(paramOvercast);
758 presetParam.InsertValue(paramRain);
759 presetParam.InsertValue(paramSnow);
760 presetParam.InsertValue(paramFog);
761 presetParam.InsertValue(paramWindMagnitude);
762 presetParam.InsertValue(paramWindDirection);
763 presetParam.InsertValue(paramVolFogDD);
764 presetParam.InsertValue(paramVolFogHD);
765 presetParam.InsertValue(paramVolFogHB);
766 params.Insert(presetParam);
767
768 // Livonia - Cloudy
769 presetParam = new CfgParamArray("");
770 paramName = new CfgParamString("Name");
771 paramName.SetValue("Livonia - Cloudy");
772 paramOvercast = new CfgParamFloat("Overcast");
773 paramOvercast.SetValue(0.4);
774 paramRain = new CfgParamFloat("Rain");
775 paramRain.SetValue(0);
776 paramSnow = new CfgParamFloat("Snow");
777 paramSnow.SetValue(0);
778 paramFog = new CfgParamFloat("Fog");
779 paramFog.SetValue(0.1);
780 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
781 paramWindMagnitude.SetValue(9);
782 paramWindDirection = new CfgParamFloat("WindDirection");
783 paramWindDirection.SetValue(-1.2);
784 paramVolFogDD = new CfgParamFloat("VolFogDD");
785 paramVolFogDD.SetValue(0.14);
786 paramVolFogHD = new CfgParamFloat("VolFogHD");
787 paramVolFogHD.SetValue(0.94);
788 paramVolFogHB = new CfgParamFloat("VolFogHB");
789 paramVolFogHB.SetValue(170);
790
791 presetParam.InsertValue(paramName);
792 presetParam.InsertValue(paramOvercast);
793 presetParam.InsertValue(paramRain);
794 presetParam.InsertValue(paramSnow);
795 presetParam.InsertValue(paramFog);
796 presetParam.InsertValue(paramWindMagnitude);
797 presetParam.InsertValue(paramWindDirection);
798 presetParam.InsertValue(paramVolFogDD);
799 presetParam.InsertValue(paramVolFogHD);
800 presetParam.InsertValue(paramVolFogHB);
801 params.Insert(presetParam);
802
803 // Livonia - Bad
804 presetParam = new CfgParamArray("");
805 paramName = new CfgParamString("Name");
806 paramName.SetValue("Livonia - Bad");
807 paramOvercast = new CfgParamFloat("Overcast");
808 paramOvercast.SetValue(0.7);
809 paramRain = new CfgParamFloat("Rain");
810 paramRain.SetValue(0.3);
811 paramSnow = new CfgParamFloat("Snow");
812 paramSnow.SetValue(0);
813 paramFog = new CfgParamFloat("Fog");
814 paramFog.SetValue(0.1);
815 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
816 paramWindMagnitude.SetValue(10);
817 paramWindDirection = new CfgParamFloat("WindDirection");
818 paramWindDirection.SetValue(-0.3);
819 paramVolFogDD = new CfgParamFloat("VolFogDD");
820 paramVolFogDD.SetValue(0.019);
821 paramVolFogHD = new CfgParamFloat("VolFogHD");
822 paramVolFogHD.SetValue(0.97);
823 paramVolFogHB = new CfgParamFloat("VolFogHB");
824 paramVolFogHB.SetValue(170);
825
826 presetParam.InsertValue(paramName);
827 presetParam.InsertValue(paramOvercast);
828 presetParam.InsertValue(paramRain);
829 presetParam.InsertValue(paramSnow);
830 presetParam.InsertValue(paramFog);
831 presetParam.InsertValue(paramWindMagnitude);
832 presetParam.InsertValue(paramWindDirection);
833 presetParam.InsertValue(paramVolFogDD);
834 presetParam.InsertValue(paramVolFogHD);
835 presetParam.InsertValue(paramVolFogHB);
836 params.Insert(presetParam);
837
838 // Livonia - Storm
839 presetParam = new CfgParamArray("");
840 paramName = new CfgParamString("Name");
841 paramName.SetValue("Livonia - Storm");
842 paramOvercast = new CfgParamFloat("Overcast");
843 paramOvercast.SetValue(0.85);
844 paramRain = new CfgParamFloat("Rain");
845 paramRain.SetValue(0.55);
846 paramSnow = new CfgParamFloat("Snow");
847 paramSnow.SetValue(0);
848 paramFog = new CfgParamFloat("Fog");
849 paramFog.SetValue(0.1);
850 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
851 paramWindMagnitude.SetValue(12);
852 paramWindDirection = new CfgParamFloat("WindDirection");
853 paramWindDirection.SetValue(0);
854 paramVolFogDD = new CfgParamFloat("VolFogDD");
855 paramVolFogDD.SetValue(0.018);
856 paramVolFogHD = new CfgParamFloat("VolFogHD");
857 paramVolFogHD.SetValue(0.985);
858 paramVolFogHB = new CfgParamFloat("VolFogHB");
859 paramVolFogHB.SetValue(170);
860
861 presetParam.InsertValue(paramName);
862 presetParam.InsertValue(paramOvercast);
863 presetParam.InsertValue(paramRain);
864 presetParam.InsertValue(paramSnow);
865 presetParam.InsertValue(paramFog);
866 presetParam.InsertValue(paramWindMagnitude);
867 presetParam.InsertValue(paramWindDirection);
868 presetParam.InsertValue(paramVolFogDD);
869 presetParam.InsertValue(paramVolFogHD);
870 presetParam.InsertValue(paramVolFogHB);
871 params.Insert(presetParam);
872
873 // Livonia - Heavy Storm
874 presetParam = new CfgParamArray("");
875 paramName = new CfgParamString("Name");
876 paramName.SetValue("Livonia - Heavy Storm");
877 paramOvercast = new CfgParamFloat("Overcast");
878 paramOvercast.SetValue(1);
879 paramRain = new CfgParamFloat("Rain");
880 paramRain.SetValue(0.9);
881 paramSnow = new CfgParamFloat("Snow");
882 paramSnow.SetValue(0);
883 paramFog = new CfgParamFloat("Fog");
884 paramFog.SetValue(0.1);
885 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
886 paramWindMagnitude.SetValue(18);
887 paramWindDirection = new CfgParamFloat("WindDirection");
888 paramWindDirection.SetValue(0.6);
889 paramVolFogDD = new CfgParamFloat("VolFogDD");
890 paramVolFogDD.SetValue(0.005);
891 paramVolFogHD = new CfgParamFloat("VolFogHD");
892 paramVolFogHD.SetValue(1);
893 paramVolFogHB = new CfgParamFloat("VolFogHB");
894 paramVolFogHB.SetValue(170);
895
896 presetParam.InsertValue(paramName);
897 presetParam.InsertValue(paramOvercast);
898 presetParam.InsertValue(paramRain);
899 presetParam.InsertValue(paramSnow);
900 presetParam.InsertValue(paramFog);
901 presetParam.InsertValue(paramWindMagnitude);
902 presetParam.InsertValue(paramWindDirection);
903 presetParam.InsertValue(paramVolFogDD);
904 presetParam.InsertValue(paramVolFogHD);
905 presetParam.InsertValue(paramVolFogHB);
906 params.Insert(presetParam);
907
908 //------------------------------------------------------------------------
909
910 // Sakhal - Clear
911 presetParam = new CfgParamArray("");
912 paramName = new CfgParamString("Name");
913 paramName.SetValue("Sakhal - Clear");
914 paramOvercast = new CfgParamFloat("Overcast");
915 paramOvercast.SetValue(0.07);
916 paramRain = new CfgParamFloat("Rain");
917 paramRain.SetValue(0);
918 paramSnow = new CfgParamFloat("Snow");
919 paramSnow.SetValue(0);
920 paramFog = new CfgParamFloat("Fog");
921 paramFog.SetValue(0);
922 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
923 paramWindMagnitude.SetValue(2);
924 paramWindDirection = new CfgParamFloat("WindDirection");
925 paramWindDirection.SetValue(0);
926 paramVolFogDD = new CfgParamFloat("VolFogDD");
927 paramVolFogDD.SetValue(0.002);
928 paramVolFogHD = new CfgParamFloat("VolFogHD");
929 paramVolFogHD.SetValue(1);
930 paramVolFogHB = new CfgParamFloat("VolFogHB");
931 paramVolFogHB.SetValue(0);
932
933 presetParam.InsertValue(paramName);
934 presetParam.InsertValue(paramOvercast);
935 presetParam.InsertValue(paramRain);
936 presetParam.InsertValue(paramSnow);
937 presetParam.InsertValue(paramFog);
938 presetParam.InsertValue(paramWindMagnitude);
939 presetParam.InsertValue(paramWindDirection);
940 presetParam.InsertValue(paramVolFogDD);
941 presetParam.InsertValue(paramVolFogHD);
942 presetParam.InsertValue(paramVolFogHB);
943 params.Insert(presetParam);
944
945 // Sakhal - Cloudy
946 presetParam = new CfgParamArray("");
947 paramName = new CfgParamString("Name");
948 paramName.SetValue("Sakhal - Cloudy");
949 paramOvercast = new CfgParamFloat("Overcast");
950 paramOvercast.SetValue(0.4);
951 paramRain = new CfgParamFloat("Rain");
952 paramRain.SetValue(0);
953 paramSnow = new CfgParamFloat("Snow");
954 paramSnow.SetValue(0.35);
955 paramFog = new CfgParamFloat("Fog");
956 paramFog.SetValue(0);
957 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
958 paramWindMagnitude.SetValue(9);
959 paramWindDirection = new CfgParamFloat("WindDirection");
960 paramWindDirection.SetValue(1.1);
961 paramVolFogDD = new CfgParamFloat("VolFogDD");
962 paramVolFogDD.SetValue(0.058);
963 paramVolFogHD = new CfgParamFloat("VolFogHD");
964 paramVolFogHD.SetValue(1);
965 paramVolFogHB = new CfgParamFloat("VolFogHB");
966 paramVolFogHB.SetValue(0);
967
968 presetParam.InsertValue(paramName);
969 presetParam.InsertValue(paramOvercast);
970 presetParam.InsertValue(paramRain);
971 presetParam.InsertValue(paramSnow);
972 presetParam.InsertValue(paramFog);
973 presetParam.InsertValue(paramWindMagnitude);
974 presetParam.InsertValue(paramWindDirection);
975 presetParam.InsertValue(paramVolFogDD);
976 presetParam.InsertValue(paramVolFogHD);
977 presetParam.InsertValue(paramVolFogHB);
978 params.Insert(presetParam);
979
980 // Sakhal - Bad
981 presetParam = new CfgParamArray("");
982 paramName = new CfgParamString("Name");
983 paramName.SetValue("Sakhal - Bad");
984 paramOvercast = new CfgParamFloat("Overcast");
985 paramOvercast.SetValue(0.7);
986 paramRain = new CfgParamFloat("Rain");
987 paramRain.SetValue(0);
988 paramSnow = new CfgParamFloat("Snow");
989 paramSnow.SetValue(0.65);
990 paramFog = new CfgParamFloat("Fog");
991 paramFog.SetValue(0);
992 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
993 paramWindMagnitude.SetValue(12);
994 paramWindDirection = new CfgParamFloat("WindDirection");
995 paramWindDirection.SetValue(-1.6);
996 paramVolFogDD = new CfgParamFloat("VolFogDD");
997 paramVolFogDD.SetValue(0.139);
998 paramVolFogHD = new CfgParamFloat("VolFogHD");
999 paramVolFogHD.SetValue(1);
1000 paramVolFogHB = new CfgParamFloat("VolFogHB");
1001 paramVolFogHB.SetValue(0);
1002
1003 presetParam.InsertValue(paramName);
1004 presetParam.InsertValue(paramOvercast);
1005 presetParam.InsertValue(paramRain);
1006 presetParam.InsertValue(paramSnow);
1007 presetParam.InsertValue(paramFog);
1008 presetParam.InsertValue(paramWindMagnitude);
1009 presetParam.InsertValue(paramWindDirection);
1010 presetParam.InsertValue(paramVolFogDD);
1011 presetParam.InsertValue(paramVolFogHD);
1012 presetParam.InsertValue(paramVolFogHB);
1013 params.Insert(presetParam);
1014
1015 // Sakhal - Storm
1016 presetParam = new CfgParamArray("");
1017 paramName = new CfgParamString("Name");
1018 paramName.SetValue("Sakhal - Storm");
1019 paramOvercast = new CfgParamFloat("Overcast");
1020 paramOvercast.SetValue(0.9);
1021 paramRain = new CfgParamFloat("Rain");
1022 paramRain.SetValue(0);
1023 paramSnow = new CfgParamFloat("Snow");
1024 paramSnow.SetValue(0.85);
1025 paramFog = new CfgParamFloat("Fog");
1026 paramFog.SetValue(0);
1027 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
1028 paramWindMagnitude.SetValue(19);
1029 paramWindDirection = new CfgParamFloat("WindDirection");
1030 paramWindDirection.SetValue(2.5);
1031 paramVolFogDD = new CfgParamFloat("VolFogDD");
1032 paramVolFogDD.SetValue(0.283);
1033 paramVolFogHD = new CfgParamFloat("VolFogHD");
1034 paramVolFogHD.SetValue(1);
1035 paramVolFogHB = new CfgParamFloat("VolFogHB");
1036 paramVolFogHB.SetValue(0);
1037
1038 presetParam.InsertValue(paramName);
1039 presetParam.InsertValue(paramOvercast);
1040 presetParam.InsertValue(paramRain);
1041 presetParam.InsertValue(paramSnow);
1042 presetParam.InsertValue(paramFog);
1043 presetParam.InsertValue(paramWindMagnitude);
1044 presetParam.InsertValue(paramWindDirection);
1045 presetParam.InsertValue(paramVolFogDD);
1046 presetParam.InsertValue(paramVolFogHD);
1047 presetParam.InsertValue(paramVolFogHB);
1048 params.Insert(presetParam);
1049
1050 // Sakhal - Heavy Storm
1051 presetParam = new CfgParamArray("");
1052 paramName = new CfgParamString("Name");
1053 paramName.SetValue("Sakhal - Heavy Storm");
1054 paramOvercast = new CfgParamFloat("Overcast");
1055 paramOvercast.SetValue(1);
1056 paramRain = new CfgParamFloat("Rain");
1057 paramRain.SetValue(0);
1058 paramSnow = new CfgParamFloat("Snow");
1059 paramSnow.SetValue(1);
1060 paramFog = new CfgParamFloat("Fog");
1061 paramFog.SetValue(0);
1062 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
1063 paramWindMagnitude.SetValue(20);
1064 paramWindDirection = new CfgParamFloat("WindDirection");
1065 paramWindDirection.SetValue(3);
1066 paramVolFogDD = new CfgParamFloat("VolFogDD");
1067 paramVolFogDD.SetValue(0.35);
1068 paramVolFogHD = new CfgParamFloat("VolFogHD");
1069 paramVolFogHD.SetValue(1);
1070 paramVolFogHB = new CfgParamFloat("VolFogHB");
1071 paramVolFogHB.SetValue(0);
1072
1073 presetParam.InsertValue(paramName);
1074 presetParam.InsertValue(paramOvercast);
1075 presetParam.InsertValue(paramRain);
1076 presetParam.InsertValue(paramSnow);
1077 presetParam.InsertValue(paramFog);
1078 presetParam.InsertValue(paramWindMagnitude);
1079 presetParam.InsertValue(paramWindDirection);
1080 presetParam.InsertValue(paramVolFogDD);
1081 presetParam.InsertValue(paramVolFogHD);
1082 presetParam.InsertValue(paramVolFogHB);
1083 params.Insert(presetParam);
1084
1085 return params;
1086 }
1087
1088 //========================================
1089 // OnInit
1090 //========================================
1091 override void OnInit()
1092 {
1093 super.OnInit();
1094
1095 int i;
1096
1099 for (i = 0; i < params.Count(); i++)
1100 {
1101 CfgParamString param = CfgParamString.Cast(params.Get(i));
1102 m_PresetList.Insert(param.GetValue());
1103 }
1104
1107 }
1108
1109 protected void LoadCameraPresets()
1110 {
1111 if (m_CameraPresets)
1112 {
1113 m_CameraPresets.Clear();
1114 }
1115 else
1116 {
1118 }
1119
1120 CfgParamArray presetParam;
1122 for (int i = 0; i < camera_params.Count(); i++)
1123 {
1124 presetParam = CfgParamArray.Cast(camera_params.Get(i));
1125 if (!presetParam)
1126 continue;
1127
1128 CfgParamString paramCName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1129 CfgParamFloat paramFocusDistance = CfgParamFloat.Cast(presetParam.GetValueByName("FocusDistance", CFG_TYPE_FLOAT));
1130 CfgParamFloat paramFocusLength = CfgParamFloat.Cast(presetParam.GetValueByName("FocusLength", CFG_TYPE_FLOAT));
1131 CfgParamFloat paramFocusLengthNear = CfgParamFloat.Cast(presetParam.GetValueByName("FocusLengthNear", CFG_TYPE_FLOAT));
1132 CfgParamFloat paramBlur = CfgParamFloat.Cast(presetParam.GetValueByName("Blur", CFG_TYPE_FLOAT));
1133 CfgParamFloat paramFocusDepthOffset = CfgParamFloat.Cast(presetParam.GetValueByName("FocusDepthOffset", CFG_TYPE_FLOAT));
1134
1135 m_CameraPresets.Insert(new ScriptConsoleCameraDOFPreset(paramCName.GetValue(), paramFocusDistance.GetValue(), paramFocusLength.GetValue(), paramFocusLengthNear.GetValue(), paramBlur.GetValue(), paramFocusDepthOffset.GetValue()));
1136 }
1137 }
1138
1139 protected void LoadWeatherPresets()
1140 {
1141 if (m_WeatherPresets)
1142 {
1143 m_WeatherPresets.Clear();
1144 }
1145 else
1146 {
1148 }
1149
1150 CfgParamArray presetParam;
1152 for (int i = 0; i < weather_params.Count(); i++)
1153 {
1154 presetParam = CfgParamArray.Cast(weather_params.Get(i));
1155 if (!presetParam)
1156 continue;
1157
1158 CfgParamString paramWName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1159 CfgParamFloat paramOvercast = CfgParamFloat.Cast(presetParam.GetValueByName("Overcast", CFG_TYPE_FLOAT));
1160 CfgParamFloat paramRain = CfgParamFloat.Cast(presetParam.GetValueByName("Rain", CFG_TYPE_FLOAT));
1161 CfgParamFloat paramSnow = CfgParamFloat.Cast(presetParam.GetValueByName("Snow", CFG_TYPE_FLOAT));
1162 CfgParamFloat paramFog = CfgParamFloat.Cast(presetParam.GetValueByName("Fog", CFG_TYPE_FLOAT));
1163 CfgParamFloat paramWindMagnitude = CfgParamFloat.Cast(presetParam.GetValueByName("WindMagnitude", CFG_TYPE_FLOAT));
1164 CfgParamFloat paramWindDirection = CfgParamFloat.Cast(presetParam.GetValueByName("WindDirection", CFG_TYPE_FLOAT));
1165 CfgParamFloat paramVolFogDD = CfgParamFloat.Cast(presetParam.GetValueByName("VolFogDD", CFG_TYPE_FLOAT));
1166 CfgParamFloat paramVolFogHD = CfgParamFloat.Cast(presetParam.GetValueByName("VolFogHD", CFG_TYPE_FLOAT));
1167 CfgParamFloat paramVolFogHB = CfgParamFloat.Cast(presetParam.GetValueByName("VolFogHB", CFG_TYPE_FLOAT));
1168
1169 m_WeatherPresets.Insert(new ScriptConsoleWeatherPreset(paramWName.GetValue(), paramOvercast.GetValue(), paramRain.GetValue(), paramSnow.GetValue(), paramFog.GetValue(), paramWindMagnitude.GetValue(), paramWindDirection.GetValue(), paramVolFogDD.GetValue(), paramVolFogHD.GetValue(), paramVolFogHB.GetValue()));
1170 }
1171 }
1172
1173 void AddCameraPreset(string name, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
1174 {
1175 CfgParamArray presetParam;
1176 CfgParamString paramName;
1178
1179 for (int i = 0; i < camera_params.Count(); i++)
1180 {
1181 presetParam = CfgParamArray.Cast(camera_params.Get(i));
1182 if (!presetParam)
1183 return;
1184
1185 paramName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1186 if (paramName.GetName() == name)
1187 {
1188 return;
1189 }
1190 }
1191
1192 presetParam = new CfgParamArray("");
1193 paramName = new CfgParamString("Name");
1194 paramName.SetValue(name);
1195
1196 CfgParamFloat paramFocusDistance = new CfgParamFloat("FocusDistance");
1197 paramFocusDistance.SetValue(focusDistance);
1198
1199 CfgParamFloat paramFocusLength = new CfgParamFloat("FocusLength");
1200 paramFocusLength.SetValue(focusLength);
1201
1202 CfgParamFloat paramFocusLengthNear = new CfgParamFloat("FocusLengthNear");
1203 paramFocusLengthNear.SetValue(focusLengthNear);
1204
1205 CfgParamFloat paramBlur = new CfgParamFloat("Blur");
1206 paramBlur.SetValue(blur);
1207
1208 CfgParamFloat paramFocusDepthOffset = new CfgParamFloat("FocusDepthOffset");
1209 paramFocusDepthOffset.SetValue(focusDepthOffset);
1210
1211 presetParam.InsertValue(paramName);
1212 presetParam.InsertValue(paramFocusDistance);
1213 presetParam.InsertValue(paramFocusLength);
1214 presetParam.InsertValue(paramFocusLengthNear);
1215 presetParam.InsertValue(paramBlur);
1216 presetParam.InsertValue(paramFocusDepthOffset);
1217 camera_params.Insert(presetParam);
1218
1219 SaveConfigToFile();
1220
1221 m_CameraPresets.Insert(new ScriptConsoleCameraDOFPreset(name, focusDistance, focusLength, focusLengthNear, blur, focusDepthOffset));
1222 }
1223
1225 {
1226 int i;
1228 for (i = 0; i < camera_params.Count(); i++)
1229 {
1230 CfgParamArray presetParam = CfgParamArray.Cast(camera_params.Get(i));
1231 if (!presetParam)
1232 continue;
1233
1234 CfgParamString paramName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1235 if (paramName.GetValue() == name)
1236 {
1237 camera_params.Remove(i);
1238 break;
1239 }
1240 }
1241
1242 SaveConfigToFile();
1243
1244 for (i = 0; i < m_CameraPresets.Count(); i++)
1245 {
1246 ScriptConsoleCameraDOFPreset cameraPreset = m_CameraPresets.Get(i);
1247 if (cameraPreset.Name == name)
1248 {
1249 m_CameraPresets.Remove(i);
1250 break;
1251 }
1252 }
1253 }
1254
1255 void AddWeatherPreset(string name, float overcast, float rain, float snow, float fog, float windM, float windD, float volFogDD, float volFogHD, float volFogHB)
1256 {
1257 CfgParamArray presetParam;
1258 CfgParamString paramName;
1259 CfgParamFloat paramOvercast, paramRain, paramSnow, paramFog, paramWindMagnitude, paramWindDirection, paramVolFogDD, paramVolFogHD, paramVolFogHB;
1260
1262 int weatherPresetIndex = -1;
1263 for (int i = 0; i < weather_params.Count(); i++)
1264 {
1265 presetParam = CfgParamArray.Cast(weather_params.Get(i));
1266 if (!presetParam)
1267 return;
1268
1269 paramName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1270 if (paramName.GetValue() == name)
1271 {
1272 weatherPresetIndex = i;
1273 break;
1274 }
1275 }
1276
1277 if (weatherPresetIndex > -1)
1278 {
1279 weather_params.Remove(weatherPresetIndex);
1280 }
1281
1282 presetParam = new CfgParamArray("");
1283 paramName = new CfgParamString("Name");
1284 paramName.SetValue(name);
1285 paramOvercast = new CfgParamFloat("Overcast");
1286 paramOvercast.SetValue(overcast);
1287 paramRain = new CfgParamFloat("Rain");
1288 paramRain.SetValue(rain);
1289 paramSnow = new CfgParamFloat("Snow");
1290 paramSnow.SetValue(snow);
1291 paramFog = new CfgParamFloat("Fog");
1292 paramFog.SetValue(fog);
1293 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
1294 paramWindMagnitude.SetValue(windM);
1295 paramWindDirection = new CfgParamFloat("WindDirection");
1296 paramWindDirection.SetValue(windD);
1297 paramVolFogDD = new CfgParamFloat("VolFogDD");
1298 paramVolFogDD.SetValue(volFogDD);
1299 paramVolFogHD = new CfgParamFloat("VolFogHD");
1300 paramVolFogHD.SetValue(volFogHD);
1301 paramVolFogHB = new CfgParamFloat("VolFogHB");
1302 paramVolFogHB.SetValue(volFogHB);
1303
1304 presetParam.InsertValue(paramName);
1305 presetParam.InsertValue(paramOvercast);
1306 presetParam.InsertValue(paramRain);
1307 presetParam.InsertValue(paramSnow);
1308 presetParam.InsertValue(paramFog);
1309 presetParam.InsertValue(paramWindMagnitude);
1310 presetParam.InsertValue(paramWindDirection);
1311 presetParam.InsertValue(paramVolFogDD);
1312 presetParam.InsertValue(paramVolFogHD);
1313 presetParam.InsertValue(paramVolFogHB);
1314
1315 if (weatherPresetIndex == -1)
1316 {
1317 weather_params.Insert(presetParam);
1318 m_WeatherPresets.Insert(new ScriptConsoleWeatherPreset(name, overcast, rain, snow, fog, windM, windD, volFogDD, volFogHD, volFogHB));
1319 }
1320 else
1321 {
1322 weather_params.InsertAt(presetParam, weatherPresetIndex);
1324 }
1325
1326 SaveConfigToFile();
1327 }
1328
1330 {
1331 int i;
1333 for (i = 0; i < weather_params.Count(); i++)
1334 {
1335 CfgParamArray presetParam = CfgParamArray.Cast(weather_params.Get(i));
1336 if (!presetParam)
1337 continue;
1338
1339 CfgParamString paramName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1340 if (paramName.GetValue() == name)
1341 {
1342 weather_params.Remove(i);
1343 break;
1344 }
1345 }
1346
1347 SaveConfigToFile();
1348
1349 for (i = 0; i < m_WeatherPresets.Count(); i++)
1350 {
1351 ScriptConsoleWeatherPreset weatherPreset = m_WeatherPresets.Get(i);
1352 if (weatherPreset.Name == name)
1353 {
1354 m_WeatherPresets.Remove(i);
1355 break;
1356 }
1357 }
1358 }
1359
1360 //========================================
1361 // GetFileName
1362 //========================================
1363 override string GetFileName()
1364 {
1365 if (!FileExist(GetSubFolderName()))//---ALL LINES CONTAINING THIS COMMENT CAN BE REMOVED IN 1.23
1366 return "$profile:debugProfile.cfg";//---ALL LINES CONTAINING THIS COMMENT CAN BE REMOVED IN 1.23
1367
1369 }
1370
1371 override string GetSubFolderName()
1372 {
1373 return CFG_FILE_DEBUG_DIR;
1374 }
1375
1376 //========================================
1377 // SceneEditorDrawSelection
1378 //========================================
1380 {
1381 return GetBool( SCENE_DRAW_SELECTION );
1382 }
1383
1385 {
1386 SetBool( SCENE_DRAW_SELECTION, value );
1387 }
1388
1389 //========================================
1390 // SceneEditorSavePlayerPos
1391 //========================================
1393 {
1395 }
1396
1398 {
1400 }
1401
1402 //========================================
1403 // SceneEditorRotationAngle
1404 //========================================
1406 {
1407 return GetInt( SCENE_ROTATION_ANGLE );
1408 }
1409
1411 {
1412 SetInt( SCENE_ROTATION_ANGLE, value );
1413 }
1414
1415 //========================================
1416 // TabSelected
1417 //========================================
1419 {
1420 return GetInt( ITEM_TAB_SELECTED );
1421 }
1422
1423 void SetTabSelected( int value )
1424 {
1425 SetInt( ITEM_TAB_SELECTED, value );
1426 }
1427
1428 //========================================
1429 // SpawnLocIndex
1430 //========================================
1432 {
1433 return GetInt( SPAWN_LOC_INDEX );
1434 }
1435
1436 void SetSpawnLocIndex( int value )
1437 {
1438 SetInt( SPAWN_LOC_INDEX, value );
1439 }
1440
1441 //========================================
1442 // FilterOrder
1443 //========================================
1445 {
1446 return GetBool( FILTER_REVERSED );
1447 }
1448
1449 void SetFilterOrderReversed( bool reversed )
1450 {
1451 SetBool( FILTER_REVERSED, reversed );
1452 }
1453
1454 //========================================
1455 // DefaultPreset
1456 //========================================
1458 {
1459 return GetString( PRESET_DEFAULT );
1460 }
1461
1462 void SetDefaultPreset( string value )
1463 {
1464 SetString( PRESET_DEFAULT, value );
1465 }
1466
1467 //========================================
1468 // Batch Spawn Params
1469 //========================================
1474
1475 void SetBatchSpawnRectangle( int row, int column, float rowStep, float columnStep)
1476 {
1478 params.Clear();
1479 CfgParamString param;
1480
1481 CfgParamInt param1 = new CfgParamInt("");
1482 param1.SetValue(row);
1483 CfgParamInt param2 = new CfgParamInt("");
1484 param2.SetValue(column);
1485 CfgParamFloat param3 = new CfgParamFloat("");
1486 param3.SetValue(rowStep);
1487 CfgParamFloat param4 = new CfgParamFloat("");
1488 param4.SetValue(columnStep);
1489
1490 params.Insert(param1);
1491 params.Insert(param2);
1492 params.Insert(param3);
1493 params.Insert(param4);
1494 SaveConfigToFile();
1495 }
1496
1497 //========================================
1498 // Batch Spawn Quantity
1499 //========================================
1501 {
1502 return GetInt( BATCH_QUANT );
1503 }
1504
1506 {
1507 SetInt( BATCH_QUANT, value );
1508 }
1509 //========================================
1510 // ItemSearch
1511 //========================================
1513 {
1514 return GetString( ITEM_SEARCH );
1515 }
1516
1517 void SetItemSearch( string value )
1518 {
1519 SetString( ITEM_SEARCH, value );
1520 }
1521
1522 //========================================
1523 // SpawnDistance
1524 //========================================
1526 {
1527 return GetFloat( SPAWN_DISTANCE );
1528 }
1529
1530 void SetSpawnDistance( float value )
1531 {
1532 SetFloat( SPAWN_DISTANCE, value );
1533 }
1534
1535 //========================================
1536 // LogsEnabled
1537 //========================================
1539 {
1540 return GetBool( LOGS_ENABLED );
1541 }
1542
1543 void SetLogsEnabled( bool value )
1544 {
1545 SetBool( LOGS_ENABLED, value );
1546 }
1547
1548 //========================================
1549 // CharacterLevelsVisible
1550 //========================================
1552 {
1553 return GetBool( CHAR_LEVELS_VIS );
1554 }
1555
1556
1557 void SetCharacterLevelsVisible( bool is_visible )
1558 {
1559 SetBool( CHAR_LEVELS_VIS, is_visible );
1560 }
1561
1562
1563 //========================================
1564 // ItemDebugPos
1565 //========================================
1567 {
1568 SetString( ITEMDEBUG ,pos.ToString(false));
1569 }
1570
1571
1573 {
1574 return GetString( ITEMDEBUG ).ToVector();
1575 }
1576
1577 //========================================
1578 // CharacterStatsVisible
1579 //========================================
1581 {
1582 return GetBool( CHAR_STATS_VIS );
1583 }
1584
1585
1586 void SetCharacterStatsVisible( bool is_visible )
1587 {
1588 SetBool( CHAR_STATS_VIS, is_visible );
1589 }
1590
1591 //========================================
1592 // CharacterModifiersVisible
1593 //========================================
1595 {
1596 return GetBool( CHAR_MODIFIERS_VIS );
1597 }
1598
1599 void SetCharacterModifiersVisible( bool is_visible )
1600 {
1601 SetBool( CHAR_MODIFIERS_VIS, is_visible );
1602 }
1603
1604 //========================================
1605 // CharacterAgentsVisible
1606 //========================================
1608 {
1609 return GetBool( CHAR_AGENTS_VIS );
1610 }
1611
1612 void SetCharacterAgentsVisible( bool is_visible )
1613 {
1614 SetBool( CHAR_AGENTS_VIS, is_visible );
1615 }
1616
1617 //========================================
1618 // CharacterDebugVisible
1619 //========================================
1621 {
1622 return GetBool( CHAR_DEBUG_VIS );
1623 }
1624
1625 void SetCharacterDebugVisible( bool is_visible )
1626 {
1627 SetBool( CHAR_DEBUG_VIS, is_visible );
1628 }
1629
1630 //========================================
1631 // CharacterStomachVisible
1632 //========================================
1634 {
1635 return GetBool( CHAR_STOMACH_VIS );
1636 }
1637
1638 void SetCharacterStomachVisible( bool is_visible )
1639 {
1640 SetBool( CHAR_STOMACH_VIS, is_visible );
1641 }
1642
1643 //========================================
1644 // FreeCameraCrosshairVisible
1645 //========================================
1650
1651 void SetFreeCameraCrosshairVisible( bool is_visible )
1652 {
1653 SetBool( FREE_CAMERA_CROSSHAIR, is_visible );
1654 }
1655
1656 //========================================
1657 // VersionVisible
1658 //========================================
1660 {
1661 return GetBool( VERSION_VIS );
1662 }
1663
1664 void SetVersionVisible( bool is_visible )
1665 {
1666 SetBool( VERSION_VIS, is_visible );
1667 }
1668
1669 //========================================
1670 // Merge Type
1671 //========================================
1673 {
1674 return GetBool( MERGE_TYPE );
1675 }
1676
1677 void SetMergeType( bool is_visible )
1678 {
1679 SetBool( MERGE_TYPE, is_visible );
1680 }
1681
1682 //========================================
1683 // Soundset Filter
1684 //========================================
1686 {
1687 return GetString( SOUNDFILTER );
1688 }
1689
1690 void SetSoundsetFilter( string content )
1691 {
1692 SetString( SOUNDFILTER, content );
1693 }
1694
1695 //========================================
1696 // TemperatureVisible
1697 //========================================
1699 {
1700 return GetBool( TEMP_VIS );
1701 }
1702
1703 void SetTempVisible( bool is_visible )
1704 {
1705 SetBool( TEMP_VIS, is_visible );
1706 }
1707
1708 //========================================
1709 // HealthVisible
1710 //========================================
1712 {
1713 return GetBool( HEALTH_VIS );
1714 }
1715
1716 void SetHealthVisible( bool is_visible )
1717 {
1718 SetBool( HEALTH_VIS, is_visible );
1719 }
1720
1721 //========================================
1722 // HorticultureVisible
1723 //========================================
1725 {
1726 return GetBool( HORTICULTURE_VIS );
1727 }
1728
1729 void SetHorticultureVisible( bool is_visible )
1730 {
1731 SetBool( HORTICULTURE_VIS, is_visible );
1732 }
1733
1734 //========================================
1735 // Show Item Preview
1736 //========================================
1738 {
1739 return GetBool( ITEM_PREVIEW );
1740 }
1741
1742 void SetShowItemPreview( bool show )
1743 {
1744 SetBool( ITEM_PREVIEW, show );
1745 }
1746
1747
1748 //========================================
1749 // ConfigClassesFlag
1750 //========================================
1752 {
1753 return GetInt( CONFIG_CLASSES_FLAG );
1754 }
1755
1756 void SetConfigClassesFlag( int flag )
1757 {
1758 SetInt( CONFIG_CLASSES_FLAG, flag );
1759 }
1760
1761
1762 //========================================
1763 // Item Category Flag
1764 //========================================
1766 {
1767 return GetInt( ITEM_CATEGORY_FLAG );
1768 }
1769
1770 void SetItemCategoryFlag( int flag )
1771 {
1772 SetInt( ITEM_CATEGORY_FLAG, flag );
1773 }
1774
1775 //========================================
1776 // User Location
1777 //========================================
1778 bool CustomLocationsAdd( string name, vector position )
1779 {
1780 string world = g_Game.GetWorldName();
1781 world.ToLower();
1782
1783 CfgParamString locationName = new CfgParamString(PluginConfigDebugProfileFixed.SUB_PARAM_POS_NAME);
1784 locationName.SetValue(name);
1785 CfgParamString locationPos = new CfgParamString(PluginConfigDebugProfileFixed.SUB_PARAM_POS_VEC);
1786 locationPos.SetValue(position.ToString(false));
1787
1788 CfgParamArray locationEntry = new CfgParamArray( locationName.GetValue() );
1789 locationEntry.InsertValue( locationName );
1790 locationEntry.InsertValue( locationPos );
1791
1792 string paramName = POSITION_NAME_ROOT + world;
1793 array<ref CfgParam> params = GetArray(paramName);
1794 params.Insert(locationEntry);
1795 SetArray(paramName, params);
1796 SaveConfigToFile();
1797
1798 return true;
1799 }
1800
1802 {
1803 if (!name)
1804 return;
1805 string world = g_Game.GetWorldName();
1806 world.ToLower();
1807 string paramName = POSITION_NAME_ROOT + world;
1808 array<ref CfgParam> params = GetArray(paramName);
1809
1810 for (int i = 0; i < params.Count(); i++)
1811 {
1812 CfgParamArray param = CfgParamArray.Cast(params.Get(i));
1813 array<ref CfgParam> prms = param.GetValues();
1814 CfgParamString par = CfgParamString.Cast(prms.Get(0));
1815 if (par.GetValue() == name)
1816 {
1817 params.RemoveOrdered(i);
1818 break;
1819 }
1820 }
1821
1822 //SetArray(paramName, params);
1823 SaveConfigToFile();
1824 }
1825
1826 //========================================
1827 // Camera Presets
1828 //========================================
1833
1834 //========================================
1835 // Weather Presets
1836 //========================================
1841
1842 //========================================
1843 // Presets
1844 //========================================
1846 {
1847 return m_PresetList;
1848 }
1849
1850 protected void SetPreset( string preset_name, int index = -1 )
1851 {
1853 CfgParamString param;
1854
1855 if ( index == -1 )
1856 {
1857 param = new CfgParamString( "" );
1858 param.SetValue( preset_name );
1859 params.Insert( param );
1860 m_PresetList.Insert( preset_name );
1861 }
1862 else
1863 {
1864 param = CfgParamString.Cast( params.Get( index ) );
1865 param.SetValue( preset_name );
1866 params.Set( index, param );
1867 m_PresetList.Set( index, preset_name );
1868 }
1869
1870 SaveConfigToFile();
1871 }
1872
1873 protected void RemovePreset( string preset_name )
1874 {
1876 for ( int i = 0; i < params.Count(); i++ )
1877 {
1878 CfgParamString param = CfgParamString.Cast( params.Get(i) );
1879 if ( param.GetValue() == preset_name )
1880 {
1881 params.RemoveItem( param );
1882 m_PresetList.RemoveItem( preset_name );
1883 }
1884 }
1885 }
1886
1887 bool GetPresetItems( string preset_name, out TStringArray arr, string param_name = "" )
1888 {
1889 if ( m_PresetList.Find(preset_name) == -1 )
1890 {
1891 return false;
1892 }
1893 if(param_name == "")
1894 param_name = SUB_PARAM_ITEM_NAME;
1895 GetSubParametersInStringArray( preset_name, param_name, arr );
1896
1897 return true;
1898 }
1899
1900 bool PresetAdd( string preset_name )
1901 {
1902 if ( m_PresetList.Find(preset_name) > -1 )
1903 {
1904 return false;
1905 }
1906
1907 SetPreset( preset_name );
1908 SetArray( preset_name, new array<ref CfgParam> );
1909 SaveConfigToFile();
1910
1911 return true;
1912 }
1913
1914 bool PresetRemove( string preset_name )
1915 {
1916 if ( m_PresetList.Find(preset_name) == -1 )
1917 {
1918 return false;
1919 }
1920
1921 RemovePreset( preset_name );
1922 RemoveParamByName( preset_name );
1923 SaveConfigToFile();
1924
1925 return true;
1926 }
1927
1928 bool PresetRename( string old_preset_name, string new_preset_name )
1929 {
1930 int index = m_PresetList.Find( old_preset_name );
1931
1932 if ( index == -1 )
1933 {
1934 return false;
1935 }
1936
1937 SetPreset( new_preset_name, index );
1938 RenameParam( old_preset_name, new_preset_name );
1939 SaveConfigToFile();
1940
1941 return true;
1942 }
1943
1944 bool ItemAddToPreset( string preset_name, string item_name )
1945 {
1946 if ( m_PresetList.Find( preset_name ) == -1 )
1947 {
1948 return false;
1949 }
1950
1951 CfgParamString param = new CfgParamString( SUB_PARAM_ITEM_NAME );
1952 param.SetValue( item_name );
1953
1954 CfgParamArray item_params = new CfgParamArray( SUB_PARAM_ITEM );
1955 item_params.InsertValue( param );
1956
1957 array<ref CfgParam> params = GetArray( preset_name );
1958 params.Insert( item_params );
1959
1960 SaveConfigToFile();
1961
1962 return true;
1963 }
1964
1965 bool ItemRemoveFromPreset( string preset_name, int item_index )
1966 {
1967 if ( m_PresetList.Find( preset_name ) == -1 )
1968 {
1969 return false;
1970 }
1971
1972 array<ref CfgParam> params = GetArray( preset_name );
1973
1974 if ( item_index >= params.Count() )
1975 {
1976 return false;
1977 }
1978
1979 params.Remove( item_index );
1980
1981 SaveConfigToFile();
1982
1983 return true;
1984 }
1985
1986 bool SwapItem( string preset_name, int item1_index, int item2_index )
1987 {
1988 array<ref CfgParam> params = GetArray( preset_name );
1989
1990 if ( item1_index >= params.Count() || item2_index >= params.Count() )
1991 {
1992 return false;
1993 }
1994
1995 params.SwapItems( item1_index, item2_index );
1996 SaveConfigToFile();
1997
1998 return true;
1999 }
2000
2001 protected array<ref CfgParam> GetItemParams( string preset_name, int item_index )
2002 {
2003 if ( m_PresetList.Find( preset_name ) == -1 )
2004 {
2005 return NULL;
2006 }
2007
2008 array<ref CfgParam> params = GetArray( preset_name );
2009
2010 if ( !params || item_index >= params.Count() )
2011 {
2012 return NULL;
2013 }
2014 if (params.IsValidIndex(item_index))
2015 CfgParamArray params_array = CfgParamArray.Cast( params.Get( item_index ) );
2016 if (params_array)
2017 return params_array.GetValues();
2018
2019 return null;
2020 }
2021
2022 protected CfgParam GetItemParam( string preset_name, int item_index, string param_name )
2023 {
2024 array<ref CfgParam> item_params = GetItemParams( preset_name, item_index );
2025
2026 if ( item_params == NULL )
2027 {
2028 return NULL;
2029 }
2030
2031 CfgParam param = NULL;
2032 for ( int i = 0; i < item_params.Count(); i++ )
2033 {
2034 if ( item_params.Get(i).GetName() == param_name )
2035 {
2036 param = item_params.Get(i);
2037 }
2038 }
2039
2040 return param;
2041 }
2042
2043 float GetItemHealth( string preset_name, int item_index )
2044 {
2045 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_HEALTH );
2046
2047 if ( param == NULL )
2048 {
2049 return -1;
2050 }
2051 else
2052 {
2053 CfgParamFloat param_float = CfgParamFloat.Cast( param );
2054 return param_float.GetValue();
2055 }
2056 }
2057
2058 bool SetItemHealth( string preset_name, int item_index, float health )
2059 {
2060 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_HEALTH );
2061
2062 if ( param != NULL )
2063 {
2064 CfgParamFloat param_float = CfgParamFloat.Cast( param );
2065 param_float.SetValue( health );
2066 }
2067 else
2068 {
2069 array<ref CfgParam> item_params = GetItemParams( preset_name, item_index );
2070
2071 if ( item_params != NULL )
2072 {
2073 CfgParamFloat new_param = new CfgParamFloat( SUB_PARAM_ITEM_HEALTH );
2074 new_param.SetValue( health );
2075 item_params.Insert( new_param );
2076 }
2077 }
2078
2079 SaveConfigToFile();
2080
2081 return true;
2082 }
2083
2084 int GetItemQuantity( string preset_name, int item_index )
2085 {
2086 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_QUANTITY );
2087
2088 if ( param == NULL )
2089 {
2090 return 1;
2091 }
2092 else
2093 {
2094 CfgParamInt param_int = CfgParamInt.Cast( param );
2095 return param_int.GetValue();
2096 }
2097 }
2098
2099 bool SetItemQuantity( string preset_name, int item_index, int quantity )
2100 {
2101 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_QUANTITY );
2102
2103 if ( param != NULL )
2104 {
2105 CfgParamInt param_int = CfgParamInt.Cast( param );
2106 param_int.SetValue( quantity );
2107 }
2108 else
2109 {
2110 array<ref CfgParam> item_params = GetItemParams( preset_name, item_index );
2111
2112 if ( item_params != NULL )
2113 {
2114 CfgParamInt new_param = new CfgParamInt( SUB_PARAM_ITEM_QUANTITY );
2115 new_param.SetValue( quantity );
2116 item_params.Insert( new_param );
2117 }
2118 }
2119
2120 SaveConfigToFile();
2121
2122 return true;
2123 }
2124
2125 bool GetItemWithPhysics( string preset_name, int item_index )
2126 {
2127 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_WITH_PHYSICS );
2128
2129 if ( param == NULL )
2130 {
2131 return false;
2132 }
2133 else
2134 {
2135 CfgParamBool param_bool = CfgParamBool.Cast( param );
2136 return param_bool.GetValue();
2137 }
2138 }
2139
2140 bool SetItemWithPhysics( string preset_name, int item_index, bool with_physics )
2141 {
2142 CfgParam param = GetItemParam( preset_name, item_index, SUB_PARAM_ITEM_WITH_PHYSICS );
2143
2144 if ( param != NULL )
2145 {
2146 CfgParamBool param_bool = CfgParamBool.Cast( param );
2147 param_bool.SetValue( with_physics );
2148 }
2149 else
2150 {
2151 array<ref CfgParam> item_params = GetItemParams( preset_name, item_index );
2152
2153 if ( item_params != NULL )
2154 {
2155 CfgParamBool new_param = new CfgParamBool( SUB_PARAM_ITEM_WITH_PHYSICS );
2156 new_param.SetValue( with_physics );
2157 item_params.Insert( new_param );
2158 }
2159 }
2160
2161 SaveConfigToFile();
2162
2163 return true;
2164 }
2165
2166 //========================================
2167 // Locations
2168 //========================================
2169
2170 void GetLocationsData( out array<ref LocationParams> arr , bool isCustom)
2171 {
2172 string world = g_Game.GetWorldName();
2173 world.ToLower();
2174 string paramName = POSITION_NAME_ROOT + world;
2175
2176 TStringArray names = new TStringArray();
2177 GetSubParametersInStringArray( paramName, PluginConfigDebugProfileFixed.SUB_PARAM_POS_NAME, names );
2178 TStringArray positions = new TStringArray();
2179 GetSubParametersInStringArray( paramName, PluginConfigDebugProfileFixed.SUB_PARAM_POS_VEC, positions );
2180 int i;
2181 if (isCustom)
2182 {
2183 for ( i = names.Count() - 1; i >= 0 ; i--)
2184 {
2185 arr.Insert(new LocationParams(names.Get(i), isCustom, positions.Get(i).ToVector()));
2186 }
2187 }
2188 else
2189 {
2190 for (i = 0; i < names.Count(); i++)
2191 {
2192 arr.Insert(new LocationParams(names.Get(i), isCustom, positions.Get(i).ToVector()));
2193 }
2194 }
2195 }
2196}
const int CFG_TYPE_BOOL
Определения CfgParam.c:4
const int CFG_TYPE_ARRAY
Определения CfgParam.c:5
const int CFG_TYPE_INT
Определения CfgParam.c:2
const int CFG_TYPE_STRING
Определения CfgParam.c:1
const int CFG_TYPE_FLOAT
Определения CfgParam.c:3
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
map
Определения ControlsXboxNew.c:4
DayZGame g_Game
Определения DayZGame.c:3868
float WVolFogDD
Определения PluginConfigDebugProfile.c:30
float WRain
Определения PluginConfigDebugProfile.c:25
float WWindMagnitude
Определения PluginConfigDebugProfile.c:28
void ScriptConsoleWeatherPreset(string name, float overcast, float rain, float snow, float fog, float windMagnitude, float windDir, float volFogDD, float volFogHD, float volFogHB)
Определения PluginConfigDebugProfile.c:34
float WWindDir
Определения PluginConfigDebugProfile.c:29
Param3< string, bool, vector > LocationParams
Определения PluginConfigDebugProfile.c:49
float WVolFogHB
Определения PluginConfigDebugProfile.c:32
float WOvercast
Определения PluginConfigDebugProfile.c:24
float WVolFogHD
Определения PluginConfigDebugProfile.c:31
float WSnow
Определения PluginConfigDebugProfile.c:26
float WFog
Определения PluginConfigDebugProfile.c:27
class ScriptConsoleCameraDOFPreset Name
int GetInt()
Определения PluginDayzPlayerDebug.c:66
class PluginLocalEnscriptHistory extends PluginLocalHistoryBase GetSubFolderName()
Определения PluginLocalEnscriptHistory.c:20
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
Определения CfgParam.c:9
Определения EntityAI.c:95
int GetSceneEditorRotationAngle()
Определения PluginConfigDebugProfile.c:1405
bool SetItemWithPhysics(string preset_name, int item_index, bool with_physics)
Определения PluginConfigDebugProfile.c:2140
bool PresetAdd(string preset_name)
Определения PluginConfigDebugProfile.c:1900
bool GetHorticultureVisible()
Определения PluginConfigDebugProfile.c:1724
void SetHealthVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1716
array< ref CfgParam > GetDefaultBatchRectParams()
Определения PluginConfigDebugProfile.c:379
CfgParamFloat GetNewCfgParamFloat(float value)
Определения PluginConfigDebugProfile.c:129
bool GetHealthVisible()
Определения PluginConfigDebugProfile.c:1711
void RemoveWeatherPreset(string name)
Определения PluginConfigDebugProfile.c:1329
string GetDefaultPreset()
Определения PluginConfigDebugProfile.c:1457
array< ref CfgParam > GetDefaultCameraPresetsParams()
Определения PluginConfigDebugProfile.c:399
bool GetVersionVisible()
Определения PluginConfigDebugProfile.c:1659
void SetItemSearch(string value)
Определения PluginConfigDebugProfile.c:1517
int GetInt(string key)
Определения PluginConfigDebugProfile.c:263
CfgParamFloat SetFloat(string key, float value)
Определения PluginConfigDebugProfile.c:223
void SetCharacterStomachVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1638
const string SUB_PARAM_ITEM
Определения PluginConfigDebugProfile.c:72
ref array< ref ScriptConsoleCameraDOFPreset > m_CameraPresets
Определения PluginConfigDebugProfile.c:95
int GetItemCategoryFlag()
Определения PluginConfigDebugProfile.c:1765
bool SetItemQuantity(string preset_name, int item_index, int quantity)
Определения PluginConfigDebugProfile.c:2099
void SetSoundsetFilter(string content)
Определения PluginConfigDebugProfile.c:1690
const string CHAR_STATS_VIS
Определения PluginConfigDebugProfile.c:60
override string GetFileName()
Определения PluginConfigDebugProfile.c:1363
CfgParamBool GetNewCfgParamBool(bool value)
Определения PluginConfigDebugProfile.c:119
CfgParamBool SetBool(string key, bool value)
Определения PluginConfigDebugProfile.c:191
void SetTabSelected(int value)
Определения PluginConfigDebugProfile.c:1423
float GetFloat(string key)
Определения PluginConfigDebugProfile.c:231
override void OnInit()
Определения PluginConfigDebugProfile.c:1091
TStringArray GetPresets()
Определения PluginConfigDebugProfile.c:1845
void SetBatchSpawnRectangle(int row, int column, float rowStep, float columnStep)
Определения PluginConfigDebugProfile.c:1475
void RemoveCameraPreset(string name)
Определения PluginConfigDebugProfile.c:1224
const string SUB_PARAM_ITEM_QUANTITY
Определения PluginConfigDebugProfile.c:75
void LoadWeatherPresets()
Определения PluginConfigDebugProfile.c:1139
static PluginConfigDebugProfile GetInstance()
Определения PluginConfigDebugProfile.c:101
bool ItemAddToPreset(string preset_name, string item_name)
Определения PluginConfigDebugProfile.c:1944
const string SCENE_LOAD_PLAYER_POS
Определения PluginConfigDebugProfile.c:53
bool GetLogsEnabled()
Определения PluginConfigDebugProfile.c:1538
bool ItemRemoveFromPreset(string preset_name, int item_index)
Определения PluginConfigDebugProfile.c:1965
const string CHAR_MODIFIERS_VIS
Определения PluginConfigDebugProfile.c:62
const string CHAR_STOMACH_VIS
Определения PluginConfigDebugProfile.c:65
void SetSceneEditorLoadPlayerPos(bool value)
Определения PluginConfigDebugProfile.c:1397
bool GetSceneEditorDrawSelection()
Определения PluginConfigDebugProfile.c:1379
const string HORTICULTURE_VIS
Определения PluginConfigDebugProfile.c:71
void SetCharacterDebugVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1625
CfgParamArray GetNewCfgParamArray(array< ref CfgParam > params)
Определения PluginConfigDebugProfile.c:109
CfgParamArray SetArray(string key, array< ref CfgParam > params)
Определения PluginConfigDebugProfile.c:159
ref TStringArray m_PresetList
Определения PluginConfigDebugProfile.c:92
const string SCENE_DRAW_SELECTION
Определения PluginConfigDebugProfile.c:52
bool GetBool(string key)
Определения PluginConfigDebugProfile.c:199
void SetSceneEditorDrawSelection(bool value)
Определения PluginConfigDebugProfile.c:1384
bool GetCharacterDebugVisible()
Определения PluginConfigDebugProfile.c:1620
bool GetSceneEditorLoadPlayerPos()
Определения PluginConfigDebugProfile.c:1392
CfgParamString SetString(string key, string value)
Определения PluginConfigDebugProfile.c:287
const string CHAR_DEBUG_VIS
Определения PluginConfigDebugProfile.c:64
void SetDefaultPreset(string value)
Определения PluginConfigDebugProfile.c:1462
const string SPAWN_LOC_INDEX
Определения PluginConfigDebugProfile.c:85
void SetFilterOrderReversed(bool reversed)
Определения PluginConfigDebugProfile.c:1449
void AddWeatherPreset(string name, float overcast, float rain, float snow, float fog, float windM, float windD, float volFogDD, float volFogHD, float volFogHB)
Определения PluginConfigDebugProfile.c:1255
CfgParamInt SetInt(string key, int value)
Определения PluginConfigDebugProfile.c:255
bool GetPresetItems(string preset_name, out TStringArray arr, string param_name="")
Определения PluginConfigDebugProfile.c:1887
void SetCharacterLevelsVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1557
const string CAMERA_PRESETS_LIST
Определения PluginConfigDebugProfile.c:88
array< ref CfgParam > GetDefaultWeatherPresetsParams()
Определения PluginConfigDebugProfile.c:549
vector GetItemDebugPos()
Определения PluginConfigDebugProfile.c:1572
const string VERSION_VIS
Определения PluginConfigDebugProfile.c:67
const string PRESET_DEFAULT
Определения PluginConfigDebugProfile.c:57
string GetSoundsetFilter()
Определения PluginConfigDebugProfile.c:1685
CfgParamInt GetNewCfgParamInt(int value)
Определения PluginConfigDebugProfile.c:139
array< ref CfgParam > GetBatchSpawnRectangle()
Определения PluginConfigDebugProfile.c:1470
void SetMergeType(bool is_visible)
Определения PluginConfigDebugProfile.c:1677
bool GetCharacterLevelsVisible()
Определения PluginConfigDebugProfile.c:1551
const string CHAR_LEVELS_VIS
Определения PluginConfigDebugProfile.c:61
const string ITEMDEBUG
Определения PluginConfigDebugProfile.c:84
bool GetCharacterStomachVisible()
Определения PluginConfigDebugProfile.c:1633
override string GetSubFolderName()
Определения PluginConfigDebugProfile.c:1371
void SetCharacterStatsVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1586
void CustomLocationsRemove(string name)
Определения PluginConfigDebugProfile.c:1801
const string FREE_CAMERA_CROSSHAIR
Определения PluginConfigDebugProfile.c:66
const string HEALTH_VIS
Определения PluginConfigDebugProfile.c:70
string GetItemSearch()
Определения PluginConfigDebugProfile.c:1512
int GetItemQuantity(string preset_name, int item_index)
Определения PluginConfigDebugProfile.c:2084
const string ITEM_CATEGORY_FLAG
Определения PluginConfigDebugProfile.c:79
void LoadCameraPresets()
Определения PluginConfigDebugProfile.c:1109
void SetFreeCameraCrosshairVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1651
const string CHAR_AGENTS_VIS
Определения PluginConfigDebugProfile.c:63
void SetConfigClassesFlag(int flag)
Определения PluginConfigDebugProfile.c:1756
bool PresetRemove(string preset_name)
Определения PluginConfigDebugProfile.c:1914
void PluginConfigDebugProfile()
Определения PluginConfigDebugProfile.c:345
array< ref ScriptConsoleCameraDOFPreset > GetCameraPresets()
Определения PluginConfigDebugProfile.c:1829
string GetString(string key)
Определения PluginConfigDebugProfile.c:298
const string SPAWN_DISTANCE
Определения PluginConfigDebugProfile.c:59
const string CONFIG_CLASSES_FLAG
Определения PluginConfigDebugProfile.c:78
CfgParamString GetNewCfgParamString(string value)
Определения PluginConfigDebugProfile.c:149
void SetLogsEnabled(bool value)
Определения PluginConfigDebugProfile.c:1543
float GetItemHealth(string preset_name, int item_index)
Определения PluginConfigDebugProfile.c:2043
const string WEATHER_PRESETS_LIST
Определения PluginConfigDebugProfile.c:89
bool GetItemWithPhysics(string preset_name, int item_index)
Определения PluginConfigDebugProfile.c:2125
float GetSpawnDistance()
Определения PluginConfigDebugProfile.c:1525
bool GetTempVisible()
Определения PluginConfigDebugProfile.c:1698
int GetFilterOrderReversed()
Определения PluginConfigDebugProfile.c:1444
bool CustomLocationsAdd(string name, vector position)
Определения PluginConfigDebugProfile.c:1778
const string TEMP_VIS
Определения PluginConfigDebugProfile.c:69
const string ITEM_SEARCH
Определения PluginConfigDebugProfile.c:58
array< ref CfgParam > GetItemParams(string preset_name, int item_index)
Определения PluginConfigDebugProfile.c:2001
CfgParam GetItemParam(string preset_name, int item_index, string param_name)
Определения PluginConfigDebugProfile.c:2022
ref array< ref ScriptConsoleWeatherPreset > m_WeatherPresets
Определения PluginConfigDebugProfile.c:96
void GetSubParametersInStringArray(string setting_name, string sub_param_name, out TStringArray arr)
Определения PluginConfigDebugProfile.c:323
const string ITEM_TAB_SELECTED
Определения PluginConfigDebugProfile.c:55
void GetLocationsData(out array< ref LocationParams > arr, bool isCustom)
Определения PluginConfigDebugProfile.c:2170
void SetCharacterModifiersVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1599
void RemovePreset(string preset_name)
Определения PluginConfigDebugProfile.c:1873
const string POSITION_NAME_ROOT
Определения PluginConfigDebugProfile.c:93
const string FILTER_REVERSED
Определения PluginConfigDebugProfile.c:86
const string MERGE_TYPE
Определения PluginConfigDebugProfile.c:68
const string SCENE_ROTATION_ANGLE
Определения PluginConfigDebugProfile.c:54
int GetBatchSpawnQuantity()
Определения PluginConfigDebugProfile.c:1500
void AddCameraPreset(string name, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
Определения PluginConfigDebugProfile.c:1173
const string BATCH_QUANT
Определения PluginConfigDebugProfile.c:82
void SetHorticultureVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1729
bool GetCharacterStatsVisible()
Определения PluginConfigDebugProfile.c:1580
const string LOGS_ENABLED
Определения PluginConfigDebugProfile.c:77
bool GetFreeCameraCrosshairVisible()
Определения PluginConfigDebugProfile.c:1646
bool SetItemHealth(string preset_name, int item_index, float health)
Определения PluginConfigDebugProfile.c:2058
const string SUB_PARAM_ITEM_HEALTH
Определения PluginConfigDebugProfile.c:74
void SetSpawnDistance(float value)
Определения PluginConfigDebugProfile.c:1530
ref map< string, ref CfgParam > m_DefaultValues
Определения PluginConfigDebugProfile.c:91
bool PresetRename(string old_preset_name, string new_preset_name)
Определения PluginConfigDebugProfile.c:1928
array< ref ScriptConsoleWeatherPreset > GetWeatherPresets()
Определения PluginConfigDebugProfile.c:1837
bool GetShowItemPreview()
Определения PluginConfigDebugProfile.c:1737
const string SUB_PARAM_ITEM_NAME
Определения PluginConfigDebugProfile.c:73
bool GetCharacterAgentsVisible()
Определения PluginConfigDebugProfile.c:1607
void SetItemCategoryFlag(int flag)
Определения PluginConfigDebugProfile.c:1770
void SetShowItemPreview(bool show)
Определения PluginConfigDebugProfile.c:1742
const string SUB_PARAM_ITEM_WITH_PHYSICS
Определения PluginConfigDebugProfile.c:76
void SetSceneEditorRotationAngle(int value)
Определения PluginConfigDebugProfile.c:1410
bool SwapItem(string preset_name, int item1_index, int item2_index)
Определения PluginConfigDebugProfile.c:1986
const string BATCH_RECT
Определения PluginConfigDebugProfile.c:81
void SetVersionVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1664
void SetCharacterAgentsVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1612
const string ITEM_PREVIEW
Определения PluginConfigDebugProfile.c:80
void SetBatchSpawnQuantity(int value)
Определения PluginConfigDebugProfile.c:1505
const string PRESET_LIST
Определения PluginConfigDebugProfile.c:56
int GetConfigClassesFlag()
Определения PluginConfigDebugProfile.c:1751
void SetPreset(string preset_name, int index=-1)
Определения PluginConfigDebugProfile.c:1850
void SetTempVisible(bool is_visible)
Определения PluginConfigDebugProfile.c:1703
void SetItemDebugPos(vector pos)
Определения PluginConfigDebugProfile.c:1566
const string SOUNDFILTER
Определения PluginConfigDebugProfile.c:83
bool GetCharacterModifiersVisible()
Определения PluginConfigDebugProfile.c:1594
array< ref CfgParam > GetArray(string key)
Определения PluginConfigDebugProfile.c:167
void SetSpawnLocIndex(int value)
Определения PluginConfigDebugProfile.c:1436
void ScriptConsoleCameraDOFPreset(string name, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
Определения PluginConfigDebugProfile.c:10
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool beautify=true)
Vector to string.
Определения EnConvert.c:106
const string CFG_FILE_DEBUG_PROFILE
Определения constants.c:242
const string CFG_FILE_DEBUG_DIR
Определения constants.c:249
array< string > TStringArray
Определения EnScript.c:685
proto bool FileExist(string name)
Check existence of file.
const string STRING_EMPTY
Определения constants.c:54
proto int ToLower()
Changes string to lowercase. Returns length.