DayZ 1.27
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 строка 1255

1256 {
1257 CfgParamArray presetParam;
1258 CfgParamString paramName;
1259 CfgParamFloat paramOvercast, paramRain, paramSnow, paramFog, paramWindMagnitude, paramWindDirection, paramVolFogDD, paramVolFogHD, paramVolFogHB;
1260
1261 array<ref CfgParam> weather_params = GetArray(WEATHER_PRESETS_LIST);
1262 int weatherPresetIndex = -1;
1263 for (int i = 0; i < weather_params.Count(); i++)
1264 {
1265 presetParam = CfgParamArray.Cast(weather_params.Get(i));
1266 if (!presetParam)
1267 return;
1268
1269 paramName = CfgParamString.Cast(presetParam.GetValueByName("Name", CFG_TYPE_STRING));
1270 if (paramName.GetValue() == name)
1271 {
1272 weatherPresetIndex = i;
1273 break;
1274 }
1275 }
1276
1277 if (weatherPresetIndex > -1)
1278 {
1279 weather_params.Remove(weatherPresetIndex);
1280 }
1281
1282 presetParam = new CfgParamArray("");
1283 paramName = new CfgParamString("Name");
1284 paramName.SetValue(name);
1285 paramOvercast = new CfgParamFloat("Overcast");
1286 paramOvercast.SetValue(overcast);
1287 paramRain = new CfgParamFloat("Rain");
1288 paramRain.SetValue(rain);
1289 paramSnow = new CfgParamFloat("Snow");
1290 paramSnow.SetValue(snow);
1291 paramFog = new CfgParamFloat("Fog");
1292 paramFog.SetValue(fog);
1293 paramWindMagnitude = new CfgParamFloat("WindMagnitude");
1294 paramWindMagnitude.SetValue(windM);
1295 paramWindDirection = new CfgParamFloat("WindDirection");
1296 paramWindDirection.SetValue(windD);
1297 paramVolFogDD = new CfgParamFloat("VolFogDD");
1298 paramVolFogDD.SetValue(volFogDD);
1299 paramVolFogHD = new CfgParamFloat("VolFogHD");
1300 paramVolFogHD.SetValue(volFogHD);
1301 paramVolFogHB = new CfgParamFloat("VolFogHB");
1302 paramVolFogHB.SetValue(volFogHB);
1303
1304 presetParam.InsertValue(paramName);
1305 presetParam.InsertValue(paramOvercast);
1306 presetParam.InsertValue(paramRain);
1307 presetParam.InsertValue(paramSnow);
1308 presetParam.InsertValue(paramFog);
1309 presetParam.InsertValue(paramWindMagnitude);
1310 presetParam.InsertValue(paramWindDirection);
1311 presetParam.InsertValue(paramVolFogDD);
1312 presetParam.InsertValue(paramVolFogHD);
1313 presetParam.InsertValue(paramVolFogHB);
1314
1315 if (weatherPresetIndex == -1)
1316 {
1317 weather_params.Insert(presetParam);
1318 m_WeatherPresets.Insert(new ScriptConsoleWeatherPreset(name, overcast, rain, snow, fog, windM, windD, volFogDD, volFogHD, volFogHB));
1319 }
1320 else
1321 {
1322 weather_params.InsertAt(presetParam, weatherPresetIndex);
1324 }
1325
1326 SaveConfigToFile();
1327 }
const int CFG_TYPE_STRING
Определения CfgParam.c:1
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void ScriptConsoleWeatherPreset(string name, float overcast, float rain, float snow, float fog, float windMagnitude, float windDir, float volFogDD, float volFogHD, float volFogHB)
Определения PluginConfigDebugProfile.c:34
void LoadWeatherPresets()
Определения PluginConfigDebugProfile.c:1139
const string WEATHER_PRESETS_LIST
Определения PluginConfigDebugProfile.c:89
ref array< ref ScriptConsoleWeatherPreset > m_WeatherPresets
Определения PluginConfigDebugProfile.c:96
array< ref CfgParam > GetArray(string key)
Определения PluginConfigDebugProfile.c:167

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