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