From 587105356407d420f960ff02dfdbfc74d6c160f1 Mon Sep 17 00:00:00 2001 From: jodav Date: Mon, 12 Jan 2015 10:49:21 +0100 Subject: [PATCH] cba'd functions --- .../functions/fnc_canMoveRallypoint.sqf | 10 +++--- addons/respawn/functions/fnc_handleKilled.sqf | 12 +++---- .../respawn/functions/fnc_handleRespawn.sqf | 4 +-- .../respawn/functions/fnc_initRallypoint.sqf | 2 +- addons/respawn/functions/fnc_module.sqf | 34 +++++++++---------- .../functions/fnc_moduleFriendlyFire.sqf | 4 +-- .../functions/fnc_moduleRallypoint.sqf | 6 ++-- .../respawn/functions/fnc_moveRallypoint.sqf | 12 ++++--- addons/respawn/functions/fnc_removeBody.sqf | 2 +- .../fnc_removeDisconnectedPlayer.sqf | 2 +- .../functions/fnc_showFriendlyFireMessage.sqf | 6 ++-- .../functions/fnc_teleportToRallypoint.sqf | 16 +++++---- addons/respawn/stringtable.xml | 21 ++++++++++++ 13 files changed, 78 insertions(+), 53 deletions(-) create mode 100644 addons/respawn/stringtable.xml diff --git a/addons/respawn/functions/fnc_canMoveRallypoint.sqf b/addons/respawn/functions/fnc_canMoveRallypoint.sqf index a0e0e2ab4b..d4607e9912 100644 --- a/addons/respawn/functions/fnc_canMoveRallypoint.sqf +++ b/addons/respawn/functions/fnc_canMoveRallypoint.sqf @@ -5,10 +5,12 @@ private ["_unit", "_side"]; _unit = _this select 0; _side = _this select 1; -_unit getVariable ["AGM_canMoveRallypoint", false] +// rallypoint names are defined in CfgVehicles.hpp + +_unit getVariable ["ACE_canMoveRallypoint"), false] && {!isNull ([ objNull, - missionNamespace getVariable ["AGM_Rallypoint_West", objNull], - missionNamespace getVariable ["AGM_Rallypoint_East", objNull], - missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull] + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] ] select ([west, east, independent] find _side) + 1)} diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 48fb056ebe..d37dccf691 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -1,5 +1,5 @@ /* - Name: AGM_Respawn_fnc_handleKilled + Name: ACE_Respawn_fnc_handleKilled Author(s): bux578 @@ -20,12 +20,12 @@ private ["_killedUnit"]; _killedUnit = _this select 0; // Saves the gear when the player is killed -AGM_Respawn_unitGear = []; +GVAR(unitGear) = []; -if (AGM_Respawn_SavePreDeathGear) then { - AGM_Respawn_unitGear = [_killedUnit] call AGM_Respawn_fnc_getAllGear; +if (GVAR(SavePreDeathGear)) then { + GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear); }; -if (missionNamespace getVariable ["AGM_showFriendlyFireMessage", false]) then { - [_this, "AGM_Respawn_fnc_showFriendlyFireMessage", 2] call AGM_Core_fnc_execRemoteFnc; +if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { + [_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(Core, execRemoteFnc); }; diff --git a/addons/respawn/functions/fnc_handleRespawn.sqf b/addons/respawn/functions/fnc_handleRespawn.sqf index 499bd33e8a..83490eb7f3 100644 --- a/addons/respawn/functions/fnc_handleRespawn.sqf +++ b/addons/respawn/functions/fnc_handleRespawn.sqf @@ -20,6 +20,6 @@ private ["_respawnedUnit"]; _respawnedUnit = _this select 0; // Restores the gear when the player respawns -if (AGM_Respawn_SavePreDeathGear) then { - [_respawnedUnit, AGM_Respawn_unitGear] call AGM_Respawn_fnc_restoreGear; +if (GVAR(SavePreDeathGear)) then { + [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear); }; diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index ae84a02605..492e426113 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -13,5 +13,5 @@ if (isNil _name) then { publicVariable _name; } else { deleteVehicle _rallypoint; - diag_log text "[AGM] Respawn: ERROR Multiple Rallypoints of same type."; + diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type."; }; diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index c407da505b..bc957c0609 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -16,28 +16,28 @@ _activated = _this select 2; if !(_activated) exitWith {}; -AGM_Respawn_Module = true; +GVAR(Module) = true; -[_logic, "AGM_Respawn_SavePreDeathGear", "SavePreDeathGear"] call AGM_Core_fnc_readBooleanParameterFromModule; -[_logic, "AGM_Respawn_RemoveDeadBodiesDisonncected", "RemoveDeadBodiesDisonncected"] call AGM_Core_fnc_readBooleanParameterFromModule; +[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(Core, readBooleanParameterFromModule); +[_logic, QGVAR(RemoveDeadBodiesDisonncected), "RemoveDeadBodiesDisonncected"] call EFUNC(Core, readBooleanParameterFromModule); if (isServer) then { - if (AGM_Respawn_RemoveDeadBodiesDisonncected) then { - _fnc_deleteDisconnected = { - _this spawn { - _unit = _this select 0; + if (GVAR(RemoveDeadBodiesDisonncected)) then { + _fnc_deleteDisconnected = { + _this spawn { + _unit = _this select 0; - sleep 4; + sleep 4; - if (!alive _unit) then { - deleteVehicle _unit; - }; - }; - false - }; + if (!alive _unit) then { + deleteVehicle _unit; + }; + }; + false + }; - addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected]; - }; + addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected]; + }; }; -diag_log text "[AGM]: Respawn Module Initialized."; +diag_log text "[ACE]: Respawn Module Initialized."; diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 3dc6fb302f..b274ed2706 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -18,11 +18,11 @@ _this spawn { if !(_activated) exitWith {}; if (isServer) then { - _varName = "AGM_showFriendlyFireMessage"; + _varName = QGVAR(showFriendlyFireMessage); missionNamespace setVariable [_varName, true]; publicVariable _varName; }; - diag_log text "[AGM]: Friendly Fire Messages Module Initialized."; + diag_log text "[ACE]: Friendly Fire Messages Module Initialized."; }; diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 33efac1953..62f36fc754 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -16,10 +16,8 @@ _activated = _this select 2; if !(_activated) exitWith {}; -//_mode = parseNumber (_logic getVariable "Action"); - { - _x setVariable ["AGM_canMoveRallypoint", true]; + _x setVariable ["ACE_canMoveRallypoint", true]; } forEach _units; -diag_log text "[AGM]: Rallypoint Module Initialized."; +diag_log text "[ACE]: Rallypoint Module Initialized."; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 68d197844c..5466528282 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -4,11 +4,13 @@ _this spawn { _unit = _this select 0; _side = _this select 1; + // rallypoint names are defined in CfgVehicles.hpp + _rallypoint = [ objNull, - missionNamespace getVariable ["AGM_RallypointExit_West", objNull], - missionNamespace getVariable ["AGM_RallypointExit_East", objNull], - missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull] + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_RallypointExit_East", objNull], + missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] ] select ([west, east, independent] find _side) + 1; if (isNull _rallypoint) exitWith {}; @@ -19,7 +21,7 @@ _this spawn { _position set [2, 0]; - ["Deploy in 5 seconds ..."] call AGM_Core_fnc_displayTextStructured; + [localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured); sleep 5; _rallypoint setPosATL _position; @@ -31,5 +33,5 @@ _this spawn { _marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber]; */ - ["Rallypoint deployed"] call AGM_Core_fnc_displayTextStructured; + [localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured); }; diff --git a/addons/respawn/functions/fnc_removeBody.sqf b/addons/respawn/functions/fnc_removeBody.sqf index 063b39abec..c8aaacd444 100644 --- a/addons/respawn/functions/fnc_removeBody.sqf +++ b/addons/respawn/functions/fnc_removeBody.sqf @@ -15,7 +15,7 @@ private ["_body", "_forceRemove", "_bodyRemoveTimer"]; _body = _this select 0; _forceRemove = _this select 1; -_bodyRemoveTimer = AGM_Respawn_BodyRemoveTimer max 0; +_bodyRemoveTimer = GVAR(BodyRemoveTimer) max 0; // could be used for SpecOps missions. if (_forceRemove) then { diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf index a3fbbc737e..2ba44ef92c 100644 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf @@ -11,5 +11,5 @@ _forceRemove = _this select 0; } forEach playableUnits; if (!isNil "_body" && {!alive _body}) then { - [_body, _forceRemove] call AGM_Respawn_fnc_removeBody; + [_body, _forceRemove] call FUNC(removeBody); }; diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index e505d2cfff..e5b8a19217 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -5,8 +5,8 @@ private ["_unit", "_killer"]; _unit = _this select 0; _killer = _this select 1; -if (_unit != _killer && side group _unit in [side group AGM_player, civilian] && {side group _killer == side group AGM_player}) then { - systemChat format ["%1 was killed by %2", [_unit] call AGM_Core_fnc_getName, [_killer] call AGM_Core_fnc_getName]; +if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then { + systemChat format ["%1 was killed by %2", [_unit] call EFUNC(Core, getName), [_killer] call EFUNC(Core, getName)]; - [_unit, "killedByFriendly", [_unit, _killer]] call AGM_Core_fnc_callCustomEventHandlers; + [_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(Core, callCustomEventHandlers); }; diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 387039479e..420865949b 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -6,22 +6,24 @@ _unit = _this select 0; _side = _this select 1; _toBase = _this select 2; +// rallypoint names are defined in CfgVehicles.hpp + _rallypoint = ([ [ objNull, - missionNamespace getVariable ["AGM_RallypointExit_West", objNull], - missionNamespace getVariable ["AGM_RallypointExit_East", objNull], - missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull] + missionNamespace getVariable ["ACE_RallypointExit_West", objNull], + missionNamespace getVariable ["ACE_RallypointExit_East", objNull], + missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] ], [ objNull, - missionNamespace getVariable ["AGM_Rallypoint_West", objNull], - missionNamespace getVariable ["AGM_Rallypoint_East", objNull], - missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull] + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] ] ] select _toBase) select ([west, east, independent] find _side) + 1; if (isNull _rallypoint) exitWith {}; _unit setPosASL (getPosASL _rallypoint); -[["Teleported to Rallypoint", "Teleported to Base"] select _toBase] call AGM_Core_fnc_displayTextStructured; +[[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(Core, displayTextStructured); diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml new file mode 100644 index 0000000000..59a9b2b31c --- /dev/null +++ b/addons/respawn/stringtable.xml @@ -0,0 +1,21 @@ + + + + + Deploy in 5 seconds ... + Wird in 5 Sekunden errichtet ... + + + Rallypoint deployed + Rallypoint errichtet + + + Teleported to Base + Zur Basis teleportiert + + + Teleported to Rallypoint + Zum Rallypoint teleportiert + + +