From ed96307f2f16d689dc2218bbe5de5e0a0b945675 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 22 Feb 2016 02:50:20 -0600 Subject: [PATCH 1/3] 3den repair - Replace bad combo with custom control --- addons/repair/CfgEden.hpp | 49 ++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/addons/repair/CfgEden.hpp b/addons/repair/CfgEden.hpp index 3adbe6b336..629578ba4f 100644 --- a/addons/repair/CfgEden.hpp +++ b/addons/repair/CfgEden.hpp @@ -1,23 +1,50 @@ +class ctrlToolbox; +class ctrlEdit; + class Cfg3DEN { + class Attributes { + class Default; + class Title: Default { + class Controls { + class Title; + }; + }; + class GVAR(isEngineer): Title { + attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);"; + attributeSave = "(missionnamespace getvariable ['ace_isEng_temp',0]) - 1;"; + class Controls: Controls { + class Title: Title{}; + class Value: ctrlToolbox { + idc = 100; + style = "0x02"; + x = "48 * (pixelW * 1.25 * 4)"; + w = "82 * (pixelW * 1.25 * 4)"; + h = "5 * (pixelH * 1.25 * 4)"; + rows = 1; + columns = 4; + strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignEngineerRole_role_none), CSTRING(AssignEngineerRole_role_engineer), CSTRING(AssignEngineerRole_role_specialist)}; + // tooltips[] = {""}; + values[] = {-1,0,1,2}; + onToolboxSelChanged = "missionnamespace setvariable ['ace_isEng_temp',_this select 1];"; + }; + }; + }; + + }; + class Object { class AttributeCategories { class ace_attributes { class Attributes { class ace_isEngineer { property = QUOTE(ace_isEngineer); - value = 0; - control = "Combo"; displayName = CSTRING(AssignEngineerRole_role_DisplayName); tooltip = CSTRING(AssignEngineerRole_role_Description); - expression = "_this setVariable ['%s',_value];"; + expression = "if (_value != -1) then {_this setVariable ['%s',_value, true];}"; typeName = "NUMBER"; condition = "objectBrain"; - defaultValue = 0; - class values { - class none {name = CSTRING(AssignEngineerRole_role_none); value = 0; default = 1;}; - class engineer {name = CSTRING(AssignEngineerRole_role_engineer); value = 1; default = 0;}; - class specialist {name = CSTRING(AssignEngineerRole_role_specialist); value = 2; default = 0;}; - }; + defaultValue = "-1"; + control = QGVAR(isEngineer); }; class ace_isRepairVehicle { property = QUOTE(ace_isRepairVehicle); @@ -25,7 +52,7 @@ class Cfg3DEN { control = "CheckboxNumber"; displayName = CSTRING(AssignRepairVehicle_role_DisplayName); tooltip = CSTRING(AssignRepairVehicle_role_Description); - expression = "_this setVariable ['%s',_value];"; + expression = "_this setVariable ['%s',_value, true];"; typeName = "NUMBER"; condition = "objectVehicle"; defaultValue = 0; @@ -36,7 +63,7 @@ class Cfg3DEN { control = "CheckboxNumber"; displayName = CSTRING(AssignRepairFacility_role_DisplayName); tooltip = CSTRING(AssignRepairFacility_role_Description); - expression = "_this setVariable ['%s',_value];"; + expression = "_this setVariable ['%s',_value, true];"; typeName = "NUMBER"; condition = "(1 - objectBrain) * (1 - objectVehicle)"; defaultValue = 0; From e6052aee1f850c252d372b59cd2c2a3cfa2b82b2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 22 Feb 2016 03:00:40 -0600 Subject: [PATCH 2/3] Fix captives 3den --- addons/captives/CfgEden.hpp | 4 ++-- addons/captives/functions/fnc_moduleHandcuffed.sqf | 8 ++++++-- addons/captives/functions/fnc_moduleSurrender.sqf | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/captives/CfgEden.hpp b/addons/captives/CfgEden.hpp index 6ee6230ee5..98757bd86c 100644 --- a/addons/captives/CfgEden.hpp +++ b/addons/captives/CfgEden.hpp @@ -8,7 +8,7 @@ class Cfg3DEN { control = "Checkbox"; displayName = CSTRING(ModuleHandcuffed_DisplayName); tooltip = CSTRING(ModuleHandcuffed_Description); - expression = QUOTE([ARR_2(_this,_value)]call FUNC(setHandcuffed)); + expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleHandcuffed)}); typeName = "BOOL"; condition = "objectBrain"; defaultValue = false; @@ -18,7 +18,7 @@ class Cfg3DEN { control = "Checkbox"; displayName = CSTRING(ModuleSurrender_DisplayName); tooltip = CSTRING(ModuleSurrender_Description); - expression = QUOTE([ARR_2(_this,_value)]call FUNC(setSurrendered)); + expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleSurrender)}); typeName = "BOOL"; condition = "objectBrain"; defaultValue = false; diff --git a/addons/captives/functions/fnc_moduleHandcuffed.sqf b/addons/captives/functions/fnc_moduleHandcuffed.sqf index 4c6cc4c6fc..dcb59ff2a1 100644 --- a/addons/captives/functions/fnc_moduleHandcuffed.sqf +++ b/addons/captives/functions/fnc_moduleHandcuffed.sqf @@ -1,6 +1,7 @@ /* * Author: PabstMirror * Module Function to make a unit handcuffed (can be called from editor) + * Also used for threeden attribute expression with dummy Logic Object * * Arguments: * 0: The Module Logic @@ -11,7 +12,7 @@ * Nothing * * Example: - * Called from module + * [objNull, [player], true] call ace_captives_fnc_moduleHandcuffed * * Public: No */ @@ -28,8 +29,11 @@ if (!isServer) exitWith {}; [{ params ["_units"]; { + TRACE_2("event",_x,local _x); ["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent); } forEach _units; }, [_units], 0.05] call EFUNC(common,waitAndExecute); -deleteVehicle _logic; +if (!isNull _logic) then { + deleteVehicle _logic; +}; diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index f5c091a78a..29659b351e 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -1,6 +1,7 @@ /* * Author: PabstMirror * Module Function to make a unit surrender (can be called from editor) + * Also used for threeden attribute expression with dummy Logic Object * * Arguments: * 0: The Module Logic @@ -11,7 +12,7 @@ * Nothing * * Example: - * Called from module + * [objNull, [player], true] call ace_captives_fnc_moduleSurrender * * Public: No */ @@ -28,8 +29,11 @@ if (!isServer) exitWith {}; [{ params ["_units"]; { + TRACE_2("event",_x,local _x); ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); } forEach _units; }, [_units], 0.05] call EFUNC(common,waitAndExecute); -deleteVehicle _logic; +if (!isNull _logic) then { + deleteVehicle _logic; +}; From 330792ba7ab84035c6993071ebe7ace31518c203 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 22 Feb 2016 11:26:32 -0600 Subject: [PATCH 3/3] Add medic threeden control --- addons/medical/CfgEden.hpp | 44 +++++++++++++++++++++++++--------- addons/medical/stringtable.xml | 12 ++++++++++ addons/repair/CfgEden.hpp | 14 ++++------- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/addons/medical/CfgEden.hpp b/addons/medical/CfgEden.hpp index 8adc47e94d..508d53d54c 100644 --- a/addons/medical/CfgEden.hpp +++ b/addons/medical/CfgEden.hpp @@ -1,23 +1,45 @@ +class ctrlToolbox; + class Cfg3DEN { + class Attributes { + class Default; + class Title: Default { + class Controls { + class Title; + }; + }; + class GVAR(isMedicControl): Title { + attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);"; + attributeSave = "(missionnamespace getvariable ['ace_isMeidc_temp',0]) - 1;"; + class Controls: Controls { + class Title: Title{}; + class Value: ctrlToolbox { + idc = 100; + style = "0x02"; + x = "48 * (pixelW * 1.25 * 4)"; + w = "82 * (pixelW * 1.25 * 4)"; + h = "5 * (pixelH * 1.25 * 4)"; + rows = 1; + columns = 4; + strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignMedicRoles_role_none), CSTRING(AssignMedicRoles_role_medic), CSTRING(AssignMedicRoles_role_doctorShort)}; + onToolboxSelChanged = "missionnamespace setvariable ['ace_isMeidc_temp',_this select 1];"; + }; + }; + }; + }; class Object { class AttributeCategories { class ace_attributes { class Attributes { class ace_isMedic { property = QUOTE(ace_isMedic); - value = 0; - control = "Combo"; + control = QGVAR(isMedicControl); displayName = CSTRING(AssignMedicRoles_role_DisplayName); tooltip = CSTRING(Attributes_isMedic_Description); - expression = QUOTE(_this setVariable [ARR_2(QUOTE(QGVAR(medicClass)),_value)];); + expression = QUOTE(if (_value != -1) then {_this setVariable [ARR_3(QUOTE(QGVAR(medicClass)),_value, true)];};); typeName = "NUMBER"; condition = "objectBrain"; - defaultValue = 0; - class values { - class none {name = CSTRING(AssignMedicRoles_role_none); value = 0; default = 1;}; - class medic {name = CSTRING(AssignMedicRoles_role_medic); value = 1; default = 0;}; - class doctor {name = CSTRING(AssignMedicRoles_role_doctor); value = 2; default = 0;}; - }; + defaultValue = "-1"; }; class ace_isMedicalVehicle { property = QUOTE(ace_isMedicalVehicle); @@ -25,7 +47,7 @@ class Cfg3DEN { control = "CheckboxNumber"; displayName = CSTRING(AssignMedicVehicle_enabled_DisplayName); tooltip = CSTRING(Attributes_isMedicalVehicle_Description); - expression = QUOTE(_this setVariable [ARR_2(QUOTE(QGVAR(medicClass)),_value)];); + expression = QUOTE(_this setVariable [ARR_3(QUOTE(QGVAR(medicClass)),_value, true)];); typeName = "NUMBER"; condition = "objectVehicle"; defaultValue = 0; @@ -36,7 +58,7 @@ class Cfg3DEN { control = "Checkbox"; displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName); tooltip = CSTRING(AssignMedicalFacility_enabled_Description); - expression = QUOTE(_this setVariable [ARR_2(QUOTE(QGVAR(isMedicalFacility)),_value)];); + expression = QUOTE(_this setVariable [ARR_3(QUOTE(QGVAR(isMedicalFacility)),_value, true)];); typeName = "BOOL"; condition = "(1 - objectBrain) * (1 - objectVehicle)"; defaultValue = "false"; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 70363577be..94eb04eb81 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3815,6 +3815,18 @@ Doktor (csak fejlett orvosok) Dottore (Solo Medici Avanzati) + + Doctor + Врач + Doktor + Doctor + Arzt + Doktor + Doutor + Médecin + Doktor + Dottore + Assigns the ACE medic class to a unit Задает юниту класс медика diff --git a/addons/repair/CfgEden.hpp b/addons/repair/CfgEden.hpp index 629578ba4f..d8885fddf9 100644 --- a/addons/repair/CfgEden.hpp +++ b/addons/repair/CfgEden.hpp @@ -1,5 +1,4 @@ class ctrlToolbox; -class ctrlEdit; class Cfg3DEN { class Attributes { @@ -9,7 +8,7 @@ class Cfg3DEN { class Title; }; }; - class GVAR(isEngineer): Title { + class GVAR(isEngineerControl): Title { attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);"; attributeSave = "(missionnamespace getvariable ['ace_isEng_temp',0]) - 1;"; class Controls: Controls { @@ -17,19 +16,16 @@ class Cfg3DEN { class Value: ctrlToolbox { idc = 100; style = "0x02"; - x = "48 * (pixelW * 1.25 * 4)"; - w = "82 * (pixelW * 1.25 * 4)"; - h = "5 * (pixelH * 1.25 * 4)"; + x = "48 * (pixelW * 1.25 * 4)"; + w = "82 * (pixelW * 1.25 * 4)"; + h = "5 * (pixelH * 1.25 * 4)"; rows = 1; columns = 4; strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignEngineerRole_role_none), CSTRING(AssignEngineerRole_role_engineer), CSTRING(AssignEngineerRole_role_specialist)}; - // tooltips[] = {""}; - values[] = {-1,0,1,2}; onToolboxSelChanged = "missionnamespace setvariable ['ace_isEng_temp',_this select 1];"; }; }; }; - }; class Object { @@ -44,7 +40,7 @@ class Cfg3DEN { typeName = "NUMBER"; condition = "objectBrain"; defaultValue = "-1"; - control = QGVAR(isEngineer); + control = QGVAR(isEngineerControl); }; class ace_isRepairVehicle { property = QUOTE(ace_isRepairVehicle);