Merge pull request #4227 from acemod/mergeMedChanges

Merge med changes into rewrite branch
This commit is contained in:
Glowbal 2016-08-20 11:53:04 +02:00 committed by GitHub
commit ec653d764a
192 changed files with 1302 additions and 1568 deletions

View File

@ -1,5 +1,5 @@
**Arma 3 Version:** `x.xx` (stable / rc / dev)
**CBA Version:** `2.x.x` (stable / dev + commit hash)
**CBA Version:** `3.x.x` (stable / dev + commit hash)
**ACE3 Version:** `3.x.x` (stable / dev + commit hash)
**Mods:**

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_add_new_gun
* call ace_atragmx_fnc_add_new_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_range_card
* call ace_atragmx_fnc_calculate_range_card
*
* Public: No
*/

View File

@ -37,7 +37,7 @@
* 8: Spin drift (MOA) <NUMBER>
*
* Example:
* call ace_atragmx_calculate_solution
* call ace_atragmx_fnc_calculate_solution
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_range_assist
* call ace_atragmx_fnc_calculate_target_range_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_solution
* call ace_atragmx_fnc_calculate_target_solution
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_speed_assist
* call ace_atragmx_fnc_calculate_target_speed_assist
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* Nothing
*
* Example:
* call ace_atragmx_change_gun
* call ace_atragmx_fnc_change_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_create_dialog
* call ace_atragmx_fnc_create_dialog
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_scope_unit
* call ace_atragmx_fnc_cycle_scope_unit
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_image_size_units
* call ace_atragmx_fnc_cycle_image_size_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_num_ticks_units
* call ace_atragmx_fnc_cycle_num_ticks_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_range_card_columns
* call ace_atragmx_fnc_cycle_range_card_columns
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_scope_unit
* call ace_atragmx_fnc_cycle_scope_unit
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_target_size_units
* call ace_atragmx_fnc_cycle_target_size_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_target_direction
* call ace_atragmx_fnc_cycle_target_direction
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_delete_gun
* call ace_atragmx_fnc_delete_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_parse_input
* call ace_atragmx_fnc_parse_input
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_reset_relative_click_memory
* call ace_atragmx_fnc_reset_relative_click_memory
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_save_gun
* call ace_atragmx_fnc_save_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_add_new_gun
* call ace_atragmx_fnc_show_add_new_gun
*
* Public: No
*/
@ -17,4 +17,4 @@
GVAR(showAddNewGun) = _this;
{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003];
{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003];

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_gun_list
* call ace_atragmx_fnc_show_gun_list
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_main_page
* call ace_atragmx_fnc_show_main_page
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_range_card
* call ace_atragmx_fnc_show_range_card
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_range_card_setup
* call ace_atragmx_fnc_show_range_card_setup
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_range_assist
* call ace_atragmx_fnc_show_target_range_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_speed_assist
* call ace_atragmx_fnc_show_target_speed_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_speed_assist_timer
* call ace_atragmx_fnc_show_target_speed_assist_timer
*
* Public: No
*/

View File

@ -5,7 +5,7 @@ class RscTitles {
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['ACE_attach_virtualAmmoDisplay', (_this select 0)];";
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(virtualAmmoDisplay), _this select 0)]);
class controls {};
class objects {
class TheObject {

View File

@ -11,7 +11,7 @@ class Cfg3DEN {
expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleHandcuffed)});
typeName = "BOOL";
condition = "objectBrain";
defaultValue = false;
defaultValue = "(false)";
};
class ace_isSurrendered {
property = QUOTE(ace_isSurrendered);
@ -21,7 +21,7 @@ class Cfg3DEN {
expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleSurrender)});
typeName = "BOOL";
condition = "objectBrain";
defaultValue = false;
defaultValue = "(false)";
};
};
};

View File

@ -67,4 +67,9 @@ class Extended_InitPost_EventHandlers {
init = QUOTE(_this call DFUNC(initObject));
};
};
class StaticWeapon {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
};

View File

@ -1,14 +0,0 @@
class CfgActions {
// fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
class None;
class TakeWeapon: None {
show = 0;
};
class TakeItem: None {
show = 0;
};
class TakeMagazine: None {
show = 0;
};
};

View File

