Cleanup some functions headers and macro using (#6866)

* Cleanup frisking

* Cleanup header format

* Cleanup FUNC macro using
This commit is contained in:
Dystopian 2019-03-21 00:18:43 +04:00 committed by PabstMirror
parent 0a4d3d5b65
commit d804d3afe6
10 changed files with 42 additions and 167 deletions

View File

@ -13,7 +13,7 @@ class Display3DEN {
}; };
class aceArsenal: virtualArsenal { class aceArsenal: virtualArsenal {
text = "ACE Arsenal"; text = "ACE Arsenal";
action = QUOTE(call FUNC(open3DEN)); action = QUOTE(call DFUNC(open3DEN));
}; };
}; };
}; };
@ -21,12 +21,12 @@ class Display3DEN {
class MenuStrip: ctrlMenuStrip { class MenuStrip: ctrlMenuStrip {
class Items { class Items {
class Tools { class Tools {
items[] += {"ACE_arsenal_portVALoadouts"}; items[] += {QGVAR(portVALoadouts)};
}; };
class ACE_arsenal_portVALoadouts { class GVAR(portVALoadouts) {
text = CSTRING(portLoadoutsText); text = CSTRING(portLoadoutsText);
picture = QPATHTOEF(common,data\logo_ace3_ca.paa); picture = QPATHTOEF(common,data\logo_ace3_ca.paa);
action = "call ace_arsenal_fnc_portVALoadouts;"; action = QUOTE(call DFUNC(portVALoadouts););
}; };
}; };
}; };

View File

@ -1,7 +1,6 @@
PREP(addLoadCaptiveActions); PREP(addLoadCaptiveActions);
PREP(canApplyHandcuffs); PREP(canApplyHandcuffs);
PREP(canEscortCaptive); PREP(canEscortCaptive);
PREP(canFriskPerson);
PREP(canLoadCaptive); PREP(canLoadCaptive);
PREP(canRemoveHandcuffs); PREP(canRemoveHandcuffs);
PREP(canStopEscorting); PREP(canStopEscorting);
@ -9,7 +8,6 @@ PREP(canSurrender);
PREP(canUnloadCaptive); PREP(canUnloadCaptive);
PREP(doApplyHandcuffs); PREP(doApplyHandcuffs);
PREP(doEscortCaptive); PREP(doEscortCaptive);
PREP(doFriskPerson);
PREP(doLoadCaptive); PREP(doLoadCaptive);
PREP(doRemoveHandcuffs); PREP(doRemoveHandcuffs);
PREP(doUnloadCaptive); PREP(doUnloadCaptive);

View File

@ -1,24 +0,0 @@
#include "script_component.hpp"
/*
* Author: bux578
* Checks the conditions for being able to frisk a unit
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* 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]}

View File

@ -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 <OBJECT>
* 1: unit <OBJECT>
*
* 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];

View File

@ -155,38 +155,6 @@
<Chinese>束線帶可以綁住俘虜</Chinese> <Chinese>束線帶可以綁住俘虜</Chinese>
<Chinesesimp>束线带可以绑住俘虏</Chinesesimp> <Chinesesimp>束线带可以绑住俘虏</Chinesesimp>
</Key> </Key>
<Key ID="STR_ACE_Captives_FriskMenuHeader">
<English>Inventory of frisked person</English>
<German>Inventar der durchsuchten Person</German>
<French>Inventaire de la personne fouillé</French>
<Spanish>Inventario de la persona cacheada</Spanish>
<Hungarian>Motozott személy felszerelése</Hungarian>
<Czech>Inventář prohledávané osoby</Czech>
<Polish>Ekwipunek rewidowanej osoby</Polish>
<Russian>Инвентарь обысканного человека</Russian>
<Portuguese>Inventário da pessoa revistada</Portuguese>
<Italian>Inventario della persona perquisita</Italian>
<Japanese>捕虜の持ち物を確認する</Japanese>
<Korean>검문당한 사람의 소지품</Korean>
<Chinese>搜身選單</Chinese>
<Chinesesimp>搜身选单</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_FriskPerson">
<English>Frisk person</English>
<German>Person durchsuchen</German>
<French>Fouiller la personne</French>
<Spanish>Cachear</Spanish>
<Czech>Prohledávaná osoba</Czech>
<Polish>Rewiduj osobę</Polish>
<Hungarian>Motozás</Hungarian>
<Russian>Обыскать человека</Russian>
<Portuguese>Revistar</Portuguese>
<Italian>Perquisisci la persona</Italian>
<Japanese>捕虜の持ち物</Japanese>
<Korean>검문당한사람</Korean>
<Chinese>搜身</Chinese>
<Chinesesimp>搜身</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_StartSurrendering"> <Key ID="STR_ACE_Captives_StartSurrendering">
<English>Surrender</English> <English>Surrender</English>
<French>Se rendre</French> <French>Se rendre</French>

View File

@ -67,7 +67,7 @@ class RscACE_SelectAnItem {
text = ""; text = "";
}; };
class itemList: RscListBox { class itemList: RscListBox {
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; onMouseButtonDblClick = QUOTE(_this call DFUNC(onSelectMenuDblClick));
idc = 8866; idc = 8866;
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
w = 0.59; w = 0.59;
@ -106,7 +106,7 @@ class RscACE_SelectAnItem {
y = 0.605; y = 0.605;
style = 2; style = 2;
text = CSTRING(Back); 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}; colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {1,1,1,0.2}; colorBackgroundActive[] = {1,1,1,0.2};
@ -120,7 +120,7 @@ class RscACE_SelectAnItem {
w = 0.15; w = 0.15;
style = 2; style = 2;
text = CSTRING(MakeSelection); text = CSTRING(MakeSelection);
action = "call ACE_Interaction_fnc_hideMenu;"; action = QUOTE(call DFUNC(hideMenu););
colorBackground[] = {0,0,0,0}; colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {1,1,1,0.2}; colorBackgroundActive[] = {1,1,1,0.2};

View File

@ -123,10 +123,10 @@ class ACE_Medical_Actions {
requiredMedic = 0; requiredMedic = 0;
treatmentTime = 15; treatmentTime = 15;
items[] = {}; 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)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = ""; callbackFailure = "";
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; callbackProgress = QUOTE(!([((_this select 0) select 1)] call DEFUNC(common,isAwake)));
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
@ -371,10 +371,10 @@ class ACE_Medical_Actions {
requiredMedic = 0; requiredMedic = 0;
treatmentTime = 15; treatmentTime = 15;
items[] = {}; items[] = {};
condition = "!([(_this select 1)] call ace_common_fnc_isAwake)"; condition = QUOTE(!([(_this select 1)] call DEFUNC(common,isAwake)));
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = ""; callbackFailure = "";
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; callbackProgress = QUOTE(!([((_this select 0) select 1)] call DEFUNC(common,isAwake)));
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic";

View File

@ -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}; if (!(_selection in GVAR(SELECTIONS))) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); -1};
//Get the hitpoint and the index //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", []]]; (getAllHitPointsDamage _unit) params [["_allHitPoints", []]];
private _hitpointIndex = -1; private _hitpointIndex = -1;
{ //case insensitive find { //case insensitive find