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