mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
SwitchUnits: remove PFH and code cleanup
This commit is contained in:
@ -3,9 +3,10 @@ class Extended_PreInit_EventHandlers {
|
|||||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
class Extended_PostInit_EventHandlers {
|
class Extended_PostInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
|
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
DFUNC(pfhClientInit) = {
|
DFUNC(pfhClientInit) = {
|
||||||
|
|
||||||
if (GVAR(EnableSwitchUnits)) exitWith {
|
if (GVAR(EnableSwitchUnits)) exitWith {
|
||||||
@ -37,3 +39,5 @@ DFUNC(pfhClientInit) = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[FUNC(pfhClientInit), 0.5, []] call cba_fnc_addPerFrameHandler;
|
[FUNC(pfhClientInit), 0.5, []] call cba_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
|
*/
|
||||||
|
@ -16,10 +16,6 @@ class CfgPatches {
|
|||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
|
|
||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(SafeZoneRadius) {
|
|
||||||
value = 100;
|
|
||||||
typeName = "SCALAR";
|
|
||||||
};
|
|
||||||
class GVAR(EnableSwitchUnits) {
|
class GVAR(EnableSwitchUnits) {
|
||||||
value = 0;
|
value = 0;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
@ -44,4 +40,8 @@ class ACE_Settings {
|
|||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
};
|
};
|
||||||
|
class GVAR(SafeZoneRadius) {
|
||||||
|
value = 100;
|
||||||
|
typeName = "SCALAR";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -40,9 +40,6 @@ DFUNC(pfhMarkAiOnMap) = {
|
|||||||
if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then {
|
if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then {
|
||||||
private ["_markerName", "_marker", "_markerColor"];
|
private ["_markerName", "_marker", "_markerColor"];
|
||||||
|
|
||||||
hint format ["marker. %1", time];
|
|
||||||
|
|
||||||
//_markerName = format ["%1", [_x] call EFUNC(common,getName)];
|
|
||||||
_markerName = str _x;
|
_markerName = str _x;
|
||||||
|
|
||||||
_marker = createMarkerLocal [_markerName, position _x];
|
_marker = createMarkerLocal [_markerName, position _x];
|
||||||
|
@ -20,8 +20,7 @@
|
|||||||
|
|
||||||
if !(isServer) exitWith {};
|
if !(isServer) exitWith {};
|
||||||
|
|
||||||
_logic = _this select 0;
|
EXPLODE_3_PVT(_this,_logic,_units,_activated);
|
||||||
_activated = _this select 2;
|
|
||||||
|
|
||||||
if !(_activated) exitWith {};
|
if !(_activated) exitWith {};
|
||||||
|
|
||||||
@ -38,3 +37,17 @@ GVAR(Module) = true;
|
|||||||
[QGVAR(EnableSwitchUnits), true, false, true] call EFUNC(common,setSetting);
|
[QGVAR(EnableSwitchUnits), true, false, true] call EFUNC(common,setSetting);
|
||||||
|
|
||||||
diag_log text "[ACE]: SwitchUnits Module Initialized.";
|
diag_log text "[ACE]: SwitchUnits Module Initialized.";
|
||||||
|
|
||||||
|
if (GVAR(EnableSwitchUnits)) then {
|
||||||
|
private ["_sides"];
|
||||||
|
_sides = [];
|
||||||
|
|
||||||
|
if(GVAR(SwitchToWest)) then {_sides pushBack west;};
|
||||||
|
if(GVAR(SwitchToEast)) then {_sides pushBack east;};
|
||||||
|
if(GVAR(SwitchToIndependent)) then {_sides pushBack independent;};
|
||||||
|
if(GVAR(SwitchToCivilian)) then {_sides pushBack civilian;};
|
||||||
|
|
||||||
|
if (player getVariable ["ACE_CanSwitchUnits", false]) then {
|
||||||
|
[player, _sides] call FUNC(initPlayer);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_SWITCHUNITS
|
#ifdef DEBUG_ENABLED_SWITCHUNITS
|
||||||
#define DEBUG_MODE_FULL
|
#define DEBUG_MODE_FULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_SETTINGS_SWITCHUNITS
|
#ifdef DEBUG_SETTINGS_SWITCHUNITS
|
||||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_SwitchUnits
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_SwitchUnits
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Edited with tabler - 2014-12-20 -->
|
|
||||||
<Project name="ACE">
|
<Project name="ACE">
|
||||||
<Package name="SwitchUnits">
|
<Package name="SwitchUnits">
|
||||||
<Key ID="STR_ACE_SwitchUnits_SwitchedUnit">
|
<Key ID="STR_ACE_SwitchUnits_SwitchedUnit">
|
||||||
|
Reference in New Issue
Block a user