@ -26,11 +26,6 @@ class Extended_DisplayLoad_EventHandlers {
};
class Extended_InitPost_EventHandlers {
class All {
class GVAR(executePersistent) {
init = QUOTE([_this select 0] call FUNC(executePersistent));
};
};
class CAManBase {
class GVAR(setName) {
init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call CBA_fnc_execNextFrame};);

View File

@ -39,10 +39,6 @@ PREP(endRadioTransmission);
PREP(eraseCache);
PREP(errorMessage);
PREP(execNextFrame);
PREP(execPersistentFnc);
PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(findUnloadPosition);
PREP(firedEH);
PREP(fixCollision);
@ -50,16 +46,13 @@ PREP(fixFloating);
PREP(fixLoweredRifleAnimation);
PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getDeathAnim);
PREP(getCaptivityStatus);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getInPosition);
PREP(getMapData);
@ -69,12 +62,10 @@ PREP(getMapPosFromGrid);
PREP(getMarkerType);
PREP(getMGRSdata);
PREP(getName);
PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw);
PREP(getSettingData);
PREP(getStaminaBarControl);
PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);
PREP(getTargetObject);
@ -102,7 +93,6 @@ PREP(hideUnit);
PREP(insertionSort);
PREP(interpolateFromArray);
PREP(inTransitionAnim);
PREP(isAutoWind);
PREP(isAwake);
PREP(isEngineer);
PREP(isEOD);
@ -117,7 +107,6 @@ PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
PREP(loadSettingsOnServer);
PREP(loadSettingsLocalizedText);
PREP(map);
PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(muteUnit);
@ -146,12 +135,9 @@ PREP(runAfterSettingsInit);
PREP(sanitizeString);
PREP(sendRequest);
PREP(serverLog);
PREP(setAllGear);
PREP(setApproximateVariablePublic);
PREP(setCaptivityStatus);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
PREP(setHearingCapability);
PREP(setName);
PREP(setParameter);
@ -215,7 +201,6 @@ PREP(getVehicleCrew);
PREP(getVehicleUAVCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);
@ -276,8 +261,3 @@ PREP(hashSet);
PREP(hashGet);
PREP(hashHasKey);
PREP(hashRem);
PREP(hashListCreateList);
PREP(hashListCreateHash);
PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);

View File

@ -160,14 +160,6 @@ if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
};
// @todo deprecated
QGVAR(remoteFnc) addPublicVariableEventHandler {
(_this select 1) call FUNC(execRemoteFnc);
};
// @todo figure out what this does.
[missionNamespace] call FUNC(executePersistent);
//////////////////////////////////////////////////
// Check files, previous installed version etc.
@ -274,8 +266,8 @@ enableCamShake true;
//FUNC(showHud) needs to be refreshed if it was set during mission init
["ace_infoDisplayChanged", {
GVAR(showHudHash) params ["", "_masks"];
if (!(_masks isEqualTo [])) then {
GVAR(showHudHash) params ["", "", "_masks"];
if !(_masks isEqualTo []) then {
[] call FUNC(showHud);
};
}] call CBA_fnc_addEventHandler;
@ -326,7 +318,37 @@ enableCamShake true;
// "playerInventoryChanged" event
["loadout", {
["ace_playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call CBA_fnc_localEvent;
private _fnc_getAllGear = {
if (isNull _this) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _this,
goggles _this,
uniform _this, uniformItems _this,
vest _this, vestItems _this,
backpack _this, backpackItems _this,
primaryWeapon _this, primaryWeaponItems _this, primaryWeaponMagazine _this,
secondaryWeapon _this, secondaryWeaponItems _this, secondaryWeaponMagazine _this,
handgunWeapon _this, handgunItems _this, handgunMagazine _this,
assignedItems _this,
binocular _this,
_this call CBA_fnc_binocularMagazine
]
};
["ace_playerInventoryChanged", [ACE_player, ACE_player call _fnc_getAllGear]] call CBA_fnc_localEvent;
}] call CBA_fnc_addPlayerEventHandler;
// "playerVisionModeChanged" event

View File

@ -5,19 +5,8 @@ ADDON = false;
#include "XEH_PREP.hpp"
// backwards comp
DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
_this call CBA_fnc_canUseWeapon;
};
DFUNC(selectWeaponMode) = {
ACE_DEPRECATED("ace_common_fnc_selectWeaponMode","3.7.0","CBA_fnc_selectWeapon");
_this call CBA_fnc_selectWeapon;
};
GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate);
GVAR(syncedEvents) = [] call CBA_fnc_hashCreate;
GVAR(showHudHash) = [] call CBA_fnc_hashCreate;
GVAR(settingsInitFinished) = false;
GVAR(runAtSettingsInitialized) = [];

View File

