DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ AddWeatherPreset()

void PluginConfigHandler::AddWeatherPreset ( string name,
float overcast,
float rain,
float snow,
float fog,
float windM,
float windD,
float volFogDD,
float volFogHD,
float volFogHB )
inlineprotected

См. определение в файле PluginConfigDebugProfile.c строка 1265

1266 {
1267 CfgParamArray presetParam;
1268 CfgParamString paramName;
1269 CfgParamFloat paramOvercast, paramRain, paramSnow, paramFog, paramWindMagnitude, paramWindDirection, paramVolFogDD, paramVolFogHD, paramVolFogHB;
1270
1271 array<ref CfgParam> weather_params = GetArray(WEATHER_PRESETS_LIST);
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 }
const int CFG_TYPE_STRING
Определения CfgParam.c:1
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void LoadWeatherPresets()
Определения PluginConfigDebugProfile.c:1131
const string WEATHER_PRESETS_LIST
Определения PluginConfigDebugProfile.c:68
ref array< ref ScriptConsoleWeatherPreset > m_WeatherPresets
Определения PluginConfigDebugProfile.c:75
array< ref CfgParam > GetArray(string key)
Определения PluginConfigDebugProfile.c:146

Перекрестные ссылки CFG_TYPE_STRING, GetArray(), LoadWeatherPresets(), m_WeatherPresets, name и WEATHER_PRESETS_LIST.