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

◆ LoadWeatherPresets()

void PluginConfigHandler::LoadWeatherPresets ( )
inlineprotected

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

1132 {
1133 if (m_WeatherPresets)
1134 {
1135 m_WeatherPresets.Clear();
1136 }
1137 else
1138 {
1139 m_WeatherPresets = new array<ref ScriptConsoleWeatherPreset>;
1140 }
1141
1142 CfgParamArray presetParam;
1143 array<ref CfgParam> weather_params = GetArray(WEATHER_PRESETS_LIST);
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 }
const int CFG_TYPE_STRING
Определения CfgParam.c:1
const int CFG_TYPE_FLOAT
Определения CfgParam.c:3
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_FLOAT, CFG_TYPE_STRING, GetArray(), m_WeatherPresets и WEATHER_PRESETS_LIST.

Используется в AddWeatherPreset() и OnInit().