From d804d3afe6512fab918e947647fd4033611e9241 Mon Sep 17 00:00:00 2001 From: Dystopian Date: Thu, 21 Mar 2019 00:18:43 +0400 Subject: [PATCH] Cleanup some functions headers and macro using (#6866) * Cleanup frisking * Cleanup header format * Cleanup FUNC macro using --- addons/arsenal/Display3DEN.hpp | 8 +-- addons/captives/XEH_PREP.hpp | 2 - .../captives/functions/fnc_canFriskPerson.sqf | 24 ------- .../captives/functions/fnc_doFriskPerson.sqf | 67 ------------------- addons/captives/stringtable.xml | 32 --------- addons/interaction/RscTitles.hpp | 6 +- addons/medical/ACE_Medical_Treatments.hpp | 8 +-- .../medical/functions/fnc_addDamageToUnit.sqf | 2 +- addons/pylons/functions/fnc_showDialog.sqf | 30 ++++----- .../rearm/functions/fnc_hasEnoughSupply.sqf | 30 ++++----- 10 files changed, 42 insertions(+), 167 deletions(-) delete mode 100644 addons/captives/functions/fnc_canFriskPerson.sqf delete mode 100644 addons/captives/functions/fnc_doFriskPerson.sqf diff --git a/addons/arsenal/Display3DEN.hpp b/addons/arsenal/Display3DEN.hpp index 0a693a2189..b1b78b9f92 100644 --- a/addons/arsenal/Display3DEN.hpp +++ b/addons/arsenal/Display3DEN.hpp @@ -13,7 +13,7 @@ class Display3DEN { }; class aceArsenal: virtualArsenal { text = "ACE Arsenal"; - action = QUOTE(call FUNC(open3DEN)); + action = QUOTE(call DFUNC(open3DEN)); }; }; }; @@ -21,12 +21,12 @@ class Display3DEN { class MenuStrip: ctrlMenuStrip { class Items { class Tools { - items[] += {"ACE_arsenal_portVALoadouts"}; + items[] += {QGVAR(portVALoadouts)}; }; - class ACE_arsenal_portVALoadouts { + class GVAR(portVALoadouts) { text = CSTRING(portLoadoutsText); picture = QPATHTOEF(common,data\logo_ace3_ca.paa); - action = "call ace_arsenal_fnc_portVALoadouts;"; + action = QUOTE(call DFUNC(portVALoadouts);); }; }; }; diff --git a/addons/captives/XEH_PREP.hpp b/addons/captives/XEH_PREP.hpp index bf0b06a1db..6157a1e33e 100644 --- a/addons/captives/XEH_PREP.hpp +++ b/addons/captives/XEH_PREP.hpp @@ -1,7 +1,6 @@ PREP(addLoadCaptiveActions); PREP(canApplyHandcuffs); PREP(canEscortCaptive); -PREP(canFriskPerson); PREP(canLoadCaptive); PREP(canRemoveHandcuffs); PREP(canStopEscorting); @@ -9,7 +8,6 @@ PREP(canSurrender); PREP(canUnloadCaptive); PREP(doApplyHandcuffs); PREP(doEscortCaptive); -PREP(doFriskPerson); PREP(doLoadCaptive); PREP(doRemoveHandcuffs); PREP(doUnloadCaptive); diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf deleted file mode 100644 index c086afa0c7..0000000000 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ /dev/null @@ -1,24 +0,0 @@ -#include "script_component.hpp" -/* - * Author: bux578 - * Checks the conditions for being able to frisk a unit - * - * Arguments: - * 0: caller (player) - * 1: target - * - * Return Value: - * The return value - * - * Example: - * [player, bob] call ACE_captives_fnc_canFriskPerson - * - * Public: No - */ - -params ["_unit", "_target"]; - -_target getVariable [QGVAR(isHandcuffed), false] -|| {_target getVariable [QGVAR(isSurrendering), false]} -|| {_target getVariable ["ACE_isSearchable", false]} -|| {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf deleted file mode 100644 index 58e7131e72..0000000000 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ /dev/null @@ -1,67 +0,0 @@ -#include "script_component.hpp" -/* - * Author: bux578 - * Open the select menu with the "personal" items of a frisked unit. It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character - * - * Arguments: - * 0: player unit - * 1: unit - * - * Return Value: - * None - * - * Example: - * [player, bob] call ACE_captives_fnc_doFristPerson; - * - * Public: No - */ - -params ["_player", "_unit"]; - -private _weapon = currentWeapon _player; -if (_weapon == primaryWeapon _player && {_weapon != ""}) then { - [_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation); -}; - -private _listedItemClasses = []; - -private _actions = [localize LSTRING(FriskMenuHeader), ""] call ACE_Interaction_fnc_prepareSelectMenu; - -private _allGear = []; - -if ((handgunWeapon _unit) != "") then { - _allGear pushBack (handgunWeapon _unit); -}; -if (count (uniformItems _unit) > 0) then { - _allGear = _allGear + (uniformItems _unit); -}; -if (count (vestItems _unit) > 0) then { - _allGear = _allGear + (vestItems _unit); -}; -if (count (backpackItems _unit) > 0) then { - _allGear = _allGear + (backpackItems _unit); -}; -if (count (assignedItems _unit) > 0) then { - _allGear = _allGear + (assignedItems _unit); -}; - -// Handgun -// Uniform Items -// Vest Items -// Backpack Items -// Assigned Items -{ - if (!(_x in _listedItemClasses)) then { - private _item = configFile >> "CfgMagazines" >> _x; - if (isNil "_item" || str _item == "") then { //str _item ? - _item = configFile >> "CfgWeapons" >> _x; - }; - _actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem; - _listedItemClasses pushBack _x; - }; -} forEach (_allGear); - -[_actions, {call ACE_Interaction_fnc_hideMenu;}, {call ACE_Interaction_fnc_hideMenu;}] call ACE_Interaction_fnc_openSelectMenu; - -// don't need an "Ok" Button -ctrlShow [8860, false]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 3b517654a7..5683d9b5f4 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -155,38 +155,6 @@ 束線帶可以綁住俘虜 束线带可以绑住俘虏 - - Inventory of frisked person - Inventar der durchsuchten Person - Inventaire de la personne fouillé - Inventario de la persona cacheada - Motozott személy felszerelése - Inventář prohledávané osoby - Ekwipunek rewidowanej osoby - Инвентарь обысканного человека - Inventário da pessoa revistada - Inventario della persona perquisita - 捕虜の持ち物を確認する - 검문당한 사람의 소지품 - 搜身選單 - 搜身选单 - - - Frisk person - Person durchsuchen - Fouiller la personne - Cachear - Prohledávaná osoba - Rewiduj osobę - Motozás - Обыскать человека - Revistar - Perquisisci la persona - 捕虜の持ち物 - 검문당한사람 - 搜身 - 搜身 - Surrender Se rendre diff --git a/addons/interaction/RscTitles.hpp b/addons/interaction/RscTitles.hpp index b619ed594c..e157fd696c 100644 --- a/addons/interaction/RscTitles.hpp +++ b/addons/interaction/RscTitles.hpp @@ -67,7 +67,7 @@ class RscACE_SelectAnItem { text = ""; }; class itemList: RscListBox { - onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; + onMouseButtonDblClick = QUOTE(_this call DFUNC(onSelectMenuDblClick)); idc = 8866; x = X_OFFSET + 0.005; w = 0.59; @@ -106,7 +106,7 @@ class RscACE_SelectAnItem { y = 0.605; style = 2; text = CSTRING(Back); - action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; + action = QUOTE(call DFUNC(hideMenu);); //'Default' call DFUNC(openMenu); 'Default' call DFUNC(openMenuSelf); colorBackground[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundActive[] = {1,1,1,0.2}; @@ -120,7 +120,7 @@ class RscACE_SelectAnItem { w = 0.15; style = 2; text = CSTRING(MakeSelection); - action = "call ACE_Interaction_fnc_hideMenu;"; + action = QUOTE(call DFUNC(hideMenu);); colorBackground[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundActive[] = {1,1,1,0.2}; diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 84d22070f2..36c0c6ba1f 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -123,10 +123,10 @@ class ACE_Medical_Actions { requiredMedic = 0; treatmentTime = 15; items[] = {}; - condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && GVAR(enableRevive)>0); + condition = QUOTE(!([(_this select 1)] call DEFUNC(common,isAwake)) && GVAR(enableRevive)>0); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; - callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; + callbackProgress = QUOTE(!([((_this select 0) select 1)] call DEFUNC(common,isAwake))); animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; @@ -371,10 +371,10 @@ class ACE_Medical_Actions { requiredMedic = 0; treatmentTime = 15; items[] = {}; - condition = "!([(_this select 1)] call ace_common_fnc_isAwake)"; + condition = QUOTE(!([(_this select 1)] call DEFUNC(common,isAwake))); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; - callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; + callbackProgress = QUOTE(!([((_this select 0) select 1)] call DEFUNC(common,isAwake))); animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 609c636bfa..b5f59e50e9 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -30,7 +30,7 @@ if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1", _this if (!(_selection in GVAR(SELECTIONS))) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); -1}; //Get the hitpoint and the index -private _hitpoint = [_unit, _selection, true] call ace_medical_fnc_translateSelections; +private _hitpoint = [_unit, _selection, true] call FUNC(translateSelections); (getAllHitPointsDamage _unit) params [["_allHitPoints", []]]; private _hitpointIndex = -1; { //case insensitive find diff --git a/addons/pylons/functions/fnc_showDialog.sqf b/addons/pylons/functions/fnc_showDialog.sqf index ae5d4d3561..119489f4d8 100644 --- a/addons/pylons/functions/fnc_showDialog.sqf +++ b/addons/pylons/functions/fnc_showDialog.sqf @@ -1,20 +1,20 @@ #include "script_component.hpp" /* -* Author: 654wak654 -* Shows the aircraft loadout dialog for given aircraft. -* -* Arguments: -* 0: Aircraft -* 1: Is curator. Disables time and resource requirements. (default: false) -* -* Return Value: -* None -* -* Example: -* [vehicle ace_player] call ace_pylons_fnc_showDialog -* -* Public: Yes -*/ + * Author: 654wak654 + * Shows the aircraft loadout dialog for given aircraft. + * + * Arguments: + * 0: Aircraft + * 1: Is curator. Disables time and resource requirements. (default: false) + * + * Return Value: + * None + * + * Example: + * [vehicle ace_player] call ace_pylons_fnc_showDialog + * + * Public: Yes + */ params ["_aircraft", ["_isCurator", false]]; diff --git a/addons/rearm/functions/fnc_hasEnoughSupply.sqf b/addons/rearm/functions/fnc_hasEnoughSupply.sqf index 232d6776ad..1af5d96a50 100644 --- a/addons/rearm/functions/fnc_hasEnoughSupply.sqf +++ b/addons/rearm/functions/fnc_hasEnoughSupply.sqf @@ -1,20 +1,20 @@ #include "script_component.hpp" /* -* Author: GitHawk -* Check whether enough supply is left to take the magazine. -* -* Arguments: -* 0: Ammo Truck -* 1: Magazine Classname -* -* Return Value: -* Enough supply -* -* Example: -* [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_hasEnoughSupply -* -* Public: No -*/ + * Author: GitHawk + * Check whether enough supply is left to take the magazine. + * + * Arguments: + * 0: Ammo Truck + * 1: Magazine Classname + * + * Return Value: + * Enough supply + * + * Example: + * [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_hasEnoughSupply + * + * Public: No + */ params ["_truck", "_magazineClass"];