From 1db1c410729addd8cc889c10d725ffc2d00a2288 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 25 Jun 2016 21:46:24 +0200 Subject: [PATCH] only disable auto-weather settings by default, but keep them toggleable --- addons/weather/Cfg3DEN.hpp | 76 ------------------------------------- addons/weather/config.cpp | 1 - addons/weather/init3DEN.sqf | 12 ++---- 3 files changed, 4 insertions(+), 85 deletions(-) delete mode 100644 addons/weather/Cfg3DEN.hpp diff --git a/addons/weather/Cfg3DEN.hpp b/addons/weather/Cfg3DEN.hpp deleted file mode 100644 index ec87fcc632..0000000000 --- a/addons/weather/Cfg3DEN.hpp +++ /dev/null @@ -1,76 +0,0 @@ - -// point of this file is to disable "auto-weather" -// we want this, because it breaks weather commands we use in this component - -// we hide the settings name and remove the tooltip -#define ALWAYS_ENABLE_WEATHER_SETTING control = QGVAR(disabledCheckbox);\ - displayName = "";\ - tooltip = "" - -class Cfg3DEN { - class Attributes { - class Title; - class Checkbox: Title { - class Controls { - class Title; - class Value; - }; - }; - - class GVAR(disabledCheckbox): Checkbox { - // setting is still in the menu, because they have to appear somewhere - // we can however set the size to 0 - w = 0; - h = 0; - attributeLoad = ""; - attributeSave = ""; - class Controls: Controls { - // the control has to have a "Title" and a "Value", otherwise the game crashes - class Title: Title { - // these also have to have a size of 0 or they would appear over the settings below - w = 0; - h = 0; - }; - // We change the "Value"s type to the same of the "Title", so it's not selectable - class Value: Title { - // hard coded. has to be 100, otherwise the game crashes - idc = 100; - }; - }; - }; - }; - class Mission { - class Intel { - class AttributeCategories { - class Rain { - class Attributes { - class RainForced { - ALWAYS_ENABLE_WEATHER_SETTING; - }; - }; - }; - class Lightnings { - class Attributes { - class LightningsForced { - ALWAYS_ENABLE_WEATHER_SETTING; - }; - }; - }; - class Waves { - class Attributes { - class WavesForced { - ALWAYS_ENABLE_WEATHER_SETTING; - }; - }; - }; - class Wind { - class Attributes { - class WindForced { - ALWAYS_ENABLE_WEATHER_SETTING; - }; - }; - }; - }; - }; - }; -}; diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp index d271a69169..f8b8130d37 100644 --- a/addons/weather/config.cpp +++ b/addons/weather/config.cpp @@ -15,7 +15,6 @@ class CfgPatches { }; #include "CfgEventhandlers.hpp" -#include "Cfg3DEN.hpp" #include "CfgWorlds.hpp" #include "RscTitles.hpp" #include "CfgVehicles.hpp" diff --git a/addons/weather/init3DEN.sqf b/addons/weather/init3DEN.sqf index 5355b26cc3..1bae6c4d95 100644 --- a/addons/weather/init3DEN.sqf +++ b/addons/weather/init3DEN.sqf @@ -1,19 +1,15 @@ -// point of this file is to disable "auto-weather" +// point of this file is to disable "auto-weather" by default // we want this, because it breaks weather commands we use in this component #include "script_component.hpp" -// cannot create checkboxes which have the default value true +// cannot create checkboxes which have the default value "true" // 3den uses inverted checkboxes instead, but those only change in appearence // we have to auto set these settings manually - on mission creation -// we also want this on mission load, just to reach as many missions as possible -private _fnc_disableAutoWeather = { +add3DENEventHandler ["onMissionNew", { set3DENMissionAttributes [ ["Intel", "IntelRainIsForced", true], ["Intel", "IntelLightningIsForced", true], ["Intel", "IntelWavesIsForced", true], ["Intel", "IntelWindIsForced", true] ]; -}; - -add3DENEventHandler ["onMissionNew", _fnc_disableAutoWeather]; -add3DENEventHandler ["onMissionLoad", _fnc_disableAutoWeather]; +}];