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

Repair - Move to separate settings menu #9236

Merged
merged 3 commits into from
Jul 3, 2023
Merged
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
40 changes: 21 additions & 19 deletions addons/repair/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
private _category = format ["ACE %1", LLSTRING(Repair)];

[
QGVAR(displayTextOnRepair), "CHECKBOX",
[LSTRING(SettingDisplayTextName), LSTRING(SettingDisplayTextDesc)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
true, // default value
false, // isGlobal
{[QGVAR(displayTextOnRepair), _this] call EFUNC(common,cbaSettings_settingChanged)}
Expand All @@ -10,7 +12,7 @@
[
QGVAR(engineerSetting_repair), "LIST",
[LSTRING(engineerSetting_Repair_name), LSTRING(engineerSetting_Repair_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[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)}
Expand All @@ -19,7 +21,7 @@
[
QGVAR(engineerSetting_wheel), "LIST",
[LSTRING(engineerSetting_Wheel_name), LSTRING(engineerSetting_Wheel_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[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)}
Expand All @@ -28,7 +30,7 @@
[
QGVAR(patchWheelEnabled), "LIST",
[LSTRING(patchWheelEnabled_name), LSTRING(patchWheelEnabled_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[-1,0,1,2],["str_player_none", LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],1], // default value
true // isGlobal
] call CBA_fnc_addSetting;
Expand All @@ -37,7 +39,7 @@
QGVAR(patchWheelRequiredItems),
"LIST",
[LSTRING(patchWheelRequiredItems_DisplayName), LSTRING(patchWheelRequiredItems_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[[], [ANY_TOOLKIT_FAKECLASS]], ["STR_A3_None", "STR_A3_CfgWeapons_Toolkit0"], 1],
true
] call CBA_fnc_addSetting;
Expand All @@ -46,15 +48,15 @@
QGVAR(patchWheelLocation),
"LIST",
[LSTRING(patchWheelLocation_DisplayName), LSTRING(patchWheelLocation_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[["ground", "vehicle"], ["vehicle"], ["ground"]], ["str_difficulty_any", LSTRING(patchWheelOnVehicle), LSTRING(patchWheelOnGround)], 0],
true
] call CBA_fnc_addSetting;

[
QGVAR(repairDamageThreshold), "SLIDER",
[LSTRING(repairDamageThreshold_name), LSTRING(repairDamageThreshold_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[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)}
Expand All @@ -63,7 +65,7 @@
[
QGVAR(repairDamageThreshold_engineer), "SLIDER",
[LSTRING(repairDamageThreshold_Engineer_name), LSTRING(repairDamageThreshold_Engineer_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[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)}
Expand All @@ -72,7 +74,7 @@
[
QGVAR(consumeItem_toolKit), "LIST", // fnc_repair expects number
[LSTRING(consumeItem_ToolKit_name), LSTRING(consumeItem_ToolKit_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[0,1],[ELSTRING(common,No), ELSTRING(common,Yes)],0], // [values, titles, defaultIndex]
true, // isGlobal
{[QGVAR(consumeItem_toolKit), _this] call EFUNC(common,cbaSettings_settingChanged)}
Expand All @@ -82,15 +84,15 @@
QGVAR(locationsBoostTraining),
"CHECKBOX",
[ELSTRING(common,LocationsBoostTraining_DisplayName), LSTRING(LocationsBoostTraining_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
false,
true
] call CBA_fnc_addSetting;

[
QGVAR(fullRepairLocation), "LIST",
[LSTRING(fullRepairLocation), LSTRING(fullRepairLocation_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[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)}
Expand All @@ -99,7 +101,7 @@
[
QGVAR(engineerSetting_fullRepair), "LIST",
[LSTRING(engineerSetting_fullRepair_name), LSTRING(engineerSetting_fullRepair_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[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)}
Expand All @@ -108,7 +110,7 @@
[
QGVAR(addSpareParts), "CHECKBOX",
[LSTRING(addSpareParts_name), LSTRING(addSpareParts_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
true, // default value
true, // isGlobal
{[QGVAR(addSpareParts), _this] call EFUNC(common,cbaSettings_settingChanged)},
Expand All @@ -119,7 +121,7 @@
QGVAR(wheelRepairRequiredItems),
"LIST",
[LSTRING(WheelRepairRequiredItems_DisplayName), LSTRING(WheelRepairRequiredItems_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[[], [ANY_TOOLKIT_FAKECLASS]], ["STR_A3_None", "STR_A3_CfgWeapons_Toolkit0"], 0],
true
] call CBA_fnc_addSetting;
Expand All @@ -128,7 +130,7 @@
QGVAR(miscRepairRequiredItems),
"LIST",
[LSTRING(MiscRepairRequiredItems_DisplayName), LSTRING(MiscRepairRequiredItems_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[[], [ANY_TOOLKIT_FAKECLASS]], ["STR_A3_None", "STR_A3_CfgWeapons_Toolkit0"], 1],
true
] call CBA_fnc_addSetting;
Expand All @@ -137,15 +139,15 @@
QGVAR(fullRepairRequiredItems),
"LIST",
[LSTRING(FullRepairRequiredItems_DisplayName), LSTRING(FullRepairRequiredItems_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[[[], [ANY_TOOLKIT_FAKECLASS]], ["STR_A3_None", "STR_A3_CfgWeapons_Toolkit0"], 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(autoShutOffEngineWhenStartingRepair), "CHECKBOX",
[LSTRING(autoShutOffEngineWhenStartingRepair_name), LSTRING(autoShutOffEngineWhenStartingRepair_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
false, // default value
true, // isGlobal
{[QGVAR(autoShutOffEngineWhenStartingRepair), _this] call EFUNC(common,cbaSettings_settingChanged)}
Expand All @@ -156,7 +158,7 @@
QGVAR(patchWheelTime),
"SLIDER",
[LSTRING(patchWheelTime_DisplayName), LSTRING(patchWheelTime_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[0.1, 60, 5, 1],
true
] call CBA_fnc_addSetting;
Expand All @@ -165,7 +167,7 @@
QGVAR(patchWheelMaximumRepair),
"SLIDER",
[LSTRING(patchWheelMaximumRepair_DisplayName), LSTRING(patchWheelMaximumRepair_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_repair"],
_category,
[0, 1, 0.3, 1, true],
true
] call CBA_fnc_addSetting;