Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snow option to Change Weather module #682

Merged
merged 5 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion addons/modules/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (isServer) then {
}] call CBA_fnc_addEventHandler;

[QGVAR(applyWeather), {
params ["_forced", "_overcast", "_rain", "_lightning", "_rainbow", "_waves", "_wind", "_gusts", "_fog"];
params ["_forced", "_overcast", "_rain", "_precipitationType", "_lightning", "_rainbow", "_waves", "_wind", "_gusts", "_fog"];

0 setOvercast _overcast;
0 setLightnings _lightning;
Expand All @@ -58,6 +58,35 @@ if (isServer) then {
0 setFog _fog;
setWind _wind;

switch (_precipitationType) do {
// Reset to default
case 0: {
[] call BIS_fnc_setRain;
};
// Set to snow
case 1: {
[
"a3\data_f\snowflake4_ca.paa", // rainDropTexture
4, // texDropCount
0.01, // minRainDensity
25, // effectRadius
0.05, // windCoef
2.5, // dropSpeed
0.5, // rndSpeed
0.5, // rndDir
0.07, // dropWidth
0.07, // dropHeight
[1, 1, 1, 0.5], // dropColor
0.0, // lumSunFront
0.2, // lumSunBack
0.5, // refractCoef
0.5, // refractSaturation
true, // snow
false // dropColorStrong
] call BIS_fnc_setRain;
};
};

if (_forced) then {
forceWeatherChange;
};
Expand Down
11 changes: 9 additions & 2 deletions addons/modules/functions/fnc_moduleWeather.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ params ["_logic"];
],
[
"SLIDER:PERCENT",
[LSTRING(ModuleWeather_Rain), LSTRING(ModuleWeather_Rain_Tooltip)],
[LSTRING(ModuleWeather_Precipitation), LSTRING(ModuleWeather_Precipitation_Tooltip)],
[0, 1, rain],
true
],
[
"TOOLBOX",
[LSTRING(ModuleWeather_PrecipitationType), LSTRING(ModuleWeather_PrecipitationType_Tooltip)],
[parseNumber (rainParams select 15), 1, 2, [LSTRING(ModuleWeather_Rain), LSTRING(ModuleWeather_Snow)]],
true
],
[
"SLIDER:PERCENT",
[LSTRING(ModuleWeather_Lightning), LSTRING(ModuleWeather_Lightning_Tooltip)],
Expand Down Expand Up @@ -96,6 +102,7 @@ params ["_logic"];
"_forced",
"_overcast",
"_rain",
"_precipitationType",
"_lightning",
"_rainbow",
"_waves",
Expand All @@ -110,7 +117,7 @@ params ["_logic"];
private _wind = [KMH_TO_MS(_windSpeed) * sin _windDirection, KMH_TO_MS(_windSpeed) * cos _windDirection, true];
private _fog = [_fogDensity, _fogDecay, _fogAltitude];

[QGVAR(applyWeather), [_forced, _overcast, _rain, _lightning, _rainbow, _waves, _wind, _gusts, _fog]] call CBA_fnc_globalEvent;
[QGVAR(applyWeather), [_forced, _overcast, _rain, _precipitationType, _lightning, _rainbow, _waves, _wind, _gusts, _fog]] call CBA_fnc_globalEvent;
}, {}, [], QGVAR(moduleWeather)] call EFUNC(dialog,create);

deleteVehicle _logic;
36 changes: 21 additions & 15 deletions addons/modules/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2212,13 +2212,24 @@
<Italian>Coperto</Italian>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Overcast_Tooltip">
<English>Sets the amount of cloud cover, higher values result in a greater likelihood of rain/storms and faster wind speeds.</English>
<German>Legt die Bedeckung der Wolken fest, höhere Werte führen zu einer höheren Wahrscheinlichkeit von Regen/Stürmen und schnelleren Windgeschwindigkeiten.</German>
<Polish>Ustala pochmurność, wysoka wartość powoduje większe prawdopodobieństwo deszczu/burzy i szybszego wiatru.</Polish>
<Japanese>雲が覆う量を決定します。高い値では大雨/嵐のようになり、強い風が吹きます。</Japanese>
<Chinesesimp>设定云量,数值越高,下雨/风暴的可能性越大,风速越快。</Chinesesimp>
<Chinese>設定雲量,數值越高,下雨/風暴的可能性越大,風速越快。</Chinese>
<Italian>Imposta la quantità di copertura nuvolosa, valori più alti comportano una maggiore probabilità di pioggia/tempeste e velocità del vento più elevate.</Italian>
<English>Sets the amount of cloud cover, higher values result in a greater likelihood of precipitations/storms and faster wind speeds.</English>
<German>Legt die Bedeckung der Wolken fest, höhere Werte führen zu einer höheren Wahrscheinlichkeit von Niederschlägen/Stürmen und schnelleren Windgeschwindigkeiten.</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Precipitation">
<English>Precipitation</English>
<German>Niederschlag</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Precipitation_Tooltip">
<English>Sets the precipitation strength, requires overcast to be greater than 70%.</English>
<German>Legt die Niederschlagsintensität fest, erfordert, dass die Bewölkung größer als 70% ist.</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_PrecipitationType">
<English>Precipitation Type</English>
<German>Niederschlagstyp</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_PrecipitationType_Tooltip">
<English>Sets the type of precipitation.</English>
<German>Legt den Niederschlagstyp fest.</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Rain">
<English>Rain</English>
Expand All @@ -2230,14 +2241,9 @@
<Chinese>雨</Chinese>
<Italian>Piovere</Italian>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Rain_Tooltip">
<English>Sets the rain strength, requires overcast to be greater than 70%.</English>
<German>Legt die Regenstärke fest, erfordert, dass die Bewölkung größer als 70% ist.</German>
<Japanese>雨の強さを決定できますが、雲の量が 70% 以上でなければ動作しません。</Japanese>
<Polish>Ustaw intensywność deszczu, wymaga aby pochmurność była większa niż 70%.</Polish>
<Chinesesimp>设置降雨强度,要求云量大于70%。</Chinesesimp>
<Chinese>設置降雨強度,要求雲量大於70%。</Chinese>
<Italian>Imposta l'intensità della pioggia, richiede un cielo coperto superiore al 70%.</Italian>
<Key ID="STR_ZEN_Modules_ModuleWeather_Snow">
<English>Snow</English>
<German>Schnee</German>
</Key>
<Key ID="STR_ZEN_Modules_ModuleWeather_Lightning">
<English>Lightning</English>
Expand Down