From a8c1846a3767d88e56a7832b7dd3a34bfd996d54 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 5 Jul 2018 11:29:32 -0500 Subject: [PATCH] Logistics - Move to CBA settings and organize in subcategories (#6284) --- addons/cargo/ACE_Settings.hpp | 13 +--- addons/cargo/XEH_preInit.sqf | 2 + addons/cargo/initSettings.sqf | 19 ++++++ addons/optionsmenu/stringtable.xml | 26 ++++---- addons/rearm/ACE_Settings.hpp | 14 +--- addons/rearm/XEH_preInit.sqf | 2 + addons/rearm/initSettings.sqf | 19 ++++++ addons/refuel/ACE_Settings.hpp | 13 +--- addons/refuel/XEH_preInit.sqf | 2 + addons/refuel/initSettings.sqf | 19 ++++++ addons/repair/ACE_Settings.hpp | 76 ++++------------------ addons/repair/XEH_preInit.sqf | 2 + addons/repair/initSettings.sqf | 100 +++++++++++++++++++++++++++++ 13 files changed, 196 insertions(+), 111 deletions(-) create mode 100644 addons/cargo/initSettings.sqf create mode 100644 addons/rearm/initSettings.sqf create mode 100644 addons/refuel/initSettings.sqf create mode 100644 addons/repair/initSettings.sqf diff --git a/addons/cargo/ACE_Settings.hpp b/addons/cargo/ACE_Settings.hpp index e95465e647..fb039373a5 100644 --- a/addons/cargo/ACE_Settings.hpp +++ b/addons/cargo/ACE_Settings.hpp @@ -1,17 +1,8 @@ class ACE_Settings { class GVAR(enable) { - displayName = CSTRING(ModuleSettings_enable); - description = CSTRING(ModuleSettings_enable_Description); - typeName = "BOOL"; - value = 1; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(paradropTimeCoefficent) { - displayName = CSTRING(paradropTimeCoefficent); - description = CSTRING(paradropTimeCoefficent_description); - typeName = "SCALAR"; - value = 2.5; - category = ECSTRING(OptionsMenu,CategoryLogistics); - sliderSettings[] = {0, 10, 2.5, 1}; + movedToSQF = 1; }; }; diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index 5ee6406a7d..3d7ac380c2 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + GVAR(initializedItemClasses) = []; GVAR(initializedVehicleClasses) = []; GVAR(cargoHolderTypes) = ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"]; diff --git a/addons/cargo/initSettings.sqf b/addons/cargo/initSettings.sqf new file mode 100644 index 0000000000..3a9f70070a --- /dev/null +++ b/addons/cargo/initSettings.sqf @@ -0,0 +1,19 @@ +// CBA Settings [ADDON: ace_cargo]: + +[ + QGVAR(enable), "CHECKBOX", + [LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(openMenu)], + true, // default value + true, // isGlobal + {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(paradropTimeCoefficent), "SLIDER", + [LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(openMenu)], + [0,10,2.5,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + true, // isGlobal + {[QGVAR(paradropTimeCoefficent), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index b5c3d2737d..bd0c93016a 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -98,19 +98,19 @@ 顯示新聞消息於主選單 - Logistics - Logistik - Logistyka - Logística - Логистика - Logistika - Logística - Logistica - Logistique - ロジスティクス - 보급 - 后勤设定 - 後勤設定 + ACE Logistics + ACE Logistik + ACE Logistyka + ACE Logística + ACE Логистика + ACE Logistika + ACE Logística + ACE Logistica + ACE Logistique + ACE ロジスティクス + ACE 보급 + ACE 后勤设定 + ACE 後勤設定 Hide diff --git a/addons/rearm/ACE_Settings.hpp b/addons/rearm/ACE_Settings.hpp index 2bd4eec450..e592466c40 100644 --- a/addons/rearm/ACE_Settings.hpp +++ b/addons/rearm/ACE_Settings.hpp @@ -1,18 +1,8 @@ class ACE_Settings { class GVAR(level) { - category = CSTRING(DisplayName); - displayName = CSTRING(RearmSettings_level_DisplayName); - description = CSTRING(RearmSettings_level_Description); - value = 0; - typeName = "SCALAR"; - values[] = {CSTRING(RearmSettings_vehicle), CSTRING(RearmSettings_magazine), CSTRING(RearmSettings_caliber)}; + movedToSQF = 1; }; class GVAR(supply) { - category = CSTRING(DisplayName); - displayName = CSTRING(RearmSettings_supply_DisplayName); - description = CSTRING(RearmSettings_supply_Description); - value = 0; - typeName = "SCALAR"; - values[] = {CSTRING(RearmSettings_unlimited), CSTRING(RearmSettings_limited), CSTRING(RearmSettings_magazineSupply)}; + movedToSQF = 1; }; }; diff --git a/addons/rearm/XEH_preInit.sqf b/addons/rearm/XEH_preInit.sqf index b47cf6628d..9361d05015 100644 --- a/addons/rearm/XEH_preInit.sqf +++ b/addons/rearm/XEH_preInit.sqf @@ -6,4 +6,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + ADDON = true; diff --git a/addons/rearm/initSettings.sqf b/addons/rearm/initSettings.sqf new file mode 100644 index 0000000000..0e5e421747 --- /dev/null +++ b/addons/rearm/initSettings.sqf @@ -0,0 +1,19 @@ +// CBA Settings [ADDON: ace_rearm]: + +[ + QGVAR(level), "LIST", + [LSTRING(RearmSettings_level_DisplayName), LSTRING(RearmSettings_level_Description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(DisplayName)], + [[0,1,2],[LSTRING(RearmSettings_vehicle), LSTRING(RearmSettings_magazine), LSTRING(RearmSettings_caliber)],0], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(level), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(supply), "LIST", + [LSTRING(RearmSettings_supply_DisplayName), LSTRING(RearmSettings_supply_Description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(DisplayName)], + [[0,1,2],[LSTRING(RearmSettings_unlimited), LSTRING(RearmSettings_limited), LSTRING(RearmSettings_magazineSupply)],0], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(supply), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; diff --git a/addons/refuel/ACE_Settings.hpp b/addons/refuel/ACE_Settings.hpp index 6904d33431..e545a7fed5 100644 --- a/addons/refuel/ACE_Settings.hpp +++ b/addons/refuel/ACE_Settings.hpp @@ -1,17 +1,8 @@ class ACE_Settings { class GVAR(rate) { - category = ECSTRING(OptionsMenu,CategoryLogistics); - displayName = CSTRING(RefuelSettings_speed_DisplayName); - description = CSTRING(RefuelSettings_speed_Description); - value = 1; - typeName = "SCALAR"; - sliderSettings[] = {0, 25, 1, 1}; + movedToSQF = 1; }; class GVAR(hoseLength) { - category = ECSTRING(OptionsMenu,CategoryLogistics); - displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); - value = 12; - typeName = "SCALAR"; - sliderSettings[] = {0, 50, 12, 1}; + movedToSQF = 1; }; }; diff --git a/addons/refuel/XEH_preInit.sqf b/addons/refuel/XEH_preInit.sqf index b47cf6628d..9361d05015 100644 --- a/addons/refuel/XEH_preInit.sqf +++ b/addons/refuel/XEH_preInit.sqf @@ -6,4 +6,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + ADDON = true; diff --git a/addons/refuel/initSettings.sqf b/addons/refuel/initSettings.sqf new file mode 100644 index 0000000000..b16cff3230 --- /dev/null +++ b/addons/refuel/initSettings.sqf @@ -0,0 +1,19 @@ +// CBA Settings [ADDON: ace_refuel]: + +[ + QGVAR(rate), "SLIDER", + [LSTRING(RefuelSettings_speed_DisplayName), LSTRING(RefuelSettings_speed_Description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + true, // isGlobal + {[QGVAR(rate), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(hoseLength), "SLIDER", + [LSTRING(RefuelSettings_hoseLength_DisplayName)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + [0,50,12,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + true, // isGlobal + {[QGVAR(hoseLength), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index d5fc6a430e..82217bc5ad 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -1,89 +1,37 @@ +// Warning: do not remove without handling wheelRepairRequiredItems's _values config on line 32 [used in repair/canRepair] class ACE_Settings { class GVAR(displayTextOnRepair) { - displayName = CSTRING(SettingDisplayTextName); - description = CSTRING(SettingDisplayTextDesc); - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(engineerSetting_repair) { - displayName = CSTRING(engineerSetting_Repair_name); - description = CSTRING(engineerSetting_Repair_description); - typeName = "SCALAR"; - value = 1; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(engineerSetting_wheel) { - displayName = CSTRING(engineerSetting_Wheel_name); - description = CSTRING(engineerSetting_Wheel_description); - typeName = "SCALAR"; - value = 0; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(repairDamageThreshold) { - displayName = CSTRING(repairDamageThreshold_name); - description = CSTRING(repairDamageThreshold_description); - typeName = "SCALAR"; - value = 0.6; - category = ECSTRING(OptionsMenu,CategoryLogistics); - sliderSettings[] = {0, 1, 0.6, 2}; + movedToSQF = 1; }; class GVAR(repairDamageThreshold_engineer) { - displayName = CSTRING(repairDamageThreshold_Engineer_name); - description = CSTRING(repairDamageThreshold_Engineer_description); - typeName = "SCALAR"; - value = 0.4; - category = ECSTRING(OptionsMenu,CategoryLogistics); - sliderSettings[] = {0, 1, 0.4, 2}; + movedToSQF = 1; }; class GVAR(consumeItem_toolKit) { - displayName = CSTRING(consumeItem_ToolKit_name); - description = CSTRING(consumeItem_ToolKit_description); - typeName = "SCALAR"; - value = 0; - values[] = {ECSTRING(common,No), ECSTRING(common,Yes)}; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(fullRepairLocation) { - displayName = CSTRING(fullRepairLocation); - description = CSTRING(fullRepairLocation_description); - typeName = "SCALAR"; - value = 2; - values[] = {CSTRING(useAnywhere), CSTRING(repairVehicleOnly), CSTRING(repairFacilityOnly), CSTRING(vehicleAndFacility), ECSTRING(common,Disabled)}; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(engineerSetting_fullRepair) { - displayName = CSTRING(engineerSetting_fullRepair_name); - description = CSTRING(engineerSetting_fullRepair_description); - typeName = "SCALAR"; - value = 2; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(addSpareParts) { - displayName = CSTRING(addSpareParts_name); - description = CSTRING(addSpareParts_description); - typeName = "BOOL"; - value = 1; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; class GVAR(wheelRepairRequiredItems) { - displayName = CSTRING(wheelRepairRequiredItems_name); - description = CSTRING(wheelRepairRequiredItems_description); - category = ECSTRING(OptionsMenu,CategoryLogistics); - typeName = "SCALAR"; - value = 0; - values[] = {"None", "ToolKit"}; + movedToSQF = 1; _values[] = {{}, {"ToolKit"}}; }; class GVAR(autoShutOffEngineWhenStartingRepair) { - displayName = CSTRING(autoShutOffEngineWhenStartingRepair_name); - description = CSTRING(autoShutOffEngineWhenStartingRepair_description); - typeName = "BOOL"; - value = 0; - category = ECSTRING(OptionsMenu,CategoryLogistics); + movedToSQF = 1; }; }; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index 040871d851..216a16fcf7 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + ["ACE_RepairItem_Base", "killed", { params ["_object"]; diff --git a/addons/repair/initSettings.sqf b/addons/repair/initSettings.sqf new file mode 100644 index 0000000000..c392711218 --- /dev/null +++ b/addons/repair/initSettings.sqf @@ -0,0 +1,100 @@ +// CBA Settings [ADDON: ace_repair]: + +[ + QGVAR(displayTextOnRepair), "CHECKBOX", + [LSTRING(SettingDisplayTextName), LSTRING(SettingDisplayTextDesc)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + true, // default value + false, // isGlobal + {[QGVAR(displayTextOnRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(engineerSetting_repair), "LIST", + [LSTRING(engineerSetting_Repair_name), LSTRING(engineerSetting_Repair_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],1], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(engineerSetting_repair), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(engineerSetting_wheel), "LIST", + [LSTRING(engineerSetting_Wheel_name), LSTRING(engineerSetting_Wheel_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],0], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(engineerSetting_wheel), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(repairDamageThreshold), "SLIDER", + [LSTRING(repairDamageThreshold_name), LSTRING(repairDamageThreshold_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [0,1,0.6,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + true, // isGlobal + {[QGVAR(repairDamageThreshold), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(repairDamageThreshold_engineer), "SLIDER", + [LSTRING(repairDamageThreshold_Engineer_name), LSTRING(repairDamageThreshold_Engineer_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [0,1,0.4,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + true, // isGlobal + {[QGVAR(repairDamageThreshold_engineer), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(consumeItem_toolKit), "LIST", // fnc_repair expects number + [LSTRING(consumeItem_ToolKit_name), LSTRING(consumeItem_ToolKit_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1],[ELSTRING(common,No), ELSTRING(common,Yes)],0], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(consumeItem_toolKit), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(fullRepairLocation), "LIST", + [LSTRING(fullRepairLocation), LSTRING(fullRepairLocation_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1,2,3,4],[LSTRING(useAnywhere), LSTRING(repairVehicleOnly), LSTRING(repairFacilityOnly), LSTRING(vehicleAndFacility), ELSTRING(common,Disabled)],2], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(fullRepairLocation), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(engineerSetting_fullRepair), "LIST", + [LSTRING(engineerSetting_fullRepair_name), LSTRING(engineerSetting_fullRepair_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],2], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(engineerSetting_fullRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(addSpareParts), "CHECKBOX", + [LSTRING(addSpareParts_name), LSTRING(addSpareParts_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + true, // default value + true, // isGlobal + {[QGVAR(addSpareParts), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(wheelRepairRequiredItems), "LIST", + [LSTRING(wheelRepairRequiredItems_name), LSTRING(wheelRepairRequiredItems_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + [[0,1],["None", "ToolKit"],0], // [values, titles, defaultIndex] + true, // isGlobal + {[QGVAR(wheelRepairRequiredItems), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init; + +[ + QGVAR(autoShutOffEngineWhenStartingRepair), "CHECKBOX", + [LSTRING(autoShutOffEngineWhenStartingRepair_name), LSTRING(autoShutOffEngineWhenStartingRepair_description)], + [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"], + false, // default value + true, // isGlobal + {[QGVAR(autoShutOffEngineWhenStartingRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_settings_fnc_init;