SwitchUnits: remove PFH and code cleanup

This commit is contained in:
bux578 2015-02-09 19:06:28 +01:00
parent 45c9b65bad
commit b8fb1cb86d
7 changed files with 27 additions and 13 deletions

View File

@ -3,9 +3,10 @@ class Extended_PreInit_EventHandlers {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
};
};
/*
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
};
};
*/

View File

@ -16,6 +16,8 @@
#include "script_component.hpp"
/*
DFUNC(pfhClientInit) = {
if (GVAR(EnableSwitchUnits)) exitWith {
@ -37,3 +39,5 @@ DFUNC(pfhClientInit) = {
};
[FUNC(pfhClientInit), 0.5, []] call cba_fnc_addPerFrameHandler;
*/

View File

@ -16,10 +16,6 @@ class CfgPatches {
#include "CfgVehicles.hpp"
class ACE_Settings {
class GVAR(SafeZoneRadius) {
value = 100;
typeName = "SCALAR";
};
class GVAR(EnableSwitchUnits) {
value = 0;
typeName = "BOOL";
@ -44,4 +40,8 @@ class ACE_Settings {
value = 1;
typeName = "BOOL";
};
class GVAR(SafeZoneRadius) {
value = 100;
typeName = "SCALAR";
};
};

View File

@ -40,9 +40,6 @@ DFUNC(pfhMarkAiOnMap) = {
if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then {
private ["_markerName", "_marker", "_markerColor"];
hint format ["marker. %1", time];
//_markerName = format ["%1", [_x] call EFUNC(common,getName)];
_markerName = str _x;
_marker = createMarkerLocal [_markerName, position _x];

View File

@ -20,8 +20,7 @@
if !(isServer) exitWith {};
_logic = _this select 0;
_activated = _this select 2;
EXPLODE_3_PVT(_this,_logic,_units,_activated);
if !(_activated) exitWith {};
@ -38,3 +37,17 @@ GVAR(Module) = true;
[QGVAR(EnableSwitchUnits), true, false, true] call EFUNC(common,setSetting);
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);
};
};

View File

@ -2,11 +2,11 @@
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_SWITCHUNITS
#define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_SWITCHUNITS
#define DEBUG_SETTINGS DEBUG_SETTINGS_SwitchUnits
#define DEBUG_SETTINGS DEBUG_SETTINGS_SwitchUnits
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-20 -->
<Project name="ACE">
<Package name="SwitchUnits">
<Key ID="STR_ACE_SwitchUnits_SwitchedUnit">