@ -86,7 +86,6 @@ class ACE_newEvents {
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgActions.hpp"
#include "CfgMoves.hpp"
#include "CfgVoice.hpp"
#include "CfgUnitInsignia.hpp"

View File

@ -14,12 +14,11 @@
params ["_client"];
{
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"];
[GVAR(syncedEvents), {
_value params ["", "_eventLog"];
["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent;
["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent;
false
} count (GVAR(syncedEvents) select 0);
}] call CBA_fnc_hashEachPair;
true

View File

@ -22,12 +22,12 @@ if (isServer) then {
// Find the event name, and shovel out the events to the client
params ["_eventName", "_client"];
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
if !([GVAR(syncedEvents), _eventName] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
false
};
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
private _eventEntry = [GVAR(syncedEvents), _eventName] call CBA_fnc_hashGet;
_eventEntry params ["", "_eventLog"];
["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent;

View File

@ -16,22 +16,19 @@
params ["_name", "_args", "_ttl"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
false
};
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
private _internalData = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
_internalData params ["_eventCode", "_eventLog"];
if (isServer) then {
// Server needs to internally log it for synchronization
if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"];
_eventLog pushBack [diag_tickTime, _args, _ttl];
};
};
_internalData params ["_eventCode"];
_args call _eventCode;

View File

@ -19,7 +19,7 @@
params ["_name", "_handler", ["_ttl", 0]];
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if ([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
false
};
@ -27,4 +27,4 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data);
[GVAR(syncedEvents), _name, _data] call CBA_fnc_hashSet;

View File

@ -30,7 +30,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then {
} else {
//Sanity check to make sure we don't enable unconsious AI
if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith {
ERROR("Enabling AI for unconsious unit");
ACE_LOGERROR("Enabling AI for unconsious unit");
};
_unit enableAI "MOVE";

View File

@ -1,53 +0,0 @@
/*
* Author: commy2
* Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1).
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: Namespace to save that variable in <OBJECT, NAMESPACE>
* 3: Name. Will overwrite previously defined functions with that name <STRING>
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execPersistentFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", "_unit", "_name"];
TRACE_4("params", _arguments, _function, _unit, _name);
_function = call compile _function;
// execute function on every currently connected machine
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);
// save persistent function for JIP
private _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
// find index to overwrite function with the same name, add to end otherwise
private _index = count _persistentFunctions;
{
if (_x select 2 == _name) exitWith {
_index = _forEachIndex;
};
} forEach _persistentFunctions;
// set new value
_persistentFunctions set [_index, [_arguments, _function, _name]];
// broadcast variable
if (typeName _unit == "NAMESPACE") then {
ACE_PersistentFunctions = _persistentFunctions;
publicVariable "ACE_PersistentFunctions";
} else {
_unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true];
};

View File

@ -1,68 +0,0 @@
/*
* Author: commy2
* Execute a function on a remote machine in mp.
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: The function will be executed where this unit is local OR the mode were this function should be executed. (default: 2) <OBJECT, NUMBER>
* 0 = execute on this machine only
* 1 = execute on server
* 2 = execute on all clients + server
* 3 = execute on dedicated only
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execRemoteFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", ["_unit", 2]];
TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function;
if (_unit isEqualType 0) exitWith {
switch (_unit) do {
case 0 : {
_arguments call _function;
};
case 1 : {
if (isServer) then {
_arguments call _function;
} else {
publicVariableServer QGVAR(remoteFnc);
};
};
case 2 : {
_arguments call _function;
GVAR(remoteFnc) set [2, 0];
publicVariable QGVAR(remoteFnc);
};
case 3 : {
if (isDedicated) then {
_arguments call _function;
} else {
if (!isServer) then {publicVariableServer QGVAR(remoteFnc)};
};
};
};
};
if (local _unit) then {
_arguments call _function;
} else {
if (isServer) then {
(owner _unit) publicVariableClient QGVAR(remoteFnc);
} else {
publicVariableServer QGVAR(remoteFnc);
};
};

View File

@ -1,25 +0,0 @@
/*
* Author: commy2
* Execute all Persistent Functions
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_target"];
{
if (isNil "_x") then {
ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else {
if (_x isEqualType []) then {
[_x select 0, _target] call (_x select 1);
};
};
} forEach (_target getVariable ["ACE_PersistentFunctions", []]);

View File

@ -1,31 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Filters array and removes every element not fitting the condition
*
* Arguments:
* 0: Array to be filtered.
* 1: Code to be evaluated.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_filter","3.7.0","select CODE");
private _result = [];
{
if (_x call _code) then {
_result pushBack _x;
};
false
} count _array;
_result

View File

@ -1,68 +0,0 @@
/*
* Author: bux578, commy2
* Returns an array containing all items of a given unit
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* 0: Headgear <STRING>
* 1: Goggles <STRING>
* 2: Uniform <STRING>
* 3: Uniform Items <ARRAY>
* 4: Vest <String>
* 5: Vest Items <ARRAY>
* 6: Backback <STRING>
* 7: Backpack Items <ARRAY>
* 8: Rifle <STRING>
* 9: Rifle Items <ARRAY>
* 10: Rifle Magazines <ARRAY>
* 11: Launcher <STRING>
* 12: Launcher Items <ARRAY>
* 13: Launcher Magazines <ARRAY>
* 14: Handgun <STRING>
* 15: Handgun Items <ARRAY>
* 16: Handgun Magazines <ARRAY>
* 17: Assigned Items (map, compass, watch, etc.) <ARRAY>
* 18: Binoculars <STRING>
* 19: Binocular Magazine (E.g. Laserbatteries) <STRING>
*
* Public: Yes
*
* Note: Element 17 includes the Head Mounted Display (HMD)
*/
#include "script_component.hpp"
params ["_unit", ["_showDeprecated", true]];
if (_showDeprecated) then {
ACE_DEPRECATED("ace_common_fnc_getAllGear","3.7.0","getUnitLoadout");
};
if (isNull _unit) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _unit,
goggles _unit,
uniform _unit, uniformItems _unit,
vest _unit, vestItems _unit,
backpack _unit, backpackItems _unit,
primaryWeapon _unit, primaryWeaponItems _unit, primaryWeaponMagazine _unit,
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit,
binocular _unit,
[_unit] call CBA_fnc_binocularMagazine
]

View File

@ -1,20 +0,0 @@
/*
* Author: commy2
* Return the captivity status of an unit.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Captivity Reasons, empty if not captive <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "setCaptive"] call FUNC(statusEffect_get)) select 1

View File

@ -1,23 +0,0 @@
/*
* Author: PabstMirror, commy2
* Returns reasons why the unit is forceWalk-ing.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* Force Walk reasons <ARRAY>
*
* Example:
* [ACE_Player] call ace_common_fnc_getForceWalkStatus
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "forceWalk"] call FUNC(statusEffect_get)) select 1

View File

@ -19,7 +19,7 @@
params ["_inputString", ["_getCenterOfGrid", true]];
if (count GVAR(mapGridData) == 0) exitWith {
ERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
ACE_LOGERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
(_this call BIS_fnc_gridToPos) select 0
};

View File

@ -1,16 +0,0 @@
/*
* Author: commy2
* Get a number from the mission.sqm file. Mission has to be saved in the Editor.
* On non-existing entries, it might return 0 or the value of an entry with the same name of another calss.
*
* Arguments:
* 0: Path of the entry in the mission.sqm <ARRAY>
*
* Return Value:
* Entry value <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
parseNumber (_this call FUNC(getStringFromMissionSQM)) // return

View File

@ -1,66 +0,0 @@
/*
* Author: commy2
* Get a string from the mission.sqm file. Mission has to be saved in the Editor.
* The string cannot contain the ; character.
* If the entry does not exist, it might return an empty string or an entry with the same name of another class!
*
* Arguments:
* 0: Path of the entry in the mission.sqm <ARRAY>
*
* Return Value:
* Value of the entry. <STRING>
*
* Public: No
*/
#include "script_component.hpp"
[_this] params ["_path", [], [[]]];
if (missionName == "") exitWith {""};
private _mission = toArray toLower loadFile "mission.sqm";
_mission resize 65536;
{
if (_x < 33) then {
_mission set [_forEachIndex, -1];
}
} forEach _mission;
_mission = toString (_mission - [-1]);
{_path set [_forEachIndex, toLower _x]} forEach _path;
for "_a" from 0 to (count _path - 2) do {
private _class = format ["class%1{", _path select _a];
private _index = _mission find _class;
private _array = toArray _mission;
for "_b" from 0 to (_index + count toArray _class - 1) do {
_array set [_b, -1];
};
_array = _array - [-1];
_mission = toString _array;
};
private _entry = format ["%1=", _path select (count _path - 1)];
_index = _mission find _entry;
if (_index == -1) exitWith {""};
_array = toArray _mission;
for "_b" from 0 to (_index + count toArray _entry - 1) do {
_array set [_b, -1];
};
_mission = toString (_array - [-1]);
_index = _mission find ";";
_mission = toArray _mission;
_mission resize _index;
format ["%1", toString _mission] // return

View File

@ -1,54 +0,0 @@
/*
* Author: commy2
* Get all turret indicies of a vehicle type.
*
* Arguments:
* 0: Vehicle type <STRING>
*
* Return Value:
* Turret Indecies <ARRAY>
*
* Public: No
*
* Note: It's advised to use allTurrets [_vehicle, true] instead whenever possible
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_getTurrets","3.7.0","allTurrets [_vehicle, true]");
params ["_type"];
private _varName = format [QGVAR(CachedTurrets_%1), _type];
private _turrets = + (uiNamespace getVariable _varName);
if (!isNil "_turrets") exitWith {_turrets};
private _config = configFile >> "CfgVehicles" >> _type;
_turrets = [];
private _fnc_addTurret = {
params ["_config", "_path"];
_config = _config >> "Turrets";
private _offset = 0;
for "_index" from 0 to (count _config - 1) do {
private _path2 = _path + [_index - _offset];
private _config2 = _config select _index;
if (isClass _config2) then {
_turrets pushBack _path2;
[_config2, _path2] call _fnc_addTurret;
} else {
_offset = _offset + 1;
};
};
};
[_config, []] call _fnc_addTurret;
uiNamespace setVariable [_varName, _turrets];
_turrets

View File

@ -12,4 +12,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashCreate),"3.8.0","CBA_fnc_hashCreate");
[[],[]]

View File

@ -13,6 +13,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashGet),"3.8.0","CBA_fnc_hashGet");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashHasKey),"3.8.0","CBA_fnc_hashHasKey");
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
params ["_hash", "_key"];

View File

@ -1,28 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList"];
ERRORDATA(1);
private _hashKeys = [];
try {
if(VALIDHASH(_hashList)) then {
_hashKeys = (_hashList select 0);
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
[_hashKeys, []];

View File

@ -1,17 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_keys"];
[_keys,[]];

View File

@ -1,26 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_value"];
ERRORDATA(2);
try {
if(VALIDHASH(_hashList)) then {
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
} else {
ERROR("Input hashlist in push not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -1,38 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index"];
ERRORDATA(2);
private _hash = nil;
try {
if(VALIDHASH(_hashList)) then {
_hashList params ["_keys", "_hashes"];
if(_index < (count _hashes)) then {
private _values = _hashes select _index;
_hash = [_keys, _values, 1];
} else {
ERROR("Index of hashlist is out of range");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
if (isNil "_hash") exitWith { nil };
_hash;

View File

@ -1,32 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index", "_value"];
ERRORDATA(3);
try {
if(VALIDHASH(_hashList)) then {
if(VALIDHASH(_value)) then {
_value params ["", "_vals"];
(_hashList select 1) set[_index, _vals];
} else {
ERROR("Set hash in hashlist is not valid");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashRem),"3.8.0","CBA_fnc_hashRem");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashSet),"3.8.0","CBA_fnc_hashSet");
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
params ["_hash", "_key", "_val"];

View File

@ -9,28 +9,14 @@
* Return Value:
* sortedArray (ARRAY)
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"
params ["_list", ["_ascending", true]];
ACE_DEPRECATED(QFUNC(insertionSort),"3.8.0","sort");
params [["_list", [], [[]]], ["_ascending", true, [false]]];
_list = + _list; // copy array to not alter the original one
for "_i" from 1 to (count _list - 1) do {
private _tmp = _list select _i;
_j = _i;
while {_j >= 1 && {_tmp < _list select (_j - 1)}} do {
_list set [_j, _list select (_j - 1)];
_j = _j - 1;
};
_list set [_j, _tmp];
};
if (!_ascending) then {
reverse _list;
};
_list sort _ascending;
_list

View File

@ -1,15 +0,0 @@
/*
* Author: commy2
* Check if wind is set on auto.
*
* Arguments
* None
*
* Return Value:
* This mission has automatic wind? <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 // return

View File

@ -1,29 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. <- :kappa:
*
* Arguments:
* 0: Array to be thingied.
* 1: Code to be applied to every element.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_map","3.7.0","apply");
// copy array to not alter the original one
_array = + _array;
{
_array set [_forEachIndex, _x call _code];
} forEach _array;
_array

View File

@ -14,13 +14,13 @@
params ["_name"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = HASH_GET(GVAR(syncedEvents),_name);
private _data = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
_data params ["", "", "", "_eventId"];
[_eventId] call CBA_fnc_removeEventHandler;
HASH_REM(GVAR(syncedEvents),_name);
[GVAR(syncedEvents), _name] call CBA_fnc_hashRem;

View File

@ -1,178 +0,0 @@
/*
* Author: bux578, commy2
* Applies gear to unit. It must be called in the machine in which the unit is local.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: All Gear based on return value of ACE_common_fnc_getAllGear <ARRAY>
* 2: Remove all attachments from weapons? (default: false) <BOOL>
* 3: Remove all items from prefilled backpacks? (default: false) <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, gear_array, true, true] call ace_common_fnc_setAllGear
*
* Public: Yes
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_setAllGear","3.7.0","setUnitLoadout");
params ["_unit", "_allGear", ["_clearAttachments", false], ["_clearBackpack", false]];
if (!local _unit) exitWith {
ACE_LOGWARNING_1("setAllGear - %1 has to be local.",_unit);
};
// remove all starting gear of a player
removeAllWeapons _unit;
removeGoggles _unit;
removeHeadgear _unit;
removeVest _unit;
removeUniform _unit;
removeAllAssignedItems _unit;
removeBackpack _unit;
_allGear params [
"_headgear", "_goggles",
"_uniform", "_uniformitems",
"_vest", "_vestitems",
"_backpack", "_backpackitems",
"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine",
"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine",
"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine",
"_assigneditems",
"_binocular",
"_binocularmagazine"
];
// start restoring the items
if (_headgear != "") then {_unit addHeadgear _headgear};
if (_goggles != "") then {_unit addGoggles _goggles};
// ensure all weapons being loaded
_unit addBackpack "ACE_FakeBackpack";
// primaryWeapon
if (_primaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _primaryweaponmagazine;
_unit addWeapon _primaryweapon;
if (_clearAttachments) then {
removeAllPrimaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addPrimaryWeaponItem _x;
};
false
} count _primaryweaponitems;
};
// secondaryWeapon
if (_secondaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _secondaryweaponmagazine;
_unit addWeapon _secondaryweapon;
if (_clearAttachments) then {
//removeAllSecondaryWeaponItems _unit;
{
_unit removeSecondaryWeaponItem _x;
false
} count secondaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addSecondaryWeaponItem _x;
};
false
} count _secondaryweaponitems;
};
// handgun
if (_handgunweapon != "") then {
{
_unit addMagazine _x;
false
} count _handgunweaponmagazine;
_unit addWeapon _handgunweapon;
if (_clearAttachments) then {
removeAllHandgunItems _unit;
};
{
if (_x != "") then {
_unit addHandgunItem _x;
};
false
} count _handgunweaponitems;
};
// binocular
_unit addWeapon _binocular;
_unit addMagazine _binocularmagazine;
// done with dummy backpack. now remove
removeBackpack _unit;
// uniform
if (_uniform != "") then {
_unit forceAddUniform _uniform;
};
{
_unit addItemToUniform _x;
false
} count _uniformitems;
// vest
if (_vest != "") then {
_unit addVest _vest;
};
{
_unit addItemToVest _x;
false
} count _vestitems;
// backpack
if (_backpack != "") then {
_unit addBackpack _backpack;
if (_clearBackpack) then {
private _backpackObject = unitBackpack _unit;
clearMagazineCargoGlobal _backpackObject;
clearWeaponCargoGlobal _backpackObject;
clearItemCargoGlobal _backpackObject;
};
{
_unit addItemToBackpack _x;
false
} count _backpackitems;
};
// assigned items
_assignedItems deleteAt (_assignedItems find _binocular);
{
_unit linkItem _x;
false
} count _assignedItems;
nil

View File

@ -1,22 +0,0 @@
/*
* Author: commy2
* Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: The reason of the captivity <STRING>
* 2: Is the reason still valid? True for setting this reason, false for removing it <BOOL>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "setCaptive", _reason, _status] call FUNC(statusEffect_set);

View File

@ -1,26 +0,0 @@
/*
* Author: Pabst Mirror (from captivity by commy2)
* Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk.
* Unit will force walk until all reasons are removed.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Reason for forcing walking <STRING>
* 2: Is the reason still valid. True to force walk, false to remove restriction. <BOOL>
*
* Returns:
* None
*
* Example:
* [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus)
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "forceWalk", _reason, _status] call FUNC(statusEffect_set);

View File

@ -40,14 +40,14 @@ if (_reason != "") then {
_reason = toLower _reason;
if (_mask isEqualTo []) then {
TRACE_2("Setting", _reason, _mask);
[GVAR(showHudHash), _reason] call FUNC(hashRem);
[GVAR(showHudHash), _reason] call CBA_fnc_hashRem;
} else {
TRACE_2("Removing", _reason, _mask);
[GVAR(showHudHash), _reason, _mask] call FUNC(hashSet);
[GVAR(showHudHash), _reason, _mask] call CBA_fnc_hashSet;
};
};
GVAR(showHudHash) params ["_reasons", "_masks"];
GVAR(showHudHash) params ["", "_reasons", "_masks"];
private _resultMask = [];
for "_index" from 0 to 7 do {

View File

@ -1,13 +1,15 @@
/*
* Author: Glowbal
* Removes white spaces from string
* Removes whitespace from a string.
*
* Arguments:
* 0: stringA <STRING>
* 1: stringB <STRING>
* 0: String <STRING>
*
* Return Value:
* copy of string <STRING>
* String Without Whitespace <STRING>
*
* Example:
* _stringWithoutWhitespace = ["String with whitespace"] call ace_common_fnc_stringRemoveWhiteSpace
*
* Public: Yes
*/

View File

@ -16,7 +16,7 @@
params ["_name", "_args", ["_ttl", 0]];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
false
};

View File

@ -18,11 +18,8 @@ if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag
{
private _name = _x;
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
[GVAR(syncedEvents), {
_value params ["_eventTime", "_eventLog", "_globalEventTTL"];
private _newEventLog = [];
@ -55,8 +52,8 @@ if (!isServer) exitWith {false};
false
} count _eventLog;
_data set [1, _newEventLog];
_value set [1, _newEventLog];
false
} count (GVAR(syncedEvents) select 0);
}] call CBA_fnc_hashEachPair;
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events

View File

@ -19,7 +19,7 @@ TRACE_2("params",_wire,_killer);
private ["_distance", "_vehicle"];
if (isNull _killer) then {
_killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull];
_killer = _wire getVariable [QGVAR(lastDamager), objNull];
if (isNull _killer) then {
private _midPoint = ((_wire selectionPosition "start") vectorAdd (_wire selectionPosition "deploy")) vectorMultiply 0.5;
{

View File

@ -0,0 +1 @@
z\ace\addons\dogtags

View File

@ -4,8 +4,8 @@ class RscStructuredText;
class RscTitles {
class GVAR(singleTag) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]);
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);
movingEnable = false;
duration = 5;
fadeIn = 0.2;
@ -49,8 +49,8 @@ class RscTitles {
};
class GVAR(doubleTag): GVAR(singleTag) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]);
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);
class controls: controls {
class background: background {

View File

@ -9,3 +9,4 @@ Adds options to check and take dog tag from dead or unconscious units
The people responsible for merging changes to this component or answering potential questions.
- [SzwedzikPL](https://github.com/SzwedzikPL)
- [esteldunedain](https://github.com/esteldunedain)

View File

@ -2,12 +2,14 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"SzwedzikPL"};
authorUrl = "https://github.com/SzwedzikPL/";
author = ECSTRING(common,ACETeam);
authors[] = {"SzwedzikPL"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

View File

@ -9,6 +9,9 @@
* Return Value:
* Children actions <ARRAY>
*
* Example:
* _childrenActions = [unit, player] call ace_dogtags_fnc_addDogtagActions
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,6 @@
/*
* Author: SzwedzikPL
* Adds dogtag item to unit (triggered by server)
* Adds dogtag item to unit (triggered by server).
*
* Arguments:
* 0: Item class <STRING>
@ -9,6 +9,9 @@
* Return Value:
* None
*
* Example:
* ["itemClass", ["name", "610-27-5955", "A POS"]] call ace_dogtags_fnc_addDogtagItem
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -8,6 +8,9 @@
* Return Value:
* A random blood type <STRING>
*
* Example:
* _bloodType = ["name"] call ace_dogtags_fnc_bloodType
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -9,6 +9,9 @@
* Return Value:
* True if dogtag can be checked <BOOL>
*
* Example:
* _canCheck = [player, unit] call ace_dogtags_fnc_canCheckDogtag
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -9,6 +9,9 @@
* Return Value:
* True if dogtag can be taken <BOOL>
*
* Example:
* _canTake = [player, unit] call ace_dogtags_fnc_canTakeDogtag
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,6 @@
/*
* Author: SzwedzikPL
* Checks unit dogtag
* Checks unit dogtag.
*
* Arguments:
* 0: Player <OBJECT>
@ -9,6 +9,9 @@
* Return Value:
* None
*
* Example:
* [player, unit] call ace_dogtags_fnc_checkDogtag
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,6 @@
/*
* Author: SzwedzikPL
* Check dogtag self menu action
* Check dogtag self menu action.
*
* Arguments:
* 0: Player <OBJECT>
@ -8,7 +8,10 @@
* 2: Item class <STRING>
*
* Return Value:
* Mone
* None
*
* Example:
* [player, unit, "itemClass"] call ace_dogtags_fnc_checkDogtagItem
*
* Public: No
*/

View File

@ -1,12 +1,18 @@
/*
* Author: esteldunedain
* Get unit dogtag data
* Get unit dogtag data.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* None
* Dogtag Data <ARRAY>
* 0: Name <STRING>
* 1: SSN <STRING>
* 2: Blood Type <STRING>
*
* Example:
* _dogtagData = [unit, player] call ace_dogtags_fnc_getDogtagData
*
* Public: No
*/

View File

@ -1,6 +1,6 @@
/*
* Author: SzwedzikPL
* Server: creates new dogtag item and send it to client
* Server: creates new dogtag item and send it to client.
*
* Arguments:
* 0: Player <OBJECT>
@ -9,6 +9,9 @@
* Return Value:
* None
*
* Example:
* [player, unit] call ace_dogtags_fnc_getDogtagItem
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,6 +1,6 @@
/*
* Author: SzwedzikPL
* Server: returns to client data on given dogtag
* Server: returns to client data on given dogtag.
*
* Arguments:
* 0: Player <OBJECT>
@ -9,11 +9,14 @@
* Return Value:
* None
*
* Example:
* [player, unit] call ace_dogtags_fnc_sendDogtagData
*
* Public: No
*/
#include "script_component.hpp"
if(!isServer) exitWith {};
if (!isServer) exitWith {};
params ["_target", "_item"];
TRACE_2("sendDogtagData",_target,_item);

View File

@ -1,14 +1,17 @@
/*
* Author: SzwedzikPL
* Shows dogtag
* Shows dogtag.
*
* Arguments:
* 0: Dog tag data <ARRAY>
* 0: Dogtag data <ARRAY>
* 1: Display as double tag <BOOLEAN>
*
* Return Value:
* None
*
* Example:
* [["name", "610-27-5955", "A POS"], true] call ace_dogtags_fnc_showDogtag
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -8,24 +8,27 @@
* Return Value:
* A random three/two/four format social security number <STRING>
*
* Example:
* _ssn = ["AAA"] call ace_dogtags_fnc_ssn
*
* Public: No
*/
#include "script_component.hpp"
params ["_name"];
private _length = count _name;
private _chars = toArray _name;
_chars pushBack _length;
_length = _length + 1;
// For short names, reuse characters
if (_length < 9) then {
// Iterates every second character, swapping odd/even with each loop
for [{_i = 0},{_i < 2*(9 - _length)},{_i = _i + 2}] do {
_chars pushBack (_chars select floor((_i + (_i/_length % 2)) % _length));
};
private _remainder = 0;
private _nums = [0,0,0,0,0,0,0,0,0];
for "_index" from 0 to (8 max _length) do {
private _inputChar = _chars select (_index % _length);
_nums set [(_index % 9), ((_nums select (_index % 9)) + _inputChar + _remainder) % 10];
_remainder = (_inputChar + _remainder) % 256;
};
// Offset array slice for long names to make generation more unique
private _slice = [0, _length % 9] select (_length > 9);
private _nums = (_chars select [_slice, 9]) apply { _x % 10 };
([_nums select [0,3],_nums select [3,2], _nums select [5,4]] apply { _x joinString "" }) joinString "-"

View File

@ -1,7 +1,7 @@
/*
* Author: SzwedzikPL
* If dogtag is not already taken triggers event on server
* If dogtag already taken displays info about it
* If dogtag is not already taken triggers event on server.
* If dogtag already taken displays info about it.
*
* Arguments:
* 0: Player <OBJECT>
@ -10,6 +10,9 @@
* Return Value:
* None
*
* Example:
* [player, unit] call ace_dogtags_fnc_takeDogtag
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,4 +1,5 @@
#define COMPONENT dogtags
#define COMPONENT_BEAUTIFIED Dogtags
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL

View File

@ -48,14 +48,6 @@ class Extended_Killed_EventHandlers {
};
};
class Extended_AnimChanged_EventHandlers {
class CAManBase {
class ADDON {
animChanged = QUOTE(_this call DFUNC(handleAnimChanged));
};
};
};
class Extended_DisplayLoad_EventHandlers {
class RscDisplayMission {
ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad));

View File

@ -20,9 +20,9 @@ if (isNil "ACE_maxWeightCarry") then {
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addEventHandler;
["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addEventHandler;
["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler;
["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler;
["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addPlayerEventHandler;
// handle waking up dragged unit and falling unconscious while dragging
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;

View File

@ -56,6 +56,9 @@ _unit setVariable [QGVAR(ReleaseActionID), [
{[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)}
] call EFUNC(common,addActionEventHandler)];
// add anim changed EH
[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler;
// show mouse hint
if (_target isKindOf "CAManBase") then {
[localize LSTRING(Drop), "", ""] call EFUNC(interaction,showMouseHint);

View File

@ -49,6 +49,9 @@ _unit setVariable [QGVAR(ReleaseActionID), [
{[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)}
] call EFUNC(common,addActionEventHandler)];
// add anim changed EH
[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler;
// show mouse hint
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);

View File

@ -17,6 +17,13 @@
#include "script_component.hpp"
params ["_unit", "_anim"];
_thisArgs params ["_realUnit"];
TRACE_4("params",_unit,_anim,_realUnit,_thisID);
if (_unit != _realUnit) exitWith {
TRACE_2("respawn (unit changed) - remove EH",_unit,_realUnit);
_unit removeEventHandler ["AnimChanged", _thisID];
};
if (_unit getVariable [QGVAR(isDragging), false]) then {
@ -25,19 +32,25 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
if (!isNull _draggedObject) then {
TRACE_2("stop drag",_unit,_draggedObject);
[_unit, _draggedObject] call FUNC(dropObject);
};
};
};
} else {
if (_unit getVariable [QGVAR(isCarrying), false]) then {
if (_unit getVariable [QGVAR(isCarrying), false]) then {
// drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
// drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
if (!isNull _carriedObject) then {
[_unit, _carriedObject] call FUNC(dropObject_carry);
if (!isNull _carriedObject) then {
TRACE_2("stop carry",_unit,_carriedObject);
[_unit, _carriedObject] call FUNC(dropObject_carry);
};
};
} else {
TRACE_1("not drag/carry - remove EH",_unit);
_unit removeEventHandler ["AnimChanged", _thisID];
};
};

View File

@ -7,7 +7,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ACE_Explosives {
displayName = CSTRING(Menu);
condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)]));
condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(PlantingExplosive),false)]));
statement = "";
exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"};
showDisabled = 1;
@ -60,6 +60,13 @@ class CfgVehicles {
icon = QPATHTOF(UI\Defuse_ca.paa);
};
};
};
class ACE_DefuseObject_Large: ACE_DefuseObject {
class ACE_Actions: ACE_Actions {
class ACE_Defuse: ACE_Defuse {
distance = 1.5;
};
};
};
class ACE_Explosives_Place: Items_base_F {

View File

@ -5,7 +5,7 @@ class RscTitles {
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['ACE_explosives_virtualAmmoDisplay', (_this select 0)];";
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(virtualAmmoDisplay), _this select 0)]);
class controls {};
class objects {
class TheObject {

Some files were not shown because too many files have changed in this diff Show More