mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Transfer curator functionality from ace_captives
This commit is contained in:
parent
b72512e3f1
commit
eefe995a0c
@ -164,8 +164,6 @@ class CfgVehicles {
|
|||||||
displayName = "$STR_ACE_Captives_ModuleSurrender_DisplayName"; //Make Unit Surrender
|
displayName = "$STR_ACE_Captives_ModuleSurrender_DisplayName"; //Make Unit Surrender
|
||||||
function = QUOTE(DFUNC(moduleSurrender));
|
function = QUOTE(DFUNC(moduleSurrender));
|
||||||
scope = 2; //show in editor
|
scope = 2; //show in editor
|
||||||
scopeCurator = 2; //show in zeus
|
|
||||||
curatorCost = 0; //???
|
|
||||||
isGlobal = 1; //run global
|
isGlobal = 1; //run global
|
||||||
isTriggerActivated = 1; //Wait for triggers
|
isTriggerActivated = 1; //Wait for triggers
|
||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
|
||||||
@ -176,4 +174,4 @@ class CfgVehicles {
|
|||||||
sync[] = {"AnyAI"};
|
sync[] = {"AnyAI"};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -23,37 +23,13 @@ private ["_bisMouseOver", "_mouseOverObject"];
|
|||||||
if (!_activated) exitWith {};
|
if (!_activated) exitWith {};
|
||||||
|
|
||||||
if (local _logic) then {
|
if (local _logic) then {
|
||||||
if ((!isnull curatorcamera) && {((count curatorMouseOver) == 2) && {(curatorMouseOver select 1) == _logic}}) then {//in zeus interface and we placed the module
|
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||||
_bisMouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver", []];//bis caches the previous curatorMouseOver
|
[{
|
||||||
if ((count _bisMouseOver) == 2) then {//check what mouse was over before the module was placed
|
PARAMS_1(_units);
|
||||||
_mouseOverObject = _bisMouseOver select 1;
|
{
|
||||||
if ((_mouseOverObject isKindOf "CAManBase") && {(vehicle _mouseOverObject) == _mouseOverObject}) then {
|
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
||||||
TRACE_2("Debug - module surrendering %1",_mouseOverObject,(name _mouseOverObject));
|
} forEach _units;
|
||||||
if (alive _mouseOverObject) then {
|
}, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
|
||||||
if (!(_mouseOverObject getVariable [QGVAR(isSurrendering), false])) then {
|
|
||||||
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, true]] call EFUNC(common,targetEvent);
|
|
||||||
} else {
|
|
||||||
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, false]] call EFUNC(common,targetEvent);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
["STR_ACE_Captives_Zeus_OnlyAlive"] call EFUNC(common,displayTextStructured);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
["STR_ACE_Captives_Zeus_OnlyInfantry"] call EFUNC(common,displayTextStructured);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(common,displayTextStructured);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
//an editor module
|
|
||||||
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
|
||||||
[{
|
|
||||||
PARAMS_1(_units);
|
|
||||||
{
|
|
||||||
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
|
||||||
} forEach _units;
|
|
||||||
}, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
|
|
||||||
};
|
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user