From b74175ec9e0054155268bde7648cf22ca6cc8339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 17:24:24 -0300 Subject: [PATCH 01/73] Don't allow adjusting range if only rangefinder is available --- addons/fcs/initKeybinds.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index dd1a94b78e..cbda9bdecc 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -51,7 +51,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); @@ -69,7 +69,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); From cb15a7106cd01927a62946b4ee56009ed2fcd04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 17:26:08 -0300 Subject: [PATCH 02/73] Allow adding FCS to static weapons --- addons/fcs/CfgEventHandlers.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp index 961a05b27d..a03ca847ea 100644 --- a/addons/fcs/CfgEventHandlers.hpp +++ b/addons/fcs/CfgEventHandlers.hpp @@ -36,6 +36,11 @@ class Extended_Init_EventHandlers { serverInit = QUOTE(_this call FUNC(vehicleInit)); }; }; + class StaticWeapon { + class ADDON { + serverInit = QUOTE(_this call FUNC(vehicleInit)); + }; + }; }; class Extended_Respawn_EventHandlers { @@ -64,6 +69,11 @@ class Extended_Respawn_EventHandlers { respawn = QUOTE(_this call FUNC(vehicleInit)); }; }; + class StaticWeapon { + class ADDON { + respawn = QUOTE(_this call FUNC(vehicleInit)); + }; + }; }; class Extended_FiredBIS_EventHandlers { @@ -92,4 +102,9 @@ class Extended_FiredBIS_EventHandlers { firedBIS = QUOTE(_this call FUNC(firedEH)); }; }; + class StaticWeapon { + class ADDON { + firedBIS = QUOTE(_this call FUNC(firedEH)); + }; + }; }; From 08af51c4a78f0c0264b56e98a50a77d209da2d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 17:29:54 -0300 Subject: [PATCH 03/73] Allow overpressure for static weapons --- addons/overpressure/CfgEventHandlers.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/overpressure/CfgEventHandlers.hpp b/addons/overpressure/CfgEventHandlers.hpp index 40c3b32a57..fa70cab5ea 100644 --- a/addons/overpressure/CfgEventHandlers.hpp +++ b/addons/overpressure/CfgEventHandlers.hpp @@ -43,4 +43,9 @@ class Extended_FiredBIS_EventHandlers { firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); }; }; + class StaticWeapons { + class ADDON { + firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); + }; + }; }; From 2105bc18db2d11d71782cc182ade12b781f72dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 17:43:57 -0300 Subject: [PATCH 04/73] Fixes for the FCS; it was missing a lot of `call`s before `FUNC`s. That made the rangefinder only work once. The flag for preventing holding is not needed becase GVAR(enabled) serving the same purpose. --- addons/fcs/functions/fnc_keyDown.sqf | 2 +- addons/fcs/initKeybinds.sqf | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index 7699b82a20..5e2fabccc9 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -19,7 +19,7 @@ _turret = _this select 1; _distance = call FUNC(getRange); -if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; +if !(!GVAR(enabled) && [] call FUNC(canUseFCS)) exitWith {}; GVAR(Enabled) = true; GVAR(Time) = time; diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index cbda9bdecc..b9ca0a927a 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -7,11 +7,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; - - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + if !((!GVAR(enabled) && [] call FUNC(canUseFCS)) || [] call FUNC(canUseRangefinder)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); @@ -26,14 +22,11 @@ ["ACE3", localize "STR_ACE_FCS_LaseTarget", { - // prevent holding down - GVAR(isDownStateKey1) = false; - // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + if !(GVAR(enabled) && [] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); @@ -51,7 +44,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(FUNC(canUseFCS)) exitWith {false}; + if !([] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); @@ -69,7 +62,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(FUNC(canUseFCS)) exitWith {false}; + if !([] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); From a1e5931f4ef0579411ce71e54baf806508e2feab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 18:06:17 -0300 Subject: [PATCH 05/73] avoid having to compute distance when it's already passed as a parameter --- addons/fcs/functions/fnc_keyDown.sqf | 3 ++- addons/fcs/functions/fnc_keyUp.sqf | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index 5e2fabccc9..24e4a7611d 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -19,7 +19,8 @@ _turret = _this select 1; _distance = call FUNC(getRange); -if !(!GVAR(enabled) && [] call FUNC(canUseFCS)) exitWith {}; +if (GVAR(Enabled)) exitWith {}; +if !([] call FUNC(canUseFCS)) exitWith {}; GVAR(Enabled) = true; GVAR(Time) = time; diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 1e5878f0b5..b893262e88 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -19,18 +19,22 @@ _turret = _this select 1; _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); -_distance = call FUNC(getRange); +_distance = 0; +if (count _this > 2) then { + _distance = _this select 2; +} else { + _distance = call FUNC(getRange); + if (_distance == 0) then { + _distance = [ + getNumber (_turretConfig >> QGVAR(DistanceInterval)), + getNumber (_turretConfig >> QGVAR(MaxDistance)), + getNumber (_turretConfig >> QGVAR(MinDistance)) + ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision + }; +}; _magazines = _vehicle magazinesTurret _turret; -if (_distance == 0) then { - _distance = [ - getNumber (_turretConfig >> QGVAR(DistanceInterval)), - getNumber (_turretConfig >> QGVAR(MaxDistance)), - getNumber (_turretConfig >> QGVAR(MinDistance)) - ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision -}; - private ["_weaponDirection", "_angleTarget"]; _weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets @@ -45,10 +49,6 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr _angleTarget = asin (_weaponDirection select 2); -if (count _this > 2) then { - _distance = _this select 2; -}; - if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then { terminate GVAR(backgroundCalculation); }; From d7430065669c586c0dcf48e983bce72a586c86f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 18:38:08 -0300 Subject: [PATCH 06/73] make vector keybinds return false so they don't block fcs keyup EH --- addons/vector/initKeybinds.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index f81c280905..fb00e7acb3 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -15,7 +15,7 @@ // Statement ["azimuth"] call FUNC(onKeyDown); - true + false }, [15, [false, false, false]], false, @@ -34,7 +34,7 @@ // Statement ["azimuth"] call FUNC(onKeyUp); - true + false }, [15, [false, false, false]], false, From 8064253a4d8d53e41fef2eb61b826ff9856ff599 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 18:15:32 +0100 Subject: [PATCH 07/73] Formatting, indentation, minor refactoring + fix for opening settings menu --- .../fnc_onListBoxSettingsChanged.sqf | 21 ++-- .../fnc_onListBoxShowSelectionChanged.sqf | 22 ++-- .../functions/fnc_onSettingsMenuOpen.sqf | 49 ++++---- .../functions/fnc_onSliderPosChanged.sqf | 47 +++---- .../functions/fnc_resetSettings.sqf | 35 +++--- .../fnc_settingsMenuUpdateKeyView.sqf | 117 +++++++++--------- .../functions/fnc_settingsMenuUpdateList.sqf | 78 ++++++------ .../functions/fnc_updateSetting.sqf | 24 ++-- 8 files changed, 212 insertions(+), 181 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 066bc76a8f..8112f4464b 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -1,12 +1,15 @@ -/** -* fnc_onListBoxSettingsChanged.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called when a listbox selection is changed. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingIndex", "_rightDropDownIndex"]; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index f4d41674bd..88cf80ef96 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -1,12 +1,16 @@ -/** -* fnc_onListBoxShowSelectionChanged.sqf -* @Descr: called when the listbox selection has changed. Updates configuration menu information -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * called when the listbox selection has changed. Updates configuration menu information + * + * Arguments: + * 0: Opened category or tab + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_localizedHeader"]; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index e3137f8ca9..c578f2be98 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -1,33 +1,36 @@ -/** -* fnc_onSettingsMenuOpen.sqf -* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * called when the settings or configuration menu has opened. Do not use anywhere else. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; { - // If the setting is user setable and not forced - if ((_x select 2) && !(_x select 6)) then { - // Append the current value to the setting metadata - _setting = + _x; - _setting pushBack (missionNamespace getVariable (_x select 0)); + // If the setting is user setable and not forced + if ((_x select 2) && !(_x select 6)) then { + // Append the current value to the setting metadata + _setting = + _x; + _setting pushBack (missionNamespace getVariable (_x select 0)); - // Categorize the setting according to types - // @todo: allow the user to modify other types of parameters? - if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { - GVAR(clientSideOptions) pushBack _setting; - }; - if ((_x select 1) == "COLOR") then { - GVAR(clientSideColors) pushBack _setting; - }; - }; + // Categorize the setting according to types + // @todo: allow the user to modify other types of parameters? + if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { + GVAR(clientSideOptions) pushBack _setting; + }; + if ((_x select 1) == "COLOR") then { + GVAR(clientSideColors) pushBack _setting; + }; + }; } forEach EGVAR(common,settings); //Delay a frame diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index ac6f52469c..df4dbf26c4 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -1,29 +1,34 @@ -/** -* fnc_onSliderPosChanged.sqf -* @Descr: N/A -* @Author: PabstMirror -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: PabstMirror + * Called when a slider position is changed. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_newColor", "_settingIndex"]; -_newColor = []; -{ - _newColor pushBack ((sliderPosition _x) / 255); -} forEach [410, 411, 412, 413]; - _settingIndex = lbCurSel 200; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_COLORS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; + case (MENU_TAB_COLORS): { + + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; + + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; + default {}; }; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index dd4b951ef5..e251b6e203 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -1,30 +1,33 @@ -/** -* fnc_resetSettings.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Sets all client side settings back to default. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index c271ecd176..460165ab1a 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -1,12 +1,15 @@ -/** -* fnc_settingsMenuUpdateKeyView.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the view on the right side with the selected settings details + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; @@ -16,58 +19,58 @@ _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; _collection = switch (GVAR(optionMenu_openTab)) do { -case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; -case MENU_TAB_COLORS: {GVAR(clientSideColors)}; - default {[]}; + case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; + case MENU_TAB_COLORS: {GVAR(clientSideColors)}; + default {[]}; }; if (count _collection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; - }; - - if (_settingIndex < 0) exitwith { - _settingIndex = 0; - }; - _setting = _collection select _settingIndex; - - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; - - if (_localizedName == "") then {_localizedName = _entryName;}; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; - - switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 8; - - // Created disable/enable options for bools - if ((_setting select 1) == "BOOL") then { - lbClear 400; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; - _settingsValue = [0, 1] select _settingsValue; - } else { - lbClear 400; - { lbAdd [400, _x]; } foreach _possibleValues; - }; - (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + _settingIndex = (lbCurSel _ctrlList); + if (_settingIndex > (count _collection)) then { + _settingIndex = count _collection - 1; }; - case (MENU_TAB_COLORS): { - _currentColor = _setting select 8; - { - sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; - } forEach [410, 411, 412, 413]; + + if (_settingIndex < 0) then { + _settingIndex = 0; + }; + _setting = _collection select _settingIndex; + + _entryName = _setting select 0; + _localizedName = _setting select 3; + _localizedDescription = _setting select 4; + + if (_localizedName == "") then {_localizedName = _entryName;}; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + + switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_OPTIONS): { + _possibleValues = _setting select 5; + _settingsValue = _setting select 8; + + // Created disable/enable options for bools + if ((_setting select 1) == "BOOL") then { + lbClear 400; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + _settingsValue = [0, 1] select _settingsValue; + } else { + lbClear 400; + { lbAdd [400, _x]; } foreach _possibleValues; + }; + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; + case (MENU_TAB_COLORS): { + _currentColor = _setting select 8; + { + sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; + } forEach [410, 411, 412, 413]; + }; }; - }; } else { //no settings in list: - lbClear 400; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + lbClear 400; + (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 73a6d3de3b..9e23a489eb 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -1,12 +1,16 @@ -/** -* fnc_settingsMenuUpdateList.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the list with all settings in the menu. + * + * Arguments: + * 0: update The selection view + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; @@ -19,35 +23,35 @@ _ctrlList = _settingsMenu displayCtrl 200; lbclear _ctrlList; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_OPTIONS): { + case (MENU_TAB_OPTIONS): { + { + _ctrlList lbadd (_x select 3); + + _settingsValue = _x select 8; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _ctrlList lbadd (_settingsText); + }foreach GVAR(clientSideOptions); + }; + case (MENU_TAB_COLORS): { { - _ctrlList lbadd (_x select 3); - - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; - } else { - (_x select 5) select _settingsValue; - }; - - _ctrlList lbadd (_settingsText); - }foreach GVAR(clientSideOptions); - }; -case (MENU_TAB_COLORS): { - { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; - }foreach GVAR(clientSideColors); - }; + _color = +(_x select 8); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _ctrlList lbadd (_x select 3); + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + }foreach GVAR(clientSideColors); + }; }; if (_updateKeyView) then { - [] call FUNC(settingsMenuUpdateKeyView); + [] call FUNC(settingsMenuUpdateKeyView); }; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index e4a9917f25..a2cba9bf51 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -1,12 +1,18 @@ -/** -* fnc_updateSetting.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Upidates a setting. + * + * Arguments: + * 0: Type Of setting + * 1: Name of setting + * 2: New value + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_changed"]; From 50bdc1d4c7786cc134e96d1c2cf83eaa59a810c3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:56:15 +0100 Subject: [PATCH 08/73] Disable unused buttons --- addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index c578f2be98..64d2fc65e2 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -35,3 +35,9 @@ GVAR(clientSideColors) = []; //Delay a frame [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); + +private "_menu"; +disableSerialization; +_menu = uiNamespace getvariable "ACE_settingsMenu"; +(_menu displayCtrl 1002) ctrlEnable false; +(_menu displayCtrl 1003) ctrlEnable false; From 8687f8d073554572eabe4d1c3eeea3c4dfaefc8e Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:56:43 +0100 Subject: [PATCH 09/73] Changed font sizes and removed animation button. --- addons/optionsmenu/gui/settingsMenu.hpp | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 8d99a591d5..995c7850a5 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -4,7 +4,7 @@ class ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX ((0.70 * safezoneW) max 1.0) + #define SIZEX (((safezoneW / safezoneH) min 1.2)) #define SIZEY (SIZEX / 1.2) #define UNITX (SIZEX / 40) #define UNITY (SIZEY / 25) @@ -42,6 +42,10 @@ class ACE_settingsMenu { x = 26.1 * UNITX + OFFSETX; w = 12.9 * UNITX; }; + class RightBackgroundHeader: RightBackground { + h = 1.4 * UNITY; + colorBackground[] = {0,0,0,1}; + }; }; class controls { @@ -85,7 +89,7 @@ class ACE_settingsMenu { colorBackgroundFocused[] = {1,1,1,1}; colorBackground[] = {1,1,1,1}; colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorDisabled[] = {1,1,1,1}; colorFocused[] = {0,0,0,1}; periodFocus = 1; periodOver = 1; @@ -99,13 +103,13 @@ class ACE_settingsMenu { }; class selectionAction_3: selectionAction_1 { idc = 1002; - text = "---"; + text = ""; x = 20 * UNITX + OFFSETX; action = ""; }; class selectionAction_4: selectionAction_1 { idc = 1003; - text = "---"; + text = ""; x = 29.5 * UNITX + OFFSETX; action = ""; }; @@ -115,7 +119,7 @@ class ACE_settingsMenu { y = 5.5 * UNITY + OFFSETY; w = 23 * UNITX; h = 15 * UNITY; - SizeEx = (UNITY * 0.7); + SizeEx = (UNITY * 0.8); colorBackground[] = {0, 0, 0, 0.9}; colorSelectBackground[] = {0, 0, 0, 0.9}; columns[] = {0.0, 0.6}; @@ -128,7 +132,7 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY *1); }; class labelKey: ACE_gui_staticBase { //Variable Name idc = 300; @@ -137,13 +141,13 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.65); }; class Label2: labelKey { idc = 301; y = 7.3 * UNITY + OFFSETY; text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 1); }; class comboBox1: ACE_gui_comboBoxBase { idc = 400; @@ -152,7 +156,7 @@ class ACE_settingsMenu { w = 7 * UNITX; h = 1 * UNITY; onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 0.9); }; class sliderBar1: RscXSliderH { idc = 410; @@ -191,15 +195,16 @@ class ACE_settingsMenu { text = ""; style = ST_LEFT + ST_MULTI; lineSpacing = 1; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.8); }; class actionClose: ACE_gui_buttonBase { idc = 10; text = "$STR_DISP_CLOSE"; x = 1 * UNITX + OFFSETX; y = 22.3 * UNITY + OFFSETY; - w = 6 * UNITX; + w = 7.5 * UNITX; h = 1 * UNITY; + style = ST_LEFT; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -217,17 +222,10 @@ class ACE_settingsMenu { periodOver = 1; action = "closedialog 0;"; }; - class action_animation: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_FixAnimation"; - x = 7.5 * UNITX + OFFSETX; - // action = "if ([player] call ACE_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call ACE_fnc_broadcastAnim; };"; - action = "hint 'todo???'"; - }; class action_reset: actionClose { idc = 1100; text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 14 * (SIZEX / 40) + OFFSETX; + x = 26.1 * (SIZEX / 40) + OFFSETX; action = QUOTE([] call FUNC(resetSettings)); }; }; From fd44f7bca6992dc1004455c6c2c9da9b21825e25 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:57:45 +0100 Subject: [PATCH 10/73] Indentation --- .../functions/fnc_onSliderPosChanged.sqf | 24 +++++++++---------- .../functions/fnc_resetSettings.sqf | 14 +++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index df4dbf26c4..b8fa0408d6 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -17,18 +17,18 @@ private ["_newColor", "_settingIndex"]; _settingIndex = lbCurSel 200; switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_COLORS): { + case (MENU_TAB_COLORS): { - _newColor = []; - { - _newColor pushBack ((sliderPosition _x) / 255); - } forEach [410, 411, 412, 413]; + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; - default {}; + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; + default {}; }; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index e251b6e203..07c7b5a5cc 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -15,19 +15,19 @@ private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; From fc0d6e8e1c3181ddcefa38d996e00ca19b5cfaeb Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 20:04:48 +0100 Subject: [PATCH 11/73] Updated author information in the config --- addons/optionsmenu/config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 51a614bb5a..7850e5972e 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -6,8 +6,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; + author[] = {"Glowbal", "PabstMirror"}; + authorUrl = "http://github.com/Glowbal"; VERSION_CONFIG; }; }; @@ -24,4 +24,4 @@ class CfgAddons { #include "CfgEventHandlers.hpp" #include "gui\define.hpp" #include "gui\settingsMenu.hpp" -#include "gui\pauseMenu.hpp" \ No newline at end of file +#include "gui\pauseMenu.hpp" From 35f72e0fdade2e29e3d5235dea6e902847cb680b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 9 Mar 2015 18:46:51 -0500 Subject: [PATCH 12/73] Dynamic Inventory Size --- addons/inventory/RscDisplayInventory.hpp | 520 +++++++++++++++++++++++ addons/inventory/config.cpp | 507 +--------------------- addons/inventory/stringtable.xml | 12 + 3 files changed, 542 insertions(+), 497 deletions(-) create mode 100644 addons/inventory/RscDisplayInventory.hpp create mode 100644 addons/inventory/stringtable.xml diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp new file mode 100644 index 0000000000..fa7afcc145 --- /dev/null +++ b/addons/inventory/RscDisplayInventory.hpp @@ -0,0 +1,520 @@ +/* +Adjust the scaling of the inventory screen +- changes it from scaling based on user's interface size to a static size +- text size and row height size are uneffected +- also tweaks the height of the two ProgressBars which looked odd scaled up so much + +regex: +x = "[-+]?(\d*[.]?\d+).* +x = X_PART\(\1\); + + */ + + +class RscText; +class RscPicture; +class RscListBox; +class RscProgress; +class RscStructuredText; +class RscActiveText; +class RscCombo; + +#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) + + +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) +#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) + + +#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), X_BIS(num), X_MAKEITBIGGA(num))]) +#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), Y_BIS(num), Y_MAKEITBIGGA(num))]) +#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), W_BIS(num), W_MAKEITBIGGA(num))]) +#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), H_BIS(num), H_MAKEITBIGGA(num))]) + +class RscDisplayInventory { + class controls { + class CA_ContainerBackground: RscText { + //crate: GroundLoad adjust size + x = X_PART(1); + y = Y_PART(1); + w = W_PART(12); + h = H_PART(22.5); + }; + class CA_PlayerBackground: RscText { + //center player's container: decrease height because of progressbar height decrease + x = X_PART(14.6); + y = Y_PART(2); + w = W_PART(24.4); + h = H_PART(21.5); + }; + class TitleBackground: RscText { + x = X_PART(14.6); + y = Y_PART(1); + w = W_PART(24.4); + h = H_PART(1); + }; + class PlayersName: RscText { + x = X_PART(15.6); + y = Y_PART(1); + w = W_PART(19.8); + h = H_PART(1); + }; + class RankBackground: RscText { + x = X_PART(15.1); + y = Y_PART(1.25); + w = W_PART(0.6); + h = H_PART(0.6); + }; + class RankPicture: RscPicture { + x = X_PART(15.1); + y = Y_PART(1.25); + w = W_PART(0.6); + h = H_PART(0.6); + }; + class ButtonBack: RscActiveText { + x = X_PART(38); + y = Y_PART(1); + w = W_PART(1); + h = H_PART(1); + }; + class BackgroundSlotPrimary: RscPicture { + x = X_PART(26.6); + y = Y_PART(6); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondary: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(11.5); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgun: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(17); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHeadgear: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotGoggles: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotHMD: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotBinoculars: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotMap: BackgroundSlotPrimary { + x = X_PART(15.1); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotGPS: BackgroundSlotPrimary { + x = X_PART(17.32); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotCompass: BackgroundSlotPrimary { + x = X_PART(21.76); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotRadio: BackgroundSlotPrimary { + x = X_PART(19.54); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotWatch: BackgroundSlotPrimary { + x = X_PART(23.98); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class ExternalContainerBackground: RscPicture { + x = X_PART(1.5); + y = Y_PART(3.7); + w = W_PART(11); + h = H_PART(18.4); + }; + class PlayerContainerBackground: ExternalContainerBackground { + x = X_PART(15.1); + y = Y_PART(6); + w = W_PART(11); + h = H_PART(14); + }; + class GroundTab: RscActiveText { + x = X_PART(1.5); + y = Y_PART(1.5); + w = W_PART(5.5); + h = H_PART(1); + }; + class SoldierTab: GroundTab { + x = X_PART(7); + y = Y_PART(1.5); + w = W_PART(5.5); + h = H_PART(1); + }; + class GroundContainer: RscListBox { + x = X_PART(1.5); + y = Y_PART(3.7); + w = W_PART(11); + h = H_PART(18.4); + }; + class GroundFilter: RscCombo { + x = X_PART(1.5); + y = Y_PART(2.6); + w = W_PART(11); + h = H_PART(1); + }; + class GroundLoad: RscProgress { + //crate: GroundLoad adjust size + x = X_PART(1.5); + y = Y_PART(22.5); + w = W_PART(11); + h = H_PART(0.5); + }; + class SlotPrimary: GroundTab { + x = X_PART(26.6); + y = Y_PART(6); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotPrimaryMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(9); + }; + class SlotPrimaryFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondary: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(11.5); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotSecondaryMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(14.5); + }; + class SlotSecondaryFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgun: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(17); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotHandgunMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(20); + }; + class SlotHandgunFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHeadgear: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotGoggles: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotHMD: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotBinoculars: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotMap: SlotPrimary { + x = X_PART(15.16); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotGPS: SlotPrimary { + x = X_PART(17.38); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotCompass: SlotPrimary { + x = X_PART(21.82); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotRadio: SlotPrimary { + x = X_PART(19.6); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotWatch: SlotPrimary { + x = X_PART(24.04); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class UniformTab: GroundTab { + x = X_PART(15.1); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class UniformSlot: SlotPrimary { + x = X_PART(15.35); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class UniformLoad: GroundLoad { + x = X_PART(15.1); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class UniformContainer: GroundContainer { + x = X_PART(15.1); + y = Y_PART(6); + w = W_PART(11); + h = H_PART(14); + }; + class VestTab: UniformTab { + x = X_PART(18.85); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class VestSlot: SlotPrimary { + x = X_PART(19.1); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class VestLoad: GroundLoad { + x = X_PART(18.85); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class BackpackTab: UniformTab { + x = X_PART(22.6); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class BackpackSlot: SlotPrimary { + x = X_PART(22.85); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class BackpackLoad: GroundLoad { + x = X_PART(22.6); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class TotalLoad: GroundLoad { + //center: progressbar height decrease + x = X_PART(15.1); + y = Y_PART(22.5); + w = W_PART(23.4); + h = H_PART(0.5); + }; + class ContainerMarker: GroundTab { + x = X_PART(0); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + class GroundMarker: ContainerMarker { + x = X_PART(1.5); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + class SoldierMarker: ContainerMarker { + x = X_PART(3); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + }; +}; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index e933cc40a4..33da2f1d3b 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -12,503 +12,16 @@ class CfgPatches { }; }; +#include "RscDisplayInventory.hpp" -class RscText; -class RscPicture; -class RscListBox; -class RscProgress; -class RscStructuredText; -class RscActiveText; -class RscCombo; -class RscControlsGroupNoScrollbars; - -/* -Adjust the scaling of the inventory screen - - changes it from scaling based on user's interface size to a static size - - text size and row height size are uneffected - - also tweaks the height of the two ProgressBars which looked odd scaled up so much -*/ - -class RscDisplayInventory { - class controls { - class CA_ContainerBackground: RscText { - //crate: GroundLoad adjust size - x = "1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "12 * (safeZoneH / 40)"; - h = "22.5 * ((safeZoneH / 1.2) / 25)"; - }; - class CA_PlayerBackground: RscText { - //center player's container: decrease height because of progressbar height decrease - x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "24.4 * (safeZoneH / 40)"; - h = "21.5 * ((safeZoneH / 1.2) / 25)"; - }; - class TitleBackground: RscText { - x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "24.4 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class PlayersName: RscText { - text = "Player name:"; - x = "15.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "19.8 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class RankBackground: RscText { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "0.6 * (safeZoneH / 40)"; - h = "0.6 * ((safeZoneH / 1.2) / 25)"; - }; - class RankPicture: RscPicture { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "0.6 * (safeZoneH / 40)"; - h = "0.6 * ((safeZoneH / 1.2) / 25)"; - }; - class ButtonBack: RscActiveText { - x = "38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimary: RscPicture { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondary: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgun: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHeadgear: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotGoggles: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHMD: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotBinoculars: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotMap: BackgroundSlotPrimary { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotGPS: BackgroundSlotPrimary { - x = "17.32 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotCompass: BackgroundSlotPrimary { - x = "21.76 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotRadio: BackgroundSlotPrimary { - x = "19.54 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotWatch: BackgroundSlotPrimary { - x = "23.98 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class ExternalContainerBackground: RscPicture { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "18.4 * ((safeZoneH / 1.2) / 25)"; - }; - class PlayerContainerBackground: ExternalContainerBackground { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "14 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundTab: RscActiveText { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "5.5 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class SoldierTab: GroundTab { - x = "7 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "5.5 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundContainer: RscListBox { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "18.4 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundFilter: RscCombo { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundLoad: RscProgress { - //crate: GroundLoad adjust size - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimary: GroundTab { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotPrimaryFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondary: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotSecondaryFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgun: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotHandgunFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHeadgear: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotGoggles: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHMD: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotBinoculars: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotMap: SlotPrimary { - x = "15.16 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotGPS: SlotPrimary { - x = "17.38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotCompass: SlotPrimary { - x = "21.82 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotRadio: SlotPrimary { - x = "19.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotWatch: SlotPrimary { - x = "24.04 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformTab: GroundTab { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformSlot: SlotPrimary { - x = "15.35 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformLoad: GroundLoad { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformContainer: GroundContainer { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "14 * ((safeZoneH / 1.2) / 25)"; - }; - class VestTab: UniformTab { - x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class VestSlot: SlotPrimary { - x = "19.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class VestLoad: GroundLoad { - x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackTab: UniformTab { - x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackSlot: SlotPrimary { - x = "22.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackLoad: GroundLoad { - x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class TotalLoad: GroundLoad { - //center: progressbar height decrease - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "23.4 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class ContainerMarker: GroundTab { - x = "0 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundMarker: ContainerMarker { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class SoldierMarker: ContainerMarker { - x = "3 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; +class ACE_Settings { + class GVAR(inventoryDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSetable = 1; + displayName = "$STR_ACE_Inventory_SettingName"; + description = "$STR_ACE_Inventory_SettingDescription"; + values[] = {"Normal (User Interface Size)", "Medium", "Biggah"}; }; }; + diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml new file mode 100644 index 0000000000..9ca01373d1 --- /dev/null +++ b/addons/inventory/stringtable.xml @@ -0,0 +1,12 @@ + + + + + + Make Inventory Display Bigger + + + Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. + + + \ No newline at end of file From 6ac83b7702f55d87a25eea8eec38d78e276007bf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 9 Mar 2015 18:53:19 -0500 Subject: [PATCH 13/73] Cleanup --- addons/inventory/RscDisplayInventory.hpp | 8 ++------ addons/inventory/config.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp index fa7afcc145..c8c93ab142 100644 --- a/addons/inventory/RscDisplayInventory.hpp +++ b/addons/inventory/RscDisplayInventory.hpp @@ -1,16 +1,14 @@ /* Adjust the scaling of the inventory screen -- changes it from scaling based on user's interface size to a static size -- text size and row height size are uneffected +- changes it from scaling based on user's interface size to a dynamic size based on a setting variable +- text size and row height size are uneffected (so more rows in a list) - also tweaks the height of the two ProgressBars which looked odd scaled up so much regex: x = "[-+]?(\d*[.]?\d+).* x = X_PART\(\1\); - */ - class RscText; class RscPicture; class RscListBox; @@ -24,13 +22,11 @@ class RscCombo; #define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) #define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) - #define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) #define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) - #define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), X_BIS(num), X_MAKEITBIGGA(num))]) #define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), Y_BIS(num), Y_MAKEITBIGGA(num))]) #define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), W_BIS(num), W_MAKEITBIGGA(num))]) diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 33da2f1d3b..c7b6649be6 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -21,7 +21,7 @@ class ACE_Settings { isClientSetable = 1; displayName = "$STR_ACE_Inventory_SettingName"; description = "$STR_ACE_Inventory_SettingDescription"; - values[] = {"Normal (User Interface Size)", "Medium", "Biggah"}; + values[] = {"Normal (Default Size)", "Medium", "Bigger"}; }; }; From 93a1cdaab66a6ffbd1aea9226c99ca2879ba05df Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Mar 2015 10:35:00 -0500 Subject: [PATCH 14/73] setCaptivityStatus in setUnconsicous --- .../medical/functions/fnc_setUnconscious.sqf | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index dbb0d115c3..b60e1ca574 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -64,22 +64,21 @@ _unit setUnitPos "DOWN"; // So the AI does not get stuck, we are moving the unit to a temp group on its own. [_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); -_captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch); +[_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus); [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); _startingTime = time; _minWaitingTime = (round(random(10)+5)); [{ - private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; + private ["_unit", "_vehicleOfUnit","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; _args = _this select 0; _unit = _args select 0; _oldAnimation = _args select 1; - _captiveSwitch = _args select 2; - _originalPos = _args select 3; - _startingTime = _args select 4; - _minWaitingTime = _args select 5; - _hasMovedOut = _args select 6; + _originalPos = _args select 2; + _startingTime = _args select 3; + _minWaitingTime = _args select 4; + _hasMovedOut = _args select 5; // Since the unit is no longer alive, get rid of this PFH. if (!alive _unit) exitwith { // EXIT PFH @@ -104,10 +103,8 @@ _minWaitingTime = (round(random(10)+5)); }; if (!_hasMovedOut) then { // Reset the unit back to the previous captive state. - if (_captiveSwitch) then { - [_unit, false] call EFUNC(common,setCaptiveSwitch); - }; - + [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); + // Swhich the unit back to its original group [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); @@ -137,6 +134,6 @@ _minWaitingTime = (round(random(10)+5)); [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call EFUNC(common,doAnimation); // Reset animations if unit starts doing wierd things. }; -}, 0.1, [_unit,_animState, _captiveSwitch, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; +}, 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; ["medical_onUnconscious", [_unit], [_unit, true]] call EFUNC(common,targetEvent); From 3f32627d617572c6ece079ca6d215d55bb90a9cd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Mar 2015 11:08:15 -0500 Subject: [PATCH 15/73] Implement Unconc Event Handler --- addons/captives/XEH_postInit.sqf | 11 ++---- addons/captives/XEH_preInit.sqf | 3 +- .../functions/fnc_handleKnockedOut.sqf | 25 ------------- .../functions/fnc_handleOnUnconscious.sqf | 36 +++++++++++++++++++ .../captives/functions/fnc_handleWokeUp.sqf | 23 ------------ 5 files changed, 39 insertions(+), 59 deletions(-) delete mode 100644 addons/captives/functions/fnc_handleKnockedOut.sqf create mode 100644 addons/captives/functions/fnc_handleOnUnconscious.sqf delete mode 100644 addons/captives/functions/fnc_handleWokeUp.sqf diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index ac86d71915..7b06770fd3 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -27,12 +27,5 @@ if (isServer) then { ["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); ["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler); -//TODO: Medical Integration Events??? - -// [_unit, "knockedOut", { -// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut}; -// }] call ACE_Core_fnc_addCustomEventhandler; - -// [_unit, "wokeUp", { -// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp}; -// }] call ACE_Core_fnc_addCustomEventhandler; +//Medical Integration Events??? +["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler); diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 34c9bca910..c09f81e51b 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -19,10 +19,9 @@ PREP(doUnloadCaptive); PREP(handleGetIn); PREP(handleGetOut); PREP(handleKilled); -PREP(handleKnockedOut); +PREP(handleOnUnconscious); PREP(handlePlayerChanged); PREP(handleUnitInitPost); -PREP(handleWokeUp); PREP(handleZeusDisplayChanged); PREP(moduleSurrender); PREP(setHandcuffed); diff --git a/addons/captives/functions/fnc_handleKnockedOut.sqf b/addons/captives/functions/fnc_handleKnockedOut.sqf deleted file mode 100644 index 1cd969807d..0000000000 --- a/addons/captives/functions/fnc_handleKnockedOut.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: commy2, PabstMirror - * Handles when a unit gets knocked out. Ends surrendering. - * - * Arguments: - * 0: Unit - * - * Return Value: - * Nothing - * - * Example: - * [bob, true] call ACE_captives_fnc_handleKnockedOut - * - * Public: No - */ -#include "script_component.hpp" - - -//ToDo: Waiting on medical integration - -PARAMS_1(_unit); - -if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop - [_unit, false] call FUNC(setSurrendered); -}; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf new file mode 100644 index 0000000000..9b73d34485 --- /dev/null +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2, PabstMirror + * Handles the "medical_onUnconscious" event + * + * Arguments: + * 0: Unit + * 0: Is Unconsisisiouses + * + * Return Value: + * Nothing + * + * Example: + * [bob, true] call ACE_captives_fnc_handleOnUnconscious + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_isUnconc); + +if (!local _unit) exitWith {}; + +systemChat format ["med: %1", _this]; + +if (_isUnconc) then { + //Knocked out: If surrendering, stop + if (_unit getVariable [QGVAR(isSurrendering), false]) then { + [_unit, false] call FUNC(setSurrendered); + }; +} else { + //Woke up: if handcuffed, goto animation + if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { + [_unit] call EFUNC(common,fixLoweredRifleAnimation); + [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); + }; +}; diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf deleted file mode 100644 index 9bf2e1a2bc..0000000000 --- a/addons/captives/functions/fnc_handleWokeUp.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Author: commy2 - * TODO - * - * Arguments: - * 0: _unit - * - * Return Value: - * The return value - * - * Example: - * [bob] call ACE_captives_fnc_handleWokeUp - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_1(_unit); - -if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { - [_unit] call EFUNC(common,fixLoweredRifleAnimation); - [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation); -}; From 49cef030d5390ea29d810da978838b9070ff764a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Mar 2015 15:48:08 -0500 Subject: [PATCH 16/73] Add "interact_keyDown" local event to interactMenu --- addons/interact_menu/functions/fnc_keyDown.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 4a0592b5b8..f3a58646a7 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -19,5 +19,7 @@ if(!GVAR(keyDown)) then { GVAR(keyDown) = true; GVAR(keyDownTime) = diag_tickTime; + + ["interact_keyDown", []] call EFUNC(common,localEvent); }; true From 794a1f9922ee43123c510797975dc4c97cfd9f39 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Mar 2015 16:01:46 -0500 Subject: [PATCH 17/73] Wirecutter handles interact event adds helper objects to all fences that have actions --- .../logistics_wirecutter/CfgEventHandlers.hpp | 5 ++ addons/logistics_wirecutter/CfgVehicles.hpp | 19 ------ .../logistics_wirecutter/XEH_clientInit.sqf | 5 ++ addons/logistics_wirecutter/XEH_preInit.sqf | 2 +- addons/logistics_wirecutter/config.cpp | 3 +- .../functions/fnc_canCutFence.sqf | 18 ------ .../functions/fnc_cutDownFence.sqf | 31 ++++++---- .../functions/fnc_cutDownFenceAbort.sqf | 16 ++++- .../functions/fnc_cutDownFenceCallback.sqf | 17 +++++- .../functions/fnc_getNearestFence.sqf | 29 +++++---- .../functions/fnc_interactEH.sqf | 60 +++++++++++++++++++ .../functions/fnc_isFence.sqf | 43 ++++++------- 12 files changed, 163 insertions(+), 85 deletions(-) delete mode 100644 addons/logistics_wirecutter/CfgVehicles.hpp create mode 100644 addons/logistics_wirecutter/XEH_clientInit.sqf delete mode 100644 addons/logistics_wirecutter/functions/fnc_canCutFence.sqf create mode 100644 addons/logistics_wirecutter/functions/fnc_interactEH.sqf diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp index f0a9f14d91..79c3aaa959 100644 --- a/addons/logistics_wirecutter/CfgEventHandlers.hpp +++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp @@ -4,3 +4,8 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp deleted file mode 100644 index 8a16d1b828..0000000000 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ /dev/null @@ -1,19 +0,0 @@ -class CfgVehicles { - class Man; - class CAManBase: Man { - class ACE_SelfActions { - class ACE_Equipment { - class GVAR(CutFence) { - displayName = "$STR_ACE_logistics_wirecutter_CutFence"; - condition = QUOTE([_player] call FUNC(canCutFence)); - statement = QUOTE([_player] call FUNC(cutDownFence)); - exceptions[] = {}; - showDisabled = 1; - priority = 0; - icon = PATHTOF(UI\wirecutter_ca.paa); - hotkey = "C"; - }; - }; - }; - }; -}; \ No newline at end of file diff --git a/addons/logistics_wirecutter/XEH_clientInit.sqf b/addons/logistics_wirecutter/XEH_clientInit.sqf new file mode 100644 index 0000000000..4d82dce0a8 --- /dev/null +++ b/addons/logistics_wirecutter/XEH_clientInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["interact_keyDown", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf index 7588a109e6..44eb941c16 100644 --- a/addons/logistics_wirecutter/XEH_preInit.sqf +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -2,11 +2,11 @@ ADDON = false; -PREP(canCutFence); PREP(cutDownFence); PREP(cutDownFenceAbort); PREP(cutDownFenceCallback); PREP(getNearestFence); +PREP(interactEH); PREP(isFence); ADDON = true; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp index 7f292132fa..27d4467ccf 100644 --- a/addons/logistics_wirecutter/config.cpp +++ b/addons/logistics_wirecutter/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_interaction"}; + requiredAddons[] = {"ace_interact_menu"}; author[] = {"gpgpgpgp", "PabstMirror"}; authorUrl = ""; VERSION_CONFIG; @@ -13,6 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" #include "CfgSounds.hpp" #include "CfgWeapons.hpp" diff --git a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf b/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf deleted file mode 100644 index f57a970d58..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* fnc_canCutFence.sqf -* -* Author: PabstMirror -* -* Condition check if player is able to cut a fence. -* Checks for "ACE_wirecutter" item and if there is a nearby fence. -* -* Argument: -* 0: OBJECT - Unit to check condition for (player) -* -* Return value: -* BOOL -*/ - -#include "script_component.hpp" -PARAMS_1(_unit); - -("ACE_wirecutter" in (items _unit)) && {!(isNull ([_unit] call FUNC(getNearestFence)))} diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 0a42d5d56b..ee4c512cd2 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -1,20 +1,31 @@ -// by gpgpgpgp, edited by commy2 +/* + * Author: gpgpgpgp, edited by commy2, PabstMirror + * Starts cutting down a fence + * + * Arguments: + * 0: Unit + * 1: Fence + * + * Return Value: + * Nothing + * + * Example: + * [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +private ["_timeToCut"]; + +PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; -_fenceObject = [ACE_player] call FUNC(getNearestFence); -if (isNull _fenceObject) exitWith {}; - -_timeToCut = 5; -if !([ACE_player] call EFUNC(common,isEngineer)) then { - _timeToCut = _timeToCut + 5; -}; +_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); -if (_timeToCut > 4.5) then { +if (_timeToCut > 5) then { playSound "ACE_wirecutter_sound_long"; } else { playSound "ACE_wirecutter_sound"; diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf index d17038af7c..20cb092131 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Stops cutting down fence (reset animation) + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort + * + * Public: No + */ #include "script_component.hpp" [ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf index 57c0289461..77bc4f2ba6 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf @@ -1,7 +1,22 @@ +/* + * Author: PabstMirror + * Once progressbar is done: Fence is cutdown + * + * Arguments: + * 0: Fence Object + * + * Return Value: + * Nothing + * + * Example: + * [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback + * + * Public: No + */ #include "script_component.hpp" PARAMS_1(_fenceObject); _fenceObject setdamage 1; -[localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured); +// [localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured); [ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf index 5004315fcd..c9e59b41a0 100644 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf @@ -1,15 +1,18 @@ -/* fnc_getNearestFence.sqf -* -* Author: PabstMirror -* -* Gets nearest fence within 5 meters to the unit. -* -* Argument: -* 0: OBJECT - Unit to search for fence objects arround -* -* Return value: -* OBJECT - Nearest object that is a fence, objNull if none found. -*/ +/* + * Author: PabstMirror + * Gets nearest fence object (not actully used, left for utility) + * + * Arguments: + * 0: Unit + * + * Return Value: + * The return value + * + * Example: + * [player] call ace_logistics_wirecutter_fnc_getNearestFence + * + * Public: Yes + */ #include "script_component.hpp" private "_nearestFence"; @@ -20,6 +23,6 @@ _nearestFence = objNull; if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { _nearestFence = _x; }; -} forEach nearestObjects [_unit, [], 5]; +} forEach nearestObjects [_unit, [], 15]; _nearestFence diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf new file mode 100644 index 0000000000..c2a721adeb --- /dev/null +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -0,0 +1,60 @@ +/* + * Author: PabstMirror + * When interact_menu starts rendering (from "interact_keyDown" event) + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * [] call ace_logistics_wirecutter_fnc_interactEH + * + * Public: Yes + */ +#include "script_component.hpp" + + +//for performance only do stuff it they have a wirecutter item +//(if they somehow get one durring keydown they'll just have to reopen) +if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; + +[{ + PARAMS_2(_args,_pfID); + EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); + + if (!EGVAR(interact_menu,keyDown)) then { + {deleteVehicle _x;} forEach _addedHelpers; + [_pfID] call CBA_fnc_removePerFrameHandler; + } else { + //If play moved >5 meters from last pos, then rescan + if (((getPosASL ace_player) distance _setPosition) > 5) then { + + _fncStatement = { + _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; + [ace_player, _attachedFence] call FUNC(cutDownFence); + }; + _fncCondition = { + _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; + ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))}) + }; + + { + if (!(_x in _fencesHelped)) then { + if ([_x] call FUNC(isFence)) then { + _fencesHelped pushBack _x; + _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); + [_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction); + _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); + _helper hideObject true; + _helper setVariable [QGVAR(attachedFence), _x]; + _addedHelpers pushBack _helper; + }; + }; + } forEach nearestObjects [ace_player, [], 15]; + + _args set [0, (getPosASL ace_player)]; + }; + }; +}, 0.1, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], []]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 2c00cec92b..aee9a22ef9 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -1,16 +1,19 @@ -/* fnc_isFence.sqf -* -* Author: PabstMirror -* -* Checks if object is a fence. Should work on any fence type, even (typeof == ""). -* Call is fairly expensive because of all of the string checking. -* -* Argument: -* 0: OBJECT - Ojbect to test -* -* Return value: -* BOOL -*/ +/* + * Author: PabstMirror + * Checks if object is a fence. Should work on any fence type, even (typeof == ""). + * Call is fairly expensive because of all of the string checking. + * + * Arguments: + * 0: An Object To Test + * + * Return Value: + * Is it a fence + * + * Example: + * [aFence] call ace_logistics_wirecutter_fnc_isFence + * + * Public: No + */ #include "script_component.hpp" //find is case sensitive, so keep everything lowercase @@ -27,14 +30,14 @@ _typeOf = toLower (typeOf _object); _returnValue = false; if (_typeOf != "") then { - _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); + _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); } else { - _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" - { - if ((_typeOf find _x) != -1) then { - _returnValue = true; - }; - } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); + _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" + { + if ((_typeOf find _x) != -1) then { + _returnValue = true; + }; + } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); }; _returnValue From 858e5def5a541086b1929b69809a55968ac8c4b9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 11 Mar 2015 12:45:01 -0500 Subject: [PATCH 18/73] Interact menu event consistant "interactMenuOpened", to match event from #191 --- addons/interact_menu/functions/fnc_keyDown.sqf | 2 +- addons/interact_menu/functions/fnc_keyDownSelfAction.sqf | 2 ++ addons/logistics_wirecutter/XEH_clientInit.sqf | 2 +- addons/logistics_wirecutter/functions/fnc_interactEH.sqf | 8 ++++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index f3a58646a7..4c8ffd8b3a 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -20,6 +20,6 @@ if(!GVAR(keyDown)) then { GVAR(keyDown) = true; GVAR(keyDownTime) = diag_tickTime; - ["interact_keyDown", []] call EFUNC(common,localEvent); + ["interactMenuOpened", [0]] call EFUNC(common,localEvent); }; true diff --git a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf index 0f58a246d2..63c81b58bc 100644 --- a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf @@ -17,6 +17,8 @@ if(!GVAR(keyDownSelfAction)) then { GVAR(keyDown) = false; GVAR(keyDownTime) = diag_tickTime; + ["interactMenuOpened", [1]] call EFUNC(common,localEvent); + GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || visibleMap; if (GVAR(useCursorMenu)) then { diff --git a/addons/logistics_wirecutter/XEH_clientInit.sqf b/addons/logistics_wirecutter/XEH_clientInit.sqf index 4d82dce0a8..c46cab29f1 100644 --- a/addons/logistics_wirecutter/XEH_clientInit.sqf +++ b/addons/logistics_wirecutter/XEH_clientInit.sqf @@ -2,4 +2,4 @@ if (!hasInterface) exitWith {}; -["interact_keyDown", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); +["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index c2a721adeb..c81fc46c40 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -3,24 +3,28 @@ * When interact_menu starts rendering (from "interact_keyDown" event) * * Arguments: - * Nothing + * Interact Menu Type (0 - world, 1 - self) * * Return Value: * Nothing * * Example: - * [] call ace_logistics_wirecutter_fnc_interactEH + * [0] call ace_logistics_wirecutter_fnc_interactEH * * Public: Yes */ #include "script_component.hpp" +PARAMS_1(_interactionType); + +if (_interactionType != 0) exitWith {}; //for performance only do stuff it they have a wirecutter item //(if they somehow get one durring keydown they'll just have to reopen) if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; [{ + private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"]; PARAMS_2(_args,_pfID); EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); From 8d0cc787b0dca50a895d55c59808737e482aa6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Thu, 12 Mar 2015 21:04:10 -0300 Subject: [PATCH 19/73] Initial port/reimplementation of ace_mapfx, providing: - dynamic map illumination - shacking maps when on the move - optional max zoom --- addons/mapfx/$PBOPREFIX$ | 1 + addons/mapfx/CfgEventhandlers.hpp | 11 ++ addons/mapfx/XEH_postClientInit.sqf | 21 +++ addons/mapfx/XEH_preInit.sqf | 11 ++ addons/mapfx/config.cpp | 20 +++ .../mapfx/functions/fnc_determineMapLight.sqf | 125 ++++++++++++++++++ addons/mapfx/functions/fnc_determineZoom.sqf | 33 +++++ addons/mapfx/functions/fnc_updateMapFx.sqf | 70 ++++++++++ addons/mapfx/functions/script_component.hpp | 1 + addons/mapfx/script_component.hpp | 12 ++ 10 files changed, 305 insertions(+) create mode 100644 addons/mapfx/$PBOPREFIX$ create mode 100644 addons/mapfx/CfgEventhandlers.hpp create mode 100644 addons/mapfx/XEH_postClientInit.sqf create mode 100644 addons/mapfx/XEH_preInit.sqf create mode 100644 addons/mapfx/config.cpp create mode 100644 addons/mapfx/functions/fnc_determineMapLight.sqf create mode 100644 addons/mapfx/functions/fnc_determineZoom.sqf create mode 100644 addons/mapfx/functions/fnc_updateMapFx.sqf create mode 100644 addons/mapfx/functions/script_component.hpp create mode 100644 addons/mapfx/script_component.hpp diff --git a/addons/mapfx/$PBOPREFIX$ b/addons/mapfx/$PBOPREFIX$ new file mode 100644 index 0000000000..9c3497b963 --- /dev/null +++ b/addons/mapfx/$PBOPREFIX$ @@ -0,0 +1 @@ +x\ace\addons\mapfx \ No newline at end of file diff --git a/addons/mapfx/CfgEventhandlers.hpp b/addons/mapfx/CfgEventhandlers.hpp new file mode 100644 index 0000000000..23dbe58c74 --- /dev/null +++ b/addons/mapfx/CfgEventhandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postClientInit)); + }; +}; diff --git a/addons/mapfx/XEH_postClientInit.sqf b/addons/mapfx/XEH_postClientInit.sqf new file mode 100644 index 0000000000..1836083993 --- /dev/null +++ b/addons/mapfx/XEH_postClientInit.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +ADDON = false; +LOG(MSG_INIT); + +call FUNC(determineZoom); + +//Probably need this spawn, because CBA_fnc_addPerFrameHandler doesn't work durring briefing. +[] spawn { + // Wait until the map display is detected + waitUntil {(!isNull findDisplay 12)}; + + GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; + GVAR(isShaking) = false; + + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapFx);}]; + +}; + +ADDON = true; diff --git a/addons/mapfx/XEH_preInit.sqf b/addons/mapfx/XEH_preInit.sqf new file mode 100644 index 0000000000..ecdf9cf694 --- /dev/null +++ b/addons/mapfx/XEH_preInit.sqf @@ -0,0 +1,11 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +ADDON = false; +LOG(MSG_INIT); + +PREP(determineMapLight); +PREP(determineZoom); +PREP(updateMapFx); + +ADDON = true; diff --git a/addons/mapfx/config.cpp b/addons/mapfx/config.cpp new file mode 100644 index 0000000000..ff20c33499 --- /dev/null +++ b/addons/mapfx/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Rocko","CAA-Picard"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +class ACE_Settings { + class GVAR(limitZoom) { + value = 0; + typeName = "BOOL"; + }; +}; \ No newline at end of file diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf new file mode 100644 index 0000000000..50e09db6a3 --- /dev/null +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -0,0 +1,125 @@ +#include "script_component.hpp" + +//TODO: Fix NVG color +private ["_darkMap","_lightColor","_lightFill","_createLight","_gunlight","_nearObjects","_light"]; + +// @todo: Update the way to check for flashlights +_gunlight = isArray(configFile>> "CfgWeapons" >> currentWeapon player >>"ace_gunlight_classes") || {"ACE_MugLite" in weapons player}; + +// Default Values +_alphaBase = if (round overcast > 0.5) then { 0.90 } else { 0.85}; +_alpha = _alphaBase min abs(sunOrMoon - 1); + +_lightColor = [0,0,0,((_alpha*1.1) min 1)]; +_lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; +_darkMap = true; +_createLight = false; + +// Check if player is not in a vehicle +if (vehicle ACE_player == ACE_player) then { + // Player is not in a vehicle + TRACE_1("NOT in vehicle",""); + _lightColor = [0,0,0,(_alpha*1.1)]; + _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; + + // check if player has NVG enabled + if (currentVisionMode ACE_player == 1) then { + // stick to nvg color + _alpha = 0.8; + _lightColor = [154/255,253/255,177/255,_alpha]; + _lightFill = "#(rgb,1,1,1)color(0.20,0.48,0.23,0.7)"; + TRACE_1("nvg on - green tint",""); + } else { + + if (_alpha < 0.05) exitWith { + _darkMap = false; + }; + + // darken map, unless following cases are fulfilled + // Priorities: Weapons flashlight, lamppost, fire, chemlight, flares + + // Check if player is near a campfires, lights or vehicles with lights on - 15m + _nearObjects = [nearestObjects [ACE_player, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); + if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; + _alpha = (((((ACE_player distance _light) - 5)/10) max 0) min 1) min _alphaBase; + _lightColor = [0,0,0,_alpha]; + _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; + TRACE_1("player near campfire",""); + }; + + // TODO: Illumination flares (timed) + + // Using chemlights + _fnc_chemLight = { + EXPLODE_2_PVT(_this,_no,_lc); + + if (count (_no) == 0) exitWith {}; + + _light = _no select 0; + _alpha = (((((player distance _light) - 2)/4) max 0) min 0.5); + _lightColor = +_lc; + _lightColor set [3, _alpha]; + _lightFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",(_lightColor select 0),(_lightColor select 1),(_lightColor select 2),(_lightColor select 3)]; + TRACE_1("player near chemlight",""); + }; + + _nearObjects = [ACE_player nearObjects ["Chemlight_red", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [1,0,0,0]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_green", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [0,1,0,0]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_blue", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [0,0,1,0]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_yellow", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [1,1,0,0]] call _fnc_chemLight; + + // Gun with light + if (_gunlight) then { + _darkMap = false; + _createLight = true; + TRACE_1("using gun light",""); + }; + }; +} else { + // Player is in a vehicle + if ((vehicle ACE_player) isKindOf "Tank") exitWith { + _darkMap = false; + _createLight = false; + }; + + // check if vehicle is not of following type: parachute + TRACE_1("in vehicle",""); + // check if player has NVG enabled + if (currentVisionMode ACE_player == 1) then { + // stick to nvg color + _alpha = 0.8; + _lightColor = [0,0.96,0,_alpha]; + _lightFill = "#(rgb,1,1,1)color(0,0.96,0,0.8)"; + TRACE_1("nvg on - green tint",""); + } else { + // darken map if vehicle is kind of bicycle or motorbike or ATV or parachute or PBX boat + if (vehicle ACE_player isKindOf "Bicycle" || {vehicle ACE_player isKindOf "Motorcycle"}) then { + if (_gunlight) then { + _darkMap = false; + _createLight = true; + TRACE_1("bright map - gun lights",""); + } else { + _lightColor = [0,0,0,(_alpha*1.1)]; + _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; + TRACE_1("darken map - no lights",""); + }; + } else { + // do not darken map, but create a lightpoint at players eye pos to simulate dash light / flashlight usage to view map + // do nothing if in a tank or apc + _darkMap = false; + _createLight = true; + TRACE_1("using vehicle light",""); + }; + }; +}; +TRACE_4("",_darkMap,_lightColor,_lightFill,_createLight); + +[_darkMap,_lightColor,_lightFill,_createLight] diff --git a/addons/mapfx/functions/fnc_determineZoom.sqf b/addons/mapfx/functions/fnc_determineZoom.sqf new file mode 100644 index 0000000000..5893967a4f --- /dev/null +++ b/addons/mapfx/functions/fnc_determineZoom.sqf @@ -0,0 +1,33 @@ +#include "script_component.hpp" + +// TODO: Perhaps change to return values instead of setting GVAR's directly + +private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; +_grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; +_fourSize = -1; +_sixSize = -1; +for "_i" from 1 to 10 do { + _continue = false; + if (isClass(_grids >> format["Zoom%1", _i])) then { + _continue = true; + _size = getText(_grids >> format["Zoom%1", _i] >> "formatX"); + if ((count toArray(_size)) == 2) then { + _fourSize = getNumber(_grids >> format["Zoom%1", _i] >> "zoomMax"); + }; + if ((count toArray(_size)) == 3) then { + _sixSize = getNumber(_grids >> format["Zoom%1", _i] >> "zoomMax"); + }; + if (_fourSize != -1 && {_sixSize != -1}) then { + _continue = false; + }; + }; + if (!_continue) exitWith {}; +}; + +if(_fourSize != -1 && {_sixSize != -1}) then { + if (isNil QGVAR(minMapSize)) then { + GVAR(minMapSize) = _sixSize + 0.01 + } else { + GVAR(minMapSize) = -1 + }; +}; diff --git a/addons/mapfx/functions/fnc_updateMapFx.sqf b/addons/mapfx/functions/fnc_updateMapFx.sqf new file mode 100644 index 0000000000..9b4b1ab7df --- /dev/null +++ b/addons/mapfx/functions/fnc_updateMapFx.sqf @@ -0,0 +1,70 @@ +#include "script_component.hpp" + +// Calculate the light +//_data = [[], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); +_data = call FUNC(determineMapLight); +diag_log _data; +_darkMap = _data select 0; +_color = _data select 1; +_fill = _data select 2; +_externalLight = _data select 3; +if (_darkMap) then { + ((findDisplay 12) displayCtrl 51) drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_color,_fill]; +} else { + if (_externalLight) then { + [] spawn { + _light = ACE_player getVariable ['ace_map_light',objNull]; + if (isNull _light) then { + _type = if (ACE_player == vehicle ACE_player) then { 'ACE_Flashlight' } else { 'ACE_Dashlight' }; + _light = _type createVehicle (getPos ACE_player); + _light attachTo [(vehicle ACE_player), if (_type == 'ACE_Flashlight') then { [0,0.4,1] } else { [0,0,-1]}]; + ACE_player setVariable ['ace_map_light',_light]; + waitUntil {sleep 0.1; !visibleMap; }; + deleteVehicle _light; + ACE_player setVariable ['ace_map_light',objNull]; + }; + }; + }; +}; + +_ctrl = ((findDisplay 12) displayCtrl 51); +_scale = ctrlMapScale _ctrl; + +_speed = 0; +if (vehicle ACE_player == ACE_player) then { + _speed = vectorMagnitude (velocity ACE_player); +}; + + +if (_speed > 0.1) then { + if (ctrlMapAnimDone _ctrl) then { + + _amplitude = (_speed - 0.1) / 5 * (1000 * _scale); + _time = 0.1; + + _shakePos = [(GVAR(lastStillPosition) select 0) + sin((time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, + (GVAR(lastStillPosition) select 1) + sin((time + _time - GVAR(lastStillTime))*260) * _amplitude]; + + _ctrl ctrlMapAnimAdd [_time, _scale, _shakePos]; + ctrlMapAnimCommit _ctrl; + + GVAR(isShaking) = true; + }; +} else { + if (GVAR(isShaking)) then { + _ctrl ctrlMapAnimAdd [0, _scale, GVAR(lastStillPosition)]; + ctrlMapAnimCommit _ctrl; + GVAR(isShaking) = false; + } else { + ctrlMapAnimClear _ctrl; + GVAR(lastStillPosition) = _ctrl ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; + + if (GVAR(limitZoom)) then { + if (GVAR(minMapSize) >= _scale) then { + _ctrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_ctrl ctrlMapScreenToWorld [0.5, 0.5])]; + ctrlMapAnimCommit _ctrl; + }; + }; + }; +}; diff --git a/addons/mapfx/functions/script_component.hpp b/addons/mapfx/functions/script_component.hpp new file mode 100644 index 0000000000..647b0b1581 --- /dev/null +++ b/addons/mapfx/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\mapfx\script_component.hpp" diff --git a/addons/mapfx/script_component.hpp b/addons/mapfx/script_component.hpp new file mode 100644 index 0000000000..63c4470744 --- /dev/null +++ b/addons/mapfx/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT mapfx +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAPFX + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAPFX + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPFX +#endif + +#include "\z\ace\addons\main\script_macros.hpp" From a4ea5fb72425e8878316755b93ed5d40a432c5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 13 Mar 2015 01:01:00 -0300 Subject: [PATCH 20/73] Cache the call to determineMapLight --- addons/mapfx/functions/fnc_updateMapFx.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mapfx/functions/fnc_updateMapFx.sqf b/addons/mapfx/functions/fnc_updateMapFx.sqf index 9b4b1ab7df..e2f1c07f00 100644 --- a/addons/mapfx/functions/fnc_updateMapFx.sqf +++ b/addons/mapfx/functions/fnc_updateMapFx.sqf @@ -1,8 +1,7 @@ #include "script_component.hpp" // Calculate the light -//_data = [[], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); -_data = call FUNC(determineMapLight); +_data = [[], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); diag_log _data; _darkMap = _data select 0; _color = _data select 1; From 86c16953eaa1e8af485d46b6669108ea79863d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 13 Mar 2015 01:35:45 -0300 Subject: [PATCH 21/73] Refactor and tweak map illumination to: - add tint depending on time of day. - make it slightly less dark at night, so it's usable under any condition. Temporarily remove light creation. --- .../mapfx/functions/fnc_determineMapLight.sqf | 230 ++++++++++-------- addons/mapfx/functions/fnc_updateMapFx.sqf | 18 +- 2 files changed, 139 insertions(+), 109 deletions(-) diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf index 50e09db6a3..8c2e78f370 100644 --- a/addons/mapfx/functions/fnc_determineMapLight.sqf +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -1,125 +1,155 @@ #include "script_component.hpp" -//TODO: Fix NVG color -private ["_darkMap","_lightColor","_lightFill","_createLight","_gunlight","_nearObjects","_light"]; +private ["_darkenMap","_darkenColor","_createLight","_gunlight","_nearObjects","_light"]; // @todo: Update the way to check for flashlights _gunlight = isArray(configFile>> "CfgWeapons" >> currentWeapon player >>"ace_gunlight_classes") || {"ACE_MugLite" in weapons player}; -// Default Values -_alphaBase = if (round overcast > 0.5) then { 0.90 } else { 0.85}; -_alpha = _alphaBase min abs(sunOrMoon - 1); +_fnc_blendColor = { + EXPLODE_3_PVT(_this,_c1,_c2,_alpha); + [(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha, + (_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha, + (_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha, + (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] +}; -_lightColor = [0,0,0,((_alpha*1.1) min 1)]; -_lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; -_darkMap = true; +_lightTint = switch (true) do { + case (daytime < 4 || dayTime >= 20) : {[0,0,0.2,1]}; + case (daytime < 5.5) : {[[0,0,0.4,1], [0.8,0.2,0,1], (daytime - 4)/1.5 ] call _fnc_blendColor}; + case (daytime < 6.5) : {[[0.8,0.2,0,1], [1,1,1,1], daytime - 5.5 ] call _fnc_blendColor}; + case (daytime < 17) : { [1,1,1,1] }; + case (daytime < 18) : {[[1,1,1,1], [0.8,0.2,0,1], daytime - 17 ] call _fnc_blendColor}; + case (daytime < 20) : {[[0.8,0.2,0,1], [0,0,0.4,1], (daytime - 18)/2] call _fnc_blendColor}; +}; + +_lightLevel = switch (true) do { + case (daytime < 4 || dayTime >= 20) : {0.08}; + case (daytime < 6) : {0.08 + (1 - 0.08) * (daytime - 4) / 2}; + case (daytime < 18): {1}; + case (daytime < 20): {1 + (0.08 - 1) * (daytime - 18) / 2}; +}; + +_lightLevel = _lightLevel - 0.5 * (_lightLevel + 0.08) * ((overcast - 0.5) max 0); + +_fnc_calcColor = { + EXPLODE_2_PVT(_this,_c1,_lightLevel); + + _l = abs(_lightLevel - 0.5) / 0.5; + + if (_lightLevel < 0.5) then { + [(_c1 select 0) * _l * _l * _l, + (_c1 select 1) * _l * _l * _l, + (_c1 select 2) * _l * _l * _l, + (_c1 select 3) * (1 - _lightLevel)] + } else { + [(_c1 select 0) * (1 - _l) + _l, + (_c1 select 1) * (1 - _l) + _l, + (_c1 select 2) * (1 - _l) + _l, + (_c1 select 3) * (1 - _lightLevel)] + }; +}; + +_darkenMap = true; _createLight = false; +// check if player has NVG enabled +if (currentVisionMode ACE_player == 1) exitWith { + // stick to nvg color + _darkenMap = true; + _darkenColor = [154/255,253/255,177/255,0.5]; + _createLight = false; + + [_darkenMap,_darkenColor,_createLight] +}; + +if (_lightLevel > 0.95) exitWith { + [false, [1,1,1,0], false] +}; + + // Check if player is not in a vehicle if (vehicle ACE_player == ACE_player) then { // Player is not in a vehicle TRACE_1("NOT in vehicle",""); - _lightColor = [0,0,0,(_alpha*1.1)]; - _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; - // check if player has NVG enabled - if (currentVisionMode ACE_player == 1) then { - // stick to nvg color - _alpha = 0.8; - _lightColor = [154/255,253/255,177/255,_alpha]; - _lightFill = "#(rgb,1,1,1)color(0.20,0.48,0.23,0.7)"; - TRACE_1("nvg on - green tint",""); - } else { + // darken map, unless following cases are fulfilled + // Priorities: Weapons flashlight, lamppost, fire, chemlight, flares - if (_alpha < 0.05) exitWith { - _darkMap = false; - }; - - // darken map, unless following cases are fulfilled - // Priorities: Weapons flashlight, lamppost, fire, chemlight, flares - - // Check if player is near a campfires, lights or vehicles with lights on - 15m - _nearObjects = [nearestObjects [ACE_player, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); - if (count (_nearObjects) > 0) then { - _light = _nearObjects select 0; - _alpha = (((((ACE_player distance _light) - 5)/10) max 0) min 1) min _alphaBase; - _lightColor = [0,0,0,_alpha]; - _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; - TRACE_1("player near campfire",""); - }; - - // TODO: Illumination flares (timed) - - // Using chemlights - _fnc_chemLight = { - EXPLODE_2_PVT(_this,_no,_lc); - - if (count (_no) == 0) exitWith {}; - - _light = _no select 0; - _alpha = (((((player distance _light) - 2)/4) max 0) min 0.5); - _lightColor = +_lc; - _lightColor set [3, _alpha]; - _lightFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",(_lightColor select 0),(_lightColor select 1),(_lightColor select 2),(_lightColor select 3)]; - TRACE_1("player near chemlight",""); - }; - - _nearObjects = [ACE_player nearObjects ["Chemlight_red", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,0,0,0]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_green", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,1,0,0]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_blue", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,0,1,0]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_yellow", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,1,0,0]] call _fnc_chemLight; - - // Gun with light - if (_gunlight) then { - _darkMap = false; - _createLight = true; - TRACE_1("using gun light",""); - }; + // Check if player is near a campfires, lights or vehicles with lights on - 15m + _nearObjects = [nearestObjects [ACE_player, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); + if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; + _lightLevel = _lightLevel max (1 - (((((ACE_player distance _light) - 5)/10) max 0) min 1)); + TRACE_1("player near campfire",""); }; + + // TODO: Illumination flares (timed) + + // Using chemlights + _fnc_chemLight = { + EXPLODE_2_PVT(_this,_no,_lc); + if (count (_no) == 0) exitWith {}; + + _light = _no select 0; + _ll = (1 - ((((ACE_player distance _light) - 2)/2) max 0)) * 0.4; + if (_ll > _lightLevel) then { + _lightLevel = _ll; + _lightTint = +_lc; + hint format ["%1 %2",ACE_player distance _light,_ll]; + }; + TRACE_1("player near chemlight",""); + }; + + _nearObjects = [ACE_player nearObjects ["Chemlight_red", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [1,0,0,1]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_green", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [0,1,0,1]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_blue", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [0,0,1,1]] call _fnc_chemLight; + + _nearObjects = [ACE_player nearObjects ["Chemlight_yellow", 4], {alive _this}] call EFUNC(common,filter); + [_nearObjects, [1,1,0,1]] call _fnc_chemLight; + + // Gun with light + if (_gunlight) then { + _darkenMap = false; + _createLight = true; + TRACE_1("using gun light",""); + }; + } else { // Player is in a vehicle if ((vehicle ACE_player) isKindOf "Tank") exitWith { - _darkMap = false; + _darkenMap = false; _createLight = false; }; // check if vehicle is not of following type: parachute TRACE_1("in vehicle",""); - // check if player has NVG enabled - if (currentVisionMode ACE_player == 1) then { - // stick to nvg color - _alpha = 0.8; - _lightColor = [0,0.96,0,_alpha]; - _lightFill = "#(rgb,1,1,1)color(0,0.96,0,0.8)"; - TRACE_1("nvg on - green tint",""); - } else { - // darken map if vehicle is kind of bicycle or motorbike or ATV or parachute or PBX boat - if (vehicle ACE_player isKindOf "Bicycle" || {vehicle ACE_player isKindOf "Motorcycle"}) then { - if (_gunlight) then { - _darkMap = false; - _createLight = true; - TRACE_1("bright map - gun lights",""); - } else { - _lightColor = [0,0,0,(_alpha*1.1)]; - _lightFill = format["#(rgb,1,1,1)color(0,0,0,%1)",_alpha]; - TRACE_1("darken map - no lights",""); - }; - } else { - // do not darken map, but create a lightpoint at players eye pos to simulate dash light / flashlight usage to view map - // do nothing if in a tank or apc - _darkMap = false; - _createLight = true; - TRACE_1("using vehicle light",""); - }; - }; -}; -TRACE_4("",_darkMap,_lightColor,_lightFill,_createLight); -[_darkMap,_lightColor,_lightFill,_createLight] + // darken map if vehicle is kind of bicycle or motorbike or ATV or parachute or PBX boat + if (vehicle ACE_player isKindOf "Bicycle" || {vehicle ACE_player isKindOf "Motorcycle"}) then { + if (_gunlight) then { + _darkenMap = false; + _createLight = true; + TRACE_1("bright map - gun lights",""); + } else { + _darkenColor = [0,0,0,(_alpha*1.1)]; + TRACE_1("darken map - no lights",""); + }; + } else { + // do not darken map, but create a lightpoint at players eye pos to simulate dash light / flashlight usage to view map + // do nothing if in a tank or apc + _darkenMap = false; + _createLight = true; + TRACE_1("using vehicle light",""); + }; + +}; + +_darkenColor = [_lightTint, _lightLevel] call _fnc_calcColor; + +TRACE_4("",_darkenMap,_darkenColor,_createLight); +[_darkenMap,_darkenColor,_createLight] diff --git a/addons/mapfx/functions/fnc_updateMapFx.sqf b/addons/mapfx/functions/fnc_updateMapFx.sqf index e2f1c07f00..93c42b4749 100644 --- a/addons/mapfx/functions/fnc_updateMapFx.sqf +++ b/addons/mapfx/functions/fnc_updateMapFx.sqf @@ -2,15 +2,15 @@ // Calculate the light _data = [[], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); -diag_log _data; -_darkMap = _data select 0; -_color = _data select 1; -_fill = _data select 2; -_externalLight = _data select 3; -if (_darkMap) then { - ((findDisplay 12) displayCtrl 51) drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_color,_fill]; + +EXPLODE_3_PVT(_data,_darkenMap,_darkenColor,_externalLight); +//systemChat format ["%1 %2 %3", _darkenMap, _darkenColor, _createLight]; + +if (_darkenMap) then { + _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; + ((findDisplay 12) displayCtrl 51) drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; } else { - if (_externalLight) then { + /*if (_externalLight) then { [] spawn { _light = ACE_player getVariable ['ace_map_light',objNull]; if (isNull _light) then { @@ -23,7 +23,7 @@ if (_darkMap) then { ACE_player setVariable ['ace_map_light',objNull]; }; }; - }; + };*/ }; _ctrl = ((findDisplay 12) displayCtrl 51); From 93262f3b9285b74dd9bf0e87128ef42e8c6175ed Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 13 Mar 2015 00:45:12 -0500 Subject: [PATCH 22/73] Use ace_isUnconscious in anim changed EH --- addons/captives/functions/fnc_doEscortCaptive.sqf | 2 +- addons/captives/functions/fnc_setHandcuffed.sqf | 6 +++--- addons/captives/functions/fnc_setSurrendered.sqf | 2 +- addons/medical/functions/fnc_setUnconscious.sqf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 299aa81631..08f44a1437 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -51,7 +51,7 @@ if (_state) then { _unit setVariable [QGVAR(escortedUnit), objNull, true]; }; }; - [_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; + [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; } else { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 0deb68dc8b..5917532874 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -52,7 +52,7 @@ if (_state) then { //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); - if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then { + if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { ERROR("Handcuff animation interrupted"); systemChat format ["debug %2: new %1", _newAnimation, time]; [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); @@ -71,8 +71,8 @@ if (_state) then { _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - if ((vehicle _unit) == _unit) then { - //Break out of hands up animation loop (doAnimation handles Unconscious prioity) + if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index e49c6e9453..3a7436abc7 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -50,7 +50,7 @@ if (_state) then { //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); - if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then { + if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { ERROR("Surrender animation interrupted"); systemChat format ["debug %2: new %1", _newAnimation, time]; [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index b60e1ca574..890f4d2787 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -25,7 +25,7 @@ if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(com // We only want this function to work on local machines if (!local _unit) exitwith { - [[_unit], QUOTE(DFUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; // Get rid of the object we are carrying, before we go unconscious. From 1e731ee4252260b6bc6d236e21b60695b34ea331 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 13 Mar 2015 18:34:13 +0100 Subject: [PATCH 23/73] fix vector cfg patches --- addons/vector/config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/vector/config.cpp b/addons/vector/config.cpp index 4603857506..926bfda58d 100644 --- a/addons/vector/config.cpp +++ b/addons/vector/config.cpp @@ -2,8 +2,8 @@ class CfgPatches { class ADDON { - units[] = {"AGM_Item_Vector"}; - weapons[] = {"AGM_Vector"}; + units[] = {"ACE_Item_Vector"}; + weapons[] = {"ACE_Vector"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"Ghost","Hamburger SV","commy2","bux578"}; From 25fc24a4192ac019decc1f7778a606686cc5a38d Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 13 Mar 2015 18:52:30 +0100 Subject: [PATCH 24/73] fix cfgPatches in laserpointer --- addons/laserpointer/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index 32357b31ef..b97587dac6 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"AGM_acc_pointer_red","AGM_acc_pointer_green"}; + weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; From db6e0fe99b0d9c3423a8c20cdfc08295354236f6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 13 Mar 2015 19:10:24 +0100 Subject: [PATCH 25/73] hpps for realistic names --- addons/realisticnames/CfgMagazines.hpp | 419 +++++++ addons/realisticnames/CfgVehicles.hpp | 555 +++++++++ addons/realisticnames/CfgWeapons.hpp | 461 ++++++++ addons/realisticnames/config.cpp | 1439 +----------------------- 4 files changed, 1438 insertions(+), 1436 deletions(-) create mode 100644 addons/realisticnames/CfgMagazines.hpp create mode 100644 addons/realisticnames/CfgVehicles.hpp create mode 100644 addons/realisticnames/CfgWeapons.hpp diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp new file mode 100644 index 0000000000..cf555c9603 --- /dev/null +++ b/addons/realisticnames/CfgMagazines.hpp @@ -0,0 +1,419 @@ + +class CfgMagazines { + class VehicleMagazine; + class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { + displayNameShort = "30mm HEI"; + }; + + class 7Rnd_Rocket_04_HE_F: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "70mm AP"; + }; + + class 24Rnd_PG_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 12Rnd_PG_missiles: 24Rnd_PG_missiles { + displayNameShort = "70mm HE"; + }; + + class 2000Rnd_65x39_Belt; + class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { + displayNameShort = "7.62mm"; + }; + class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { + displayNameShort = "7.62mm"; + }; + + class 500Rnd_127x99_mag: VehicleMagazine { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 200Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 100Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 200Rnd_40mm_G_belt: VehicleMagazine { + displayNameShort = "40mm HE"; + }; + + class 24Rnd_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + + class 300Rnd_20mm_shells: VehicleMagazine { + displayNameShort = "20mm HE"; + }; + + class 14Rnd_80mm_rockets: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + + class 250Rnd_30mm_HE_shells: VehicleMagazine { + displayNameShort = "30mm HE"; + }; + class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm APDS"; + }; + + class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "80mm HE"; + }; + + class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { + displayNameShort = "80mm AP"; + }; + + class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { + displayNameShort = "30mm HEI-T"; + }; + + class 680Rnd_35mm_AA_shells: VehicleMagazine { + displayNameShort = "35mm HEI"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + + class 32Rnd_155mm_Mo_shells: VehicleMagazine { + displayNameShort = "155mm HE"; + }; + class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { + displayNameShort = "155mm Smoke"; + }; + class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Mines"; + }; + class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm AT Mines"; + }; + class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Cluster"; + }; + class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Guided"; + }; + class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Laser Guided"; + }; + + class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { + displayName = "227mm HE Missile"; + displayNameShort = "227mm HE"; + }; + + class 30Rnd_120mm_HE_shells: VehicleMagazine { + displayNameShort = "120mm HE"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + + class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm AP"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + + class 200Rnd_762x51_Belt: VehicleMagazine { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Red; + class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Green; + class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Yellow; + class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Red; + class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Green; + class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Yellow; + class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 16Rnd_120mm_HE_shells; + class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { + displayNameShort = "125mm HE"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Red; + class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { + displayNameShort = "125mm HE-T"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Green; + class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { + displayNameShort = "125mm HE-T"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Yellow; + class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { + displayNameShort = "125mm HE-T"; + }; + + class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { + displayNameShort = "125mm MP"; + }; + class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells; + class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { + displayNameShort = "125mm AP"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Red; + class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { + displayNameShort = "125mm AP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Green; + class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { + displayNameShort = "125mm AP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; + class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { + displayNameShort = "125mm AP-T"; + }; + + class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { + displayNameShort = "105mm MP"; + }; + class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + + class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { + displayNameShort = "105mm AP"; + }; + class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + + class 60Rnd_40mm_GPR_shells: VehicleMagazine { + displayNameShort = "40mm GPR"; + }; + class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + + class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm AP"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; + + class 450Rnd_127x108_Ball: VehicleMagazine { + displayNameShort = "12.7mm"; + }; + + class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm MP"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; + + class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm AP"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + + class 200Rnd_20mm_G_belt: VehicleMagazine { + displayNameShort = "20mm HE"; + }; + class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { + displayNameShort = "20mm HE"; + }; + + // mines + class CA_Magazine; + // http://en.wikipedia.org/wiki/M15_mine + class ATMine_Range_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_ATMine_Name"; + }; + // http://en.wikipedia.org/wiki/VS-50_mine + class APERSMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; + }; + // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html + class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; + }; + // http://en.wikipedia.org/wiki/PMR-3_mine + class APERSTripMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; + }; + // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf + class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_SLAM_Name"; + }; + + // claymore + class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_Claymore_Name"; + }; + + // satchels + class SatchelCharge_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; + }; + class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { + displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; + }; + + // hand grenades + class HandGrenade: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; + }; + class SmokeShell: HandGrenade { + displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; + }; + class SmokeShellBlue: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; + }; + class SmokeShellGreen: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; + }; + class SmokeShellOrange: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; + }; + class SmokeShellPurple: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; + }; + class SmokeShellRed: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; + }; + class SmokeShellYellow: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; + }; +}; diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp new file mode 100644 index 0000000000..218e04ff09 --- /dev/null +++ b/addons/realisticnames/CfgVehicles.hpp @@ -0,0 +1,555 @@ + +class CfgVehicles { + // static weapons + class StaticMGWeapon; + class HMG_01_base_F: StaticMGWeapon { + displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; + }; + class HMG_01_A_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; + }; + class HMG_01_high_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; + }; + + class AT_01_base_F; + class B_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class O_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class I_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + + class AA_01_base_F; + class B_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class O_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class I_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + + class GMG_TriPod; + class GMG_01_base_F: GMG_TriPod { + displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; + }; + class GMG_01_A_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; + }; + class GMG_01_high_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; + }; + + // M-ATV + class MRAP_01_base_F; + class B_MRAP_01_F: MRAP_01_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; + }; + + class MRAP_01_gmg_base_F: MRAP_01_base_F {}; + class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; + }; + + class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; + class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; + }; + + // punisher + class MRAP_02_base_F; + class O_MRAP_02_F: MRAP_02_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; + }; + + class MRAP_02_hmg_base_F: MRAP_02_base_F {}; + class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; + }; + + class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; + class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; + }; + + // strider + class MRAP_03_base_F; + class I_MRAP_03_F: MRAP_03_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; + }; + + class MRAP_03_hmg_base_F: MRAP_03_base_F {}; + class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; + }; + + class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; + class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; + }; + + // merkava derivates + class MBT_01_base_F; + class B_MBT_01_base_F: MBT_01_base_F {}; + + class B_MBT_01_cannon_F: B_MBT_01_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; + }; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; + }; + + class MBT_01_arty_base_F: MBT_01_base_F {}; + class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; + + class B_MBT_01_arty_F: B_MBT_01_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; + }; + + class MBT_01_mlrs_base_F: MBT_01_base_F {}; + class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; + + class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. + }; + + // T100 derivates + class MBT_02_base_F; + class O_MBT_02_base_F: MBT_02_base_F {}; + + class O_MBT_02_cannon_F: O_MBT_02_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; + }; + + class MBT_02_arty_base_F: MBT_02_base_F {}; + class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; + + class O_MBT_02_arty_F: O_MBT_02_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; + }; + + // leopard sg + class I_MBT_03_base_F; + class I_MBT_03_cannon_F: I_MBT_03_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; + }; + + // tracked apcs + class B_APC_Tracked_01_base_F; + class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; + }; + + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. + }; + + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; + }; + + class O_APC_Tracked_02_base_F; + class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; + }; + + class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; + }; + + class I_APC_tracked_03_base_F; + class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; + }; + + // wheeled apcs + class B_APC_Wheeled_01_base_F; + class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; + }; + + class O_APC_Wheeled_02_base_F; + class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; + }; + + class I_APC_Wheeled_03_base_F; + class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; + }; + + // trucks + class Truck_01_base_F; + class B_Truck_01_transport_F: Truck_01_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; + }; + class B_Truck_01_covered_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; + }; + class B_Truck_01_mover_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; + }; + class B_Truck_01_box_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; + }; + class B_Truck_01_medical_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; + }; + class B_Truck_01_ammo_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; + }; + class B_Truck_01_fuel_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; + }; + class B_Truck_01_Repair_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; + }; + class Truck_02_transport_base_F; + class O_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class Truck_02_base_F; + class O_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class Truck_02_Ammo_base_F; + class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class Truck_02_fuel_base_F; + class O_Truck_02_fuel_F: Truck_02_fuel_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class Truck_02_box_base_F; + class O_Truck_02_box_F: Truck_02_box_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class Truck_02_medical_base_F; + class O_Truck_02_medical_F: Truck_02_medical_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + class I_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class I_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class I_Truck_02_fuel_F: Truck_02_fuel_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class I_Truck_02_box_F: Truck_02_box_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class I_Truck_02_medical_F: Truck_02_medical_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + + class Truck_03_base_F; + class O_Truck_03_transport_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; + }; + class O_Truck_03_covered_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; + }; + class O_Truck_03_device_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; + }; + class O_Truck_03_ammo_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; + }; + class O_Truck_03_fuel_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; + }; + class O_Truck_03_repair_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; + }; + class O_Truck_03_medical_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; + }; + + // helicopters + class Heli_Attack_01_base_F; + class B_Heli_Attack_01_F: Heli_Attack_01_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; + }; + + class Heli_Light_01_unarmed_base_F; + class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; + }; + + class Heli_Light_01_armed_base_F; + class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; + }; + + class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; + }; + + class Heli_Transport_03_base_F; + class B_Heli_Transport_03_F: Heli_Transport_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; + }; + class Heli_Transport_03_unarmed_base_F; + class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; + }; + + class Heli_Light_02_base_F; + class O_Heli_Light_02_F: Heli_Light_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; + }; + class Heli_Light_02_unarmed_base_F; + class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; + }; + + class Heli_light_03_base_F; + class I_Heli_light_03_F: Heli_light_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; + }; + + class Heli_light_03_unarmed_base_F; + class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; + }; + + class Heli_Transport_02_base_F; + class I_Heli_Transport_02_F: Heli_Transport_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; + }; + + // planes + class Plane_CAS_01_base_F; + class B_Plane_CAS_01_F: Plane_CAS_01_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; + }; + + class Plane_CAS_02_base_F; + class O_Plane_CAS_02_F: Plane_CAS_02_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; + }; + + class Plane_Fighter_03_base_F; + class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; + }; + + class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; + }; + + // uavs + class UAV_02_base_F; + class B_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class O_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class I_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + + class UAV_02_CAS_base_F: UAV_02_base_F {}; + class B_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class O_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class I_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + + // pistols + class Pistol_Base_F; + class Weapon_hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class Weapon_hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class Weapon_hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // rocket launchers + class Launcher_Base_F; + class Weapon_launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + class Weapon_launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class Weapon_launch_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + + class Weapon_launch_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class Weapon_launch_B_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; + //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; + + class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + + // rifles + + // MX + class Weapon_Base_F; + class Weapon_arifle_MX_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + }; + + class Weapon_arifle_MXC_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + }; + + class Weapon_arifle_MX_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + }; + + class Weapon_arifle_MX_SW_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + + class Weapon_arifle_MXM_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + + // Katiba + class Weapon_arifle_Katiba_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + + class Weapon_arifle_Katiba_C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + + // F2000 + class Weapon_arifle_Mk20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + + class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class Weapon_arifle_Mk20C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + + class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + + class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // TAR-21 + class Weapon_arifle_TRG21_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + + class Weapon_arifle_TRG20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + + // sub machine guns + class Weapon_SMG_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + class Weapon_SMG_02_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + class Weapon_hgun_PDW2000_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + class Weapon_arifle_SDAR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // machine guns + class Weapon_LMG_Mk200_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class Weapon_LMG_Zafir_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class Weapon_srifle_EBR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class Weapon_srifle_GM6_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + + class Weapon_srifle_GM6_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class Weapon_srifle_LRR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + + class Weapon_srifle_LRR_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class Weapon_srifle_DMR_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; +}; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp new file mode 100644 index 0000000000..8e64434bd4 --- /dev/null +++ b/addons/realisticnames/CfgWeapons.hpp @@ -0,0 +1,461 @@ + +class Mode_FullAuto; + +class CfgWeapons { + // assault rifles + + // MX + class arifle_MX_Base_F; + class arifle_MX_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + }; + class arifle_MX_Black_F: arifle_MX_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; + }; + + class arifle_MXC_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + }; + class arifle_MXC_Black_F: arifle_MXC_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; + }; + + class arifle_MX_GL_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + }; + class arifle_MX_GL_Black_F: arifle_MX_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; + }; + + class arifle_MX_SW_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + class arifle_MX_SW_Black_F: arifle_MX_SW_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; + }; + + class arifle_MXM_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + class arifle_MXM_Black_F: arifle_MXM_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; + }; + + // Katiba + class arifle_katiba_Base_F; + class arifle_Katiba_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + class arifle_Katiba_GL_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + class arifle_Katiba_C_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + // SDAR + class SDAR_base_F; + class arifle_SDAR_F: SDAR_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // TAR-21 + class Tavor_base_F; + class arifle_TRG21_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + class arifle_TRG21_GL_F: arifle_TRG21_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + class arifle_TRG20_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + // F2000 + class mk20_base_F; + class arifle_Mk20_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + class arifle_Mk20_plain_F: arifle_Mk20_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class arifle_Mk20C_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + class arifle_Mk20C_plain_F: arifle_Mk20C_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class arifle_Mk20_GL_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // Vector + class SMG_01_Base; + class SMG_01_F: SMG_01_Base { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + // Scorpion + class SMG_02_base_F; + class SMG_02_F: SMG_02_base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + // PDW 2000 + class pdw2000_base_F; + class hgun_pdw2000_F: pdw2000_base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + // pistols + class Pistol_Base_F; + class hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // machine guns + class Rifle_Long_Base_F; + class LMG_Mk200_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class LMG_Zafir_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class EBR_base_F; + class srifle_EBR_F: EBR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class LRR_base_F; + class srifle_LRR_F: LRR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + class srifle_LRR_camo_F: srifle_LRR_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class GM6_base_F; + class srifle_GM6_F: GM6_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + class srifle_GM6_camo_F: srifle_GM6_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class DMR_01_base_F; + class srifle_DMR_01_F: DMR_01_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; + + // launchers + class Launcher_Base_F; + class launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class launch_Titan_base: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + class launch_Titan_short_base: launch_Titan_base { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + // vehicle weapons + + // gatlings + class CannonCore; + class gatling_20mm: CannonCore { + //displayName = ""; + class manual: CannonCore { + //displayName = ""; + }; + }; + class Twin_Cannon_20mm: gatling_20mm { + displayName = "Plamen PL-20"; + class manual: manual { + displayName = "Plamen PL-20"; + }; + }; + + class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels + displayName = "GSh-3-30"; + class LowROF: Mode_FullAuto { + displayName = "GSh-3-30"; + }; + }; + + class Gatling_30mm_Plane_CAS_01_F: CannonCore { + displayName = "GAU-8"; + class LowROF: Mode_FullAuto { + displayName = "GAU-8"; + }; + }; + + class Cannon_30mm_Plane_CAS_02_F: CannonCore { + displayName = "GSh-301"; + class LowROF: Mode_FullAuto { + displayName = "GSh-301"; + }; + }; + + // missiles + class RocketPods; + class Missile_AA_04_Plane_CAS_01_F: RocketPods { + displayName = "AIM-9 Sidewinder"; + }; + class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { + displayName = "Wympel R-73"; + }; + + class MissileLauncher; + class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { + displayName = "AGM-65 Maverick"; + }; + class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { + displayName = "Kh-25MTP"; + }; + + // rockets + class Rocket_04_HE_Plane_CAS_01_F: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "Hydra 70"; + }; + + class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + + class rockets_Skyfire: RocketPods { + displayName = "Skyfire-70"; + class Burst: RocketPods { + displayName = "Skyfire-70"; + }; + }; + + // more missiles + class missiles_DAR: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + + class missiles_DAGR: RocketPods { + displayName = "DAGR"; + class Burst: RocketPods { + displayName = "DAGR"; + }; + }; + + class missiles_ASRAAM: MissileLauncher { + displayName = "AIM-132 ASRAAM"; + }; + + class missiles_Zephyr: MissileLauncher { + displayName = "AIM-120A AMRAAM"; + }; + + class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on + displayName = "9K121 Vikhr"; + }; + + // bomb + class Bomb_04_Plane_CAS_01_F: RocketPods { + //displayName = ""; + }; + class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { + displayName = "FAB-250M-54"; + }; + + // machine guns + class MGunCore; + class M134_minigun: MGunCore { + displayName = "2x M134 Minigun"; + }; + + class LMG_RCWS; + class MGun; + + class LMG_Minigun: LMG_RCWS { + displayName = "M134 Minigun"; + class manual: MGun { + displayName = "M134 Minigun"; + }; + }; + + class HMG_127: LMG_RCWS { + displayName = "M2"; + class manual: MGun { + displayName = "M2"; + }; + }; + + class HMG_01: HMG_127 { + displayName = "XM312"; + }; + class HMG_M2: HMG_01 { + displayName = "M2"; + }; + + class HMG_NSVT: HMG_127 { + displayName = "NSVT"; + class manual: manual { + displayName = "NSVT"; + }; + }; + + // grenade launchers + class GMG_F; + class GMG_20mm: GMG_F { + displayName = "XM307"; + class manual: GMG_F { + displayName = "XM307"; + }; + }; + + class GMG_40mm: GMG_F { + displayName = "Mk 19"; + class manual: GMG_F { + displayName = "Mk 19"; + }; + }; + + // autocannons + class autocannon_35mm: CannonCore { + displayName = "GDF-001"; + class manual: CannonCore { + displayName = "GDF-001"; + }; + }; + + // aa missiles + class missiles_titan: MissileLauncher { + displayName = "Mini-Spike"; + }; + + // mortar + class mortar_155mm_AMOS: CannonCore { + displayName = "L/52"; + }; + + // artillery rockets + class rockets_230mm_GAT: RocketPods { + displayName = "M269"; + }; + + // tank guns + class cannon_120mm: CannonCore { + class player; + displayName = "MG251"; + }; + + class cannon_120mm_long: cannon_120mm { + displayName = "L/55"; + class player: player {}; + }; + + class cannon_105mm: cannon_120mm { + displayName = "M68"; + class player: player { + displayName = "M68"; + }; + }; + + class cannon_125mm: cannon_120mm { + displayName = "2A46"; + }; + + // coax machine guns + class LMG_coax: LMG_RCWS { + displayName = "PKT"; + }; + + class ACE_LMG_coax_MBT_01: LMG_coax { + displayName = "MAG 58"; + }; + + class ACE_LMG_coax_APC_Tracked_03: LMG_coax { + displayName = "L94A1"; + }; + + // more autocannons + class autocannon_Base_F; + class autocannon_40mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm: autocannon_30mm_CTWS { + displayName = "L21A1 RARDEN"; + class AP: AP { + displayName = "L21A1 RARDEN"; + }; + + class HE: HE { + displayName = "L21A1 RARDEN"; + }; + }; +}; diff --git a/addons/realisticnames/config.cpp b/addons/realisticnames/config.cpp index e7a7984721..6a8ea59290 100644 --- a/addons/realisticnames/config.cpp +++ b/addons/realisticnames/config.cpp @@ -12,1439 +12,6 @@ class CfgPatches { }; }; -// VEHICLES -class CfgVehicles { - // static weapons - class StaticMGWeapon; - class HMG_01_base_F: StaticMGWeapon { - displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; - }; - class HMG_01_A_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; - }; - class HMG_01_high_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; - }; - - class AT_01_base_F; - class B_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class O_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class I_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - - class AA_01_base_F; - class B_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class O_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class I_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - - class GMG_TriPod; - class GMG_01_base_F: GMG_TriPod { - displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; - }; - class GMG_01_A_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; - }; - class GMG_01_high_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; - }; - - // M-ATV - class MRAP_01_base_F; - class B_MRAP_01_F: MRAP_01_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; - }; - - class MRAP_01_gmg_base_F: MRAP_01_base_F {}; - class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; - }; - - class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; - class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; - }; - - // punisher - class MRAP_02_base_F; - class O_MRAP_02_F: MRAP_02_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; - }; - - class MRAP_02_hmg_base_F: MRAP_02_base_F {}; - class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; - }; - - class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; - class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; - }; - - // strider - class MRAP_03_base_F; - class I_MRAP_03_F: MRAP_03_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; - }; - - class MRAP_03_hmg_base_F: MRAP_03_base_F {}; - class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; - }; - - class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; - class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; - }; - - // merkava derivates - class MBT_01_base_F; - class B_MBT_01_base_F: MBT_01_base_F {}; - - class B_MBT_01_cannon_F: B_MBT_01_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; - }; - class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; - }; - - class MBT_01_arty_base_F: MBT_01_base_F {}; - class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; - - class B_MBT_01_arty_F: B_MBT_01_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; - }; - - class MBT_01_mlrs_base_F: MBT_01_base_F {}; - class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; - - class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. - }; - - // T100 derivates - class MBT_02_base_F; - class O_MBT_02_base_F: MBT_02_base_F {}; - - class O_MBT_02_cannon_F: O_MBT_02_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; - }; - - class MBT_02_arty_base_F: MBT_02_base_F {}; - class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; - - class O_MBT_02_arty_F: O_MBT_02_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; - }; - - // leopard sg - class I_MBT_03_base_F; - class I_MBT_03_cannon_F: I_MBT_03_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; - }; - - // tracked apcs - class B_APC_Tracked_01_base_F; - class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; - }; - - class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. - }; - - class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; - }; - - class O_APC_Tracked_02_base_F; - class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; - }; - - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; - }; - - class I_APC_tracked_03_base_F; - class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; - }; - - // wheeled apcs - class B_APC_Wheeled_01_base_F; - class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; - }; - - class O_APC_Wheeled_02_base_F; - class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; - }; - - class I_APC_Wheeled_03_base_F; - class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; - }; - - // trucks - class Truck_01_base_F; - class B_Truck_01_transport_F: Truck_01_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; - }; - class B_Truck_01_covered_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; - }; - class B_Truck_01_mover_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; - }; - class B_Truck_01_box_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; - }; - class B_Truck_01_medical_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; - }; - class B_Truck_01_ammo_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; - }; - class B_Truck_01_fuel_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; - }; - class B_Truck_01_Repair_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; - }; - class Truck_02_transport_base_F; - class O_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class Truck_02_base_F; - class O_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class Truck_02_Ammo_base_F; - class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class Truck_02_fuel_base_F; - class O_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class Truck_02_box_base_F; - class O_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class Truck_02_medical_base_F; - class O_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - class I_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class I_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class I_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class I_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class I_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - - class Truck_03_base_F; - class O_Truck_03_transport_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; - }; - class O_Truck_03_covered_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; - }; - class O_Truck_03_device_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; - }; - class O_Truck_03_ammo_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; - }; - class O_Truck_03_fuel_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; - }; - class O_Truck_03_repair_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; - }; - class O_Truck_03_medical_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; - }; - - // helicopters - class Heli_Attack_01_base_F; - class B_Heli_Attack_01_F: Heli_Attack_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; - }; - - class Heli_Light_01_unarmed_base_F; - class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; - }; - - class Heli_Light_01_armed_base_F; - class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; - }; - - class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; - }; - - class Heli_Transport_03_base_F; - class B_Heli_Transport_03_F: Heli_Transport_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; - }; - class Heli_Transport_03_unarmed_base_F; - class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; - }; - - class Heli_Light_02_base_F; - class O_Heli_Light_02_F: Heli_Light_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; - }; - class Heli_Light_02_unarmed_base_F; - class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; - }; - - class Heli_light_03_base_F; - class I_Heli_light_03_F: Heli_light_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; - }; - - class Heli_light_03_unarmed_base_F; - class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; - }; - - class Heli_Transport_02_base_F; - class I_Heli_Transport_02_F: Heli_Transport_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; - }; - - // planes - class Plane_CAS_01_base_F; - class B_Plane_CAS_01_F: Plane_CAS_01_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; - }; - - class Plane_CAS_02_base_F; - class O_Plane_CAS_02_F: Plane_CAS_02_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; - }; - - class Plane_Fighter_03_base_F; - class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; - }; - - class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; - }; - - // uavs - class UAV_02_base_F; - class B_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class O_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class I_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - - class UAV_02_CAS_base_F: UAV_02_base_F {}; - class B_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class O_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class I_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - - // pistols - class Pistol_Base_F; - class Weapon_hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class Weapon_hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class Weapon_hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // rocket launchers - class Launcher_Base_F; - class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - class Weapon_launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class Weapon_launch_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - - class Weapon_launch_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class Weapon_launch_B_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; - //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - - class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - - // rifles - - // MX - class Weapon_Base_F; - class Weapon_arifle_MX_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - - class Weapon_arifle_MXC_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - - class Weapon_arifle_MX_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - - class Weapon_arifle_MX_SW_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - - class Weapon_arifle_MXM_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - - // Katiba - class Weapon_arifle_Katiba_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - - class Weapon_arifle_Katiba_C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - - // F2000 - class Weapon_arifle_Mk20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - - class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class Weapon_arifle_Mk20C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - - class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - - class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // TAR-21 - class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - - class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - - // sub machine guns - class Weapon_SMG_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - class Weapon_SMG_02_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - class Weapon_hgun_PDW2000_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // machine guns - class Weapon_LMG_Mk200_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class Weapon_LMG_Zafir_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class Weapon_srifle_EBR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class Weapon_srifle_GM6_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - - class Weapon_srifle_GM6_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - - class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; -}; - -// WEAPONS -class Mode_FullAuto; - -class CfgWeapons { - // assault rifles - - // MX - class arifle_MX_Base_F; - class arifle_MX_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - class arifle_MX_Black_F: arifle_MX_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; - }; - - class arifle_MXC_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - class arifle_MXC_Black_F: arifle_MXC_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; - }; - - class arifle_MX_GL_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - class arifle_MX_GL_Black_F: arifle_MX_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; - }; - - class arifle_MX_SW_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - class arifle_MX_SW_Black_F: arifle_MX_SW_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; - }; - - class arifle_MXM_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - class arifle_MXM_Black_F: arifle_MXM_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; - }; - - // Katiba - class arifle_katiba_Base_F; - class arifle_Katiba_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - class arifle_Katiba_GL_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - class arifle_Katiba_C_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - // SDAR - class SDAR_base_F; - class arifle_SDAR_F: SDAR_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // TAR-21 - class Tavor_base_F; - class arifle_TRG21_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - class arifle_TRG21_GL_F: arifle_TRG21_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - class arifle_TRG20_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - // F2000 - class mk20_base_F; - class arifle_Mk20_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - class arifle_Mk20_plain_F: arifle_Mk20_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class arifle_Mk20C_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - class arifle_Mk20C_plain_F: arifle_Mk20C_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class arifle_Mk20_GL_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // Vector - class SMG_01_Base; - class SMG_01_F: SMG_01_Base { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - // Scorpion - class SMG_02_base_F; - class SMG_02_F: SMG_02_base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - // PDW 2000 - class pdw2000_base_F; - class hgun_pdw2000_F: pdw2000_base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - // pistols - class Pistol_Base_F; - class hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // machine guns - class Rifle_Long_Base_F; - class LMG_Mk200_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class LMG_Zafir_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class EBR_base_F; - class srifle_EBR_F: EBR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class LRR_base_F; - class srifle_LRR_F: LRR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - class srifle_LRR_camo_F: srifle_LRR_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class GM6_base_F; - class srifle_GM6_F: GM6_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - class srifle_GM6_camo_F: srifle_GM6_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class DMR_01_base_F; - class srifle_DMR_01_F: DMR_01_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; - - // launchers - class Launcher_Base_F; - class launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class launch_Titan_base: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - class launch_Titan_short_base: launch_Titan_base { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - // vehicle weapons - - // gatlings - class CannonCore; - class gatling_20mm: CannonCore { - //displayName = ""; - class manual: CannonCore { - //displayName = ""; - }; - }; - class Twin_Cannon_20mm: gatling_20mm { - displayName = "Plamen PL-20"; - class manual: manual { - displayName = "Plamen PL-20"; - }; - }; - - class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels - displayName = "GSh-3-30"; - class LowROF: Mode_FullAuto { - displayName = "GSh-3-30"; - }; - }; - - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - displayName = "GAU-8"; - class LowROF: Mode_FullAuto { - displayName = "GAU-8"; - }; - }; - - class Cannon_30mm_Plane_CAS_02_F: CannonCore { - displayName = "GSh-301"; - class LowROF: Mode_FullAuto { - displayName = "GSh-301"; - }; - }; - - // missiles - class RocketPods; - class Missile_AA_04_Plane_CAS_01_F: RocketPods { - displayName = "AIM-9 Sidewinder"; - }; - class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { - displayName = "Wympel R-73"; - }; - - class MissileLauncher; - class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { - displayName = "AGM-65 Maverick"; - }; - class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { - displayName = "Kh-25MTP"; - }; - - // rockets - class Rocket_04_HE_Plane_CAS_01_F: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "Hydra 70"; - }; - - class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - - class rockets_Skyfire: RocketPods { - displayName = "Skyfire-70"; - class Burst: RocketPods { - displayName = "Skyfire-70"; - }; - }; - - // more missiles - class missiles_DAR: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - - class missiles_DAGR: RocketPods { - displayName = "DAGR"; - class Burst: RocketPods { - displayName = "DAGR"; - }; - }; - - class missiles_ASRAAM: MissileLauncher { - displayName = "AIM-132 ASRAAM"; - }; - - class missiles_Zephyr: MissileLauncher { - displayName = "AIM-120A AMRAAM"; - }; - - class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on - displayName = "9K121 Vikhr"; - }; - - // bomb - class Bomb_04_Plane_CAS_01_F: RocketPods { - //displayName = ""; - }; - class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { - displayName = "FAB-250M-54"; - }; - - // machine guns - class MGunCore; - class M134_minigun: MGunCore { - displayName = "2x M134 Minigun"; - }; - - class LMG_RCWS; - class MGun; - - class LMG_Minigun: LMG_RCWS { - displayName = "M134 Minigun"; - class manual: MGun { - displayName = "M134 Minigun"; - }; - }; - - class HMG_127: LMG_RCWS { - displayName = "M2"; - class manual: MGun { - displayName = "M2"; - }; - }; - - class HMG_01: HMG_127 { - displayName = "XM312"; - }; - class HMG_M2: HMG_01 { - displayName = "M2"; - }; - - class HMG_NSVT: HMG_127 { - displayName = "NSVT"; - class manual: manual { - displayName = "NSVT"; - }; - }; - - // grenade launchers - class GMG_F; - class GMG_20mm: GMG_F { - displayName = "XM307"; - class manual: GMG_F { - displayName = "XM307"; - }; - }; - - class GMG_40mm: GMG_F { - displayName = "Mk 19"; - class manual: GMG_F { - displayName = "Mk 19"; - }; - }; - - // autocannons - class autocannon_35mm: CannonCore { - displayName = "GDF-001"; - class manual: CannonCore { - displayName = "GDF-001"; - }; - }; - - // aa missiles - class missiles_titan: MissileLauncher { - displayName = "Mini-Spike"; - }; - - // mortar - class mortar_155mm_AMOS: CannonCore { - displayName = "L/52"; - }; - - // artillery rockets - class rockets_230mm_GAT: RocketPods { - displayName = "M269"; - }; - - // tank guns - class cannon_120mm: CannonCore { - class player; - displayName = "MG251"; - }; - - class cannon_120mm_long: cannon_120mm { - displayName = "L/55"; - class player: player {}; - }; - - class cannon_105mm: cannon_120mm { - displayName = "M68"; - class player: player { - displayName = "M68"; - }; - }; - - class cannon_125mm: cannon_120mm { - displayName = "2A46"; - }; - - // coax machine guns - class LMG_coax: LMG_RCWS { - displayName = "PKT"; - }; - - class ACE_LMG_coax_MBT_01: LMG_coax { - displayName = "MAG 58"; - }; - - class ACE_LMG_coax_APC_Tracked_03: LMG_coax { - displayName = "L94A1"; - }; - - // more autocannons - class autocannon_Base_F; - class autocannon_40mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - }; - - class autocannon_30mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - }; - - class autocannon_30mm: autocannon_30mm_CTWS { - displayName = "L21A1 RARDEN"; - class AP: AP { - displayName = "L21A1 RARDEN"; - }; - - class HE: HE { - displayName = "L21A1 RARDEN"; - }; - }; -}; - -class CfgMagazines { - class VehicleMagazine; - class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { - displayNameShort = "30mm HEI"; - }; - - class 7Rnd_Rocket_04_HE_F: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "70mm AP"; - }; - - class 24Rnd_PG_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 12Rnd_PG_missiles: 24Rnd_PG_missiles { - displayNameShort = "70mm HE"; - }; - - class 2000Rnd_65x39_Belt; - class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { - displayNameShort = "7.62mm"; - }; - class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { - displayNameShort = "7.62mm"; - }; - - class 500Rnd_127x99_mag: VehicleMagazine { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 200Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 100Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 200Rnd_40mm_G_belt: VehicleMagazine { - displayNameShort = "40mm HE"; - }; - - class 24Rnd_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - - class 300Rnd_20mm_shells: VehicleMagazine { - displayNameShort = "20mm HE"; - }; - - class 14Rnd_80mm_rockets: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - - class 250Rnd_30mm_HE_shells: VehicleMagazine { - displayNameShort = "30mm HE"; - }; - class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm APDS"; - }; - - class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "80mm HE"; - }; - - class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { - displayNameShort = "80mm AP"; - }; - - class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { - displayNameShort = "30mm HEI-T"; - }; - - class 680Rnd_35mm_AA_shells: VehicleMagazine { - displayNameShort = "35mm HEI"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - - class 32Rnd_155mm_Mo_shells: VehicleMagazine { - displayNameShort = "155mm HE"; - }; - class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { - displayNameShort = "155mm Smoke"; - }; - class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Mines"; - }; - class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm AT Mines"; - }; - class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Cluster"; - }; - class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Guided"; - }; - class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Laser Guided"; - }; - - class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { - displayName = "227mm HE Missile"; - displayNameShort = "227mm HE"; - }; - - class 30Rnd_120mm_HE_shells: VehicleMagazine { - displayNameShort = "120mm HE"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - - class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm AP"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - - class 200Rnd_762x51_Belt: VehicleMagazine { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Red; - class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Green; - class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Yellow; - class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Red; - class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Green; - class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Yellow; - class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 16Rnd_120mm_HE_shells; - class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { - displayNameShort = "125mm HE"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Red; - class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { - displayNameShort = "125mm HE-T"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Green; - class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { - displayNameShort = "125mm HE-T"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Yellow; - class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { - displayNameShort = "125mm HE-T"; - }; - - class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { - displayNameShort = "125mm MP"; - }; - class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells; - class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { - displayNameShort = "125mm AP"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Red; - class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { - displayNameShort = "125mm AP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Green; - class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { - displayNameShort = "125mm AP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; - class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { - displayNameShort = "125mm AP-T"; - }; - - class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { - displayNameShort = "105mm MP"; - }; - class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - - class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { - displayNameShort = "105mm AP"; - }; - class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - - class 60Rnd_40mm_GPR_shells: VehicleMagazine { - displayNameShort = "40mm GPR"; - }; - class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - - class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm AP"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; - - class 450Rnd_127x108_Ball: VehicleMagazine { - displayNameShort = "12.7mm"; - }; - - class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm MP"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; - - class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm AP"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - - class 200Rnd_20mm_G_belt: VehicleMagazine { - displayNameShort = "20mm HE"; - }; - class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { - displayNameShort = "20mm HE"; - }; - - // mines - class CA_Magazine; - // http://en.wikipedia.org/wiki/M15_mine - class ATMine_Range_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_ATMine_Name"; - }; - // http://en.wikipedia.org/wiki/VS-50_mine - class APERSMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; - }; - // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html - class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; - }; - // http://en.wikipedia.org/wiki/PMR-3_mine - class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; - }; - // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf - class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_SLAM_Name"; - }; - - // claymore - class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_Claymore_Name"; - }; - - // satchels - class SatchelCharge_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; - }; - class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; - }; - - // hand grenades - class HandGrenade: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; - }; - class SmokeShell: HandGrenade { - displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; - }; - class SmokeShellBlue: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; - }; - class SmokeShellGreen: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; - }; - class SmokeShellOrange: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; - }; - class SmokeShellPurple: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; - }; - class SmokeShellRed: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; - }; - class SmokeShellYellow: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; - }; -}; +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" From 7e2e6999bdf88f29b9616e5967c347f656e4fb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 13 Mar 2015 19:34:56 -0300 Subject: [PATCH 26/73] Ported from ACE2: - Bring scale legend to ingame map - Tweak map colors to make them exactly the same as ACE2 (had to import road colors directly from Arma 2, cause ACE just used defaults). - Hide bushes and trees from the ingame map (they remain visible on the editor) - Keep sattelite texture toogable, but with a opacity of 50%. --- addons/map/MapTweaks.hpp | 38 ++++++++++++++++++++++++++++++++++++++ addons/map/config.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 addons/map/MapTweaks.hpp diff --git a/addons/map/MapTweaks.hpp b/addons/map/MapTweaks.hpp new file mode 100644 index 0000000000..2cf5786059 --- /dev/null +++ b/addons/map/MapTweaks.hpp @@ -0,0 +1,38 @@ +// Hide Bushes +class Bush { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 14; + importance = "0.2 * 14 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; + +// Hide Trees +class SmallTree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.6 * 12 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; +class Tree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.9 * 16 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; + +class Legend { + x = SafeZoneX+SafeZoneW-.340; + y = SafeZoneY+SafeZoneH-.152; + font = "PuristaMedium"; + w = .340; + h = .152; + sizeEx = 0.039210; + colorBackground[] = {0.906000, 0.901000, 0.880000, 0.5}; + color[] = {0, 0, 0, 0.75}; +}; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 36a6f85168..98ed1b3c60 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -50,11 +50,39 @@ class ACE_Settings { class RscMapControl { + maxSatelliteAlpha = 0.5; + + // From Arma 2 + colorTracks[] = {1.0,0.0,0.0,1}; + colorTracksFill[] = {1.0,1.0,0.0,1}; + colorRoads[] = {0.0,0.0,0.0,1}; + colorRoadsFill[] = {1,1,0,1}; + colorMainRoads[] = {0.0,0.0,0.0,1}; + colorMainRoadsFill[] = {1,0.6,0.4,1}; + colorRailWay[] = {0.8,0.2,0,1}; + + // From ACE2 + colorBackground[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorOutside[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorCountlines[] = {0.647059, 0.533333, 0.286275, 1}; + colorMainCountlines[] = {0.858824, 0, 0,1}; + colorForest[] = {0.6, 0.8, 0.2, 0.25}; + colorLevels[] = {0.0, 0.0, 0.0, 1.0}; + colorRocks[] = {0.50, 0.50, 0.50, 0.50}; + + sizeExLevel = 0.03; + showCountourInterval = 1; // refs #13673 + sizeExGrid = 0.032; }; // REGULAR MAP class RscDisplayMainMap { + class controlsBackground { + class CA_Map : RscMapControl { + #include "MapTweaks.hpp" + }; + }; // get rid of the "center to player position" - button (as it works even on elite) class controls { class TopRight: RscControlsGroup { From 80e7117eadc8486a25900f02149ad58b619dce14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 13 Mar 2015 22:27:14 -0300 Subject: [PATCH 27/73] Tweak ambientBrightness to take into acount the cloud coverage --- addons/common/functions/fnc_ambientBrightness.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index 034129735a..f29ff9e8e5 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -11,4 +11,4 @@ */ #include "script_component.hpp" -sunOrMoon * sunOrMoon + moonIntensity/5 min 1 +sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast) From 69fa51cfeb016675a1032948089d3d9146861ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 13 Mar 2015 22:27:38 -0300 Subject: [PATCH 28/73] Calculate map illumination based on ambientBrightness --- .../mapfx/functions/fnc_determineMapLight.sqf | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf index 8c2e78f370..c5267689d5 100644 --- a/addons/mapfx/functions/fnc_determineMapLight.sqf +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -13,23 +13,15 @@ _fnc_blendColor = { (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] }; + _lightTint = switch (true) do { - case (daytime < 4 || dayTime >= 20) : {[0,0,0.2,1]}; - case (daytime < 5.5) : {[[0,0,0.4,1], [0.8,0.2,0,1], (daytime - 4)/1.5 ] call _fnc_blendColor}; - case (daytime < 6.5) : {[[0.8,0.2,0,1], [1,1,1,1], daytime - 5.5 ] call _fnc_blendColor}; - case (daytime < 17) : { [1,1,1,1] }; - case (daytime < 18) : {[[1,1,1,1], [0.8,0.2,0,1], daytime - 17 ] call _fnc_blendColor}; - case (daytime < 20) : {[[0.8,0.2,0,1], [0,0,0.4,1], (daytime - 18)/2] call _fnc_blendColor}; + case (sunOrMoon == 1.0) : { [1,1,1,1] }; + case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; + case (sunOrMoon > 0.50) : {[[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor}; + case (sunOrMoon <= 0.5) : { [0,0,0.1,1] }; }; -_lightLevel = switch (true) do { - case (daytime < 4 || dayTime >= 20) : {0.08}; - case (daytime < 6) : {0.08 + (1 - 0.08) * (daytime - 4) / 2}; - case (daytime < 18): {1}; - case (daytime < 20): {1 + (0.08 - 1) * (daytime - 18) / 2}; -}; - -_lightLevel = _lightLevel - 0.5 * (_lightLevel + 0.08) * ((overcast - 0.5) max 0); +_lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); _fnc_calcColor = { EXPLODE_2_PVT(_this,_c1,_lightLevel); From 97776c168bf3e8a65918e3c8e0db771773829ad2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 14 Mar 2015 10:48:53 +0100 Subject: [PATCH 29/73] use chemlights common parent class to reduce nearObjects calls --- .../mapfx/functions/fnc_determineMapLight.sqf | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf index 8c2e78f370..2307116b4e 100644 --- a/addons/mapfx/functions/fnc_determineMapLight.sqf +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -100,17 +100,25 @@ if (vehicle ACE_player == ACE_player) then { TRACE_1("player near chemlight",""); }; - _nearObjects = [ACE_player nearObjects ["Chemlight_red", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,0,0,1]] call _fnc_chemLight; + // all chemlights inherit from SmokeShell, CfgAmmo + _nearObjects = [ACE_player nearObjects ["SmokeShell", 4], {alive _this}] call EFUNC(common,filter); - _nearObjects = [ACE_player nearObjects ["Chemlight_green", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,1,0,1]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_blue", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,0,1,1]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_yellow", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,1,0,1]] call _fnc_chemLight; + { + switch (toLower typeOf _x) do { + case ("chemlight_red"): { + [_nearObjects, [1,0,0,1]] call _fnc_chemLight; + }; + case ("chemlight_green"): { + [_nearObjects, [0,1,0,1]] call _fnc_chemLight; + }; + case ("chemlight_blue"): { + [_nearObjects, [0,0,1,1]] call _fnc_chemLight; + }; + case ("chemlight_yellow"): { + [_nearObjects, [1,1,0,1]] call _fnc_chemLight; + }; + }; + } forEach _nearObjects; // Gun with light if (_gunlight) then { From 1b3dcfc07bbbf00e01334cbb59fe37a52f38845c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 14 Mar 2015 11:26:52 +0100 Subject: [PATCH 30/73] A3 check if gunlight is turned on --- addons/mapfx/XEH_preInit.sqf | 1 + .../mapfx/functions/fnc_determineMapLight.sqf | 3 +- addons/mapfx/functions/fnc_isGunLightOn.sqf | 42 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 addons/mapfx/functions/fnc_isGunLightOn.sqf diff --git a/addons/mapfx/XEH_preInit.sqf b/addons/mapfx/XEH_preInit.sqf index ecdf9cf694..b894367c9a 100644 --- a/addons/mapfx/XEH_preInit.sqf +++ b/addons/mapfx/XEH_preInit.sqf @@ -6,6 +6,7 @@ LOG(MSG_INIT); PREP(determineMapLight); PREP(determineZoom); +PREP(isGunLightOn); PREP(updateMapFx); ADDON = true; diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf index 2307116b4e..445bd5392d 100644 --- a/addons/mapfx/functions/fnc_determineMapLight.sqf +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -2,8 +2,7 @@ private ["_darkenMap","_darkenColor","_createLight","_gunlight","_nearObjects","_light"]; -// @todo: Update the way to check for flashlights -_gunlight = isArray(configFile>> "CfgWeapons" >> currentWeapon player >>"ace_gunlight_classes") || {"ACE_MugLite" in weapons player}; +_gunlight = [ACE_player] call FUNC(isGunLightOn); _fnc_blendColor = { EXPLODE_3_PVT(_this,_c1,_c2,_alpha); diff --git a/addons/mapfx/functions/fnc_isGunLightOn.sqf b/addons/mapfx/functions/fnc_isGunLightOn.sqf new file mode 100644 index 0000000000..14b9c98cd1 --- /dev/null +++ b/addons/mapfx/functions/fnc_isGunLightOn.sqf @@ -0,0 +1,42 @@ +/* + * Author: commy2 + * + * Check if the given unit has it's flashlight attachment turned on. + * + * Argument: + * 0: A unit with gunlight (Object) + * + * Return value: + * Unit has flashlight turned on? (Bool). + */ +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +private "_weapon"; + +_weapon = currentWeapon _unit; + +// exit if flashlight is turned off +if !(_unit isFlashlightOn _weapon) exitWith {false}; + +// get type of attachment +private "_gunLight"; +_gunLight = switch (_weapon) do { + case (""): {""}; + case (primaryWeapon _unit): { + primaryWeaponItems _unit select 1; + }; + case (secondaryWeapon _unit): { + secondaryWeaponItems _unit select 1; + }; + case (handgunWeapon _unit): { + handgunItems _unit select 1; + }; + default {""}; +}; + +// return false if the gunlight is a day laser +!(toLower _gunLight in ["ace_acc_pointer_red", "ace_acc_pointer_green"]) From 58212f5ce0a6329b9082ad0af6c30644d97f5fd5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 14 Mar 2015 12:05:43 +0100 Subject: [PATCH 31/73] add PBO to drag objects --- addons/dragging/$PBOPREFIX$ | 1 + addons/dragging/CfgEventHandlers.hpp | 6 ++++++ addons/dragging/XEH_preInit.sqf | 7 +++++++ addons/dragging/config.cpp | 15 +++++++++++++++ addons/dragging/functions/fnc_empty.sqf | 3 +++ addons/dragging/functions/script_component.hpp | 1 + addons/dragging/script_component.hpp | 12 ++++++++++++ 7 files changed, 45 insertions(+) create mode 100644 addons/dragging/$PBOPREFIX$ create mode 100644 addons/dragging/CfgEventHandlers.hpp create mode 100644 addons/dragging/XEH_preInit.sqf create mode 100644 addons/dragging/config.cpp create mode 100644 addons/dragging/functions/fnc_empty.sqf create mode 100644 addons/dragging/functions/script_component.hpp create mode 100644 addons/dragging/script_component.hpp diff --git a/addons/dragging/$PBOPREFIX$ b/addons/dragging/$PBOPREFIX$ new file mode 100644 index 0000000000..4090738414 --- /dev/null +++ b/addons/dragging/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\dragging \ No newline at end of file diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/dragging/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf new file mode 100644 index 0000000000..69abb46fa9 --- /dev/null +++ b/addons/dragging/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(empty); + +ADDON = true; diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp new file mode 100644 index 0000000000..ce4613ae39 --- /dev/null +++ b/addons/dragging/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_interact_menu"}; + author[] = {"https://github.com/commy2/"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/dragging/functions/fnc_empty.sqf b/addons/dragging/functions/fnc_empty.sqf new file mode 100644 index 0000000000..c60a82b2d8 --- /dev/null +++ b/addons/dragging/functions/fnc_empty.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +diag_log text format["This is here as an example!!!"]; diff --git a/addons/dragging/functions/script_component.hpp b/addons/dragging/functions/script_component.hpp new file mode 100644 index 0000000000..9d257a69d3 --- /dev/null +++ b/addons/dragging/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\dragging\script_component.hpp" \ No newline at end of file diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp new file mode 100644 index 0000000000..3e8c54519b --- /dev/null +++ b/addons/dragging/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT dragging +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_DRAGGING + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_DRAGGING + #define DEBUG_SETTINGS DEBUG_ENABLED_DRAGGING +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file From f3f20439c851b0cbb417dca94001b84f5551421c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 14 Mar 2015 13:51:23 +0100 Subject: [PATCH 32/73] config stuff, functions to make objects dragable --- addons/dragging/CfgEventHandlers.hpp | 14 +++++ addons/dragging/CfgVehicles.hpp | 43 +++++++++++++++ addons/dragging/XEH_postInit.sqf | 11 ++++ addons/dragging/XEH_preInit.sqf | 3 +- addons/dragging/config.cpp | 1 + addons/dragging/functions/fnc_empty.sqf | 3 - addons/dragging/functions/fnc_initObject.sqf | 25 +++++++++ .../dragging/functions/fnc_setDraggable.sqf | 55 +++++++++++++++++++ 8 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 addons/dragging/CfgVehicles.hpp create mode 100644 addons/dragging/XEH_postInit.sqf delete mode 100644 addons/dragging/functions/fnc_empty.sqf create mode 100644 addons/dragging/functions/fnc_initObject.sqf create mode 100644 addons/dragging/functions/fnc_setDraggable.sqf diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index f0a9f14d91..463ae20ddc 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -4,3 +4,17 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_Init_EventHandlers { + class ThingX { + class ADDON { + init = QUOTE(if (local (_this select 0)) then {_this call DFUNC(initObject)};); + }; + }; +}; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp new file mode 100644 index 0000000000..e20cc9f6e9 --- /dev/null +++ b/addons/dragging/CfgVehicles.hpp @@ -0,0 +1,43 @@ + +class CfgVehicles { + class ThingX; + class ReammoBox_F: ThingX { + GVAR(canDrag) = 0; + GVAR(dragPosition[]) = {0,1,1}; + GVAR(dragDirection) = 0; + }; + + class Slingload_base_F: ReammoBox_F { + GVAR(canDrag) = 0; + }; + + class EAST_Box_Base: ReammoBox_F { + GVAR(canDrag) = 1; + }; + class IND_Box_Base: ReammoBox_F { + GVAR(canDrag) = 1; + }; + /*class FIA_Box_Base_F: ReammoBox_F { + GVAR(canDrag) = 1; + };*/ + class NATO_Box_Base: ReammoBox_F { + GVAR(canDrag) = 1; + }; + + // Remove Larger crate dragging support. + // Would be better to allow some sort of joint push/drag functionality + // Requiring 2 units to access the larger crates and attaching them together (a crappy method of doing it) + // in order to move the bigger ones. Currently simply remove support. + // I believe these crates are currently broken (hitbox doesn't work or something) in 1.22 (2014-07-04) + class Box_East_AmmoVeh_F: EAST_Box_Base { + GVAR(canDrag) = 0; + }; + + class Box_NATO_AmmoVeh_F: NATO_Box_Base { + GVAR(canDrag) = 0; + }; + + class Box_IND_AmmoVeh_F: IND_Box_Base { + GVAR(canDrag) = 0; + }; +}; diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf new file mode 100644 index 0000000000..18dff50699 --- /dev/null +++ b/addons/dragging/XEH_postInit.sqf @@ -0,0 +1,11 @@ +// by PabstMirror + +#include "script_component.hpp" + +GVAR(currentHeightChange) = 0; + +[{_this call DFUNC(handleScrollWheel)}] call FUNC(common,addScrollWheelEventHandler); + +if (isNil QGVAR(maxWeight)) then { + GVAR(maxWeight) = 800; +}; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 69abb46fa9..3825d1b429 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; -PREP(empty); +PREP(initObject); +PREP(setDraggable); ADDON = true; diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp index ce4613ae39..35f9f6d492 100644 --- a/addons/dragging/config.cpp +++ b/addons/dragging/config.cpp @@ -13,3 +13,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/dragging/functions/fnc_empty.sqf b/addons/dragging/functions/fnc_empty.sqf deleted file mode 100644 index c60a82b2d8..0000000000 --- a/addons/dragging/functions/fnc_empty.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -diag_log text format["This is here as an example!!!"]; diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf new file mode 100644 index 0000000000..3d1f51ad21 --- /dev/null +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Initialize variables for dragable objects. Called from init EH. + * + * Argument: + * 0: Any object (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canDrag)) == 1) then { + private ["_position", "_direction"]; + + _position = getArray (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(dragPosition)); + _direction = getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(dragDirection)); + + [_object, true, _position, _direction] call FUNC(setDraggable); +}; diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf new file mode 100644 index 0000000000..6c068540a6 --- /dev/null +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -0,0 +1,55 @@ +/* + * Author: commy2 + * + * Enable the object to be dragged. + * + * Argument: + * 0: Any object (Object) + * 1: true to enable dragging, false to disable (Bool) + * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0]) + * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_object", "_enableDrag", "_position", "_direction"]; + +_this resize 4; + +_object = _this select 0; +_enableDrag = _this select 1; +_position = _this select 2; +_direction = _this select 3; + +if (isNil "_position") then { + _position = _object getVariable [QGVAR(dragPosition), [0,0,0]]; +}; + +if (isNil "_direction") then { + _direction = _object getVariable [QGVAR(dragDirection), 0]; +}; + +// update variables +_object setVariable [QGVAR(canDrag), _enableDrag, true]; +_object setVariable [QGVAR(dragPosition), _position, true]; +_object setVariable [QGVAR(dragDirection), _direction, true]; + +// add action to class if it is not already present +private ["_type", "_initializedClasses"]; + +_initializedClasses = GETMVAR(GVAR(initializedClasses),[]); + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; + +private ["_name", "_icon", "_selection", "_statement", "_condition"]; + +_name = "drag"; +_icon = ""; +_selection = ""; +_statement = {hint str _target}; +_condition = {true}; + +[_type, 0, [_name], _name, _icon, _selection, _statement, _condition, 2] call EFUNC(interact_menu,addClassAction); From c03115b564ef2a20f803ec779dd61fa4093e36ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 14 Mar 2015 13:46:10 -0300 Subject: [PATCH 33/73] Refactored mapfx code, make the three features optional --- addons/mapfx/XEH_postClientInit.sqf | 2 +- addons/mapfx/config.cpp | 10 +- .../mapfx/functions/fnc_determineMapLight.sqf | 197 +++++++++--------- addons/mapfx/functions/fnc_determineZoom.sqf | 14 +- addons/mapfx/functions/fnc_updateMapFx.sqf | 125 +++++------ 5 files changed, 186 insertions(+), 162 deletions(-) diff --git a/addons/mapfx/XEH_postClientInit.sqf b/addons/mapfx/XEH_postClientInit.sqf index 1836083993..111bcbb171 100644 --- a/addons/mapfx/XEH_postClientInit.sqf +++ b/addons/mapfx/XEH_postClientInit.sqf @@ -3,9 +3,9 @@ ADDON = false; LOG(MSG_INIT); +// Calculate the maximum zoom allowed for this map call FUNC(determineZoom); -//Probably need this spawn, because CBA_fnc_addPerFrameHandler doesn't work durring briefing. [] spawn { // Wait until the map display is detected waitUntil {(!isNull findDisplay 12)}; diff --git a/addons/mapfx/config.cpp b/addons/mapfx/config.cpp index ff20c33499..1cdb1e93c1 100644 --- a/addons/mapfx/config.cpp +++ b/addons/mapfx/config.cpp @@ -13,7 +13,15 @@ class CfgPatches { #include "CfgEventHandlers.hpp" class ACE_Settings { - class GVAR(limitZoom) { + class GVAR(mapIllumination) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapShake) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapLimitZoom) { value = 0; typeName = "BOOL"; }; diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/mapfx/functions/fnc_determineMapLight.sqf index c5267689d5..370bcdb167 100644 --- a/addons/mapfx/functions/fnc_determineMapLight.sqf +++ b/addons/mapfx/functions/fnc_determineMapLight.sqf @@ -1,10 +1,23 @@ +/* +* Author: Rocko and CAA-Picard +* Calculates the current map illumination for a given unit +* +* Arguments: +* 0: Unit +* +* Return Value: +* 0: Does the map needs shading? +* 1: Color of the overlay +* +* Public: No +*/ #include "script_component.hpp" -private ["_darkenMap","_darkenColor","_createLight","_gunlight","_nearObjects","_light"]; +EXPLODE_1_PVT(_this,_unit); -// @todo: Update the way to check for flashlights -_gunlight = isArray(configFile>> "CfgWeapons" >> currentWeapon player >>"ace_gunlight_classes") || {"ACE_MugLite" in weapons player}; +private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight"]; +// Blend two colors _fnc_blendColor = { EXPLODE_3_PVT(_this,_c1,_c2,_alpha); [(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha, @@ -13,27 +26,26 @@ _fnc_blendColor = { (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] }; - +// Ambient light tint depending on time of day _lightTint = switch (true) do { - case (sunOrMoon == 1.0) : { [1,1,1,1] }; + case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] }; case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; case (sunOrMoon > 0.50) : {[[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor}; case (sunOrMoon <= 0.5) : { [0,0,0.1,1] }; }; -_lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); - +// Calculates overlay color from tint and light level _fnc_calcColor = { EXPLODE_2_PVT(_this,_c1,_lightLevel); - _l = abs(_lightLevel - 0.5) / 0.5; - if (_lightLevel < 0.5) then { - [(_c1 select 0) * _l * _l * _l, - (_c1 select 1) * _l * _l * _l, - (_c1 select 2) * _l * _l * _l, + _l = _lightLevel / 0.5; + [(_c1 select 0) * _l, + (_c1 select 1) * _l, + (_c1 select 2) * _l, (_c1 select 3) * (1 - _lightLevel)] } else { + _l = (_lightLevel - 0.5) / 0.5; [(_c1 select 0) * (1 - _l) + _l, (_c1 select 1) * (1 - _l) + _l, (_c1 select 2) * (1 - _l) + _l, @@ -41,107 +53,92 @@ _fnc_calcColor = { }; }; -_darkenMap = true; -_createLight = false; +_lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); // check if player has NVG enabled -if (currentVisionMode ACE_player == 1) exitWith { +if (currentVisionMode _unit == 1) exitWith { // stick to nvg color - _darkenMap = true; - _darkenColor = [154/255,253/255,177/255,0.5]; - _createLight = false; - - [_darkenMap,_darkenColor,_createLight] + [true, [154/255,253/255,177/255,0.5]] }; +// Do not obscure the map if the ambient light level is above 0.95 if (_lightLevel > 0.95) exitWith { - [false, [1,1,1,0], false] + [false, [0.5,0.5,0.5,0]] }; +// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination) +if (vehicle _unit != _unit) then { + // Player is in a vehicle + if ((vehicle _unit) isKindOf "Tank") then { + _isEnclosed = true; + }; +}; +if (_isEnclosed) exitWith { + TRACE_1("Player in a enclosed vehicle",""); + [false, [1,1,1,0]] +}; -// Check if player is not in a vehicle -if (vehicle ACE_player == ACE_player) then { - // Player is not in a vehicle - TRACE_1("NOT in vehicle",""); +// Player is not in a vehicle +TRACE_1("Player is on foot or in an open vehicle",""); - // darken map, unless following cases are fulfilled - // Priorities: Weapons flashlight, lamppost, fire, chemlight, flares +// Check if player is near a campfires, lights or vehicles with lights on - 15m +_nearObjects = [nearestObjects [_unit, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; - // Check if player is near a campfires, lights or vehicles with lights on - 15m - _nearObjects = [nearestObjects [ACE_player, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); - if (count (_nearObjects) > 0) then { - _light = _nearObjects select 0; - _lightLevel = _lightLevel max (1 - (((((ACE_player distance _light) - 5)/10) max 0) min 1)); + _ll = (1 - (((((_unit distance _light) - 5)/10) max 0) min 1)); + if (_ll > _lightLevel) then { + _lightLevel = _ll; TRACE_1("player near campfire",""); }; - - // TODO: Illumination flares (timed) - - // Using chemlights - _fnc_chemLight = { - EXPLODE_2_PVT(_this,_no,_lc); - if (count (_no) == 0) exitWith {}; - - _light = _no select 0; - _ll = (1 - ((((ACE_player distance _light) - 2)/2) max 0)) * 0.4; - if (_ll > _lightLevel) then { - _lightLevel = _ll; - _lightTint = +_lc; - hint format ["%1 %2",ACE_player distance _light,_ll]; - }; - TRACE_1("player near chemlight",""); - }; - - _nearObjects = [ACE_player nearObjects ["Chemlight_red", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,0,0,1]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_green", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,1,0,1]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_blue", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [0,0,1,1]] call _fnc_chemLight; - - _nearObjects = [ACE_player nearObjects ["Chemlight_yellow", 4], {alive _this}] call EFUNC(common,filter); - [_nearObjects, [1,1,0,1]] call _fnc_chemLight; - - // Gun with light - if (_gunlight) then { - _darkenMap = false; - _createLight = true; - TRACE_1("using gun light",""); - }; - -} else { - // Player is in a vehicle - if ((vehicle ACE_player) isKindOf "Tank") exitWith { - _darkenMap = false; - _createLight = false; - }; - - // check if vehicle is not of following type: parachute - TRACE_1("in vehicle",""); - - // darken map if vehicle is kind of bicycle or motorbike or ATV or parachute or PBX boat - if (vehicle ACE_player isKindOf "Bicycle" || {vehicle ACE_player isKindOf "Motorcycle"}) then { - if (_gunlight) then { - _darkenMap = false; - _createLight = true; - TRACE_1("bright map - gun lights",""); - } else { - _darkenColor = [0,0,0,(_alpha*1.1)]; - TRACE_1("darken map - no lights",""); - }; - } else { - // do not darken map, but create a lightpoint at players eye pos to simulate dash light / flashlight usage to view map - // do nothing if in a tank or apc - _darkenMap = false; - _createLight = true; - TRACE_1("using vehicle light",""); - }; - }; -_darkenColor = [_lightTint, _lightLevel] call _fnc_calcColor; -TRACE_4("",_darkenMap,_darkenColor,_createLight); -[_darkenMap,_darkenColor,_createLight] +// Gun with light +_nearObjects = [nearestObjects [_unit, ["CAManBase"], 10], { _this isFlashlightOn (currentWeapon _this)}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = (_nearObjects select 0); + _flashlight = (_light weaponAccessories currentMuzzle _light) select 1; + + // Check if it's a day laser + if (_flashlight == "ACE_acc_pointer_red") exitWith {}; + if (_flashlight == "ACE_acc_pointer_green") exitWith {}; + + _lightLevel = _lightLevel max (1 - (((((_unit distance _light) - 2)/8) max 0) min 1)); + TRACE_1("Using gun light",""); +}; + + +// @todo: Illumination flares (timed) + + +// Using chemlights +_nearObjects = [_unit nearObjects ["SmokeShell", 4], { + alive _this && {(typeOf _this == "Chemlight_red") || { + (typeOf _this == "Chemlight_green") || { + (typeOf _this == "Chemlight_blue") || { + (typeOf _this == "Chemlight_yellow")}}}}}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; + + _ll = (1 - ((((_unit distance _light) - 2)/2) max 0)) * 0.4; + if (_ll > _lightLevel) then { + _flareTint = switch (typeOf _light) do { + case "Chemlight_red" : {[1,0,0,1]}; + case "Chemlight_green" : {[0,1,0,1]}; + case "Chemlight_blue" : {[0,0,1,1]}; + case "Chemlight_yellow" : {[1,1,0,1]}; + }; + _lightTint = [_lightTint, _flareTint, (_ll - _lightLevel)/(1 - _lightLevel)] call _fnc_blendColor; + _lightLevel = _ll; + TRACE_1("player near chemlight",""); + }; +}; + +// Do not obscure the map if the ambient light level is above 0.95 +if (_lightLevel > 0.95) exitWith { + [false, [0.5,0.5,0.5,0]] +}; + +// Calculate resulting map color +[true, [_lightTint, _lightLevel] call _fnc_calcColor] diff --git a/addons/mapfx/functions/fnc_determineZoom.sqf b/addons/mapfx/functions/fnc_determineZoom.sqf index 5893967a4f..fdc620b417 100644 --- a/addons/mapfx/functions/fnc_determineZoom.sqf +++ b/addons/mapfx/functions/fnc_determineZoom.sqf @@ -1,7 +1,17 @@ +/* +* Author: Rocko +* Calculate the maximum zoom level allowed for the current map +* +* Arguments: +* None +* +* Return Value: +* None +* +* Public: No +*/ #include "script_component.hpp" -// TODO: Perhaps change to return values instead of setting GVAR's directly - private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; _grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; _fourSize = -1; diff --git a/addons/mapfx/functions/fnc_updateMapFx.sqf b/addons/mapfx/functions/fnc_updateMapFx.sqf index 93c42b4749..ad32a02632 100644 --- a/addons/mapfx/functions/fnc_updateMapFx.sqf +++ b/addons/mapfx/functions/fnc_updateMapFx.sqf @@ -1,69 +1,78 @@ +/* +* Author: Rocko and CAA-Picard +* On map draw, updates the effects +* +* Arguments: +* None +* +* Return Value: +* None +* +* Public: No +*/ #include "script_component.hpp" -// Calculate the light -_data = [[], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); +private ["_mapCtrl","_mapScale"]; -EXPLODE_3_PVT(_data,_darkenMap,_darkenColor,_externalLight); -//systemChat format ["%1 %2 %3", _darkenMap, _darkenColor, _createLight]; +_mapCtrl = ((findDisplay 12) displayCtrl 51); +_mapScale = ctrlMapScale _mapCtrl; -if (_darkenMap) then { - _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; - ((findDisplay 12) displayCtrl 51) drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; -} else { - /*if (_externalLight) then { - [] spawn { - _light = ACE_player getVariable ['ace_map_light',objNull]; - if (isNull _light) then { - _type = if (ACE_player == vehicle ACE_player) then { 'ACE_Flashlight' } else { 'ACE_Dashlight' }; - _light = _type createVehicle (getPos ACE_player); - _light attachTo [(vehicle ACE_player), if (_type == 'ACE_Flashlight') then { [0,0.4,1] } else { [0,0,-1]}]; - ACE_player setVariable ['ace_map_light',_light]; - waitUntil {sleep 0.1; !visibleMap; }; - deleteVehicle _light; - ACE_player setVariable ['ace_map_light',objNull]; - }; - }; - };*/ -}; +if (GVAR(mapIllumination)) then { + private ["_data","_darkenFill"]; -_ctrl = ((findDisplay 12) displayCtrl 51); -_scale = ctrlMapScale _ctrl; + // Calculate map illumination + _data = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); -_speed = 0; -if (vehicle ACE_player == ACE_player) then { - _speed = vectorMagnitude (velocity ACE_player); -}; - - -if (_speed > 0.1) then { - if (ctrlMapAnimDone _ctrl) then { - - _amplitude = (_speed - 0.1) / 5 * (1000 * _scale); - _time = 0.1; - - _shakePos = [(GVAR(lastStillPosition) select 0) + sin((time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, - (GVAR(lastStillPosition) select 1) + sin((time + _time - GVAR(lastStillTime))*260) * _amplitude]; - - _ctrl ctrlMapAnimAdd [_time, _scale, _shakePos]; - ctrlMapAnimCommit _ctrl; - - GVAR(isShaking) = true; + EXPLODE_2_PVT(_data,_darkenMap,_darkenColor); + if (_darkenMap) then { + _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; + _mapCtrl drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; }; -} else { - if (GVAR(isShaking)) then { - _ctrl ctrlMapAnimAdd [0, _scale, GVAR(lastStillPosition)]; - ctrlMapAnimCommit _ctrl; - GVAR(isShaking) = false; +}; + +if (GVAR(mapShake)) then { + private ["_speed","_amplitude", "_time", "_shakePos"]; + + // Only shake map while moving on foot + _speed = 0; + if (vehicle ACE_player == ACE_player) then { + _speed = vectorMagnitude (velocity ACE_player); + }; + + // If speed is large enough, create anims to shake map + if (_speed > 0.1) then { + if (ctrlMapAnimDone _mapCtrl) then { + + _amplitude = (_speed - 0.1) / 5 * (1000 * _mapScale); + _time = 0.1; + + _shakePos = [(GVAR(lastStillPosition) select 0) + sin((time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, + (GVAR(lastStillPosition) select 1) + sin((time + _time - GVAR(lastStillTime))*260) * _amplitude]; + + _mapCtrl ctrlMapAnimAdd [_time, _mapScale, _shakePos]; + ctrlMapAnimCommit _mapCtrl; + + GVAR(isShaking) = true; + }; } else { - ctrlMapAnimClear _ctrl; - GVAR(lastStillPosition) = _ctrl ctrlMapScreenToWorld [0.5, 0.5]; - GVAR(lastStillTime) = time; - - if (GVAR(limitZoom)) then { - if (GVAR(minMapSize) >= _scale) then { - _ctrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_ctrl ctrlMapScreenToWorld [0.5, 0.5])]; - ctrlMapAnimCommit _ctrl; - }; + if (GVAR(isShaking)) then { + // Stop shaking, return to original position + _mapCtrl ctrlMapAnimAdd [0, _mapScale, GVAR(lastStillPosition)]; + ctrlMapAnimCommit _mapCtrl; + GVAR(isShaking) = false; + } else { + // The map is still, store state + ctrlMapAnimClear _mapCtrl; + GVAR(lastStillPosition) = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; }; }; }; + +if (GVAR(mapLimitZoom)) then { + if (GVAR(minMapSize) >= _mapScale) then { + ctrlMapAnimClear _mapCtrl; + _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_mapCtrl ctrlMapScreenToWorld [0.5, 0.5])]; + ctrlMapAnimCommit _mapCtrl; + }; +}; From b79978116da8facfb896777a964035f98b98c97b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 14 Mar 2015 18:38:44 +0100 Subject: [PATCH 34/73] some functions --- addons/dragging/functions/fnc_canDrag.sqf | 0 addons/dragging/functions/fnc_startDrag.sqf | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 addons/dragging/functions/fnc_canDrag.sqf create mode 100644 addons/dragging/functions/fnc_startDrag.sqf diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf new file mode 100644 index 0000000000..e69de29bb2 From a92389f4503b43db086b9eb851f11c50e1e73563 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 14 Mar 2015 13:10:25 -0500 Subject: [PATCH 35/73] optMenu - remove 'fix anim' button and add headers --- .../fnc_onListBoxSettingsChanged.sqf | 24 +++++---- .../fnc_onListBoxShowSelectionChanged.sqf | 24 +++++---- .../functions/fnc_onSettingsMenuOpen.sqf | 52 +++++++++++-------- .../functions/fnc_onSliderPosChanged.sqf | 24 +++++---- .../functions/fnc_resetSettings.sqf | 38 ++++++++------ .../fnc_settingsMenuUpdateKeyView.sqf | 24 +++++---- .../functions/fnc_settingsMenuUpdateList.sqf | 24 +++++---- .../functions/fnc_updateSetting.sqf | 26 ++++++---- addons/optionsmenu/gui/settingsMenu.hpp | 10 ++-- 9 files changed, 150 insertions(+), 96 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 066bc76a8f..f5a39ff588 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -1,12 +1,18 @@ -/** -* fnc_onListBoxSettingsChanged.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called when the listbox selection is changed for an options (eg: chaning a setting from false to true) + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ #include "script_component.hpp" private ["_settingIndex", "_rightDropDownIndex"]; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index f4d41674bd..8b0b161033 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -1,12 +1,18 @@ -/** -* fnc_onListBoxShowSelectionChanged.sqf -* @Descr: called when the listbox selection has changed. Updates configuration menu information -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Changes which tab is open (options or colors) + * + * Arguments: + * The tab to open (defined in script_component) + * + * Return Value: + * None + * + * Example: + * [MENU_TAB_COLORS] call ACE_optionsmenu_fnc_onListBoxShowSelectionChanged + * + * Public: No + */ #include "script_component.hpp" private ["_settingsMenu", "_localizedHeader"]; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index e3137f8ca9..512628c128 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -1,33 +1,39 @@ -/** -* fnc_onSettingsMenuOpen.sqf -* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called from the onLoad of ACE_settingsMenu dialog. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen + * + * Public: No + */ #include "script_component.hpp" // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; { - // If the setting is user setable and not forced - if ((_x select 2) && !(_x select 6)) then { - // Append the current value to the setting metadata - _setting = + _x; - _setting pushBack (missionNamespace getVariable (_x select 0)); + // If the setting is user setable and not forced + if ((_x select 2) && !(_x select 6)) then { + // Append the current value to the setting metadata + _setting = + _x; + _setting pushBack (missionNamespace getVariable (_x select 0)); - // Categorize the setting according to types - // @todo: allow the user to modify other types of parameters? - if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { - GVAR(clientSideOptions) pushBack _setting; - }; - if ((_x select 1) == "COLOR") then { - GVAR(clientSideColors) pushBack _setting; - }; - }; + // Categorize the setting according to types + // @todo: allow the user to modify other types of parameters? + if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { + GVAR(clientSideOptions) pushBack _setting; + }; + if ((_x select 1) == "COLOR") then { + GVAR(clientSideColors) pushBack _setting; + }; + }; } forEach EGVAR(common,settings); //Delay a frame diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index ac6f52469c..fb4a2aa293 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -1,12 +1,18 @@ -/** -* fnc_onSliderPosChanged.sqf -* @Descr: N/A -* @Author: PabstMirror -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: PabstMirror + * Called when one of the color sliders is moved. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onSliderPosChanged + * + * Public: No + */ #include "script_component.hpp" private ["_newColor", "_settingIndex"]; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index dd4b951ef5..4dfa835413 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -1,30 +1,36 @@ -/** -* fnc_resetSettings.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Resets all settings to default. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ #include "script_component.hpp" private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index c271ecd176..35d0480bc0 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -1,12 +1,18 @@ -/** -* fnc_settingsMenuUpdateKeyView.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the right half of the option menu for the currently selected option. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView + * + * Public: No + */ #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 73a6d3de3b..15e166ebc6 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -1,12 +1,18 @@ -/** -* fnc_settingsMenuUpdateList.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the setting when the client has selected a new value. Saves to profilenamespace. + * + * Arguments: + * 0: Update the keylist as well + * + * Return Value: + * None + * + * Example: + * [false] call ACE_optionsmenu_fnc_settingsMenuUpdateList + * + * Public: No + */ #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index e4a9917f25..e73ce3a85d 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -1,12 +1,20 @@ -/** -* fnc_updateSetting.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Updates the setting when the client has selected a new value. Saves to profilenamespace and calls setSetting. + * + * Arguments: + * 0: The Tab Open + * 1: The setting's name + * 2: The new value either an index or a color OR + * + * Return Value: + * None + * + * Example: + * [MENU_TAB_COLORS, "ace_fireTruckColor", [1,0,0,1]] call ACE_optionsmenu_fnc_updateSetting + * + * Public: No + */ #include "script_component.hpp" private ["_changed"]; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 8d99a591d5..236ac72894 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -217,13 +217,17 @@ class ACE_settingsMenu { periodOver = 1; action = "closedialog 0;"; }; - class action_animation: actionClose { + + //probably use this for the export to hpp button: +/* class action_animation: actionClose { idc = 1100; text = "$STR_ACE_OptionsMenu_FixAnimation"; x = 7.5 * UNITX + OFFSETX; // action = "if ([player] call ACE_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call ACE_fnc_broadcastAnim; };"; - action = "hint 'todo???'"; - }; + action = QUOTE(_this call FUNC(k,rgr)); + }; */ + + class action_reset: actionClose { idc = 1100; text = "$STR_ACE_OptionsMenu_ResetAll"; From 518010be36fbc25c01cd5240a649081c0ea46452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 14 Mar 2015 16:58:05 -0300 Subject: [PATCH 36/73] Reordered the map, mapfx and pbos: - mapfx moved inside map - everything related to map tools and drawing moved to it's own pbo called ace_maptools Also fixed a couple of bugs in BFT - Only a single marker was being drawn - The BFT_HideAi parameter had the opposite effect --- addons/map/CfgEventHandlers.hpp | 13 +- addons/map/CfgMarkers.hpp | 91 ++++----- addons/map/CfgVehicles.hpp | 180 +++-------------- addons/map/CfgWeapons.hpp | 15 -- addons/map/MapControls.hpp | 98 +-------- addons/map/MapGpsUI.hpp | 81 -------- addons/map/README.md | 7 +- addons/map/XEH_postInitClient.sqf | 75 ++----- addons/map/XEH_preInit.sqf | 31 +-- addons/map/XEH_preInitServer.sqf | 6 - addons/map/config.cpp | 187 +++++++++--------- .../functions/fnc_blueForceTrackingUpdate.sqf | 46 ++--- .../functions/fnc_determineMapLight.sqf | 0 .../functions/fnc_determineZoom.sqf | 0 .../functions/fnc_updateMapEffects.sqf} | 0 addons/map/stringtable.xml | 143 +------------- addons/mapfx/$PBOPREFIX$ | 1 - addons/mapfx/XEH_postClientInit.sqf | 21 -- addons/mapfx/XEH_preInit.sqf | 11 -- addons/mapfx/config.cpp | 28 --- addons/mapfx/functions/script_component.hpp | 1 - addons/mapfx/script_component.hpp | 12 -- addons/maptools/$PBOPREFIX$ | 1 + .../CfgEventHandlers.hpp} | 4 +- addons/maptools/CfgMarkers.hpp | 26 +++ addons/maptools/CfgVehicles.hpp | 133 +++++++++++++ addons/maptools/CfgWeapons.hpp | 15 ++ addons/maptools/MapControls.hpp | 80 ++++++++ addons/maptools/MapGpsUI.hpp | 79 ++++++++ addons/maptools/README.md | 14 ++ addons/maptools/UI/IconBFTracking_ca.paa | Bin 0 -> 5625 bytes addons/{map => maptools}/UI/mapGps.paa | Bin addons/{map => maptools}/UI/maptool_item.paa | Bin addons/maptools/XEH_postInitClient.sqf | 70 +++++++ addons/maptools/XEH_preInit.sqf | 38 ++++ addons/maptools/config.cpp | 74 +++++++ .../{map => maptools}/data/mapToolFixed.paa | Bin .../data/mapToolRotatingNormal.paa | Bin .../data/mapToolRotatingSmall.paa | Bin .../functions/fnc_addLineMarker.sqf | 0 .../functions/fnc_calculateMapScale.sqf | 0 .../functions/fnc_canDraw.sqf | 0 .../functions/fnc_canUseMapGPS.sqf | 0 .../functions/fnc_canUseMapTools.sqf | 0 .../functions/fnc_cancelDrawing.sqf | 0 .../functions/fnc_copyMapReceiveMarkers.sqf | 0 .../functions/fnc_copyMapRemoteSend.sqf | 0 .../functions/fnc_copyMapStart.sqf | 0 .../functions/fnc_handleKeyDown.sqf | 0 .../functions/fnc_handleMouseButton.sqf | 0 .../functions/fnc_handleMouseMove.sqf | 0 .../functions/fnc_handleMouseZChanged.sqf | 0 .../functions/fnc_isInsideMapTool.sqf | 0 .../functions/fnc_mapStateUpdater.sqf | 0 .../functions/fnc_openMapGps.sqf | 0 .../functions/fnc_openMapGpsUpdate.sqf | 0 .../functions/fnc_removeLineMarker.sqf | 0 .../functions/fnc_updateLineMarker.sqf | 0 .../functions/fnc_updateMapToolMarkers.sqf | 0 .../maptools/functions/script_component.hpp | 1 + addons/maptools/script_component.hpp | 17 ++ addons/maptools/stringtable.xml | 148 ++++++++++++++ 62 files changed, 910 insertions(+), 837 deletions(-) delete mode 100644 addons/map/CfgWeapons.hpp delete mode 100644 addons/map/MapGpsUI.hpp delete mode 100644 addons/map/XEH_preInitServer.sqf rename addons/{mapfx => map}/functions/fnc_determineMapLight.sqf (100%) rename addons/{mapfx => map}/functions/fnc_determineZoom.sqf (100%) rename addons/{mapfx/functions/fnc_updateMapFx.sqf => map/functions/fnc_updateMapEffects.sqf} (100%) delete mode 100644 addons/mapfx/$PBOPREFIX$ delete mode 100644 addons/mapfx/XEH_postClientInit.sqf delete mode 100644 addons/mapfx/XEH_preInit.sqf delete mode 100644 addons/mapfx/config.cpp delete mode 100644 addons/mapfx/functions/script_component.hpp delete mode 100644 addons/mapfx/script_component.hpp create mode 100644 addons/maptools/$PBOPREFIX$ rename addons/{mapfx/CfgEventhandlers.hpp => maptools/CfgEventHandlers.hpp} (52%) create mode 100644 addons/maptools/CfgMarkers.hpp create mode 100644 addons/maptools/CfgVehicles.hpp create mode 100644 addons/maptools/CfgWeapons.hpp create mode 100644 addons/maptools/MapControls.hpp create mode 100644 addons/maptools/MapGpsUI.hpp create mode 100644 addons/maptools/README.md create mode 100644 addons/maptools/UI/IconBFTracking_ca.paa rename addons/{map => maptools}/UI/mapGps.paa (100%) rename addons/{map => maptools}/UI/maptool_item.paa (100%) create mode 100644 addons/maptools/XEH_postInitClient.sqf create mode 100644 addons/maptools/XEH_preInit.sqf create mode 100644 addons/maptools/config.cpp rename addons/{map => maptools}/data/mapToolFixed.paa (100%) rename addons/{map => maptools}/data/mapToolRotatingNormal.paa (100%) rename addons/{map => maptools}/data/mapToolRotatingSmall.paa (100%) rename addons/{map => maptools}/functions/fnc_addLineMarker.sqf (100%) rename addons/{map => maptools}/functions/fnc_calculateMapScale.sqf (100%) rename addons/{map => maptools}/functions/fnc_canDraw.sqf (100%) rename addons/{map => maptools}/functions/fnc_canUseMapGPS.sqf (100%) rename addons/{map => maptools}/functions/fnc_canUseMapTools.sqf (100%) rename addons/{map => maptools}/functions/fnc_cancelDrawing.sqf (100%) rename addons/{map => maptools}/functions/fnc_copyMapReceiveMarkers.sqf (100%) rename addons/{map => maptools}/functions/fnc_copyMapRemoteSend.sqf (100%) rename addons/{map => maptools}/functions/fnc_copyMapStart.sqf (100%) rename addons/{map => maptools}/functions/fnc_handleKeyDown.sqf (100%) rename addons/{map => maptools}/functions/fnc_handleMouseButton.sqf (100%) rename addons/{map => maptools}/functions/fnc_handleMouseMove.sqf (100%) rename addons/{map => maptools}/functions/fnc_handleMouseZChanged.sqf (100%) rename addons/{map => maptools}/functions/fnc_isInsideMapTool.sqf (100%) rename addons/{map => maptools}/functions/fnc_mapStateUpdater.sqf (100%) rename addons/{map => maptools}/functions/fnc_openMapGps.sqf (100%) rename addons/{map => maptools}/functions/fnc_openMapGpsUpdate.sqf (100%) rename addons/{map => maptools}/functions/fnc_removeLineMarker.sqf (100%) rename addons/{map => maptools}/functions/fnc_updateLineMarker.sqf (100%) rename addons/{map => maptools}/functions/fnc_updateMapToolMarkers.sqf (100%) create mode 100644 addons/maptools/functions/script_component.hpp create mode 100644 addons/maptools/script_component.hpp create mode 100644 addons/maptools/stringtable.xml diff --git a/addons/map/CfgEventHandlers.hpp b/addons/map/CfgEventHandlers.hpp index 23d60e02da..49b87fb4fd 100644 --- a/addons/map/CfgEventHandlers.hpp +++ b/addons/map/CfgEventHandlers.hpp @@ -1,12 +1,11 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); - serverInit = QUOTE( call COMPILE_FILE(XEH_preInitServer) ); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); - }; + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + }; }; diff --git a/addons/map/CfgMarkers.hpp b/addons/map/CfgMarkers.hpp index d6281a4a6e..0a04e4a691 100644 --- a/addons/map/CfgMarkers.hpp +++ b/addons/map/CfgMarkers.hpp @@ -1,67 +1,42 @@ // MARKERS class CfgMarkers { - class Flag; + class Flag; - // Reenable NATO symbols ... - class b_unknown: Flag {scope = 2;}; + // Reenable NATO symbols ... + class b_unknown: Flag {scope = 2;}; - // ... and disable all the useless ones - // If you think that some of these are needed, create an issue; But until - // there's a better way to place markers, there should be only the most - // important markers here. - // Keep in mind that all of these can still be placed in the editor. - class b_hq: b_unknown {scope = 1;}; - class b_installation: b_unknown {scope = 1;}; - class b_maint: b_unknown {scope = 1;}; - class b_med: b_unknown {scope = 1;}; - class b_service: b_unknown {scope = 1;}; - class b_support: b_unknown {scope = 1;}; + // ... and disable all the useless ones + // If you think that some of these are needed, create an issue; But until + // there's a better way to place markers, there should be only the most + // important markers here. + // Keep in mind that all of these can still be placed in the editor. + class b_hq: b_unknown {scope = 1;}; + class b_installation: b_unknown {scope = 1;}; + class b_maint: b_unknown {scope = 1;}; + class b_med: b_unknown {scope = 1;}; + class b_service: b_unknown {scope = 1;}; + class b_support: b_unknown {scope = 1;}; - class n_unknown: b_unknown {}; - class n_hq: n_unknown {scope = 1;}; - class n_installation: n_unknown {scope = 1;}; - class u_installation: n_unknown {scope = 1;}; // i have no idea... - class n_maint: n_unknown {scope = 1;}; - class n_med: n_unknown {scope = 1;}; - class n_service: n_unknown {scope = 1;}; - class n_support: n_unknown {scope = 1;}; + class n_unknown: b_unknown {}; + class n_hq: n_unknown {scope = 1;}; + class n_installation: n_unknown {scope = 1;}; + class u_installation: n_unknown {scope = 1;}; // i have no idea... + class n_maint: n_unknown {scope = 1;}; + class n_med: n_unknown {scope = 1;}; + class n_service: n_unknown {scope = 1;}; + class n_support: n_unknown {scope = 1;}; - class o_unknown: b_unknown {}; - class o_hq: o_unknown {scope = 1;}; - class o_installation: o_unknown {scope = 1;}; - class o_maint: o_unknown {scope = 1;}; - class o_med: o_unknown {scope = 1;}; - class o_service: o_unknown {scope = 1;}; - class o_support: o_unknown {scope = 1;}; + class o_unknown: b_unknown {}; + class o_hq: o_unknown {scope = 1;}; + class o_installation: o_unknown {scope = 1;}; + class o_maint: o_unknown {scope = 1;}; + class o_med: o_unknown {scope = 1;}; + class o_service: o_unknown {scope = 1;}; + class o_support: o_unknown {scope = 1;}; - // disable all civy markers (harbor etc.) - class c_unknown: b_unknown {scope = 1;}; + // disable all civy markers (harbor etc.) + class c_unknown: b_unknown {scope = 1;}; - // disable quantity indicators (fire team/squad/platoon ...) - class group_0: b_unknown {scope = 1;}; - - - class ACE_MapToolFixed { - name = "MapToolFixed"; - icon = PATHTOF(data\mapToolFixed.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingNormal { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingNormal.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingSmall { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingSmall.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; + // disable quantity indicators (fire team/squad/platoon ...) + class group_0: b_unknown {scope = 1;}; }; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 4452c10b23..6b68864728 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,160 +1,28 @@ -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ - }; - class CfgVehicles { - class Man; - class CAManBase: Man { - class ACE_SelfActions { - - class ACE_MapTools { - displayName = "$STR_ACE_Map_MapTools_Menu"; - condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); - statement = ""; - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 100; - enableInside = 1; - - class ACE_MapToolsHide { - displayName = "$STR_ACE_Map_MapToolsHide"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 5; - enableInside = 1; + class Module_F; + class ACE_ModuleBlueForceTracking: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Blue Force Tracking"; + function = QFUNC(blueForceTrackingModule); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconBFTracking_ca.paa); + class Arguments { + class Interval { + displayName = "Interval"; + description = "How often the markers should be refreshed (in seconds)"; + defaultValue = 1; + }; + class HideAiGroups { + displayName = "Hide AI groups?"; + description = "Hide markers for 'AI only' groups?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1; }; + }; + }; }; - class ACE_MapToolsShowNormal { - displayName = "$STR_ACE_Map_MapToolsShowNormal"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); - statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 4; - enableInside = 1; - }; - class ACE_MapToolsShowSmall { - displayName = "$STR_ACE_Map_MapToolsShowSmall"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); - statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 3; - enableInside = 1; - }; - class ACE_MapToolsAlignNorth { - displayName = "$STR_ACE_Map_MapToolsAlignNorth"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 2; - enableInside = 1; - }; - class ACE_MapToolsAlignCompass { - displayName = "$STR_ACE_Map_MapToolsAlignCompass"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); - statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 1; - enableInside = 1; - }; - class ACE_MapGpsShow { - displayName = "$STR_ACE_Map_MapGpsShow"; - condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); - statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - class ACE_MapGpsHide { - displayName = "$STR_ACE_Map_MapGpsHide"; - condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); - statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - }; }; - - class ACE_Actions { - class ACE_MainActions { - class ACE_CopyMap { - displayName = "$STR_ACE_Map_CopyMap"; - condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); - showDisabled = 0; - priority = -1; - }; - }; - }; - }; - - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class FIA_Box_Base_F; - - class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) - }; - }; - - class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) - }; - }; - - class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) - }; - }; - - class Box_FIA_Support_F: FIA_Box_Base_F { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) - }; - }; - - class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) - }; - }; - - class Module_F; - class ACE_ModuleBlueForceTracking: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Blue Force Tracking"; - function = QFUNC(blueForceTrackingModule); - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\IconBFTracking_ca.paa); - class Arguments { - class Interval { - displayName = "Interval"; - description = "How often the markers should be refreshed (in seconds)"; - defaultValue = 1; - }; - class HideAiGroups { - displayName = "Hide AI groups?"; - description = "Hide markers for 'AI only' groups?"; - typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1; }; - }; - }; - }; - }; }; diff --git a/addons/map/CfgWeapons.hpp b/addons/map/CfgWeapons.hpp deleted file mode 100644 index fa6d0897c5..0000000000 --- a/addons/map/CfgWeapons.hpp +++ /dev/null @@ -1,15 +0,0 @@ -class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_F; - - class ACE_MapTools: ACE_ItemCore { - displayName = "$STR_ACE_MapTools_Name"; - descriptionShort = "$STR_ACE_MapTools_Description"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = PATHTOF(UI\maptool_item.paa); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 1; - }; - }; -}; diff --git a/addons/map/MapControls.hpp b/addons/map/MapControls.hpp index 3255cb7929..62256e2df4 100644 --- a/addons/map/MapControls.hpp +++ b/addons/map/MapControls.hpp @@ -1,93 +1,9 @@ class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; - }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ColorBlack: RscButton { - idc = 36732; - x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.2,1}; - colorBackgroundActive[] = {0,0,0,1}; - colorFocused[] = {0,0,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlack""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorBlack")]); - }; - class ColorRed: RscButton { - idc = 36733; - x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.2,0.2,1}; - colorBackgroundActive[] = {1,0,0,1}; - colorFocused[] = {1,0,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorRed""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),QUOTE(ColorRed))]); - }; - class ColorGreen: RscButton { - idc = 36734; - x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.8,0.2,1}; - colorBackgroundActive[] = {0,1,0,1}; - colorFocused[] = {0,1,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorGreen""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorGreen")]); - }; - class ColorBlue: RscButton { - idc = 36735; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.8,1}; - colorBackgroundActive[] = {0,0,1,1}; - colorFocused[] = {0,0,1,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlue""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorBlue")]); - }; - class ColorYellow: RscButton { - idc = 36736; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.2,1}; - colorBackgroundActive[] = {1,1,0,1}; - colorFocused[] = {1,1,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorYellow""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorYellow")]); - }; - class ColorWhite: RscButton { - idc = 36737; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.8,1}; - colorBackgroundActive[] = {1,1,1,1}; - colorFocused[] = {1,1,1,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorWhite""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorWhite")]); - }; + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; }; diff --git a/addons/map/MapGpsUI.hpp b/addons/map/MapGpsUI.hpp deleted file mode 100644 index e21b8db0a1..0000000000 --- a/addons/map/MapGpsUI.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) - -#define ST_LEFT 0x00 -#define ST_RIGHT 0x01 -#define ST_CENTER 0x02 - -#define W_gps 0.4025 -#define H_gps 0.25 -#define X_gps safeZoneX + safeZoneW - 1.1 * W_gps -#define Y_gps safeZoneY + safeZoneH - 1.2 * H_gps - -class RscTitles { - class RscACE_MapGps { - idd = 9855; - movingEnable = 1; - duration = 3600; - fadein = 0; - fadeout = 0; - // onLoad = QUOTE(uiNamespace setVariable [ARR_2(QGVAR(ui_mapGpsDisplay), _this select 0)];); - onLoad = "uiNamespace setVariable ['ACE_map_ui_mapGpsDisplay', _this select 0];"; //@todo cbaify this - //onUnLoad = "_this call onRscLoad"; - class controls { - class back:RscPicture { - x = X_gps; - y = Y_gps; - w = W_gps; - h = H_gps; - text = PATHTOF(UI\mapGps.paa); - colorBackground[] = {1, 1, 1, 1}; - }; - class heading: RscText{ - idc = 913590; - x = X_gps + W_gps * 0.25; - y = Y_gps + H_gps * 0.12; - w = W_gps * 0.2; - h = H_gps * 0.16; - style = ST_LEFT; - text = "225"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.042; - }; - class altitude: RscText{ - idc = 913591; - x = X_gps + W_gps * 0.55; - y = Y_gps + H_gps * 0.12; - w = W_gps * 0.2; - h = H_gps * 0.16; - style = ST_RIGHT; - text = "55 m"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.042; - }; - class coordinates: RscText{ - idc = 913592; - x = X_gps + W_gps * 0.2; - y = Y_gps + H_gps * 0.33; - w = W_gps * 0.6; - h = H_gps * 0.35; - style = ST_CENTER; - text = "012.3 115.1"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.1; - }; - }; - }; -}; diff --git a/addons/map/README.md b/addons/map/README.md index e51efe71d5..6544d0f236 100644 --- a/addons/map/README.md +++ b/addons/map/README.md @@ -1,7 +1,12 @@ ace_map ======= -Various tweaks to the in-game map. +Various tweaks to the in-game map. Including: +- Better map styling (countours, legend, hiding bushes and trees, etc). +- Max zoom level (optional) +- Map shaking while walking (optional) +- Map illumination (optional) +- Blufor tracker (optional) ## Maintainers diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 24b906e61c..1155834f1c 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,71 +1,20 @@ -// by CAA-Picard - #include "script_component.hpp" -if (!hasInterface) exitWith{}; +ADDON = false; +LOG(MSG_INIT); -// Init variables -GVAR(mapVisableLastFrame) = false; -GVAR(mapGpsShow) = true; +// Calculate the maximum zoom allowed for this map +call FUNC(determineZoom); -GVAR(mapTool_Shown) = 0; -GVAR(mapTool_pos) = [0,0]; -GVAR(mapTool_angle) = 0; -GVAR(mapTool_isDragging) = false; -GVAR(mapTool_isRotating) = false; - -GVAR(drawing_isDrawing) = false; -GVAR(drawing_tempLineMarker) = []; -GVAR(drawing_lineMarkers) = []; -GVAR(drawing_drawColor) = "ColorBlack"; -GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; - -//Probably need this spawn, because CBA_fnc_addPerFrameHandler doesn't work durring breifing. [] spawn { - _fnc_installMapEvents = { - _d = _this; - diag_log format ["Installing EH in display %1", _d]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; - }; + // Wait until the map display is detected + waitUntil {(!isNull findDisplay 12)}; - // Wait until the briefing map is detected - // display = 37 for SP - // display = 52 for host server on MP; - // display = 53 for MP clients) - waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; + GVAR(isShaking) = false; - if (isNull findDisplay 12) then { - // Install event handlers on the map control of the briefing screen (control = 51) - GVAR(drawing_syncMarkers) = true; - if (!isNull findDisplay 52) then { - 52 call _fnc_installMapEvents; - } else { - if (!isNull findDisplay 53) then { - 53 call _fnc_installMapEvents; - } else { - 37 call _fnc_installMapEvents; - }; - }; - } else { - // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing - GVAR(drawing_syncMarkers) = false; - { - _x call FUNC(addLineMarker); - } forEach GVAR(drawing_serverLineMarkers); - }; - - // Wait until the main map display is detected (display = 12) - waitUntil { !isNull findDisplay 12 }; - // Install event handlers on the map control and display (control = 51) - GVAR(drawing_syncMarkers) = false; - 12 call _fnc_installMapEvents; - - // Update the size and rotation of map tools - [] call FUNC(updateMapToolMarkers); - - [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; }; + +ADDON = true; diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index 1ab43c7ca8..9bd60c865f 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -1,35 +1,12 @@ #include "script_component.hpp" ADDON = false; +LOG(MSG_INIT); -PREP(addLineMarker); PREP(blueForceTrackingModule); PREP(blueForceTrackingUpdate); -PREP(calculateMapScale); -PREP(cancelDrawing); -PREP(canDraw); -PREP(canUseMapTools); -PREP(canUseMapGPS); -PREP(copyMapReceiveMarkers); -PREP(copyMapRemoteSend); -PREP(copyMapStart); -PREP(handleKeyDown); -PREP(handleMouseButton); -PREP(handleMouseMove); -PREP(handleMouseZChanged); -PREP(isInsideMapTool); -PREP(mapStateUpdater); -PREP(openMapGps); -PREP(openMapGpsUpdate); -PREP(removeLineMarker); -PREP(updateMapToolMarkers); -PREP(updateLineMarker); - -//Add Event Handlers: -["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); -["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); - -["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); -["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); +PREP(determineMapLight); +PREP(determineZoom); +PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/XEH_preInitServer.sqf b/addons/map/XEH_preInitServer.sqf deleted file mode 100644 index 1614e9a340..0000000000 --- a/addons/map/XEH_preInitServer.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by CAA-Picard - -#include "script_component.hpp" - -GVAR(drawing_serverLineMarkers) = []; -publicVariable QGVAR(drawing_serverLineMarkers); diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 36a6f85168..a5c8e925ca 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -1,15 +1,15 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {"ACE_MapTools"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_interaction"}; - author[] = {"KoffeinFlummi","CAA-Picard"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; + author[] = {"KoffeinFlummi","Rocko","CAA-Picard"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; }; class RscControlsGroup; @@ -28,10 +28,6 @@ class ACE_Settings { value = 1.0; typeName = "SCALAR"; }; - class GVAR(EveryoneCanDrawOnBriefing) { - value = 1; - typeName = "BOOL"; - }; class GVAR(BFT_Enabled) { value = 0; typeName = "BOOL"; @@ -40,116 +36,125 @@ class ACE_Settings { value = 0; typeName = "BOOL"; }; + class GVAR(mapIllumination) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapShake) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapLimitZoom) { + value = 0; + typeName = "BOOL"; + }; }; -#include "MapGpsUI.hpp" #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" - class RscMapControl { - sizeExGrid = 0.032; + sizeExGrid = 0.032; }; // REGULAR MAP class RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; // DIARY class RscDisplayDiary { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + class controls { + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; // BRIEFING SCREEN class RscDisplayGetReady: RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; class RscDisplayClientGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; class RscDisplayServerGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index b2619155c2..030daeaa36 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -2,37 +2,37 @@ // Delete last set of markers (always) { - deleteMarkerLocal _x; + deleteMarkerLocal _x; } forEach GVAR(BFT_markers); if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { - _groupsToDrawMarkers = []; - _playerSide = call EFUNC(common,playerSide); + _groupsToDrawMarkers = []; + _playerSide = call EFUNC(common,playerSide); - if (GVAR(BFT_HideAiGroups)) then { - _groupsToDrawMarkers = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter); - } else { - _groupsToDrawMarkers = [allGroups, { - _anyPlayers = { - [_x] call EFUNC(common,isPlayer); - } count units _this; - (side _this == _playerSide) && _anyPlayers > 0 - }] call EFUNC(common,filter); - }; + if !(GVAR(BFT_HideAiGroups)) then { + _groupsToDrawMarkers = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter); + } else { + _groupsToDrawMarkers = [allGroups, { + _anyPlayers = { + [_x] call EFUNC(common,isPlayer); + } count units _this; + (side _this == _playerSide) && _anyPlayers > 0 + }] call EFUNC(common,filter); + }; + + { + _markerType = [_x] call EFUNC(common,getMarkerType); - { - _markerType = [_x] call EFUNC(common,getMarkerType); + _colour = format ["Color%1", side _x]; - _colour = format ["Color%1", side _x]; + _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; + _marker setMarkerTypeLocal _markerType; + _marker setMarkerColorLocal _colour; + _marker setMarkerTextLocal (groupID _x); - _marker = createMarkerLocal [format ["ACE_BFT_%1", _i], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; - _marker setMarkerTypeLocal _markerType; - _marker setMarkerColorLocal _colour; - _marker setMarkerTextLocal (groupID _x); - - GVAR(BFT_markers) pushBack _marker; - } forEach _groupsToDrawMarkers; + GVAR(BFT_markers) pushBack _marker; + } forEach _groupsToDrawMarkers; }; diff --git a/addons/mapfx/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf similarity index 100% rename from addons/mapfx/functions/fnc_determineMapLight.sqf rename to addons/map/functions/fnc_determineMapLight.sqf diff --git a/addons/mapfx/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf similarity index 100% rename from addons/mapfx/functions/fnc_determineZoom.sqf rename to addons/map/functions/fnc_determineZoom.sqf diff --git a/addons/mapfx/functions/fnc_updateMapFx.sqf b/addons/map/functions/fnc_updateMapEffects.sqf similarity index 100% rename from addons/mapfx/functions/fnc_updateMapFx.sqf rename to addons/map/functions/fnc_updateMapEffects.sqf diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index afc6c2cec2..e3e2a6fe93 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -2,147 +2,6 @@ - - Map Tools - Herramientas de mapa - Outils de navigation - Narzędzia nawigacyjne - Kartenwerkzeug - Pomůcky k Mapě - Strumenti Cartografici - Ferramentas de Mapa - Térképészeti eszközök - Инструменты карты - - - The Map Tools allow you to measure distances and angles on the map. - Las herramientas de mapa permiten medir distancias y ángulos en el mapa. - Les outils de navigation permettent de mesurer des distances et des angles sur la carte. - Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. - Das Kartenwerkzeug erlaubt es dir, Distanzen und Winkel zu messen. - Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. - Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. - As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. - A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. - Картографические инструменты позволяют измерять расстояния и углы на карте. - - - Map Tools >> - Herramientas de mapa >> - Outils de navigation >> - Narzędzia nawigacyjne >> - Kartenwerkzeug >> - Pomůcky k Mapě >> - Strumenti Cartografici >> - Ferramentas de Mapa >> - Térképészeti eszközök >> - Инструменты карты >> - - - Hide Map Tool - Verstecke Kartenwerkzeug - Ocultar herr. de mapa - Ranger les outils - Nascondi Strumenti Cartografici - Ocultar Ferramenta de Mapa - Térképészeti eszközök elrejtése - Ukryj narzędzia nawigacyjne - Schovat pomůcku k mapě - Скрыть инструменты - - - Show Normal Map Tool - Zeige Kartenwerkzeug (normal) - Mostrar herr. de mapa normal - Montrer outils normaux - Visualizza Strumenti Cartografici standard - Mostrar Ferramenta de Mapa Padrão - Térképészeti eszköz megjelenítése (normál méret) - Pokaż normalne narzędzia nawigacyjne - Zobrazit normální pomůcku k mapě - Показать инструменты (средн. размер) - - - Show Small Map Tool - Zeige Kartenwerkzeug (klein) - Mostrar herr. de mapa pequeñas - Montrer petits outils - Visualizza Strumenti Cartografici piccoli - Mostrar Ferramenta de Mapa Pequena - Térképészeti eszköz megjelenítése (kicsinyített) - Pokaż pomniejszone narzędzia nawigacyjne - Zobrazit malou pomůcku k mapě - Показать инструменты (малый размер) - - - Align Map Tool to North - Kartenwerkzeug nach Norden ausrichten - Alinear herr. de mapa al norte - Aligner au nord - Allinea gli Strumenti Cartografici con il Nord - Alinhar Ferramenta de Mapa com o Norte - Térképészeti eszköz Északhoz állítása - Wyrównaj linijkę do północy - Srovnat pomůcku k mapě na sever - Выровнять инструменты на север - - - Align Map Tool to Compass - Kartenwerkzeug am Kompass ausrichten - Alinear herr. de mapa a la brújula - Aligner sur la boussole - Allinea gli Strumenti Cartografici con la bussola - Alinhar Ferramenta de Mapa com a Bússola - Térképészeti eszköz iránytűhöz állítása - Wyrównaj linijkę do kompasu - Srovnat pomůcku k mapě ke kompasu - Выровнять инструменты по компасу - - - Show GPS on Map - Zeige GPS auf der Karte - Mostrar el GPS sobre el mapa - Ranger le GPS - Visualizza il GPS sulla mappa - Mostrar GPS no Mapa - GPS megjelnítése a térképen - Pokaż GPS na mapie - Zobrazit GPS na mapě - Показать GPS на карте - - - Hide GPS on Map - Verstecke GPS auf der Karte - Ocultar el GPS del mapa - Montrer le GPS - Nascondi il GPS sulla mappa - Ocultar GPS no Mapa - GPS elrejtése térképről - Ukryj GPS na mapie - Schovat GPS na mapě - Скрыть GPS на карте - - - Copy Map - Karte kopieren - Copiar mapa - Скопировать карту - Kopiuj oznaczenia mapy - Copier la carte - Zkopírovat mapu - Copiare Carta - Térkép másolása - Copiar Mapa - - - Direction: %1° - Drehung: %1° - Direction: %1° - Směr: %1° - Kierunek: %1° - Dirección: %1° - Irány: %1 - Направление:%1 - + \ No newline at end of file diff --git a/addons/mapfx/$PBOPREFIX$ b/addons/mapfx/$PBOPREFIX$ deleted file mode 100644 index 9c3497b963..0000000000 --- a/addons/mapfx/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -x\ace\addons\mapfx \ No newline at end of file diff --git a/addons/mapfx/XEH_postClientInit.sqf b/addons/mapfx/XEH_postClientInit.sqf deleted file mode 100644 index 111bcbb171..0000000000 --- a/addons/mapfx/XEH_postClientInit.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; -LOG(MSG_INIT); - -// Calculate the maximum zoom allowed for this map -call FUNC(determineZoom); - -[] spawn { - // Wait until the map display is detected - waitUntil {(!isNull findDisplay 12)}; - - GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; - GVAR(lastStillTime) = time; - GVAR(isShaking) = false; - - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapFx);}]; - -}; - -ADDON = true; diff --git a/addons/mapfx/XEH_preInit.sqf b/addons/mapfx/XEH_preInit.sqf deleted file mode 100644 index ecdf9cf694..0000000000 --- a/addons/mapfx/XEH_preInit.sqf +++ /dev/null @@ -1,11 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -ADDON = false; -LOG(MSG_INIT); - -PREP(determineMapLight); -PREP(determineZoom); -PREP(updateMapFx); - -ADDON = true; diff --git a/addons/mapfx/config.cpp b/addons/mapfx/config.cpp deleted file mode 100644 index 1cdb1e93c1..0000000000 --- a/addons/mapfx/config.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "script_component.hpp" -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interaction"}; - author[] = {"Rocko","CAA-Picard"}; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" - -class ACE_Settings { - class GVAR(mapIllumination) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapShake) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapLimitZoom) { - value = 0; - typeName = "BOOL"; - }; -}; \ No newline at end of file diff --git a/addons/mapfx/functions/script_component.hpp b/addons/mapfx/functions/script_component.hpp deleted file mode 100644 index 647b0b1581..0000000000 --- a/addons/mapfx/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\mapfx\script_component.hpp" diff --git a/addons/mapfx/script_component.hpp b/addons/mapfx/script_component.hpp deleted file mode 100644 index 63c4470744..0000000000 --- a/addons/mapfx/script_component.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#define COMPONENT mapfx -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_MAPFX - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_MAPFX - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPFX -#endif - -#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/maptools/$PBOPREFIX$ b/addons/maptools/$PBOPREFIX$ new file mode 100644 index 0000000000..11a24a58d8 --- /dev/null +++ b/addons/maptools/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\map \ No newline at end of file diff --git a/addons/mapfx/CfgEventhandlers.hpp b/addons/maptools/CfgEventHandlers.hpp similarity index 52% rename from addons/mapfx/CfgEventhandlers.hpp rename to addons/maptools/CfgEventHandlers.hpp index 23dbe58c74..27bbf326d3 100644 --- a/addons/mapfx/CfgEventhandlers.hpp +++ b/addons/maptools/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_postClientInit)); + clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); }; }; diff --git a/addons/maptools/CfgMarkers.hpp b/addons/maptools/CfgMarkers.hpp new file mode 100644 index 0000000000..8a2b86fc13 --- /dev/null +++ b/addons/maptools/CfgMarkers.hpp @@ -0,0 +1,26 @@ +// MARKERS +class CfgMarkers { + class ACE_MapToolFixed { + name = "MapToolFixed"; + icon = PATHTOF(data\mapToolFixed.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingNormal { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingNormal.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingSmall { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingSmall.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; +}; diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp new file mode 100644 index 0000000000..9963f6b067 --- /dev/null +++ b/addons/maptools/CfgVehicles.hpp @@ -0,0 +1,133 @@ +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ + }; + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + + class ACE_MapTools { + displayName = "$STR_ACE_MapTools_MapTools_Menu"; + condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); + statement = ""; + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 100; + enableInside = 1; + + class ACE_MapToolsHide { + displayName = "$STR_ACE_MapTools_MapToolsHide"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 5; + enableInside = 1; + }; + class ACE_MapToolsShowNormal { + displayName = "$STR_ACE_MapTools_MapToolsShowNormal"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); + statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 4; + enableInside = 1; + }; + class ACE_MapToolsShowSmall { + displayName = "$STR_ACE_MapTools_MapToolsShowSmall"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); + statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 3; + enableInside = 1; + }; + class ACE_MapToolsAlignNorth { + displayName = "$STR_ACE_MapTools_MapToolsAlignNorth"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 2; + enableInside = 1; + }; + class ACE_MapToolsAlignCompass { + displayName = "$STR_ACE_MapTools_MapToolsAlignCompass"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 1; + enableInside = 1; + }; + class ACE_MapGpsShow { + displayName = "$STR_ACE_MapTools_MapGpsShow"; + condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + class ACE_MapGpsHide { + displayName = "$STR_ACE_MapTools_MapGpsHide"; + condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + }; + }; + + class ACE_Actions { + class ACE_MainActions { + class ACE_CopyMap { + displayName = "$STR_ACE_MapTools_CopyMap"; + condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); + showDisabled = 0; + priority = -1; + }; + }; + }; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; +}; diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp new file mode 100644 index 0000000000..9d4d313c43 --- /dev/null +++ b/addons/maptools/CfgWeapons.hpp @@ -0,0 +1,15 @@ +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_MapTools: ACE_ItemCore { + displayName = "$STR_ACE_MapTools_Name"; + descriptionShort = "$STR_ACE_MapTools_Description"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = PATHTOF(UI\maptool_item.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; + }; +}; diff --git a/addons/maptools/MapControls.hpp b/addons/maptools/MapControls.hpp new file mode 100644 index 0000000000..409796a6b1 --- /dev/null +++ b/addons/maptools/MapControls.hpp @@ -0,0 +1,80 @@ +class controls { + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ColorBlack: RscButton { + idc = 36732; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.2,1}; + colorBackgroundActive[] = {0,0,0,1}; + colorFocused[] = {0,0,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorBlack')]); + }; + class ColorRed: RscButton { + idc = 36733; + x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.2,0.2,1}; + colorBackgroundActive[] = {1,0,0,1}; + colorFocused[] = {1,0,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorRed')]); + }; + class ColorGreen: RscButton { + idc = 36734; + x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.8,0.2,1}; + colorBackgroundActive[] = {0,1,0,1}; + colorFocused[] = {0,1,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorGreen')]); + }; + class ColorBlue: RscButton { + idc = 36735; + x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.8,1}; + colorBackgroundActive[] = {0,0,1,1}; + colorFocused[] = {0,0,1,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorBlue')]); + }; + class ColorYellow: RscButton { + idc = 36736; + x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.2,1}; + colorBackgroundActive[] = {1,1,0,1}; + colorFocused[] = {1,1,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorYellow')]); + }; + class ColorWhite: RscButton { + idc = 36737; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.8,1}; + colorBackgroundActive[] = {1,1,1,1}; + colorFocused[] = {1,1,1,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorWhite')]); + }; +}; diff --git a/addons/maptools/MapGpsUI.hpp b/addons/maptools/MapGpsUI.hpp new file mode 100644 index 0000000000..ff8ec8b96e --- /dev/null +++ b/addons/maptools/MapGpsUI.hpp @@ -0,0 +1,79 @@ +#define GUI_GRID_X (0) +#define GUI_GRID_Y (0) +#define GUI_GRID_W (0.025) +#define GUI_GRID_H (0.04) + +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 + +#define W_gps 0.4025 +#define H_gps 0.25 +#define X_gps safeZoneX + safeZoneW - 1.1 * W_gps +#define Y_gps safeZoneY + safeZoneH - 1.2 * H_gps + +class RscTitles { + class RscACE_MapGps { + idd = 9855; + movingEnable = 1; + duration = 3600; + fadein = 0; + fadeout = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ui_mapGpsDisplay)), _this select 0)];); + class controls { + class back:RscPicture { + x = X_gps; + y = Y_gps; + w = W_gps; + h = H_gps; + text = PATHTOF(UI\mapGps.paa); + colorBackground[] = {1, 1, 1, 1}; + }; + class heading: RscText{ + idc = 913590; + x = X_gps + W_gps * 0.25; + y = Y_gps + H_gps * 0.12; + w = W_gps * 0.2; + h = H_gps * 0.16; + style = ST_LEFT; + text = "225"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.042; + }; + class altitude: RscText{ + idc = 913591; + x = X_gps + W_gps * 0.55; + y = Y_gps + H_gps * 0.12; + w = W_gps * 0.2; + h = H_gps * 0.16; + style = ST_RIGHT; + text = "55 m"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.042; + }; + class coordinates: RscText{ + idc = 913592; + x = X_gps + W_gps * 0.2; + y = Y_gps + H_gps * 0.33; + w = W_gps * 0.6; + h = H_gps * 0.35; + style = ST_CENTER; + text = "012.3 115.1"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.1; + }; + }; + }; +}; diff --git a/addons/maptools/README.md b/addons/maptools/README.md new file mode 100644 index 0000000000..9248948efa --- /dev/null +++ b/addons/maptools/README.md @@ -0,0 +1,14 @@ +ace_maptools +============ + +Map tools: +- Roamer +- Map drawing +- Showing GPS on map + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [esteldunedain](https://github.com/esteldunedain) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/maptools/UI/IconBFTracking_ca.paa b/addons/maptools/UI/IconBFTracking_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..128f08f6f01b5ec82dd4ffa2cc70a453948304b2 GIT binary patch literal 5625 zcmdT|4NM!?9X}^2DJ>Al$F#;UgJYF8Q?fKxPp#6{&^cg4p`l6BkSSAuG*QxGM_NTP zG0)JHxlz*`q1z(VQfsML_n~Pfb1$k;YtppDA|GVw$7~!Jq{L(-fSCie#~p9)o&A4z zxhQkcmPvg&!~O36{=fgn`@fI7dr)z4;iexJZ!TQGFwE4{RFQviR9B`?6`;M)fgYncp!@ zv1HFJb^+i2J70(?X?g9#y&AAzKID^p1FUT)cacv3mxjHf-(5@NpKqL<=)x%j`Fta) z{ZxTV!_&4AzKY7Vzr#Iawj0pDe8>?d_oR{74MTicaFMVO@c%j=n7?X8opl!Y2S#J$ zRtI>c2Sq+Vnoj*SFqRfWNs9sG|E)g;rleWPx9UX9Hp^SJz&|jGA_#E=Ci3CV@pIzm zfahvI&B@nl`I@gmzjQe2BKM?8T%(Q~_v<#$`K#~5gI8B0fIN%fMtdLNeq1kxl6SKK z@9W2MA9{=8ag3XCXn!Now;Us4$=*JqU;Zl1r^IiO%1e?PPeg4(c=bByUpkB?O$6XZ z{KfI42RrP3z{&DaF*a=->9*1F*2Yl8j#ZKX5I3|Jh#P*PrFYQ%`<$8n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eqy^dXMjlj7T425vmm-1O#!9q!*# p%rzZ&Z0C;m05>zQH+6lc&j-8!uc$bmTbCc1r}1az!sGa${u@mGGnxPZ literal 0 HcmV?d00001 diff --git a/addons/map/UI/mapGps.paa b/addons/maptools/UI/mapGps.paa similarity index 100% rename from addons/map/UI/mapGps.paa rename to addons/maptools/UI/mapGps.paa diff --git a/addons/map/UI/maptool_item.paa b/addons/maptools/UI/maptool_item.paa similarity index 100% rename from addons/map/UI/maptool_item.paa rename to addons/maptools/UI/maptool_item.paa diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf new file mode 100644 index 0000000000..167c89f245 --- /dev/null +++ b/addons/maptools/XEH_postInitClient.sqf @@ -0,0 +1,70 @@ +// by CAA-Picard + +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +// Init variables +GVAR(mapVisableLastFrame) = false; +GVAR(mapGpsShow) = true; + +GVAR(mapTool_Shown) = 0; +GVAR(mapTool_pos) = [0,0]; +GVAR(mapTool_angle) = 0; +GVAR(mapTool_isDragging) = false; +GVAR(mapTool_isRotating) = false; + +GVAR(drawing_isDrawing) = false; +GVAR(drawing_tempLineMarker) = []; +GVAR(drawing_lineMarkers) = []; +GVAR(drawing_drawColor) = "ColorBlack"; +GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; + +[] spawn { + _fnc_installMapEvents = { + _d = _this; + diag_log format ["Installing EH in display %1", _d]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; + (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + }; + + // Wait until the briefing map is detected + // display = 37 for SP + // display = 52 for host server on MP; + // display = 53 for MP clients) + waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + + if (isNull findDisplay 12) then { + // Install event handlers on the map control of the briefing screen (control = 51) + GVAR(drawing_syncMarkers) = true; + if (!isNull findDisplay 52) then { + 52 call _fnc_installMapEvents; + } else { + if (!isNull findDisplay 53) then { + 53 call _fnc_installMapEvents; + } else { + 37 call _fnc_installMapEvents; + }; + }; + } else { + // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing + GVAR(drawing_syncMarkers) = false; + { + _x call FUNC(addLineMarker); + } forEach GVAR(drawing_serverLineMarkers); + }; + + // Wait until the main map display is detected (display = 12) + waitUntil { !isNull findDisplay 12 }; + // Install event handlers on the map control and display (control = 51) + GVAR(drawing_syncMarkers) = false; + 12 call _fnc_installMapEvents; + + // Update the size and rotation of map tools + [] call FUNC(updateMapToolMarkers); + + [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf new file mode 100644 index 0000000000..20777fb118 --- /dev/null +++ b/addons/maptools/XEH_preInit.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addLineMarker); +PREP(calculateMapScale); +PREP(cancelDrawing); +PREP(canDraw); +PREP(canUseMapTools); +PREP(canUseMapGPS); +PREP(copyMapReceiveMarkers); +PREP(copyMapRemoteSend); +PREP(copyMapStart); +PREP(handleKeyDown); +PREP(handleMouseButton); +PREP(handleMouseMove); +PREP(handleMouseZChanged); +PREP(isInsideMapTool); +PREP(mapStateUpdater); +PREP(openMapGps); +PREP(openMapGpsUpdate); +PREP(removeLineMarker); +PREP(updateMapToolMarkers); +PREP(updateLineMarker); + +if (isServer) then { + GVAR(drawing_serverLineMarkers) = []; + publicVariable QGVAR(drawing_serverLineMarkers); +}; + +//Add Event Handlers: +["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); +["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); + +["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); +["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); + +ADDON = true; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp new file mode 100644 index 0000000000..ea39ca7708 --- /dev/null +++ b/addons/maptools/config.cpp @@ -0,0 +1,74 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_MapTools"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; + author[] = {"CAA-Picard"}; + authorUrl = "https://github.com/esteldunedain/"; + VERSION_CONFIG; + }; +}; + +class ACE_Settings { + class GVAR(EveryoneCanDrawOnBriefing) { + value = 1; + typeName = "BOOL"; + }; +}; + +class RscControlsGroup; +class RscActiveText; +class RscPicture; +class RscText; +class RscObject; +class RscButton; +class RscButtonMenuOK; +class RscButtonMenuCancel; +class RscButtonMenu; +class RscEdit; + +#include "MapGpsUI.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMarkers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + + +// REGULAR MAP +class RscDisplayMainMap { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; + +// BRIEFING SCREEN +class RscDisplayGetReady: RscDisplayMainMap { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; +class RscDisplayClientGetReady: RscDisplayGetReady { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; +class RscDisplayServerGetReady: RscDisplayGetReady { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; diff --git a/addons/map/data/mapToolFixed.paa b/addons/maptools/data/mapToolFixed.paa similarity index 100% rename from addons/map/data/mapToolFixed.paa rename to addons/maptools/data/mapToolFixed.paa diff --git a/addons/map/data/mapToolRotatingNormal.paa b/addons/maptools/data/mapToolRotatingNormal.paa similarity index 100% rename from addons/map/data/mapToolRotatingNormal.paa rename to addons/maptools/data/mapToolRotatingNormal.paa diff --git a/addons/map/data/mapToolRotatingSmall.paa b/addons/maptools/data/mapToolRotatingSmall.paa similarity index 100% rename from addons/map/data/mapToolRotatingSmall.paa rename to addons/maptools/data/mapToolRotatingSmall.paa diff --git a/addons/map/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_addLineMarker.sqf rename to addons/maptools/functions/fnc_addLineMarker.sqf diff --git a/addons/map/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf similarity index 100% rename from addons/map/functions/fnc_calculateMapScale.sqf rename to addons/maptools/functions/fnc_calculateMapScale.sqf diff --git a/addons/map/functions/fnc_canDraw.sqf b/addons/maptools/functions/fnc_canDraw.sqf similarity index 100% rename from addons/map/functions/fnc_canDraw.sqf rename to addons/maptools/functions/fnc_canDraw.sqf diff --git a/addons/map/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf similarity index 100% rename from addons/map/functions/fnc_canUseMapGPS.sqf rename to addons/maptools/functions/fnc_canUseMapGPS.sqf diff --git a/addons/map/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf similarity index 100% rename from addons/map/functions/fnc_canUseMapTools.sqf rename to addons/maptools/functions/fnc_canUseMapTools.sqf diff --git a/addons/map/functions/fnc_cancelDrawing.sqf b/addons/maptools/functions/fnc_cancelDrawing.sqf similarity index 100% rename from addons/map/functions/fnc_cancelDrawing.sqf rename to addons/maptools/functions/fnc_cancelDrawing.sqf diff --git a/addons/map/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapReceiveMarkers.sqf rename to addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf diff --git a/addons/map/functions/fnc_copyMapRemoteSend.sqf b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapRemoteSend.sqf rename to addons/maptools/functions/fnc_copyMapRemoteSend.sqf diff --git a/addons/map/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapStart.sqf rename to addons/maptools/functions/fnc_copyMapStart.sqf diff --git a/addons/map/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf similarity index 100% rename from addons/map/functions/fnc_handleKeyDown.sqf rename to addons/maptools/functions/fnc_handleKeyDown.sqf diff --git a/addons/map/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseButton.sqf rename to addons/maptools/functions/fnc_handleMouseButton.sqf diff --git a/addons/map/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseMove.sqf rename to addons/maptools/functions/fnc_handleMouseMove.sqf diff --git a/addons/map/functions/fnc_handleMouseZChanged.sqf b/addons/maptools/functions/fnc_handleMouseZChanged.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseZChanged.sqf rename to addons/maptools/functions/fnc_handleMouseZChanged.sqf diff --git a/addons/map/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf similarity index 100% rename from addons/map/functions/fnc_isInsideMapTool.sqf rename to addons/maptools/functions/fnc_isInsideMapTool.sqf diff --git a/addons/map/functions/fnc_mapStateUpdater.sqf b/addons/maptools/functions/fnc_mapStateUpdater.sqf similarity index 100% rename from addons/map/functions/fnc_mapStateUpdater.sqf rename to addons/maptools/functions/fnc_mapStateUpdater.sqf diff --git a/addons/map/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf similarity index 100% rename from addons/map/functions/fnc_openMapGps.sqf rename to addons/maptools/functions/fnc_openMapGps.sqf diff --git a/addons/map/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf similarity index 100% rename from addons/map/functions/fnc_openMapGpsUpdate.sqf rename to addons/maptools/functions/fnc_openMapGpsUpdate.sqf diff --git a/addons/map/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_removeLineMarker.sqf rename to addons/maptools/functions/fnc_removeLineMarker.sqf diff --git a/addons/map/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_updateLineMarker.sqf rename to addons/maptools/functions/fnc_updateLineMarker.sqf diff --git a/addons/map/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf similarity index 100% rename from addons/map/functions/fnc_updateMapToolMarkers.sqf rename to addons/maptools/functions/fnc_updateMapToolMarkers.sqf diff --git a/addons/maptools/functions/script_component.hpp b/addons/maptools/functions/script_component.hpp new file mode 100644 index 0000000000..adeb2788b5 --- /dev/null +++ b/addons/maptools/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\maptools\script_component.hpp" diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp new file mode 100644 index 0000000000..a3dad97a49 --- /dev/null +++ b/addons/maptools/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT maptools +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAPTOOLS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAPTOOLS + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + + +#define MARKERNAME_MAPTOOL_FIXED "ACE_MapToolFixed" +#define MARKERNAME_MAPTOOL_ROTATINGNORMAL "ACE_MapToolRotatingNormal" +#define MARKERNAME_MAPTOOL_ROTATINGSMALL "ACE_MapToolRotatingSmall" diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml new file mode 100644 index 0000000000..1658856128 --- /dev/null +++ b/addons/maptools/stringtable.xml @@ -0,0 +1,148 @@ + + + + + + Map Tools + Herramientas de mapa + Outils de navigation + Narzędzia nawigacyjne + Kartenwerkzeug + Pomůcky k Mapě + Strumenti Cartografici + Ferramentas de Mapa + Térképészeti eszközök + Инструменты карты + + + The Map Tools allow you to measure distances and angles on the map. + Las herramientas de mapa permiten medir distancias y ángulos en el mapa. + Les outils de navigation permettent de mesurer des distances et des angles sur la carte. + Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. + Das Kartenwerkzeug erlaubt es dir, Distanzen und Winkel zu messen. + Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. + Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. + As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. + A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. + Картографические инструменты позволяют измерять расстояния и углы на карте. + + + Map Tools >> + Herramientas de mapa >> + Outils de navigation >> + Narzędzia nawigacyjne >> + Kartenwerkzeug >> + Pomůcky k Mapě >> + Strumenti Cartografici >> + Ferramentas de Mapa >> + Térképészeti eszközök >> + Инструменты карты >> + + + Hide Map Tool + Verstecke Kartenwerkzeug + Ocultar herr. de mapa + Ranger les outils + Nascondi Strumenti Cartografici + Ocultar Ferramenta de Mapa + Térképészeti eszközök elrejtése + Ukryj narzędzia nawigacyjne + Schovat pomůcku k mapě + Скрыть инструменты + + + Show Normal Map Tool + Zeige Kartenwerkzeug (normal) + Mostrar herr. de mapa normal + Montrer outils normaux + Visualizza Strumenti Cartografici standard + Mostrar Ferramenta de Mapa Padrão + Térképészeti eszköz megjelenítése (normál méret) + Pokaż normalne narzędzia nawigacyjne + Zobrazit normální pomůcku k mapě + Показать инструменты (средн. размер) + + + Show Small Map Tool + Zeige Kartenwerkzeug (klein) + Mostrar herr. de mapa pequeñas + Montrer petits outils + Visualizza Strumenti Cartografici piccoli + Mostrar Ferramenta de Mapa Pequena + Térképészeti eszköz megjelenítése (kicsinyített) + Pokaż pomniejszone narzędzia nawigacyjne + Zobrazit malou pomůcku k mapě + Показать инструменты (малый размер) + + + Align Map Tool to North + Kartenwerkzeug nach Norden ausrichten + Alinear herr. de mapa al norte + Aligner au nord + Allinea gli Strumenti Cartografici con il Nord + Alinhar Ferramenta de Mapa com o Norte + Térképészeti eszköz Északhoz állítása + Wyrównaj linijkę do północy + Srovnat pomůcku k mapě na sever + Выровнять инструменты на север + + + Align Map Tool to Compass + Kartenwerkzeug am Kompass ausrichten + Alinear herr. de mapa a la brújula + Aligner sur la boussole + Allinea gli Strumenti Cartografici con la bussola + Alinhar Ferramenta de Mapa com a Bússola + Térképészeti eszköz iránytűhöz állítása + Wyrównaj linijkę do kompasu + Srovnat pomůcku k mapě ke kompasu + Выровнять инструменты по компасу + + + Show GPS on Map + Zeige GPS auf der Karte + Mostrar el GPS sobre el mapa + Ranger le GPS + Visualizza il GPS sulla mappa + Mostrar GPS no Mapa + GPS megjelnítése a térképen + Pokaż GPS na mapie + Zobrazit GPS na mapě + Показать GPS на карте + + + Hide GPS on Map + Verstecke GPS auf der Karte + Ocultar el GPS del mapa + Montrer le GPS + Nascondi il GPS sulla mappa + Ocultar GPS no Mapa + GPS elrejtése térképről + Ukryj GPS na mapie + Schovat GPS na mapě + Скрыть GPS на карте + + + Copy Map + Karte kopieren + Copiar mapa + Скопировать карту + Kopiuj oznaczenia mapy + Copier la carte + Zkopírovat mapu + Copiare Carta + Térkép másolása + Copiar Mapa + + + Direction: %1° + Drehung: %1° + Direction: %1° + Směr: %1° + Kierunek: %1° + Dirección: %1° + Irány: %1 + Направление:%1 + + + \ No newline at end of file From 618c021f7e29be6dfa664fa3ca53255876290df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 14 Mar 2015 17:15:28 -0300 Subject: [PATCH 37/73] Tab to space plus comments for the spawns --- addons/map/XEH_postInitClient.sqf | 2 + addons/maptools/XEH_postInitClient.sqf | 83 +++++++++++++------------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 1155834f1c..ccaf9041ab 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -6,6 +6,8 @@ LOG(MSG_INIT); // Calculate the maximum zoom allowed for this map call FUNC(determineZoom); +// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. +// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { // Wait until the map display is detected waitUntil {(!isNull findDisplay 12)}; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 167c89f245..5267a8c802 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -20,51 +20,52 @@ GVAR(drawing_lineMarkers) = []; GVAR(drawing_drawColor) = "ColorBlack"; GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; +// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. +// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { - _fnc_installMapEvents = { - _d = _this; - diag_log format ["Installing EH in display %1", _d]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; - }; + _fnc_installMapEvents = { + _d = _this; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; + (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + }; - // Wait until the briefing map is detected - // display = 37 for SP - // display = 52 for host server on MP; - // display = 53 for MP clients) - waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + // Wait until the briefing map is detected + // display = 37 for SP + // display = 52 for host server on MP; + // display = 53 for MP clients) + waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; - if (isNull findDisplay 12) then { - // Install event handlers on the map control of the briefing screen (control = 51) - GVAR(drawing_syncMarkers) = true; - if (!isNull findDisplay 52) then { - 52 call _fnc_installMapEvents; - } else { - if (!isNull findDisplay 53) then { - 53 call _fnc_installMapEvents; - } else { - 37 call _fnc_installMapEvents; - }; - }; - } else { - // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing - GVAR(drawing_syncMarkers) = false; - { - _x call FUNC(addLineMarker); - } forEach GVAR(drawing_serverLineMarkers); - }; + if (isNull findDisplay 12) then { + // Install event handlers on the map control of the briefing screen (control = 51) + GVAR(drawing_syncMarkers) = true; + if (!isNull findDisplay 52) then { + 52 call _fnc_installMapEvents; + } else { + if (!isNull findDisplay 53) then { + 53 call _fnc_installMapEvents; + } else { + 37 call _fnc_installMapEvents; + }; + }; + } else { + // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing + GVAR(drawing_syncMarkers) = false; + { + _x call FUNC(addLineMarker); + } forEach GVAR(drawing_serverLineMarkers); + }; - // Wait until the main map display is detected (display = 12) - waitUntil { !isNull findDisplay 12 }; - // Install event handlers on the map control and display (control = 51) - GVAR(drawing_syncMarkers) = false; - 12 call _fnc_installMapEvents; + // Wait until the main map display is detected (display = 12) + waitUntil { !isNull findDisplay 12 }; + // Install event handlers on the map control and display (control = 51) + GVAR(drawing_syncMarkers) = false; + 12 call _fnc_installMapEvents; - // Update the size and rotation of map tools - [] call FUNC(updateMapToolMarkers); + // Update the size and rotation of map tools + [] call FUNC(updateMapToolMarkers); - [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; + [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; }; From 5a2d7d59b64ea0265c8ba2b95d28d356eb55b8d2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 14 Mar 2015 21:38:16 -0500 Subject: [PATCH 38/73] Maptools - Use MACRO_ADDITEM from Main --- addons/maptools/CfgVehicles.hpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp index 9963f6b067..4ecc649893 100644 --- a/addons/maptools/CfgVehicles.hpp +++ b/addons/maptools/CfgVehicles.hpp @@ -1,8 +1,3 @@ -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ - }; - class CfgVehicles { class Man; class CAManBase: Man { @@ -103,31 +98,31 @@ class CfgVehicles { class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) + MACRO_ADDITEM(ACE_MapTools,12); }; }; class Box_East_Support_F: EAST_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) + MACRO_ADDITEM(ACE_MapTools,12); }; }; class Box_IND_Support_F: IND_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) + MACRO_ADDITEM(ACE_MapTools,12); }; }; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) + MACRO_ADDITEM(ACE_MapTools,12); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12) + MACRO_ADDITEM(ACE_MapTools,12); }; }; }; From e13ab9e7fa957b056c51624d97679942c448f67b Mon Sep 17 00:00:00 2001 From: bux578 Date: Sun, 15 Mar 2015 07:23:18 +0100 Subject: [PATCH 39/73] add logo and mod.cpp --- extras/logo.png | Bin 37167 -> 0 bytes logo_ace3_ca.paa | Bin 0 -> 31590 bytes mod.cpp | 12 ++++++++++++ 3 files changed, 12 insertions(+) delete mode 100644 extras/logo.png create mode 100644 logo_ace3_ca.paa create mode 100644 mod.cpp diff --git a/extras/logo.png b/extras/logo.png deleted file mode 100644 index bb2bb1e90c8cd11011094a0c0f6bfa055d7bf90b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37167 zcmXt81yEZ}w2lzmi@UpfahD>+J-B;uCwPk&mtsX)+}+)!xI>G!I25->|My;IlFi)7 zOzz!1d-k(Wsw#45$VA8h002!vURoUh02#f0UqOU_{q)LJGJPH3%@pONU&q(iom5-U z>wx4Uujd8;puG9_1_Cm_5WHSQa92>4LD&SMBf(Q7?Crf?q5vpJOK5tp9Ci34(;8@R z+z4TLjb>e{&X)0C`>pecwAf;T@Z^hYJ`>PT>kShqmh-{0bMQ$bCPZ2ivm16GBZFVxMu>y1s%4L`fGV+FlL8V~9(p{t1P#J7MmvMt^%nJunrJ6pZzT(R@BNV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#if>p9w1W6)+75?I!VQvH92vD8;lzid{7Ape)g z{x?hgZ|w7*aJBw_kW+z$f!`C>SS^;X)W)UnS(wTZeVQ=KVV>BcPQITIcAUXzP9xq-!t?; jQm^B^|BtAcq%U*WcU$*?g{K#C4ZKeO>Ux6Y7;xiX)QpvR diff --git a/logo_ace3_ca.paa b/logo_ace3_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..dbfe1ce3237c223dd5c8b5f7210c3f01b5f5794d GIT binary patch literal 31590 zcmeHw4SZ8ow(s62Crt}&a|)D}kCGi4n)Ew-ND25lYGLIVXvv9vni$e1(% z9MSQk1wj!hsiO|+b!=g@>X~r$2%#T-_=yDZg1mVmrjSHDJ8$kR5o36X z_^w&A3XSmI4zI^YAar3I)Ln+ql{E9H9bu{X5cn#9T>4L(pDC^AJi!h+MC9 zK^J~2k|IopK884^LsBg&*sLnp%)XC}Gf@?0kP8=+O32`hjpZ$kwVt!sSh-U&WX2hc zvjt?YlE$b6Y|peHV$h)`d2KX_bx8<6O5=>Eg{p-*Vd3o{~EG0GzM^5R``45Roht5=^OnoFO7Ms@SndFZMngpG! zO=>=irS4c+4V#a6!x=3i3vv}B(q}iup3g^XBvK}vGNBPJ?Eo(^y zuVA$9+XB>scAQ}S)JLnk69U-eSccu?VpFW$Eysbq@^Mx@l0R%WvuRbR(mn%sJ7|s$ zV>@CJdiiT7xQ@ReL}RbUclWvVybF*<-bZ#2ej*^hh+O`z?9 z!aS!V-PWNIZuRq*Z{bnxGfWza{bwrO-hfjL}Rdmra~pHbXF&ODeEp z@ZWQInbht*T+z0lUfGJJiw1ckNs^Oe{n@=U2CL7VVc6)uDkWsL?W)E`j3}B6uEKsG zUM5h`h>_74r~Kn1$scV6=55!ZvFX3LFZPPanGV5VitJ+KLdn%q0aunjLrqN@oq{#l z**6l=-VBRYBaHXjq_mo!Y{ixG1l#!vvbKsCeKYVOH%}6Em?d`f1^4`u0j%}kMVr0f zYAiD)4WsVcC^%PRX4o(jvRh-iqvwz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od.cpp @@ -0,0 +1,12 @@ +name = "ACE3"; +picture = "logo_ace3_ca.paa"; +actionName = "Github"; +action = "https://github.com/KoffeinFlummi/ACE3"; +description = "ACE3 - Version 3.0.0"; +logo = "logo_ace3_ca.paa"; +logoOver = "logo_ace3_ca.paa"; +tooltip = "ACE3"; +tooltipOwned = "ACE3 Owned"; +overview = "ACE3 is a joint effort by the teams behind ACE2, AGM and CSE to improve the realism and authenticity of Arma3."; +author = "ACE3 Team"; +overviewPicture = "logo_ace3_ca.paa"; \ No newline at end of file From 876424695e49485bca18d592f94f98f85bfd5a51 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 15 Mar 2015 09:02:11 +0100 Subject: [PATCH 40/73] solve canInteract conflicts, fix #198 --- addons/common/XEH_preInit.sqf | 2 + .../fnc_addCanInteractWithConditon.sqf | 38 ++++++++++++++++ .../common/functions/fnc_canInteractWith.sqf | 44 +++++++++++++++++-- addons/common/functions/fnc_claim.sqf | 39 +++++++++++----- addons/common/functions/fnc_owned.sqf | 19 ++++++-- .../fnc_removeCanInteractWithConditon.sqf | 34 ++++++++++++++ 6 files changed, 158 insertions(+), 18 deletions(-) create mode 100644 addons/common/functions/fnc_addCanInteractWithConditon.sqf create mode 100644 addons/common/functions/fnc_removeCanInteractWithConditon.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index c71232a55a..4eb107ce37 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -7,6 +7,7 @@ ADDON = false; PREP(addActionEventHandler); PREP(addActionMenuEventHandler); PREP(addCameraEventHandler); +PREP(addCanInteractWithConditon); PREP(addCustomEventHandler); PREP(addLineToDebugDraw); PREP(addMapMarkerCreatedEventHandler); @@ -147,6 +148,7 @@ PREP(receiveRequest); PREP(removeActionEventHandler); PREP(removeActionMenuEventHandler); PREP(removeCameraEventHandler); +PREP(removeCanInteractWithConditon); PREP(removeCustomEventHandler); PREP(removeMapMarkerCreatedEventHandler); PREP(removeScrollWheelEventHandler); diff --git a/addons/common/functions/fnc_addCanInteractWithConditon.sqf b/addons/common/functions/fnc_addCanInteractWithConditon.sqf new file mode 100644 index 0000000000..99815a08a7 --- /dev/null +++ b/addons/common/functions/fnc_addCanInteractWithConditon.sqf @@ -0,0 +1,38 @@ +/* + * Author: commy2 + * + * Add a condition that gets checked by ace_common_fnc_canInteractWith. + * + * Arguments: + * 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. (String) + * 1: The condition to check. format of "_this" is "[_player, _target]". (Code) + * + * Return Value: + * Unit can interact? + * + */ +#include "script_component.hpp" + +private ["_conditionName", "_conditionFunc"]; + +_conditionName = toLower (_this select 0); +_conditionFunc = _this select 1; + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_index"; +_index = _conditionNames find _conditionName; + +if (_index == -1) then { + _index = count _conditionNames; +}; + +_conditionNames set [_index, _conditionName]; +_conditionFuncs set [_index, _conditionFunc]; + +GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 9c5405452e..5e69f670e3 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -1,11 +1,47 @@ -// by commy2 +/* + * Author: commy2 + * + * Check if the unit can interact. + * + * Arguments: + * 0: The player. (Object) + * 1: The interaction target. objNull to ignore. (Object) + * 2: Exceptions. What general conditions are to skip? (Array) + * + * Return Value: + * Unit can interact? + * + */ #include "script_component.hpp" -private ["_unit", "_target", "_owner"]; +private ["_unit", "_target", "_exceptions"]; _unit = _this select 0; _target = _this select 1; +_exceptions = _this select 2; -_owner = _target getVariable ["ACE_isUsedBy", objNull]; +// exit if the target is not free to interact +private "_owner"; +_owner = _target getVariable [QGVAR(owner), objNull]; -isNull _owner || {_unit == _owner} || {!isPlayer _owner} +if (!isNull _owner && {_unit != _owner} && {!([_owner] call FUNC(isPlayer))}) exitWith {false}; + +// check general conditions + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_canInteract"; +_canInteract = true; + +{ + if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { + _canInteract = false; + }; +} forEach _conditionNames; + +_canInteract diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index cf960ac462..73317ee876 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -1,7 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * + * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc. + * + * Arguments: + * 0: Unit that claims another object. ObjNull to remove claim. (Object) + * 1: The object that gets claimed. (Object) + * 2: Lock the claimed object aswell? (Bool) + * + * Return Value: + * NONE + * + */ #include "script_component.hpp" -private ["_unit", "_target", "_lockTarget", "_owner"]; +private ["_unit", "_target", "_lockTarget"]; _unit = _this select 0; _target = _this select 1; @@ -9,20 +22,26 @@ _lockTarget = _this select 2; if (isNil "_lockTarget") then {_lockTarget = false}; -_owner = _target getVariable ["ACE_isUsedBy", objNull]; +private "_owner"; +_owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { diag_log text "[ACE] ERROR: Claiming already owned object."; }; -_target setVariable ["ACE_isUsedBy", _unit, true]; +// transfer this immediately +_target setVariable [QGVAR(owner), _unit, true]; +// lock target object if (_lockTarget) then { - if (!isNull _unit) then { - [_target, "{_locked = locked _this; _this setVariable ['ACE_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc); - } else { - [_target, "{_this lock (_this getVariable ['ACE_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc); - }; + if (!isNull _unit) then { + ["lockVehicle", _target, _target] call FUNC(targetEvent); + } else { + ["unlockVehicle", _target, _target] call FUNC(targetEvent); + }; }; -//systemChat str locked _target; systemChat str (_target getVariable ['ACE_lockStatus', locked _target]); +/* +systemChat str locked _target; +systemChat str (_target getVariable [QGVAR(lockStatus), locked _target]); +*/ diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index 4fa1dbeb98..5588c23781 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -1,8 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit. + * + * Arguments: + * 0: Any object. (Object) + * + * Return Value: + * Is this object claimed by someone? + * + */ #include "script_component.hpp" -private "_object"; +private "_target"; -_object = _this select 0; +_target = _this select 0; -!isNull (_object getVariable ["ACE_isUsedBy", objNull]) +!isNull (_target getVariable [QGVAR(owner), objNull]) diff --git a/addons/common/functions/fnc_removeCanInteractWithConditon.sqf b/addons/common/functions/fnc_removeCanInteractWithConditon.sqf new file mode 100644 index 0000000000..6cfd751c4c --- /dev/null +++ b/addons/common/functions/fnc_removeCanInteractWithConditon.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Remove a condition that gets checked by ace_common_fnc_canInteractWith. + * + * Arguments: + * 0: The conditions id. (String) + * + * Return Value: + * Unit can interact? + * + */ +#include "script_component.hpp" + +private "_conditionName"; + +_conditionName = toLower (_this select 0); + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_index"; +_index = _conditionNames find _conditionName; + +if (_index == -1) exitWith {}; + +_conditionNames deleteAt _index; +_conditionFuncs deleteAt _index; + +GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; From 4dab0b73d56c574728145d042a7c901afcc456ca Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 15 Mar 2015 09:26:16 +0100 Subject: [PATCH 41/73] add conditions on post init --- addons/captives/XEH_postInit.sqf | 6 ++++++ addons/captives/config.cpp | 13 ------------ addons/common/XEH_postInit.sqf | 7 +++++-- addons/common/config.cpp | 6 ------ .../common/functions/fnc_canInteractWith.sqf | 2 ++ .../scripts/initCanInteractFunction.sqf | 20 ------------------- addons/interaction/XEH_clientInit.sqf | 2 ++ addons/interaction/config.cpp | 6 ------ 8 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 addons/common/scripts/initCanInteractFunction.sqf diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index ac86d71915..ba4c40582e 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -36,3 +36,9 @@ if (isServer) then { // [_unit, "wokeUp", { // if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp}; // }] call ACE_Core_fnc_addCustomEventhandler; + +if (!hasInterface) exitWith {}; + +["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithConditon); +["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithConditon); +["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithConditon); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index 27b7c4ec60..57de6ee970 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -16,16 +16,3 @@ class CfgPatches { #include "CfgMoves.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - - -class ACE_canInteractConditions { - class GVAR(isNotEscorting) { - condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false))); - }; - class GVAR(isNotHandcuffed) { - condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false))); - }; - class GVAR(isNotSurrendering) { - condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false))); - }; -}; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 35b0f5c3fe..4e501aaa19 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -55,8 +55,6 @@ if (_currentVersion != _previousVersion) then { if (!hasInterface) exitWith {}; call COMPILE_FILE(scripts\assignedItemFix); - -call COMPILE_FILE(scripts\initCanInteractFunction); call COMPILE_FILE(scripts\initScrollWheel); 0 spawn { @@ -161,3 +159,8 @@ _vehicle setFuel _fuelLevel; ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); + +["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithConditon); + +//@todo remove obsolete +GVAR(canInteract) = {true}; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index d562d185ec..8081a05637 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -51,12 +51,6 @@ class ACE_Rsc_Control_Base { h = 0; }; -class ACE_canInteractConditions { - class GVAR(notOnMap) { - condition = "!visibleMap"; - }; -}; - class ACE_Settings { /* *class GVAR(sampleSetting) { diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 5e69f670e3..366da13458 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -20,6 +20,8 @@ _unit = _this select 0; _target = _this select 1; _exceptions = _this select 2; +_exceptions = [_exceptions, {toLower _this}] call FUNC(map); + // exit if the target is not free to interact private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; diff --git a/addons/common/scripts/initCanInteractFunction.sqf b/addons/common/scripts/initCanInteractFunction.sqf deleted file mode 100644 index a0a6eb787f..0000000000 --- a/addons/common/scripts/initCanInteractFunction.sqf +++ /dev/null @@ -1,20 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"]; - -_function = "private '_exceptions'; _exceptions = _this; alive ACE_player"; - -_configFile = configFile >> "ACE_canInteractConditions"; -_count = count _configFile; - -for "_index" from 0 to (_count -1) do { - _config = _configFile select _index; - _configName = configName _config; - - _condition = getText (_config >> "condition"); - - _function = _function + format ["&& {%1 || {'%2' in _exceptions}}", _condition, _configName]; -}; - -GVAR(canInteract) = compileFinal _function; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 0e05014cf7..56618b10cf 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -69,3 +69,5 @@ GVAR(isOpeningDoor) = false; false; }, [29, [false, false, false]], false] call cba_fnc_addKeybind; + +["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithConditon); diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index c9cfd2c0b4..a39e8f8bf5 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -24,9 +24,3 @@ class ACE_Settings { typeName = "BOOL"; }; }; - -class ACE_canInteractConditions { - class GVAR(isNotSwimming) { - condition = QUOTE( !underwater ACE_player ); - }; -}; From b5f307919eb356f639d5dfa8f664f94594b120ce Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 15 Mar 2015 13:00:10 +0100 Subject: [PATCH 42/73] replace canInteract with canInteractWith --- addons/common/XEH_postInit.sqf | 3 -- addons/common/functions/fnc_progressBar.sqf | 4 +- addons/fcs/initKeybinds.sqf | 12 ++---- addons/grenades/XEH_postInit.sqf | 3 +- .../functions/fnc_compileMenu.sqf | 2 +- .../functions/fnc_compileMenuSelfAction.sqf | 2 +- addons/interaction/XEH_clientInit.sqf | 9 ++-- addons/interaction/functions/fnc_openDoor.sqf | 2 +- addons/movement/XEH_postInit.sqf | 3 +- addons/nametags/XEH_postInit.sqf | 3 +- addons/nightvision/XEH_postInitClient.sqf | 6 +-- addons/overheating/XEH_postInit.sqf | 3 +- addons/parachute/XEH_postInit.sqf | 3 +- addons/reload/XEH_postInit.sqf | 3 +- .../reload/functions/fnc_startLinkingBelt.sqf | 2 +- addons/resting/XEH_postInit.sqf | 3 +- addons/safemode/XEH_postInit.sqf | 3 +- addons/scopes/XEH_postInit.sqf | 12 ++---- addons/vector/initKeybinds.sqf | 12 ++---- addons/vehiclelock/functions/fnc_lockpick.sqf | 2 +- addons/vehicles/XEH_postInit.sqf | 3 +- addons/weaponselect/XEH_postInit.sqf | 42 +++++++------------ 22 files changed, 47 insertions(+), 90 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 4e501aaa19..8e10b6c583 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -161,6 +161,3 @@ _vehicle setFuel _fuelLevel; ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithConditon); - -//@todo remove obsolete -GVAR(canInteract) = {true}; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 0b8fcc7ac4..15fbab1e24 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -11,7 +11,7 @@ * 3: CODE or STRING - On Failure: Code called or STRING raised as event. * 4: STRING - (Optional) Localized Title * 5: CODE - (Optional) Code to check each frame -* 6: ARRAY - (Optional) Exceptions for checking EGVAR(common,canInteract) +* 6: ARRAY - (Optional) Exceptions for checking EGVAR(common,canInteractWith) * * Return value: * Nothing @@ -62,7 +62,7 @@ _perFrameFunction = { if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then { _errorCode = 3; } else { - if (!(_exceptions call EGVAR(common,canInteract))) then { + if (!([_player, objNull, _exceptions] call EGVAR(common,canInteractWith))) then { _errorCode = 4; } else { if (_elapsedTime >= _totalTime) then { diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index f573a7e9d9..c30e93dba0 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -3,8 +3,7 @@ ["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; @@ -21,8 +20,7 @@ GVAR(isDownStateKey1) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; @@ -35,8 +33,7 @@ ["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; @@ -50,8 +47,7 @@ ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 89f4e05bb4..6229871679 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -13,8 +13,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; ["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 5ba4a1b5a7..e6a2744f03 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -46,7 +46,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 9407ce6dcd..179617318c 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -43,7 +43,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 56618b10cf..fa8aadb47b 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -19,8 +19,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false}; @@ -40,8 +39,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; @@ -55,8 +53,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", { // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotDragging"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement ACE_Modifier = 1; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 616538a6ff..0d67ae7a55 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -47,7 +47,7 @@ playSound "ACE_Sound_Click"; !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} }; - if (!_usedMouseWheel && {time < _time} && {[] call EGVAR(common,canInteract)}) then { + if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EGVAR(common,canInteractWith)}) then { _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); {_house animate [_x, _phase]} forEach _animations; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 037e0105e9..9d2d48ce74 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -21,8 +21,7 @@ ["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (ACE_player != (vehicle ACE_player)) exitWith {false}; diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 2de39f5807..4d9a1341d7 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -10,8 +10,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement GVAR(ShowNamesTime) = time; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 0707104fad..65d6e8c45f 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -40,8 +40,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode _player != 1)) exitWith {false}; @@ -55,8 +54,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode _player != 1)) exitWith {false}; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index a1b3dec206..57b02b101e 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index c80f093209..35efab12a9 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -19,8 +19,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { [ace_player] call FUNC(showAltimeter); diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 6ea3e01326..6751348532 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 3b35a5a72a..d739cd8c56 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -42,7 +42,7 @@ if (_maxAmmo == 0) exitWith {}; // Condition to call each frame _condition = { EXPLODE_2_PVT((_this select 0),_player,_target); - ([_player, _target] call EFUNC(common,canInteract)) && ((_player distance _target) < 3) && ((speed _target) < 1) + ([_player, _target, []] call EFUNC(common,canInteractWith)) && ((_player distance _target) < 3) && ((speed _target) < 1) }; _onFinish = { diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf index 18c3409e38..9251c7663f 100644 --- a/addons/resting/XEH_postInit.sqf +++ b/addons/resting/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {inputAction 'reloadMagazine' == 0} && diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 549195b188..9508843e25 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -9,8 +9,7 @@ ["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index a884292416..6f8fae1a1b 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -36,8 +36,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; @@ -52,8 +51,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; @@ -68,8 +66,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; @@ -84,8 +81,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index a41c13c757..73c2d90225 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -3,8 +3,7 @@ ["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; @@ -21,8 +20,7 @@ GVAR(isDownStateKey1) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement ["azimuth"] call FUNC(onKeyUp); @@ -34,8 +32,7 @@ ["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; @@ -52,8 +49,7 @@ GVAR(isDownStateKey2) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement ["distance"] call FUNC(onKeyUp); diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 94feb71e61..c6a6369515 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -64,7 +64,7 @@ case (_funcType == "startLockpick"): { _condition = { PARAMS_1(_args); EXPLODE_2_PVT(_args,_unit,_veh); - ([_unit] call EFUNC(common,canInteract)) && ((_unit distance _veh) < 5) && ((speed _veh) < 1) + ([_unit, objNull, []] call EFUNC(common,canInteractWith)) && ((_unit distance _veh) < 5) && ((speed _veh) < 1) }; [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize "STR_ACE_Vehicle_Action_LockpickInUse"), _condition] call EFUNC(common,progressBar); }; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 18d9e2f580..316e539572 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player == driver vehicle ACE_player && {vehicle ACE_player isKindOf 'Car' || diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index c268f49b3c..6160448d56 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -22,8 +21,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -37,8 +35,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -52,8 +49,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -67,8 +63,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -82,8 +77,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -97,8 +91,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -112,8 +105,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -127,8 +119,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; @@ -142,8 +133,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; @@ -157,8 +147,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -172,8 +161,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -187,8 +175,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -202,8 +189,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; From 2744f46bd27bbdaab00fe4b0ed0df1010f396828 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 15 Mar 2015 16:12:37 +0100 Subject: [PATCH 43/73] spelling --- addons/captives/XEH_postInit.sqf | 6 +++--- addons/common/XEH_postInit.sqf | 2 +- addons/common/XEH_preInit.sqf | 4 ++-- ...WithConditon.sqf => fnc_addCanInteractWithCondition.sqf} | 0 ...hConditon.sqf => fnc_removeCanInteractWithCondition.sqf} | 0 addons/interaction/XEH_clientInit.sqf | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename addons/common/functions/{fnc_addCanInteractWithConditon.sqf => fnc_addCanInteractWithCondition.sqf} (100%) rename addons/common/functions/{fnc_removeCanInteractWithConditon.sqf => fnc_removeCanInteractWithCondition.sqf} (100%) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index ba7dbe1caf..651edbcf86 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -32,6 +32,6 @@ if (isServer) then { if (!hasInterface) exitWith {}; -["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithConditon); -["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithConditon); -["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithConditon); +["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition); +["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition); +["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 8e10b6c583..970eec92b4 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -160,4 +160,4 @@ _vehicle setFuel _fuelLevel; ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); -["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithConditon); +["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 4eb107ce37..73fe903684 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -7,7 +7,7 @@ ADDON = false; PREP(addActionEventHandler); PREP(addActionMenuEventHandler); PREP(addCameraEventHandler); -PREP(addCanInteractWithConditon); +PREP(addCanInteractWithCondition); PREP(addCustomEventHandler); PREP(addLineToDebugDraw); PREP(addMapMarkerCreatedEventHandler); @@ -148,7 +148,7 @@ PREP(receiveRequest); PREP(removeActionEventHandler); PREP(removeActionMenuEventHandler); PREP(removeCameraEventHandler); -PREP(removeCanInteractWithConditon); +PREP(removeCanInteractWithCondition); PREP(removeCustomEventHandler); PREP(removeMapMarkerCreatedEventHandler); PREP(removeScrollWheelEventHandler); diff --git a/addons/common/functions/fnc_addCanInteractWithConditon.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf similarity index 100% rename from addons/common/functions/fnc_addCanInteractWithConditon.sqf rename to addons/common/functions/fnc_addCanInteractWithCondition.sqf diff --git a/addons/common/functions/fnc_removeCanInteractWithConditon.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf similarity index 100% rename from addons/common/functions/fnc_removeCanInteractWithConditon.sqf rename to addons/common/functions/fnc_removeCanInteractWithCondition.sqf diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index fa8aadb47b..9c4a33083f 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -67,4 +67,4 @@ GVAR(isOpeningDoor) = false; }, [29, [false, false, false]], false] call cba_fnc_addKeybind; -["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithConditon); +["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); From 898476fc2f1f9ce8c573d101790c29da1f052a97 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 15 Mar 2015 16:45:06 +0100 Subject: [PATCH 44/73] no target in self actions --- addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 179617318c..81f4a25ef1 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -43,7 +43,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; From 1cdc341320d8f84240f792b01e001284446867de Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 16:40:47 -0500 Subject: [PATCH 45/73] Headers, Formatting --- addons/hearing/CfgEventHandlers.hpp | 2 +- addons/hearing/functions/fnc_addEarPlugs.sqf | 18 +++++---- addons/hearing/functions/fnc_earRinging.sqf | 37 ++++++++++-------- .../hearing/functions/fnc_explosionNear.sqf | 15 +++++--- addons/hearing/functions/fnc_firedNear.sqf | 32 ++++++++++------ .../hearing/functions/fnc_hasEarPlugsIn.sqf | 18 +++++---- .../hearing/functions/fnc_putInEarplugs.sqf | 19 +++++----- .../hearing/functions/fnc_removeEarplugs.sqf | 21 +++++----- addons/hearing/functions/fnc_updateVolume.sqf | 38 +++++++++++++------ 9 files changed, 121 insertions(+), 79 deletions(-) diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 9f0acc6c7c..1fe2508fef 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -33,4 +33,4 @@ class Extended_Explosion_EventHandlers { clientExplosion = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(explosionNear)}; ); }; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 9253717c11..7cd4661c0f 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -1,13 +1,17 @@ /* * Author: commy2 - * * Called on unit initialization. Adds earplugs if the unit is equipped with either a really loud primary weapon or a rocket launcher. * - * Argument: - * 0: A Soldier (Object) + * Arguments: + * 0: A Soldier * - * Return value: - * Nothing + * Return Value: + * None + * + * Example: + * [guy] call ace_hearing_fnc_addEarPlugs + * + * Public: No */ #include "script_component.hpp" @@ -19,7 +23,7 @@ _unit = _this select 0; _launcher = secondaryWeapon _unit; if (_launcher != "") exitWith { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarBuds"; }; // otherwise add earplugs if the soldier has a big rifle @@ -32,5 +36,5 @@ if (isNil "_magazine") exitWith {}; _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "audiblefire") > 8) then { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarBuds"; }; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 4581a6fdd9..2460e0fd5c 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -1,13 +1,18 @@ /* * Author: KoffeinFlummi, commy2 - * * Creates ear ringing effect with set strength. * * Arguments: - * 0: strength of ear ringing (Number between 0 and 1) + * 0: Unit (player) + * 1: strength of ear ringing (Number between 0 and 1) * * Return Value: - * none + * None + * + * Example: + * [clientExplosionEvent] call ace_hearing_fnc_earRinging + * + * Public: No */ #include "script_component.hpp" @@ -17,7 +22,7 @@ _unit = _this select 0; _strength = _this select 1; if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { - _strength = _strength / 4; + _strength = _strength / 4; }; GVAR(newStrength) = GVAR(newStrength) max _strength; @@ -28,24 +33,24 @@ if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith { if (GVAR(DisableEarRinging)) exitWith {}; if (_strength > 0.75) exitWith { - playSound "ACE_EarRinging_Heavy"; - GVAR(isEarRingingPlaying) = true; - [ + playSound "ACE_EarRinging_Heavy"; + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 7.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.5) exitWith { - playSound "ACE_EarRinging_Medium"; - GVAR(isEarRingingPlaying) = true; - [ + playSound "ACE_EarRinging_Medium"; + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 5.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.2) exitWith { - playSound "ACE_EarRinging_Weak"; - GVAR(isEarRingingPlaying) = true; + playSound "ACE_EarRinging_Weak"; GVAR(isEarRingingPlaying) = true; - [ + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 3.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 8c7b477da0..418916cc8e 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -1,13 +1,18 @@ /* * Author: KoffeinFlummi, commy2 - * * Handles deafness due to explosions going off near the player. * * Arguments: - * -> Explosion Event Handler + * 0: vehicle - Object the event handler is assigned to (player) + * 1: damage - Damage inflicted to the object * * Return Value: - * none + * None + * + * Example: + * [clientExplosionEvent] call ace_hearing_fnc_explosionNear + * + * Public: No */ #include "script_component.hpp" @@ -20,6 +25,6 @@ _strength = (_damage * 2) min 1; if (_strength < 0.01) exitWith {}; [_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); + sleep 0.2; + _this call FUNC(earRinging); }; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 10e8508617..9b110fbbbb 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -1,13 +1,23 @@ /* * Author: KoffeinFlummi, commy2 - * * Handles deafness due to large-caliber weapons going off near the player. * * Arguments: - * -> FiredNear Event Handler + * 0: Unit - Object the event handler is assigned to + * 1: Firer: Object - Object which fires a weapon near the unit + * 2: Distance - Distance in meters between the unit and firer + * 3: weapon - Fired weapon + * 4: muzzle - Muzzle that was used + * 5: mod - Current mode of the fired weapon + * 6: ammo - Ammo used * * Return Value: - * none + * None + * + * Example: + * [clientFiredNearEvent] call ace_hearing_fnc_firedNear + * + * Public: No */ #include "script_component.hpp" @@ -25,17 +35,17 @@ if (_weapon in ["Throw", "Put"]) exitWith {}; if (_unit != vehicle _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {}; _silencer = switch (_weapon) do { - case (primaryWeapon _unit) : {primaryWeaponItems _unit select 0}; - case (secondaryWeapon _unit) : {secondaryWeaponItems _unit select 0}; - case (handgunWeapon _unit) : {handgunItems _unit select 0}; - default {""}; +case (primaryWeapon _unit) : {primaryWeaponItems _unit select 0}; +case (secondaryWeapon _unit) : {secondaryWeaponItems _unit select 0}; +case (handgunWeapon _unit) : {handgunItems _unit select 0}; + default {""}; }; _audibleFireCoef = 1; //_audibleFireTimeCoef = 1; if (_silencer != "") then { - _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); - //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); + _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); + //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); }; _audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); @@ -47,6 +57,6 @@ _strength = _loudness - (_loudness/50 * _distance); // linear drop off if (_strength < 0.01) exitWith {}; [_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); + sleep 0.2; + _this call FUNC(earRinging); }; diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index 8fcfe1eeb1..58dc302888 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -1,18 +1,20 @@ /* * Author: commy2 - * * Check if the unit has earplugs put in. * - * Argument: - * A soldier (Object) + * Arguments: + * 0:Unit (player) * - * Return value: - * Boolean (Bool) + * Return Value: + * Have Earplugs in + * + * Example: + * [ace_player] call ace_hearing_fnc_hasEarPlugsIn + * + * Public: No */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_hasEarPlugsin", false] diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 767ec9c698..d5e3867a76 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -1,20 +1,21 @@ /* - * Author: Hope Johnson - * Edited by commy2 - * - * Puts in / takes out earplugs. + * Author: Hope Johnson and commy2 + * Puts in earplugs. * * Arguments: - * none + * 0:Unit (player) * * Return Value: - * none + * None + * + * Example: + * [ace_player] call ace_hearing_fnc_putInEarplugs + * + * Public: No */ #include "script_component.hpp" -private "_player"; - -_player = _this select 0; +PARAMS_1(_player); // Buds in inventory, putting them in _player removeItem "ACE_EarBuds"; diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 9436807a46..a762f06b47 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -1,23 +1,24 @@ /* - * Author: Hope Johnson - * Edited by commy2 - * - * Puts in / takes out earplugs. + * Author: Hope Johnson and commy2 + * Takes out earplugs. * * Arguments: - * none + * 0:Unit (player) * * Return Value: - * none + * None + * + * Example: + * [ace_player] call ace_hearing_fnc_removeEarplugs + * + * Public: No */ #include "script_component.hpp" -private "_player"; - -_player = _this select 0; +PARAMS_1(_player); if !(_player canAdd "ACE_EarBuds") exitWith { // inventory full - [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); + [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); }; // Buds already in and removing them. diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 187d4ce116..34ea959f39 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,4 +1,18 @@ -// by commy2 and CAA-Picard +/* + * Author: commy2 and CAA-Picard + * Updates and applys the current deafness. Called every 0.1 sec from a PFEH. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_hearing_fnc_updateVolume + * + * Public: No + */ #include "script_component.hpp" #define STRENGHTODEAFNESS 3 @@ -6,17 +20,17 @@ // Check if new noises increase deafness if (GVAR(newStrength) * STRENGHTODEAFNESS > GVAR(currentDeafness)) then { - GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; + GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; }; GVAR(newStrength) = 0; // Recover rate is slower if deafness is severe _recoverRate = 0.01; if (GVAR(currentDeafness) > 0.7) then { - _recoverRate = 0.005; - if (GVAR(currentDeafness) > 0.9) then { - _recoverRate = 0.002; - }; + _recoverRate = 0.005; + if (GVAR(currentDeafness) > 0.9) then { + _recoverRate = 0.002; + }; }; // Deafness recovers with time @@ -27,19 +41,19 @@ _volume = (1 - GVAR(currentDeafness) max 0)^2 max 0.04; // Earplugs reduce hearing 50% if ([ACE_player] call FUNC(hasEarPlugsIn)) then { - _volume = _volume min 0.5; + _volume = _volume min 0.5; }; // Reduce volume if player is unconscious if (ACE_player getVariable ["ACE_isUnconscious", false]) then { - _volume = _volume min 0.4; + _volume = _volume min 0.4; }; if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { - 0.1 fadeSound _volume; - 0.1 fadeSpeech _volume; - ACE_player setVariable ["tf_globalVolume", _volume]; - ACE_player setVariable ["acre_sys_core_globalVolume", _volume]; + 0.1 fadeSound _volume; + 0.1 fadeSpeech _volume; + ACE_player setVariable ["tf_globalVolume", _volume]; + ACE_player setVariable ["acre_sys_core_globalVolume", _volume]; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; From 04412e8ba49cbf7bfc031dd5a4de2100c33a2beb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 16:46:06 -0500 Subject: [PATCH 46/73] Replace spawn with waitAndExec --- addons/hearing/functions/fnc_explosionNear.sqf | 5 +---- addons/hearing/functions/fnc_firedNear.sqf | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 418916cc8e..b213a1304a 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -24,7 +24,4 @@ _damage = _this select 1; _strength = (_damage * 2) min 1; if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 9b110fbbbb..83d50776f7 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -56,7 +56,4 @@ _strength = _loudness - (_loudness/50 * _distance); // linear drop off if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); From ec0e2d72c2675fa900a333cc8bc2236c1eafeb69 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Mar 2015 16:47:50 -0500 Subject: [PATCH 47/73] Check firer's silencer instead of player's --- addons/hearing/functions/fnc_firedNear.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 83d50776f7..c66361801e 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -35,9 +35,9 @@ if (_weapon in ["Throw", "Put"]) exitWith {}; if (_unit != vehicle _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {}; _silencer = switch (_weapon) do { -case (primaryWeapon _unit) : {primaryWeaponItems _unit select 0}; -case (secondaryWeapon _unit) : {secondaryWeaponItems _unit select 0}; -case (handgunWeapon _unit) : {handgunItems _unit select 0}; + case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; + case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; + case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; default {""}; }; From efb3657da3f6bee0f1223dbb592286ea564ef555 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 16 Mar 2015 14:31:16 +0100 Subject: [PATCH 48/73] drag boxes --- addons/dragging/CfgEventHandlers.hpp | 4 ++-- addons/dragging/CfgVehicles.hpp | 1 + addons/dragging/XEH_preInit.sqf | 2 ++ addons/dragging/functions/fnc_canDrag.sqf | 1 + addons/dragging/functions/fnc_setDraggable.sqf | 10 ++++------ addons/dragging/functions/fnc_startDrag.sqf | 2 ++ addons/interact_menu/functions/fnc_compileMenu.sqf | 2 +- addons/main/script_macros.hpp | 1 + 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 463ae20ddc..2821f3d307 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -12,9 +12,9 @@ class Extended_PostInit_EventHandlers { }; class Extended_Init_EventHandlers { - class ThingX { + class ReammoBox_F { class ADDON { - init = QUOTE(if (local (_this select 0)) then {_this call DFUNC(initObject)};); + init = QUOTE(_this call DFUNC(initObject)); }; }; }; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index e20cc9f6e9..3b7f43fead 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -2,6 +2,7 @@ class CfgVehicles { class ThingX; class ReammoBox_F: ThingX { + XEH_ENABLED; GVAR(canDrag) = 0; GVAR(dragPosition[]) = {0,1,1}; GVAR(dragDirection) = 0; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 3825d1b429..ba4327f9e2 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP(canDrag); PREP(initObject); PREP(setDraggable); +PREP(startDrag); ADDON = true; diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index e69de29bb2..f32a5804e2 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -0,0 +1 @@ +true \ No newline at end of file diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 6c068540a6..3e185cf81f 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -32,9 +32,9 @@ if (isNil "_direction") then { }; // update variables -_object setVariable [QGVAR(canDrag), _enableDrag, true]; -_object setVariable [QGVAR(dragPosition), _position, true]; -_object setVariable [QGVAR(dragDirection), _direction, true]; +_object setVariable [QGVAR(canDrag), _enableDrag]; +_object setVariable [QGVAR(dragPosition), _position]; +_object setVariable [QGVAR(dragDirection), _direction]; // add action to class if it is not already present private ["_type", "_initializedClasses"]; @@ -49,7 +49,5 @@ private ["_name", "_icon", "_selection", "_statement", "_condition"]; _name = "drag"; _icon = ""; _selection = ""; -_statement = {hint str _target}; -_condition = {true}; -[_type, 0, [_name], _name, _icon, _selection, _statement, _condition, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, [_name], _name, _icon, _selection, FUNC(startDrag), FUNC(canDrag), 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index e69de29bb2..324bf850d5 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -0,0 +1,2 @@ + +hint str _target diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index e6a2744f03..fe3da17917 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -18,7 +18,7 @@ private ["_objectType","_actionsVarName"]; _objectType = _target; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; -}; +};systemChat _objectType; _actionsVarName = format [QGVAR(Act_%1), _objectType]; // Exit if the action menu is already compiled for this class diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 33f1037905..8425c4ad1e 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -1,4 +1,5 @@ #include "\x\cba\addons\main\script_macros_common.hpp" +#include "\x\cba\addons\xeh\script_xeh.hpp" // Default versioning level #define DEFAULT_VERSIONING_LEVEL 2 From ad181de5786899f47e451f43127c93956718d98e Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 16 Mar 2015 15:41:55 +0100 Subject: [PATCH 49/73] main me nu for reammo_box --- addons/dragging/functions/fnc_setDraggable.sqf | 8 ++++++-- addons/interaction/CfgVehicles.hpp | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 3e185cf81f..6ffa3476cc 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -39,15 +39,19 @@ _object setVariable [QGVAR(dragDirection), _direction]; // add action to class if it is not already present private ["_type", "_initializedClasses"]; -_initializedClasses = GETMVAR(GVAR(initializedClasses),[]); +_type = typeOf _object; +_initializedClasses = GETGVAR(initializedClasses,[]); // do nothing if the class is already initialized if (_type in _initializedClasses) exitWith {}; +_initializedClasses pushBack _type; +GVAR(initializedClasses) = _initializedClasses; + private ["_name", "_icon", "_selection", "_statement", "_condition"]; _name = "drag"; _icon = ""; _selection = ""; -[_type, 0, [_name], _name, _icon, _selection, FUNC(startDrag), FUNC(canDrag), 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", _name], _name, _icon, _selection, FUNC(startDrag), FUNC(canDrag), 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 947c2e2579..1bd1e81be2 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -497,4 +497,17 @@ class CfgVehicles { class ACE_SelfActions {}; }; + class thingX; + class ReammoBox_F: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 2; + condition = "true"; + }; + }; + class ACE_SelfActions {}; + }; + }; From 5d0f0c2896d67775a64cca4701758e34056ccf7d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 16 Mar 2015 10:56:05 -0500 Subject: [PATCH 50/73] Rename ACE_EarBuds -> ACE_EarPlugs Can't verify translations --- addons/hearing/CfgAmmo.hpp | 2 +- addons/hearing/CfgSounds.hpp | 2 +- addons/hearing/CfgVehicles.hpp | 26 +++++++++---------- addons/hearing/CfgWeapons.hpp | 8 +++--- addons/hearing/config.cpp | 4 +-- addons/hearing/functions/fnc_addEarPlugs.sqf | 4 +-- .../hearing/functions/fnc_putInEarplugs.sqf | 10 +++---- .../hearing/functions/fnc_removeEarplugs.sqf | 8 +++--- addons/hearing/stringtable.xml | 16 ++++++------ 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/addons/hearing/CfgAmmo.hpp b/addons/hearing/CfgAmmo.hpp index dea7901434..ddc2bf3297 100644 --- a/addons/hearing/CfgAmmo.hpp +++ b/addons/hearing/CfgAmmo.hpp @@ -4,4 +4,4 @@ class CfgAmmo { class B_127x108_Ball: BulletBase { audibleFire = 15; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgSounds.hpp b/addons/hearing/CfgSounds.hpp index 17436088c3..ac64f42c4e 100644 --- a/addons/hearing/CfgSounds.hpp +++ b/addons/hearing/CfgSounds.hpp @@ -11,4 +11,4 @@ class CfgSounds { sound[] = {QUOTE(PATHTOF(sounds\ACE_earringing_heavy.wav)),8,1.7}; titles[] = {}; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 1f499d88a4..300209f4e0 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -4,8 +4,8 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class ACE_PutInEarplugs { - displayName = "$STR_ACE_Hearing_Earbuds_On"; - condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarBuds' in items _player} ); + displayName = "$STR_ACE_Hearing_EarPlugs_On"; + condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} ); statement = QUOTE( [_player] call FUNC(putInEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -14,7 +14,7 @@ class CfgVehicles { enableInside = 1; }; class ACE_RemoveEarplugs { - displayName = "$STR_ACE_Hearing_Earbuds_Off"; + displayName = "$STR_ACE_Hearing_EarPlugs_Off"; condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) ); statement = QUOTE( [_player] call FUNC(removeEarPlugs) ); showDisabled = 0; @@ -35,61 +35,61 @@ class CfgVehicles { class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class B_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_East_Support_F: EAST_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class O_supplyCrate_F: B_supplyCrate_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_IND_Support_F: IND_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class I_supplyCrate_F: B_supplyCrate_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class IG_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class C_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; }; diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 15fa2097a3..e70cc62c25 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -2,9 +2,9 @@ class CfgWeapons { class ACE_ItemCore; class InventoryItem_Base_F; - class ACE_EarBuds: ACE_ItemCore { - displayName = "$STR_ACE_Hearing_Earbuds_Name"; - descriptionShort = "$STR_ACE_Hearing_Earbuds_Description"; + class ACE_EarPlugs: ACE_ItemCore { + displayName = "$STR_ACE_Hearing_EarPlugs_Name"; + descriptionShort = "$STR_ACE_Hearing_EarPlugs_Description"; model = PATHTOF(ACE_earplugs.p3d); picture = PATHTOF(UI\ACE_earplugs_x_ca.paa); scope = 2; @@ -12,4 +12,4 @@ class CfgWeapons { mass = 1; }; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 4499e647f6..446fd10180 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"ACE_EarBuds"}; + weapons[] = {"ACE_EarPlugs"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common", "ace_interaction"}; author[] = {"KoffeinFlummi", "CAA-Picard", "HopeJ", "commy2"}; @@ -29,4 +29,4 @@ class ACE_Settings { isClientSetable = 1; displayName = "$STR_ACE_Hearing_DisableEarRinging"; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 7cd4661c0f..455de07fd9 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -23,7 +23,7 @@ _unit = _this select 0; _launcher = secondaryWeapon _unit; if (_launcher != "") exitWith { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarPlugs"; }; // otherwise add earplugs if the soldier has a big rifle @@ -36,5 +36,5 @@ if (isNil "_magazine") exitWith {}; _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "audiblefire") > 8) then { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarPlugs"; }; diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index d5e3867a76..b02a19d5bc 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -17,12 +17,12 @@ PARAMS_1(_player); -// Buds in inventory, putting them in -_player removeItem "ACE_EarBuds"; +// Plugs in inventory, putting them in +_player removeItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", true, true]; -[localize "STR_ACE_Hearing_Earbuds_Are_On"] call EFUNC(common,displayTextStructured); +[localize "STR_ACE_Hearing_EarPlugs_Are_On"] call EFUNC(common,displayTextStructured); -/*// No Ear Buds in inventory, telling user -[localize "STR_ACE_Hearing_NoBuds"] call EFUNC(common,displayTextStructured);*/ +/*// No Ear Plugs in inventory, telling user +[localize "STR_ACE_Hearing_NoPlugs"] call EFUNC(common,displayTextStructured);*/ diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index a762f06b47..e2d0b68d51 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -17,13 +17,13 @@ PARAMS_1(_player); -if !(_player canAdd "ACE_EarBuds") exitWith { // inventory full +if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); }; -// Buds already in and removing them. -_player addItem "ACE_EarBuds"; +// Plugs already in and removing them. +_player addItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", false, true]; -[localize "STR_ACE_Hearing_Earbuds_Are_Off"] call EFUNC(common,displayTextStructured); +[localize "STR_ACE_Hearing_EarPlugs_Are_Off"] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 385bf35936..7f6110915a 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -2,7 +2,7 @@ - + Ear Plugs Ohrenstöpsel Tapones para los oídos @@ -14,8 +14,8 @@ Protetor auricular Tappi auricolari - - Protective Ear Buds allow the wearer to be near loud weaponry without damage to his hearing. + + Protective Ear Plugs allow the wearer to be near loud weaponry without damage to his hearing. Schützende Ohrenstöpsel, die es dem Träger ermöglichen, sich in der Nähe lauter Waffen aufzuhalten. Los tapones para los oídos permiten al usuario operar armamento ruidoso sin sufrir pérdida de audición. Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu. @@ -26,7 +26,7 @@ Protetor para ouvidos permitem que o usuário esteja próximo a ruídos sem danificar sua audição. Proteggono l'apparato uditivo, permettendo a chi li indossa di resistere ai suoni particolarmente forti senza alcun danno. - + Earplugs in Ohrenstöpsel drinnen Poner tapones @@ -38,7 +38,7 @@ Protetores colocados Indossa i tappi auricolari - + Earplugs out Ohrenstöpsel raus Quitar tapones @@ -50,7 +50,7 @@ Protetores retirados Levati i tappi auricolari - + Earplugs in Ohrenstöpsel drinnen Tapones puestos @@ -62,7 +62,7 @@ Protetores colocados Indossa i tappi auricolari - + Earplugs out Ohrenstöpsel raus Tapones quitados @@ -74,7 +74,7 @@ Protetores retirados Levati i tappi auricolari - + You have no ear plugs Keine Ohrenstöpsel im Inventar No tienes tapones para los oídos From d06760e77ee0b62d5077cab66ae84dbb915a79e0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 16 Mar 2015 13:14:45 -0500 Subject: [PATCH 51/73] Use ACRE API: acre_api_fnc_setGlobalVolume --- addons/hearing/functions/fnc_updateVolume.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 34ea959f39..8be8bfa0e1 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -53,7 +53,7 @@ if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { 0.1 fadeSound _volume; 0.1 fadeSpeech _volume; ACE_player setVariable ["tf_globalVolume", _volume]; - ACE_player setVariable ["acre_sys_core_globalVolume", _volume]; + if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;}; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; From 27404fed1b97084031688e84f3825073f08fa317 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 16 Mar 2015 19:25:29 +0100 Subject: [PATCH 52/73] function to drop object, fix position event --- addons/common/XEH_postInit.sqf | 2 + addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_fixPosition.sqf | 29 ++++++++++ addons/dragging/CfgEventHandlers.hpp | 2 +- addons/dragging/CfgVehicles.hpp | 2 +- addons/dragging/XEH_clientInit.sqf | 13 +++++ addons/dragging/XEH_postInit.sqf | 11 ---- addons/dragging/XEH_preInit.sqf | 4 ++ addons/dragging/functions/fnc_dragObject.sqf | 54 +++++++++++++++++++ .../dragging/functions/fnc_dragObjectPFH.sqf | 30 +++++++++++ addons/dragging/functions/fnc_dropObject.sqf | 36 +++++++++++++ .../dragging/functions/fnc_setDraggable.sqf | 2 +- addons/dragging/functions/fnc_startDrag.sqf | 37 ++++++++++++- .../dragging/functions/fnc_startDragPFH.sqf | 20 +++++++ addons/dragging/script_component.hpp | 4 +- 15 files changed, 231 insertions(+), 16 deletions(-) create mode 100644 addons/common/functions/fnc_fixPosition.sqf create mode 100644 addons/dragging/XEH_clientInit.sqf delete mode 100644 addons/dragging/XEH_postInit.sqf create mode 100644 addons/dragging/functions/fnc_dragObject.sqf create mode 100644 addons/dragging/functions/fnc_dragObjectPFH.sqf create mode 100644 addons/dragging/functions/fnc_dropObject.sqf create mode 100644 addons/dragging/functions/fnc_startDragPFH.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 970eec92b4..1a26553ed7 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -20,6 +20,8 @@ if (hasInterface) then { }; }] call FUNC(addEventhandler); +["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); + // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { if (time > 0) exitWith { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 73fe903684..c822de6d47 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -56,6 +56,7 @@ PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); PREP(fixLoweredRifleAnimation); +PREP(fixPosition); PREP(getAllDefinedSetVariables); PREP(getAllGear); PREP(getCaptivityStatus); diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf new file mode 100644 index 0000000000..a59c509a96 --- /dev/null +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. + * + * Argument: + * Object (Object) + * + * Return value: + * NONE + */ +#include "script_component.hpp" + +// setVectorUp requires local object +if (!local _this) exitWith {}; + +private "_position"; +_position = getPos _this; + +// don't place the object below the ground +if (_position select 2 < 0) then { + _position set [2, 0]; + _this setPos _position; +}; + +// adjust position to sloped terrain, if placed on ground +if (getPosATL _this select 2 == _position select 2) then { + _this setVectorUp surfaceNormal _position; +}; diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 2821f3d307..2ab440414c 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -7,7 +7,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); }; }; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 3b7f43fead..89721efd97 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ReammoBox_F: ThingX { XEH_ENABLED; GVAR(canDrag) = 0; - GVAR(dragPosition[]) = {0,1,1}; + GVAR(dragPosition[]) = {0,1.2,0}; GVAR(dragDirection) = 0; }; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf new file mode 100644 index 0000000000..339b7f590f --- /dev/null +++ b/addons/dragging/XEH_clientInit.sqf @@ -0,0 +1,13 @@ +// by PabstMirror, commy2 + +#include "script_component.hpp" + +GVAR(currentHeightChange) = 0; + +//[{_this call DFUNC(handleScrollWheel)}] call FUNC(common,addScrollWheelEventHandler); + +if (isNil QGVAR(maxWeight)) then { + GVAR(maxWeight) = 800; +}; + +["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf deleted file mode 100644 index 18dff50699..0000000000 --- a/addons/dragging/XEH_postInit.sqf +++ /dev/null @@ -1,11 +0,0 @@ -// by PabstMirror - -#include "script_component.hpp" - -GVAR(currentHeightChange) = 0; - -[{_this call DFUNC(handleScrollWheel)}] call FUNC(common,addScrollWheelEventHandler); - -if (isNil QGVAR(maxWeight)) then { - GVAR(maxWeight) = 800; -}; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index ba4327f9e2..88bd1d3d22 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -3,8 +3,12 @@ ADDON = false; PREP(canDrag); +PREP(dragObject); +PREP(dragObjectPFH); +PREP(dropObject); PREP(initObject); PREP(setDraggable); PREP(startDrag); +PREP(startDragPFH); ADDON = true; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf new file mode 100644 index 0000000000..9120c049b1 --- /dev/null +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -0,0 +1,54 @@ +/* + * Author: commy2 + * + * Drag an object. Called from ace_dragging_fnc_startDrag + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// get attachTo offset and direction. +private ["_position", "_direction"]; + +_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; +_direction = _target getVariable [QGVAR(dragDirection), 0]; + +// add height offset of model +private "_offset"; +_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + +_position = _position vectorAdd [0, 0, _offset]; + +// attach object +_target attachTo [_unit, _position]; +_target setDir _direction; + +// add scrollwheel action to release object +/* + _actionID = _unit getVariable ["AGM_Drag_ReleaseActionID", -1]; + + if (_actionID != -1) then { + _unit removeAction _actionID; + }; + _actionID = _unit addAction [format ["%1", localize "STR_AGM_Drag_EndDrag"], "player call AGM_Drag_fnc_releaseObject;", nil, 20, false, true, "","player call AGM_Drag_fnc_isDraggingObject"]; + + _unit setVariable ["AGM_Drag_ReleaseActionID", _actionID]; +*/ + +_unit setVariable [QGVAR(isDragging), true, true]; + +// check everything +[FUNC(dragObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; + +// reset current dragging height. +GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf new file mode 100644 index 0000000000..cf8e710474 --- /dev/null +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -0,0 +1,30 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; + +// drop if the player is dead +if !([_unit] call EFUNC(common,isAlive)) exitWith { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) exitWith { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// drop if not in dragging anim. This also exits when entering a vehicle. +if !(animationState _unit in DRAG_ANIMATIONS) exitWith { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +if !([_unit] call EFUNC(common,isPlayer)) exitWith { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf new file mode 100644 index 0000000000..77c928513d --- /dev/null +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2 + * + * Drop a dragged object. + * + * Argument: + * 0: Unit that drags the other object (Object) + * 1: Dragged object to drop (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// remove scroll wheel action +/* +_this removeAction (_this getVariable ["AGM_Drag_ReleaseActionID", -1]); +*/ + +// play release animation +_unit playAction "released"; + +// release object +detach _target; + +_unit setVariable [QGVAR(isDragging), false, true]; + +// make object accesable for other units +[objNull, _target, true] call EFUNC(common,claim); + +["fixPosition", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 6ffa3476cc..e63f453d29 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -54,4 +54,4 @@ _name = "drag"; _icon = ""; _selection = ""; -[_type, 0, ["ACE_MainActions", _name], _name, _icon, _selection, FUNC(startDrag), FUNC(canDrag), 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", _name], _name, _icon, _selection, {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 324bf850d5..8c96dbe630 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -1,2 +1,37 @@ +/* + * Author: commy2 + * + * Start the dragging process. + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" -hint str _target +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// @todo check weight +//_ableToDrag = ((_draggedObject call AGM_Drag_fnc_GetWeight) <= AGM_Drag_MaxWeight); + +// add a primary weapon if the unit has none. +// @todo prevent opening inventory when equipped with a fake weapon +if (primaryWeapon _unit == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; +}; + +// select primary, otherwise the drag animation actions don't work. +_unit selectWeapon primaryWeapon _unit; + +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + +_unit playActionNow "grabDrag"; + +[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf new file mode 100644 index 0000000000..b6515aa2d9 --- /dev/null +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target", "_timeOut"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; +_timeOut = _this select 0 select 2; + +// timeout. Do nothing. Quit. time, because anim length is linked to ingame time. +if (time > _timeOut) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// unit is ready to start dragging +if (animationState _unit in DRAG_ANIMATIONS) exitWith { + [_unit, _target] call FUNC(dragObject); + + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp index 3e8c54519b..0f601ae8d9 100644 --- a/addons/dragging/script_component.hpp +++ b/addons/dragging/script_component.hpp @@ -9,4 +9,6 @@ #define DEBUG_SETTINGS DEBUG_ENABLED_DRAGGING #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb"] From 2da0eee1e278da6653829e331de7f5321c340fc2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 16 Mar 2015 20:09:54 +0100 Subject: [PATCH 53/73] add drop dragged object action --- addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/functions/fnc_canDrop.sqf | 1 + addons/dragging/functions/fnc_dragObject.sqf | 34 ++++++++++++------- addons/dragging/functions/fnc_dropObject.sqf | 5 ++- .../dragging/functions/fnc_setDraggable.sqf | 9 ++--- 5 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 addons/dragging/functions/fnc_canDrop.sqf diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 88bd1d3d22..4ed8925e48 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -3,6 +3,7 @@ ADDON = false; PREP(canDrag); +PREP(canDrop); PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf new file mode 100644 index 0000000000..f32a5804e2 --- /dev/null +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -0,0 +1 @@ +true \ No newline at end of file diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 9120c049b1..75a3c0cb2a 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -33,19 +33,29 @@ _position = _position vectorAdd [0, 0, _offset]; _target attachTo [_unit, _position]; _target setDir _direction; -// add scrollwheel action to release object -/* - _actionID = _unit getVariable ["AGM_Drag_ReleaseActionID", -1]; - - if (_actionID != -1) then { - _unit removeAction _actionID; - }; - _actionID = _unit addAction [format ["%1", localize "STR_AGM_Drag_EndDrag"], "player call AGM_Drag_fnc_releaseObject;", nil, 20, false, true, "","player call AGM_Drag_fnc_isDraggingObject"]; - - _unit setVariable ["AGM_Drag_ReleaseActionID", _actionID]; -*/ - _unit setVariable [QGVAR(isDragging), true, true]; +_unit setVariable [QGVAR(draggedObject), _target, true]; + +// add scrollwheel action to release object +private "_actionID"; +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + +if (_actionID != -1) then { + _unit removeAction _actionID; +}; + +_actionID = _unit addAction [ + format ["%1", "STR_AGM_Drag_EndDrag"], + QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)), + nil, + 20, + false, + true, + "", + QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])) +]; + +_unit setVariable [QGVAR(ReleaseActionID), _actionID]; // check everything [FUNC(dragObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 77c928513d..35952af48e 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -18,9 +18,7 @@ _unit = _this select 0; _target = _this select 1; // remove scroll wheel action -/* -_this removeAction (_this getVariable ["AGM_Drag_ReleaseActionID", -1]); -*/ +_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); // play release animation _unit playAction "released"; @@ -29,6 +27,7 @@ _unit playAction "released"; detach _target; _unit setVariable [QGVAR(isDragging), false, true]; +_unit setVariable [QGVAR(draggedObject), objNull, true]; // make object accesable for other units [objNull, _target, true] call EFUNC(common,claim); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index e63f453d29..38e9438ca0 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -48,10 +48,5 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses) = _initializedClasses; -private ["_name", "_icon", "_selection", "_statement", "_condition"]; - -_name = "drag"; -_icon = ""; -_selection = ""; - -[_type, 0, ["ACE_MainActions", _name], _name, _icon, _selection, {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drag)], "drg", "", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drop)], "drp", "", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}, 2] call EFUNC(interact_menu,addClassAction); From 2aaef08c1d0699f00aea1fb3f1c068f0c6d0a609 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 16 Mar 2015 20:39:49 +0100 Subject: [PATCH 54/73] can drag / drop functions, localization --- addons/dragging/functions/fnc_canDrag.sqf | 24 ++++++++- addons/dragging/functions/fnc_canDrop.sqf | 23 +++++++- addons/dragging/functions/fnc_dragObject.sqf | 2 +- .../dragging/functions/fnc_setDraggable.sqf | 4 +- addons/dragging/stringtable.xml | 54 +++++++++++++++++++ 5 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 addons/dragging/stringtable.xml diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index f32a5804e2..17c2ffb901 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -1 +1,23 @@ -true \ No newline at end of file +/* + * Author: commy2 + * + * Check if unit can drag the object. Doesn't check weight. + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * Can the unit drag the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +// a static weapon has to be empty for dragging +if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf index f32a5804e2..df75b9540f 100644 --- a/addons/dragging/functions/fnc_canDrop.sqf +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -1 +1,22 @@ -true \ No newline at end of file +/* + * Author: commy2 + * + * Check if unit can drop the object. + * + * Argument: + * 0: Unit that currently drags a object (Object) + * 1: Object that is dragged (Object) + * + * Return value: + * Can the unit drop the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; + +_unit getVariable [QGVAR(draggedObject), objNull] == _target diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 75a3c0cb2a..2f04e0e599 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -45,7 +45,7 @@ if (_actionID != -1) then { }; _actionID = _unit addAction [ - format ["%1", "STR_AGM_Drag_EndDrag"], + format ["%1", localize "STR_ACE_Dragging_Drop"], QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)), nil, 20, diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 38e9438ca0..82ebc201e2 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -48,5 +48,5 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses) = _initializedClasses; -[_type, 0, ["ACE_MainActions", QGVAR(drag)], "drg", "", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); -[_type, 0, ["ACE_MainActions", QGVAR(drop)], "drp", "", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drag)], localize "STR_ACE_Dragging_Drag", "", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drop)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}, 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml new file mode 100644 index 0000000000..d8f4f1981a --- /dev/null +++ b/addons/dragging/stringtable.xml @@ -0,0 +1,54 @@ + + + + + + Drag + Тащить + Arrastrar + Ciągnij + Táhnout + Tracter + Ziehen + Arrastar + Trascina + Húzás + + + Release + Отпустить + Soltar + Puść + Položit + Lâcher + Loslassen + Largar + Lascia + Elengedés + + + Unable to drag item due to weight + Слишком тяжелый предмет + No se puede arrastrar el objeto debido a su peso + Nie można ciągnąć tego przedmiotu z powodu jego wagi + Předmět je příliž těžký! + Trop lourd pour être tracté + Dieser Gegenstand kann nicht gezogen werden, da er zu schwer ist. + Não é possível carregar o item devido a seu peso + Non è possibile trascinare l'oggetto a causa del suo peso + Túl nehéz ahhoz, hogy elhúzd + + + Carry + Tragen + Portar + Nieś + Porter + Nést + Carregar + Trascina + Felvesz + Нести + + + From cf45de7c11cff3da7c8c999fc47ec6f4c6540042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Mon, 16 Mar 2015 18:34:45 -0300 Subject: [PATCH 55/73] Typo on altimeter. Fix #204 --- addons/parachute/functions/fnc_showAltimeter.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 1b3edc26f5..8e3c3d83e3 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -43,4 +43,4 @@ GVAR(AltimeterActive) = true; (_this select 0) set [2, _height]; (_this select 0) set [3, _curTime]; -}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameEventHandler); +}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameHandler); From fef150cff2fa83a23c5f4f9e9e2e0fb2c174e83c Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 00:24:25 +0100 Subject: [PATCH 56/73] attempt to fix collisions --- addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_fixCollisions.sqf | 55 +++++++++++++++++++ addons/dragging/functions/fnc_dropObject.sqf | 2 + 3 files changed, 58 insertions(+) create mode 100644 addons/common/functions/fnc_fixCollisions.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index c822de6d47..a70014c25d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -55,6 +55,7 @@ PREP(execPersistentFnc); PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); +PREP(fixCollisions); PREP(fixLoweredRifleAnimation); PREP(fixPosition); PREP(getAllDefinedSetVariables); diff --git a/addons/common/functions/fnc_fixCollisions.sqf b/addons/common/functions/fnc_fixCollisions.sqf new file mode 100644 index 0000000000..2f4078bb1f --- /dev/null +++ b/addons/common/functions/fnc_fixCollisions.sqf @@ -0,0 +1,55 @@ +/* + * Author: commy2 + * Attempt to fix physx collisions causing unreasonable impact forces and damage. + * + * Arguments: + * 0: Object + * + * Return Value: + * Nothing + * + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +if (!local _object) exitWith {}; + +// ignore collision damage +_object setVariable [QGVAR(fixCollisionsDamage), damage _object]; + +private ["_ehID", "_vectorDirAndUp"]; + +_ehID = _object addEventHandler ["HandleDamage", { + + if (isNull (_this select 3)) exitWith { + (_this select 0) getVariable [QGVAR(fixCollisionsDamage), 0]; + }; + (_this select 0) setVariable [QGVAR(fixCollisionsDamage), _this select 2]; + + _this select 2 + +}]; + +_vectorDirAndUp = [vectorDir _object, vectorUp _object]; + +[{ + private ["_object", "_ehID", "_vectorDirAndUp", "_timeOut"]; + + _object = _this select 0 select 0; + _ehID = _this select 0 select 1; + _vectorDirAndUp = _this select 0 select 2; + _timeOut = _this select 0 select 3; + + // adjust vector to prevent fliping + _object setVectorDirAndUp _vectorDirAndUp;systemChat str damage _object;// + + if (time > _timeOut) exitWith { + _object removeEventHandler ["HandleDamage", _ehID];hint str time;// + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + +}, 0, [_object, _ehID, _vectorDirAndUp, time + 2]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 35952af48e..dc850c6f00 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -24,6 +24,8 @@ _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); _unit playAction "released"; // release object +[_target] call EFUNC(common,fixCollisions);//"fixCollision" + detach _target; _unit setVariable [QGVAR(isDragging), false, true]; From 4c1f7111b5e8e8288d187a82c547c3744feb1a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Mon, 16 Mar 2015 20:24:53 -0300 Subject: [PATCH 57/73] Add map module --- addons/map/CfgVehicles.hpp | 39 +++++++++++++++++++++++++ addons/map/UI/IconMap_ca.paa | Bin 0 -> 5625 bytes addons/map/XEH_preInit.sqf | 1 + addons/map/functions/fnc_moduleMap.sqf | 22 ++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 addons/map/UI/IconMap_ca.paa create mode 100644 addons/map/functions/fnc_moduleMap.sqf diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 6b68864728..7960fe67ee 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,5 +1,44 @@ class CfgVehicles { class Module_F; + class ACE_ModuleMap: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Map"; + function = QFUNC(moduleMap); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconMap_ca.paa); + class Arguments { + class MapIllumination { + displayName = "Map illumination?"; + description = "Calculate dynamic map illumination based on light conditions?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1; }; + class No { name = "No"; value = 0; }; + }; + }; + class MapShake { + displayName = "Map shake?"; + description = "Make map shake when walking?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1;}; + class No { name = "No"; value = 0; }; + }; + }; + class MapLimitZoom { + displayName = "Limit map zoom?"; + description = "Limit the amount of zoom available for the map?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1;}; + }; + }; + }; + }; + class ACE_ModuleBlueForceTracking: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; diff --git a/addons/map/UI/IconMap_ca.paa b/addons/map/UI/IconMap_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..128f08f6f01b5ec82dd4ffa2cc70a453948304b2 GIT binary patch literal 5625 zcmdT|4NM!?9X}^2DJ>Al$F#;UgJYF8Q?fKxPp#6{&^cg4p`l6BkSSAuG*QxGM_NTP zG0)JHxlz*`q1z(VQfsML_n~Pfb1$k;YtppDA|GVw$7~!Jq{L(-fSCie#~p9)o&A4z zxhQkcmPvg&!~O36{=fgn`@fI7dr)z4;iexJZ!TQGFwE4{RFQviR9B`?6`;M)fgYncp!@ zv1HFJb^+i2J70(?X?g9#y&AAzKID^p1FUT)cacv3mxjHf-(5@NpKqL<=)x%j`Fta) z{ZxTV!_&4AzKY7Vzr#Iawj0pDe8>?d_oR{74MTicaFMVO@c%j=n7?X8opl!Y2S#J$ zRtI>c2Sq+Vnoj*SFqRfWNs9sG|E)g;rleWPx9UX9Hp^SJz&|jGA_#E=Ci3CV@pIzm zfahvI&B@nl`I@gmzjQe2BKM?8T%(Q~_v<#$`K#~5gI8B0fIN%fMtdLNeq1kxl6SKK z@9W2MA9{=8ag3XCXn!Now;Us4$=*JqU;Zl1r^IiO%1e?PPeg4(c=bByUpkB?O$6XZ z{KfI42RrP3z{&DaF*a=->9*1F*2Yl8j#ZKX5I3|Jh#P*PrFYQ%`<$8nCgm z&MJgzo&wCA)#NfvD$SRE-@CQJRDtT7JEPpl{@3Mt?$_)s%#YIb@%iy{NIb10bW(f< zb4OONBZtiZJwci-Em04IyTD;(`b(iBhBPbm)G zX{Y&3rmvPSkm|o>0oXSWq-+oJZ$1h*YXC2feA{z?t^8o1P!k@u@N1AIW}8=a)7X;sn7(=p}z&7&D2dI6Gax)cR_i=47qw6z7lfVN4X0 z$B!AgC#>;?i-BLQug2f~4O<<=TN?Ct{uOW5U)gAV>Tqhkj!C-yt!?i}SN2!)-GWD% z`>tR3Gac^=;xCHmz+RfunG;l;zi!b_Jb?acx#42S_6=X71vx%%Od{kWP|EL0kJ}zF zi6+2#N$TV2?wj+gZR6~I95U$NVqZ1Bt2}(wwUCQ+m+TLWM#-&-{2{uAizcz}Kk%vf z=Zf<#`fxsWQ-909B$hdv|7Gnz5KQC|ZiIXN7(Rb2nxfcPii@F9ycx6qq}US1=dWt% z_#x>pYcFz1Li~sD#qFVmP+okC#gvXe#qQ{nogRJ%IM}AI^84U-WcE9r{(p)4|Qh#?_&+Yh<*~^dcRp0-L zdjj+;2SrruQY;e<3s(>hkTVT=83hWw^)mXSFfG3(+7MmRK;MMp`w{=r z3cwpKi<7;IZKHCWA3MMOnWZ4duQiM3H`bT|XNCA}#x)z80Y4bv(~Ylu4=OYb`bdcvIKJ<<*w95{1@{BaVOM3X-or>3nH?HE(0`JSOWd(?>?&M#j z{yaN$6rVXS=|DfuCi5AF>KlY2`IxJny!y>T?q|2%<~LmCts?`R7xixA;rIi+vxg3i2mIfVU3vRTDkP3s^tq2%kBk zsNaM^kgM&h@!G&5RcuMKc%b2&z2l23seW{V(Ab2<$k=;G(E z=FD_h9_Z?5%X-fGHn?3$`r{7{fb*h7p)bb=rB6a6gb$e656>}2KLz=Hf#ttlz2jlZ zx8#c_4qe#(azDtI#|~dV|Kr*nfYZFJZC70l^(Q0T`lr5j`ScuR9%)&bwUI6pn*{cz z-RQySUyhV-siF416FdI?qyN}W@g|}1rrqRT=3eqy^dXMjlj7T425vmm-1O#!9q!*# p%rzZ&Z0C;m05>zQH+6lc&j-8!uc$bmTbCc1r}1az!sGa${u@mGGnxPZ literal 0 HcmV?d00001 diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index 9bd60c865f..7899c6a637 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(blueForceTrackingModule); PREP(blueForceTrackingUpdate); PREP(determineMapLight); PREP(determineZoom); +PREP(moduleMap); PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf new file mode 100644 index 0000000000..4fdea61420 --- /dev/null +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -0,0 +1,22 @@ +/* + * Author: CAA-Picard + * Initializes the Map module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(mapIllumination), "MapIllumination"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Interaction Module Initialized."; From 5b91996c69d066b4e9a4ff0b8f5e3bc80f864035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Mon, 16 Mar 2015 20:28:37 -0300 Subject: [PATCH 58/73] Add hearing module and additional customization parameters: - Enable/Disable combat deafness altogether (default on) - Volume when using earbuds (default 50%) - Volume when unconscious (default 40%) --- addons/hearing/CfgEventHandlers.hpp | 6 ++--- addons/hearing/CfgVehicles.hpp | 23 ++++++++++++++++++ addons/hearing/UI/IconHearing_ca.paa | Bin 0 -> 5625 bytes addons/hearing/XEH_preInit.sqf | 1 + addons/hearing/config.cpp | 16 ++++++++++-- .../hearing/functions/fnc_moduleHearing.sqf | 20 +++++++++++++++ addons/hearing/functions/fnc_updateVolume.sqf | 7 ++++-- 7 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 addons/hearing/UI/IconHearing_ca.paa create mode 100644 addons/hearing/functions/fnc_moduleHearing.sqf diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 9f0acc6c7c..94b1ab0703 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -22,7 +22,7 @@ class Extended_Init_EventHandlers { class Extended_FiredNear_EventHandlers { class CAManBase { class GVAR(FiredNear) { - clientFiredNear = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(firedNear)}; ); + clientFiredNear = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(firedNear)}; ); }; }; }; @@ -30,7 +30,7 @@ class Extended_FiredNear_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class GVAR(ExplosionNear) { - clientExplosion = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(explosionNear)}; ); + clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; ); }; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 1f499d88a4..41562e9044 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -92,4 +92,27 @@ class CfgVehicles { MACRO_ADDITEM(ACE_EarBuds,12); }; }; + + + class Module_F; + class ACE_ModuleHearing: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Hearing"; + function = QFUNC(moduleHearing); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconHearing_ca.paa); + class Arguments { + class EnableCombatDeafness { + displayName = "Enable combat deafness?"; + description = "Enable combat deafness?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1; }; + class No { name = "No"; value = 0; }; + }; + }; + }; + }; }; diff --git a/addons/hearing/UI/IconHearing_ca.paa b/addons/hearing/UI/IconHearing_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..128f08f6f01b5ec82dd4ffa2cc70a453948304b2 GIT binary patch literal 5625 zcmdT|4NM!?9X}^2DJ>Al$F#;UgJYF8Q?fKxPp#6{&^cg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cFz1Li~sD#qFVmP+okC#gvXe#qQ{nogRJ%IM}AI^84U-WcE9r{(p)4|Qh#?_&+Yh<*~^dcRp0-L zdjj+;2SrruQY;e<3s(>hkTVT=83hWw^)mXSFfG3(+7MmRK;MMp`w{=r z3cwpKi<7;IZKHCWA3MMOnWZ4duQiM3H`bT|XNCA}#x)z80Y4bv(~Ylu4=OYb`bdcvIKJ<<*w95{1@{BaVOM3X-or>3nH?HE(0`JSOWd(?>?&M#j z{yaN$6rVXS=|DfuCi5AF>KlY2`IxJny!y>T?q|2%<~LmCts?`R7xixA;rIi+vxg3i2mIfVU3vRTDkP3s^tq2%kBk zsNaM^kgM&h@!G&5RcuMKc%b2&z2l23seW{V(Ab2<$k=;G(E z=FD_h9_Z?5%X-fGHn?3$`r{7{fb*h7p)bb=rB6a6gb$e656>}2KLz=Hf#ttlz2jlZ zx8#c_4qe#(azDtI#|~dV|Kr*nfYZFJZC70l^(Q0T`lr5j`ScuR9%)&bwUI6pn*{cz z-RQySUyhV-siF416FdI?qyN}W@g|}1rrqRT=3eqy^dXMjlj7T425vmm-1O#!9q!*# p%rzZ&Z0C;m05>zQH+6lc&j-8!uc$bmTbCc1r}1az!sGa${u@mGGnxPZ literal 0 HcmV?d00001 diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 95d317b4b1..0785a32aff 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(earRinging); PREP(explosionNear); PREP(firedNear); PREP(hasEarPlugsIn); +PREP(moduleHearing); PREP(putInEarPlugs); PREP(removeEarPlugs); PREP(updateVolume); diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 4499e647f6..0825573d9f 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -23,10 +23,22 @@ class CfgPatches { #include "CfgAmmo.hpp" class ACE_Settings { + class GVAR(EnableCombatDeafness) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(EarplugsVolume) { + value = 0.5; + typeName = "SCALAR"; + }; + class GVAR(UnconsciousnessVolume) { + value = 0.4; + typeName = "SCALAR"; + }; class GVAR(DisableEarRinging) { - default = 1; + value = 0; typeName = "BOOL"; isClientSetable = 1; displayName = "$STR_ACE_Hearing_DisableEarRinging"; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf new file mode 100644 index 0000000000..78e79d971e --- /dev/null +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -0,0 +1,20 @@ +/* + * Author: CAA-Picard + * Initializes the Map module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Interaction Module Initialized."; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 187d4ce116..48b1befc18 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -4,6 +4,9 @@ #define STRENGHTODEAFNESS 3 #define MAXDEAFNESS 1.1 +// Exit if combat deafness is disabled +if !(GVAR(enableCombatDeafness)) exitWith {}; + // Check if new noises increase deafness if (GVAR(newStrength) * STRENGHTODEAFNESS > GVAR(currentDeafness)) then { GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; @@ -27,12 +30,12 @@ _volume = (1 - GVAR(currentDeafness) max 0)^2 max 0.04; // Earplugs reduce hearing 50% if ([ACE_player] call FUNC(hasEarPlugsIn)) then { - _volume = _volume min 0.5; + _volume = _volume min GVAR(EarplugsVolume); }; // Reduce volume if player is unconscious if (ACE_player getVariable ["ACE_isUnconscious", false]) then { - _volume = _volume min 0.4; + _volume = _volume min GVAR(UnconsciousnessVolume); }; if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { From 6d868d1bd1dac50b5c26ac899808d8cf827a51fe Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 11:44:41 +0100 Subject: [PATCH 59/73] fix collisions when releasing, fix crate fliping in buildings --- addons/common/XEH_postInit.sqf | 1 + addons/common/XEH_preInit.sqf | 2 +- addons/common/functions/fnc_fixCollision.sqf | 21 +++++++ addons/common/functions/fnc_fixCollisions.sqf | 55 ------------------- addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/functions/fnc_dropObject.sqf | 14 ++++- .../functions/fnc_isObjectOnObject.sqf | 6 ++ 7 files changed, 42 insertions(+), 58 deletions(-) create mode 100644 addons/common/functions/fnc_fixCollision.sqf delete mode 100644 addons/common/functions/fnc_fixCollisions.sqf create mode 100644 addons/dragging/functions/fnc_isObjectOnObject.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 1a26553ed7..f260b7b4ec 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -20,6 +20,7 @@ if (hasInterface) then { }; }] call FUNC(addEventhandler); +["fixCollision", FUNC(fixCollision)] call FUNC(addEventhandler); ["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); // hack to get PFH to work in briefing diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index a70014c25d..e346c1e74d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -55,7 +55,7 @@ PREP(execPersistentFnc); PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); -PREP(fixCollisions); +PREP(fixCollision); PREP(fixLoweredRifleAnimation); PREP(fixPosition); PREP(getAllDefinedSetVariables); diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf new file mode 100644 index 0000000000..6b43cec469 --- /dev/null +++ b/addons/common/functions/fnc_fixCollision.sqf @@ -0,0 +1,21 @@ +/* + * Author: commy2 + * Attempt to fix physx collisions causing unreasonable impact forces and damage. + * + * Arguments: + * 0: Object + * + * Return Value: + * Nothing + * + */ +#include "script_component.hpp" + +// allowDamage requires local object +if (!local _this) exitWith {}; + +// prevent collision damage, @todo allowDamage API +_this allowDamage false; + +// re-allow damage after 2 seconds +[{_this allowDamage true}, _this, 2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/common/functions/fnc_fixCollisions.sqf b/addons/common/functions/fnc_fixCollisions.sqf deleted file mode 100644 index 2f4078bb1f..0000000000 --- a/addons/common/functions/fnc_fixCollisions.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: commy2 - * Attempt to fix physx collisions causing unreasonable impact forces and damage. - * - * Arguments: - * 0: Object - * - * Return Value: - * Nothing - * - */ -#include "script_component.hpp" - -private "_object"; - -_object = _this select 0; - -if (!local _object) exitWith {}; - -// ignore collision damage -_object setVariable [QGVAR(fixCollisionsDamage), damage _object]; - -private ["_ehID", "_vectorDirAndUp"]; - -_ehID = _object addEventHandler ["HandleDamage", { - - if (isNull (_this select 3)) exitWith { - (_this select 0) getVariable [QGVAR(fixCollisionsDamage), 0]; - }; - (_this select 0) setVariable [QGVAR(fixCollisionsDamage), _this select 2]; - - _this select 2 - -}]; - -_vectorDirAndUp = [vectorDir _object, vectorUp _object]; - -[{ - private ["_object", "_ehID", "_vectorDirAndUp", "_timeOut"]; - - _object = _this select 0 select 0; - _ehID = _this select 0 select 1; - _vectorDirAndUp = _this select 0 select 2; - _timeOut = _this select 0 select 3; - - // adjust vector to prevent fliping - _object setVectorDirAndUp _vectorDirAndUp;systemChat str damage _object;// - - if (time > _timeOut) exitWith { - _object removeEventHandler ["HandleDamage", _ehID];hint str time;// - - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - -}, 0, [_object, _ehID, _vectorDirAndUp, time + 2]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 4ed8925e48..46c3ebecb1 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -8,6 +8,7 @@ PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); PREP(initObject); +PREP(isObjectOnObject); PREP(setDraggable); PREP(startDrag); PREP(startDragPFH); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index dc850c6f00..a8f56d6753 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -20,14 +20,24 @@ _target = _this select 1; // remove scroll wheel action _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); +private "_inBuilding"; +_inBuilding = [_unit] call FUNC(isObjectOnObject); + // play release animation _unit playAction "released"; -// release object -[_target] call EFUNC(common,fixCollisions);//"fixCollision" +// prevent collision damage +["fixCollision", _target, _target] call EFUNC(common,targetEvent); +// release object detach _target; +// prevent object from flipping inside buildings +if (_inBuilding) then { + _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); +}; + + _unit setVariable [QGVAR(isDragging), false, true]; _unit setVariable [QGVAR(draggedObject), objNull, true]; diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf new file mode 100644 index 0000000000..0a8624820e --- /dev/null +++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf @@ -0,0 +1,6 @@ +// by commy2 + +private "_object"; +_object = _this select 0; + +(getPosATL _object select 2) - (getPos _object select 2) > 1E-5 From 5f39cf213b1782c9d956f7a31cf31c0054e46d9d Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 12:20:46 +0100 Subject: [PATCH 60/73] some fixes for MP --- addons/common/functions/fnc_canInteractWith.sqf | 2 +- addons/dragging/XEH_clientInit.sqf | 1 - addons/dragging/functions/fnc_dropObject.sqf | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 366da13458..b74f2092b4 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -26,7 +26,7 @@ _exceptions = [_exceptions, {toLower _this}] call FUNC(map); private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; -if (!isNull _owner && {_unit != _owner} && {!([_owner] call FUNC(isPlayer))}) exitWith {false}; +if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 339b7f590f..48a210b574 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -1,5 +1,4 @@ // by PabstMirror, commy2 - #include "script_component.hpp" GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index a8f56d6753..bdc7e0003e 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -37,7 +37,6 @@ if (_inBuilding) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); }; - _unit setVariable [QGVAR(isDragging), false, true]; _unit setVariable [QGVAR(draggedObject), objNull, true]; From 57becc203c0f468d097bcb511279f474217cb05f Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 13:47:07 +0100 Subject: [PATCH 61/73] handle disconnection when dragging --- addons/dragging/CfgEventHandlers.hpp | 1 + addons/dragging/XEH_clientInit.sqf | 14 ++++++++++++++ addons/dragging/XEH_serverInit.sqf | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 addons/dragging/XEH_serverInit.sqf diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 2ab440414c..182f65f118 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -8,6 +8,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit)); }; }; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 48a210b574..a8ae492c6f 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -10,3 +10,17 @@ if (isNil QGVAR(maxWeight)) then { }; ["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); + +// release object on player change. This does work when returning to lobby, but not when hard disconnecting. +["playerChanged", { + private ["_newPlayer", "_oldPlayer"]; + + _newPlayer = _this select 0; + _oldPlayer = _this select 1; + + { + if (_x getVariable [QGVAR(isDragging), false]) then { + [_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); + }; + } forEach [_newPlayer, _oldPlayer]; +}] call EFUNC(common,addEventhandler); diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf new file mode 100644 index 0000000000..cf3d7caeb9 --- /dev/null +++ b/addons/dragging/XEH_serverInit.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "script_component.hpp" + +// release object on hard disconnection. +addMissionEventHandler ["HandleDisconnect", { + private "_unit"; + + _unit = _this select 0; + + if (_unit getVariable [QGVAR(isDragging), false]) then { + [_unit, _unit getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); + }; +}]; From 75548e21d9f119731578a518e0a8a9bae2bb0307 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 15:42:25 +0100 Subject: [PATCH 62/73] add carry objects --- addons/dragging/CfgVehicles.hpp | 12 ++++ addons/dragging/XEH_clientInit.sqf | 1 + addons/dragging/XEH_preInit.sqf | 6 ++ addons/dragging/functions/fnc_canCarry.sqf | 25 +++++++ addons/dragging/functions/fnc_canDrag.sqf | 2 + .../dragging/functions/fnc_canDrop_carry.sqf | 22 +++++++ addons/dragging/functions/fnc_carryObject.sqf | 66 +++++++++++++++++++ .../dragging/functions/fnc_carryObjectPFH.sqf | 30 +++++++++ .../dragging/functions/fnc_dragObjectPFH.sqf | 5 ++ .../functions/fnc_dropObject_carry.sqf | 49 ++++++++++++++ addons/dragging/functions/fnc_initObject.sqf | 20 ++++-- .../dragging/functions/fnc_setCarryable.sqf | 52 +++++++++++++++ 12 files changed, 286 insertions(+), 4 deletions(-) create mode 100644 addons/dragging/functions/fnc_canCarry.sqf create mode 100644 addons/dragging/functions/fnc_canDrop_carry.sqf create mode 100644 addons/dragging/functions/fnc_carryObject.sqf create mode 100644 addons/dragging/functions/fnc_carryObjectPFH.sqf create mode 100644 addons/dragging/functions/fnc_dropObject_carry.sqf create mode 100644 addons/dragging/functions/fnc_setCarryable.sqf diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 89721efd97..37196b270f 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -3,25 +3,34 @@ class CfgVehicles { class ThingX; class ReammoBox_F: ThingX { XEH_ENABLED; + GVAR(canCarry) = 0; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + GVAR(canDrag) = 0; GVAR(dragPosition[]) = {0,1.2,0}; GVAR(dragDirection) = 0; }; class Slingload_base_F: ReammoBox_F { + GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; class EAST_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; GVAR(canDrag) = 1; }; class IND_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; GVAR(canDrag) = 1; }; /*class FIA_Box_Base_F: ReammoBox_F { + GVAR(canCarry) = 1; GVAR(canDrag) = 1; };*/ class NATO_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; GVAR(canDrag) = 1; }; @@ -31,14 +40,17 @@ class CfgVehicles { // in order to move the bigger ones. Currently simply remove support. // I believe these crates are currently broken (hitbox doesn't work or something) in 1.22 (2014-07-04) class Box_East_AmmoVeh_F: EAST_Box_Base { + GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; class Box_NATO_AmmoVeh_F: NATO_Box_Base { + GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; class Box_IND_AmmoVeh_F: IND_Box_Base { + GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; }; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index a8ae492c6f..98da043742 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -10,6 +10,7 @@ if (isNil QGVAR(maxWeight)) then { }; ["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); +["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. ["playerChanged", { diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 46c3ebecb1..5428cebcd5 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -2,13 +2,19 @@ ADDON = false; +PREP(canCarry); PREP(canDrag); PREP(canDrop); +PREP(canDrop_carry); +PREP(carryObject); +PREP(carryObjectPFH); PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); +PREP(dropObject_carry); PREP(initObject); PREP(isObjectOnObject); +PREP(setCarryable); PREP(setDraggable); PREP(startDrag); PREP(startDragPFH); diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf new file mode 100644 index 0000000000..6d3210776b --- /dev/null +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Check if unit can carry the object. Doesn't check weight. + * + * Argument: + * 0: Unit that should do the carrying (Object) + * 1: Object to carry (Object) + * + * Return value: + * Can the unit carry the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +// a static weapon has to be empty for dragging +if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; + +_target getVariable [QGVAR(canCarry), false] diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 17c2ffb901..5b0c578699 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -21,3 +21,5 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; + +_target getVariable [QGVAR(canDrag), false] diff --git a/addons/dragging/functions/fnc_canDrop_carry.sqf b/addons/dragging/functions/fnc_canDrop_carry.sqf new file mode 100644 index 0000000000..9efbbe9b0f --- /dev/null +++ b/addons/dragging/functions/fnc_canDrop_carry.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * + * Check if unit can drop the carried object. + * + * Argument: + * 0: Unit that currently carries a object (Object) + * 1: Object that is carried (Object) + * + * Return value: + * Can the unit drop the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; + +_unit getVariable [QGVAR(carriedObject), objNull] == _target diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf new file mode 100644 index 0000000000..8ebf015800 --- /dev/null +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -0,0 +1,66 @@ +/* + * Author: commy2 + * + * Carry an object. + * + * Argument: + * 0: Unit that should do the carrying (Object) + * 1: Object to carry (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// select no weapon and stop sprinting +_unit action ["SwitchWeapon", _unit, _unit, 99]; + +[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); + +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + +// get attachTo offset and direction. +private ["_position", "_direction"]; + +_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; +_direction = _target getVariable [QGVAR(carryDirection), 0]; + +// attach object +_target attachTo [_unit, _position]; +_target setDir _direction; + +_unit setVariable [QGVAR(isCarrying), true, true]; +_unit setVariable [QGVAR(carriedObject), _target, true]; + +// add scrollwheel action to release object +private "_actionID"; +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + +if (_actionID != -1) then { + _unit removeAction _actionID; +}; + +_actionID = _unit addAction [ + format ["%1", localize "STR_ACE_Dragging_Drop"], + QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)), + nil, + 20, + false, + true, + "", + QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])) +]; + +_unit setVariable [QGVAR(ReleaseActionID), _actionID]; + +// check everything +[FUNC(carryObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; + +// reset current dragging height. +GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf new file mode 100644 index 0000000000..b89719c688 --- /dev/null +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -0,0 +1,30 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; + +// drop if the player is dead +if !([_unit] call EFUNC(common,isAlive)) exitWith { + [_unit, _target] call FUNC(dropObject_carry); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) exitWith { + [_unit, _target] call FUNC(dropObject_carry); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// drop if not in carrying anim. +if (currentWeapon _unit != "") exitWith { + [_unit, _target] call FUNC(dropObject_carry); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +if !([_unit] call EFUNC(common,isPlayer)) exitWith { + [_unit, _target] call FUNC(dropObject_carry); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index cf8e710474..5c78f9d24b 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -24,6 +24,11 @@ if !(animationState _unit in DRAG_ANIMATIONS) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; +if (currentWeapon _unit != primaryWeapon _unit) exitWith { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + if !([_unit] call EFUNC(common,isPlayer)) exitWith { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf new file mode 100644 index 0000000000..0751936f88 --- /dev/null +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -0,0 +1,49 @@ +/* + * Author: commy2 + * + * Drop a carried object. + * + * Argument: + * 0: Unit that carries the other object (Object) + * 1: Carried object to drop (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// remove scroll wheel action +_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); + +private "_inBuilding"; +_inBuilding = [_unit] call FUNC(isObjectOnObject); + +// prevent collision damage +["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); +["fixCollision", _target, _target] call EFUNC(common,targetEvent); + +// release object +detach _target; + +// reselect weapon and re-enable sprint +_unit selectWeapon primaryWeapon _unit; + +[_unit, "isDragging", false] call EFUNC(common,setforceWalkStatus); + +// prevent object from flipping inside buildings +if (_inBuilding) then { + _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); +}; + +_unit setVariable [QGVAR(isCarrying), false, true]; +_unit setVariable [QGVAR(carriedObject), objNull, true]; + +// make object accesable for other units +[objNull, _target, true] call EFUNC(common,claim); + +["fixPosition", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf index 3d1f51ad21..65866bd028 100644 --- a/addons/dragging/functions/fnc_initObject.sqf +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * Initialize variables for dragable objects. Called from init EH. + * Initialize variables for drag or carryable objects. Called from init EH. * * Argument: * 0: Any object (Object) @@ -15,11 +15,23 @@ private "_object"; _object = _this select 0; -if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canDrag)) == 1) then { +private "_config"; +_config = configFile >> "CfgVehicles" >> typeOf _object; + +if (getNumber (_config >> QGVAR(canDrag)) == 1) then { private ["_position", "_direction"]; - _position = getArray (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(dragPosition)); - _direction = getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(dragDirection)); + _position = getArray (_config >> QGVAR(dragPosition)); + _direction = getNumber (_config >> QGVAR(dragDirection)); [_object, true, _position, _direction] call FUNC(setDraggable); }; + +if (getNumber (_config >> QGVAR(canCarry)) == 1) then { + private ["_position", "_direction"]; + + _position = getArray (_config >> QGVAR(carryPosition)); + _direction = getNumber (_config >> QGVAR(carryDirection)); + + [_object, true, _position, _direction] call FUNC(setCarryable); +}; diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf new file mode 100644 index 0000000000..52de076982 --- /dev/null +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -0,0 +1,52 @@ +/* + * Author: commy2 + * + * Enable the object to be carried. + * + * Argument: + * 0: Any object (Object) + * 1: true to enable carrying, false to disable (Bool) + * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0]) + * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_object", "_enableCarry", "_position", "_direction"]; + +_this resize 4; + +_object = _this select 0; +_enableCarry = _this select 1; +_position = _this select 2; +_direction = _this select 3; + +if (isNil "_position") then { + _position = _object getVariable [QGVAR(carryPosition), [0,0,0]]; +}; + +if (isNil "_direction") then { + _direction = _object getVariable [QGVAR(carryDirection), 0]; +}; + +// update variables +_object setVariable [QGVAR(canCarry), _enableCarry]; +_object setVariable [QGVAR(carryPosition), _position]; +_object setVariable [QGVAR(carryDirection), _direction]; + +// add action to class if it is not already present +private ["_type", "_initializedClasses"]; + +_type = typeOf _object; +_initializedClasses = GETGVAR(initializedClasses_carry,[]); + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; + +_initializedClasses pushBack _type; +GVAR(initializedClasses_carry) = _initializedClasses; + +[_type, 0, ["ACE_MainActions", QGVAR(carry)], localize "STR_ACE_Dragging_Carry", "", "", {[_player, _target] call FUNC(carryObject)}, {[_player, _target] call FUNC(canCarry)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drop_carry)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}, 2] call EFUNC(interact_menu,addClassAction); From dc7cfab06f4a8827fff84570f1bff6195bd889fc Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 17 Mar 2015 15:45:34 +0100 Subject: [PATCH 63/73] change default carry position --- addons/dragging/functions/fnc_setCarryable.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 52de076982..d1dd9cf1a9 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -6,7 +6,7 @@ * Argument: * 0: Any object (Object) * 1: true to enable carrying, false to disable (Bool) - * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0]) + * 2: Position offset for attachTo command (Array, optinal; default: [0,1,1]) * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) * * Return value: @@ -24,7 +24,7 @@ _position = _this select 2; _direction = _this select 3; if (isNil "_position") then { - _position = _object getVariable [QGVAR(carryPosition), [0,0,0]]; + _position = _object getVariable [QGVAR(carryPosition), [0,1,1]]; }; if (isNil "_direction") then { From ab39608e4d23c364a5e7ffd5a185aa0da07de711 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 01:36:56 +0100 Subject: [PATCH 64/73] change height when carrying, fix most cases of floating objects --- addons/common/XEH_postInit.sqf | 5 ++- addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_fixFloating.sqf | 32 +++++++++++++ addons/dragging/XEH_clientInit.sqf | 4 +- addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/config.cpp | 2 +- .../dragging/functions/fnc_carryObjectPFH.sqf | 26 +++-------- .../dragging/functions/fnc_dragObjectPFH.sqf | 31 +++---------- addons/dragging/functions/fnc_dropObject.sqf | 1 + .../functions/fnc_dropObject_carry.sqf | 1 + .../functions/fnc_handleScrollWheel.sqf | 45 +++++++++++++++++++ addons/interaction/XEH_clientInit.sqf | 2 +- 12 files changed, 101 insertions(+), 50 deletions(-) create mode 100644 addons/common/functions/fnc_fixFloating.sqf create mode 100644 addons/dragging/functions/fnc_handleScrollWheel.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index f260b7b4ec..6398f6aa98 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -20,8 +20,9 @@ if (hasInterface) then { }; }] call FUNC(addEventhandler); -["fixCollision", FUNC(fixCollision)] call FUNC(addEventhandler); -["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); +["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler); +["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler); +["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler); // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index e346c1e74d..de848941fd 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -56,6 +56,7 @@ PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); PREP(fixCollision); +PREP(fixFloating); PREP(fixLoweredRifleAnimation); PREP(fixPosition); PREP(getAllDefinedSetVariables); diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf new file mode 100644 index 0000000000..6f08af1482 --- /dev/null +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -0,0 +1,32 @@ +/* + * Author: commy2 + * Attempt to fix floating physx with disabled damage after setPosXXX commands. + * + * Arguments: + * Physx object (Object) + * + * Return Value: + * Nothing + * + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this; + +// setHitPointDamage requires local object +if (!local _object) exitWith {}; + +// save and restore hitpoints, see below why +private ["_hitPoints", "_hitPointDamages"]; + +_hitPoints = [_object] call FUNC(getHitpoints); +_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map); + +// this prevents physx objects from floating when near other physx objects with allowDamage false +_object setDamage damage _object; + +{ + _object setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; +} forEach _hitPoints; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 98da043742..3fbd1efd0b 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -1,9 +1,7 @@ // by PabstMirror, commy2 #include "script_component.hpp" -GVAR(currentHeightChange) = 0; - -//[{_this call DFUNC(handleScrollWheel)}] call FUNC(common,addScrollWheelEventHandler); +[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); if (isNil QGVAR(maxWeight)) then { GVAR(maxWeight) = 800; diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 5428cebcd5..bbbb55ab2a 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -12,6 +12,7 @@ PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); PREP(dropObject_carry); +PREP(handleScrollWheel); PREP(initObject); PREP(isObjectOnObject); PREP(setCarryable); diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp index 35f9f6d492..4ce7d328b9 100644 --- a/addons/dragging/config.cpp +++ b/addons/dragging/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common","ace_interact_menu"}; + requiredAddons[] = {"ace_common","ace_interaction","ace_interact_menu"}; author[] = {"https://github.com/commy2/"}; authorUrl = ""; VERSION_CONFIG; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index b89719c688..4f40d2b5d6 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -6,25 +6,13 @@ private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; -// drop if the player is dead -if !([_unit] call EFUNC(common,isAlive)) exitWith { - [_unit, _target] call FUNC(dropObject_carry); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) exitWith { - [_unit, _target] call FUNC(dropObject_carry); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -// drop if not in carrying anim. -if (currentWeapon _unit != "") exitWith { - [_unit, _target] call FUNC(dropObject_carry); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -if !([_unit] call EFUNC(common,isPlayer)) exitWith { +if ( + !([_unit] call EFUNC(common,isAlive)) // drop if the player is dead + || {!([_target] call EFUNC(common,isAlive))} // drop if the crate is destroyed + || {currentWeapon _unit != ""} + || {stance _unit != "STAND"} // drop when crouching or inside a vehicle + || {!([_unit] call EFUNC(common,isPlayer))} +) then { [_unit, _target] call FUNC(dropObject_carry); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 5c78f9d24b..8a27be1584 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -6,30 +6,13 @@ private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; -// drop if the player is dead -if !([_unit] call EFUNC(common,isAlive)) exitWith { - [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) exitWith { - [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -// drop if not in dragging anim. This also exits when entering a vehicle. -if !(animationState _unit in DRAG_ANIMATIONS) exitWith { - [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -if (currentWeapon _unit != primaryWeapon _unit) exitWith { - [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; -}; - -if !([_unit] call EFUNC(common,isPlayer)) exitWith { +if ( + !([_unit] call EFUNC(common,isAlive)) // drop if the player is dead + || {!([_target] call EFUNC(common,isAlive))} // drop if the crate is destroyed + || {!(animationState _unit in DRAG_ANIMATIONS)} // drop if not in dragging anim. This also exits when entering a vehicle. + || {currentWeapon _unit != primaryWeapon _unit} + || {!([_unit] call EFUNC(common,isPlayer))} +) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index bdc7e0003e..1b86f24394 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -44,3 +44,4 @@ _unit setVariable [QGVAR(draggedObject), objNull, true]; [objNull, _target, true] call EFUNC(common,claim); ["fixPosition", _target, _target] call EFUNC(common,targetEvent); +["fixFloating", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 0751936f88..497b96b95c 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -47,3 +47,4 @@ _unit setVariable [QGVAR(carriedObject), objNull, true]; [objNull, _target, true] call EFUNC(common,claim); ["fixPosition", _target, _target] call EFUNC(common,targetEvent); +["fixFloating", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..ce100abf50 --- /dev/null +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,45 @@ +/* + * Author: L-H, commy2 + * + * Handles raising and lowering the dragged weapon to be able to place it on top of objects. + * + * Argument: + * 0: Scroll amount (Number) + * + * Return value: + * Handled or not. (Bool) + */ +#include "script_component.hpp" + +// requires modifier key to be hold down +if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false}; + +private "_unit"; +_unit = ACE_player; + +// EH is always assigned. Exit and don't overwrite input if not carrying +if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; + +private "_scrollAmount"; + +_scrollAmount = _this select 0; + +// move carried item 15 cm per scroll interval +_scrollAmount = _scrollAmount * 0.15; + +private "_carriedItem"; +_carriedItem = _unit getVariable [QGVAR(carriedObject),objNull]; + +private ["_position", "_maxHeight"]; + +_position = getPosATL _carriedItem; +_maxHeight = (_unit ModelToWorld [0,0,0]) select 2; + +_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; + +// move up/down object and reattach at current position +detach _carriedItem; +_carriedItem setPosATL _position; +_carriedItem attachTo [_unit]; + +true diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 9c4a33083f..e303fae857 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -53,7 +53,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotDragging"]] call EGVAR(common,canInteractWith)) exitWith {false}; + //if !([ACE_player, objNull, ["isNotDragging"]] call EGVAR(common,canInteractWith)) exitWith {false}; // not needed // Statement ACE_Modifier = 1; From ac8ff45d44775a20e679095196a14d0f3feadaae Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 11:29:58 +0100 Subject: [PATCH 65/73] lock / unlock events --- addons/common/XEH_postInit.sqf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 6398f6aa98..6fec7a1a20 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -24,6 +24,15 @@ if (hasInterface) then { ["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler); ["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler); +["lockVehicle", { + _this setVariable [QGVAR(lockStatus), locked _this]; + _this lock 2; +}] call FUNC(addEventhandler); + +["unlockVehicle", { + _this lock (_this getVariable [QGVAR(lockStatus), locked _this]); +}] call FUNC(addEventhandler); + // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { if (time > 0) exitWith { From c23c0788f618b208ae2e330e941a358e3fc55ec3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 13:36:22 +0100 Subject: [PATCH 66/73] tweaks, carry static weapons --- addons/common/functions/fnc_fixPosition.sqf | 4 +-- addons/dragging/CfgEventHandlers.hpp | 10 +++++++ addons/dragging/CfgVehicles.hpp | 30 +++++++++++++++++++ addons/dragging/functions/fnc_carryObject.sqf | 6 ++++ addons/dragging/functions/fnc_dropObject.sqf | 1 + .../functions/fnc_compileMenu.sqf | 2 +- addons/reload/functions/fnc_canCheckAmmo.sqf | 2 +- 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index a59c509a96..32cde87e52 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -18,8 +18,8 @@ private "_position"; _position = getPos _this; // don't place the object below the ground -if (_position select 2 < 0) then { - _position set [2, 0]; +if (_position select 2 < -0.1) then { + _position set [2, -0.1]; _this setPos _position; }; diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 182f65f118..a74afd1df7 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -13,6 +13,16 @@ class Extended_PostInit_EventHandlers { }; class Extended_Init_EventHandlers { + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + class StaticMortar { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; class ReammoBox_F { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 37196b270f..5ac84b7038 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -1,5 +1,35 @@ class CfgVehicles { + // Static weapons + class LandVehicle; + class StaticWeapon: LandVehicle { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + //remove actions from Taru Pods + class Pod_Heli_Transport_04_base_F: StaticWeapon { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + // ammo boxes class ThingX; class ReammoBox_F: ThingX { XEH_ENABLED; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 8ebf015800..1baa69b65d 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -31,6 +31,12 @@ private ["_position", "_direction"]; _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(carryDirection), 0]; +// add height offset of model +private "_offset"; +_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + +_position = _position vectorAdd [0, 0, _offset]; + // attach object _target attachTo [_unit, _position]; _target setDir _direction; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 1b86f24394..706c27ded9 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -27,6 +27,7 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject); _unit playAction "released"; // prevent collision damage +["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent); // release object diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index fe3da17917..e6a2744f03 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -18,7 +18,7 @@ private ["_objectType","_actionsVarName"]; _objectType = _target; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; -};systemChat _objectType; +}; _actionsVarName = format [QGVAR(Act_%1), _objectType]; // Exit if the action menu is already compiled for this class diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 3e83281b43..2cabe6edc2 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -13,7 +13,7 @@ EXPLODE_2_PVT(_this,_player,_target); -// Return true for static weapons if they have been fired once +// Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { (currentMagazine _target) != "" }; From ec6496ed2f292bbf5c6d934f050b57fb9dde5019 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 14:14:16 +0100 Subject: [PATCH 67/73] fix authors, add weight checks --- addons/dragging/XEH_clientInit.sqf | 8 ++- addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/config.cpp | 4 +- addons/dragging/functions/fnc_carryObject.sqf | 8 +++ addons/dragging/functions/fnc_getWeight.sqf | 54 +++++++++++++++++++ addons/dragging/functions/fnc_startDrag.sqf | 9 +++- addons/dragging/stringtable.xml | 6 ++- 7 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 addons/dragging/functions/fnc_getWeight.sqf diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 3fbd1efd0b..ba9d14af21 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -3,8 +3,12 @@ [{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); -if (isNil QGVAR(maxWeight)) then { - GVAR(maxWeight) = 800; +if (isNil "ACE_maxWeightDrag") then { + ACE_maxWeightDrag = 800; +}; + +if (isNil "ACE_maxWeightCarry") then { + ACE_maxWeightCarry = 600; }; ["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index bbbb55ab2a..8ab3e36c4d 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -12,6 +12,7 @@ PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); PREP(dropObject_carry); +PREP(getWeight); PREP(handleScrollWheel); PREP(initObject); PREP(isObjectOnObject); diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp index 4ce7d328b9..2d5854d86f 100644 --- a/addons/dragging/config.cpp +++ b/addons/dragging/config.cpp @@ -6,8 +6,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common","ace_interaction","ace_interact_menu"}; - author[] = {"https://github.com/commy2/"}; - authorUrl = ""; + author[] = {"Garth 'L-H' de Wet","commy2"}; + authorUrl = "https://github.com/commy2/"; VERSION_CONFIG; }; }; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 1baa69b65d..5fe3f36ccb 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -17,6 +17,14 @@ private ["_unit", "_target"]; _unit = _this select 0; _target = _this select 1; +// check weight +private "_weight"; +_weight = [_target] call FUNC(getWeight); + +if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { + [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); +}; + // select no weapon and stop sprinting _unit action ["SwitchWeapon", _unit, _unit, 99]; diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf new file mode 100644 index 0000000000..2b44bf90d9 --- /dev/null +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -0,0 +1,54 @@ +/* + Name: AGM_Drag_fnc_GetWeight + + Author(s): + L-H, edited by commy2 + + Description: + Returns the weight of a crate. + + Parameters: + 0: OBJECT - Crate to get weight of + + Returns: + NUMBER - Weight + + Example: + _weight = Crate1 call AGM_Drag_fnc_GetWeight; +*/ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +private ["_totalWeight", "_fnc","_fnc_Extra"]; +_totalWeight = 0; +_fnc_Extra = { + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight +}; +_fnc = { + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight +}; +_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); +_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); +_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra); +_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc); + +_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). + +_totalWeight diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 8c96dbe630..7704722d0d 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -17,8 +17,13 @@ private ["_unit", "_target"]; _unit = _this select 0; _target = _this select 1; -// @todo check weight -//_ableToDrag = ((_draggedObject call AGM_Drag_fnc_GetWeight) <= AGM_Drag_MaxWeight); +// check weight +private "_weight"; +_weight = [_target] call FUNC(getWeight); + +if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { + [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); +}; // add a primary weapon if the unit has none. // @todo prevent opening inventory when equipped with a fake weapon diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index d8f4f1981a..1fca04fee1 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -27,7 +27,9 @@ Elengedés - Unable to drag item due to weight + Item to heavy + Gegenstand zu schwer + Carry From 4ea6b91e4799cc8c2057698465421971b966c6fe Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 15:42:33 +0100 Subject: [PATCH 68/73] use eventhandlers instead of PFH --- addons/common/XEH_postInit.sqf | 9 ++++++ addons/dragging/CfgEventHandlers.hpp | 16 ++++++++++ addons/dragging/XEH_clientInit.sqf | 14 ++------- addons/dragging/XEH_preInit.sqf | 4 +++ .../dragging/functions/fnc_carryObjectPFH.sqf | 9 ++---- .../dragging/functions/fnc_dragObjectPFH.sqf | 9 ++---- .../functions/fnc_handleAnimChanged.sqf | 31 +++++++++++++++++++ .../dragging/functions/fnc_handleKilled.sqf | 20 ++++++++++++ .../functions/fnc_handlePlayerChanged.sqf | 17 ++++++++++ .../fnc_handlePlayerWeaponChanged.sqf | 31 +++++++++++++++++++ 10 files changed, 134 insertions(+), 26 deletions(-) create mode 100644 addons/dragging/functions/fnc_handleAnimChanged.sqf create mode 100644 addons/dragging/functions/fnc_handleKilled.sqf create mode 100644 addons/dragging/functions/fnc_handlePlayerChanged.sqf create mode 100644 addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 6fec7a1a20..1d951c3ceb 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -99,6 +99,7 @@ GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312); GVAR(OldCameraView) = cameraView; GVAR(OldPlayerVehicle) = vehicle ACE_player; GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); +GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ @@ -159,6 +160,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); ["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent); }; + // "playerWeaponChanged" event + _newPlayerWeapon = currentWeapon ACE_player; + if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then { + // Raise ACE event locally + GVAR(OldPlayerWeapon) = _newPlayerWeapon; + ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); + }; + }, 0, []] call cba_fnc_addPerFrameHandler; [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index a74afd1df7..6a6aa440f7 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -29,3 +29,19 @@ class Extended_Init_EventHandlers { }; }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call DFUNC(handleKilled)); + }; + }; +}; + +class Extended_AnimChanged_EventHandlers { + class CAManBase { + class ADDON { + animChanged = QUOTE(_this call DFUNC(handleAnimChanged)); + }; + }; +}; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index ba9d14af21..da9c6eefd6 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -15,15 +15,5 @@ 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. -["playerChanged", { - private ["_newPlayer", "_oldPlayer"]; - - _newPlayer = _this select 0; - _oldPlayer = _this select 1; - - { - if (_x getVariable [QGVAR(isDragging), false]) then { - [_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); - }; - } forEach [_newPlayer, _oldPlayer]; -}] call EFUNC(common,addEventhandler); +["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 8ab3e36c4d..7a0be053ad 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -13,6 +13,10 @@ PREP(dragObjectPFH); PREP(dropObject); PREP(dropObject_carry); PREP(getWeight); +PREP(handleAnimChanged); +PREP(handleKilled); +PREP(handlePlayerChanged); +PREP(handlePlayerWeaponChanged); PREP(handleScrollWheel); PREP(initObject); PREP(isObjectOnObject); diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 4f40d2b5d6..81b2369624 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -6,13 +6,8 @@ private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; -if ( - !([_unit] call EFUNC(common,isAlive)) // drop if the player is dead - || {!([_target] call EFUNC(common,isAlive))} // drop if the crate is destroyed - || {currentWeapon _unit != ""} - || {stance _unit != "STAND"} // drop when crouching or inside a vehicle - || {!([_unit] call EFUNC(common,isPlayer))} -) then { +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) then { [_unit, _target] call FUNC(dropObject_carry); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 8a27be1584..e741b01f17 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -6,13 +6,8 @@ private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; -if ( - !([_unit] call EFUNC(common,isAlive)) // drop if the player is dead - || {!([_target] call EFUNC(common,isAlive))} // drop if the crate is destroyed - || {!(animationState _unit in DRAG_ANIMATIONS)} // drop if not in dragging anim. This also exits when entering a vehicle. - || {currentWeapon _unit != primaryWeapon _unit} - || {!([_unit] call EFUNC(common,isPlayer))} -) then { +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf new file mode 100644 index 0000000000..b5eb4d4d8f --- /dev/null +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -0,0 +1,31 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_anim"]; + +_unit = _this select 0; +_anim = _this select 1; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + + // drop dragged object when not in valid animation + if !(_anim in DRAG_ANIMATIONS) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); + }; + +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + + // drop carried object when not standing + if (stance _unit != "STAND") then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + +}; diff --git a/addons/dragging/functions/fnc_handleKilled.sqf b/addons/dragging/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..4dcfc77fcd --- /dev/null +++ b/addons/dragging/functions/fnc_handleKilled.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); +}; diff --git a/addons/dragging/functions/fnc_handlePlayerChanged.sqf b/addons/dragging/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..e2dd41021b --- /dev/null +++ b/addons/dragging/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,17 @@ +// by commy2 +#include "script_component.hpp" + +private ["_newPlayer", "_oldPlayer"]; + +_newPlayer = _this select 0; +_oldPlayer = _this select 1; + +{ + if (_x getVariable [QGVAR(isDragging), false]) then { + [_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); + }; + + if (_x getVariable [QGVAR(isCarrying), false]) then { + [_x, _x getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry); + }; +} forEach [_newPlayer, _oldPlayer]; diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf new file mode 100644 index 0000000000..44160b54c1 --- /dev/null +++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf @@ -0,0 +1,31 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + + // drop dragged object when selecting a non-primary weapon + if (_weapon != primaryWeapon _unit) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); + }; + +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + + // drop carried object when selecting any weapon + if (_weapon != "") then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + +}; From 0bc78119124dbe9be4a16e62efd432cbab796f3c Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 15:52:34 +0100 Subject: [PATCH 69/73] don't drag or carry dead objects --- addons/dragging/functions/fnc_canCarry.sqf | 2 +- addons/dragging/functions/fnc_canDrag.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 6d3210776b..13402b53b5 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -_target getVariable [QGVAR(canCarry), false] +alive _target && {_target getVariable [QGVAR(canCarry), false]} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 5b0c578699..9771496aa2 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -_target getVariable [QGVAR(canDrag), false] +alive _target && {_target getVariable [QGVAR(canDrag), false]} From be17e25487a83471d1c436d572ad7cdd900669c1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 16:02:01 +0100 Subject: [PATCH 70/73] handle dc is the same fnc as handle killed --- addons/dragging/XEH_serverInit.sqf | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf index cf3d7caeb9..f6c231d275 100644 --- a/addons/dragging/XEH_serverInit.sqf +++ b/addons/dragging/XEH_serverInit.sqf @@ -1,13 +1,5 @@ // by commy2 #include "script_component.hpp" -// release object on hard disconnection. -addMissionEventHandler ["HandleDisconnect", { - private "_unit"; - - _unit = _this select 0; - - if (_unit getVariable [QGVAR(isDragging), false]) then { - [_unit, _unit getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); - }; -}]; +// release object on hard disconnection. Function is identical to killed +addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}]; From 330fc5658fc97215ad48d9ab34df596fb654b167 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 16:47:04 +0100 Subject: [PATCH 71/73] fake weapon had mass > 0, fix #205 --- addons/common/CfgWeapons.hpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index 5df5d75da8..5da1bff649 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -7,14 +7,22 @@ class CfgWeapons { simulation = "ItemMineDetector"; }; - class Rifle_Base_F; + class Rifle; + class Rifle_Base_F: Rifle { + class WeaponSlotsInfo; + }; + class ACE_FakePrimaryWeapon: Rifle_Base_F { + scope = 2; + displayName = ""; + model = ""; + picture = ""; + magazines[] = {"ACE_FakeMagazine"}; discreteDistance[] = {}; discreteDistanceInitIndex = 0; - displayName = ""; - picture = ""; - model = ""; - magazines[] = {"ACE_FakeMagazine"}; - scope = 2; + + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 0; + }; }; }; From 1071284010e76f332ec2c3cea9d72618b294cf60 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 16:55:57 +0100 Subject: [PATCH 72/73] properly remove fake weapon, fix grabDrag action with fake weapon --- addons/dragging/functions/fnc_dropObject.sqf | 2 ++ addons/dragging/functions/fnc_startDrag.sqf | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 706c27ded9..00aa7a6bca 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -33,6 +33,8 @@ _unit playAction "released"; // release object detach _target; +_unit removeWeapon "ACE_FakePrimaryWeapon"; + // prevent object from flipping inside buildings if (_inBuilding) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 7704722d0d..1e286fb4a4 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -37,6 +37,7 @@ _unit selectWeapon primaryWeapon _unit; // prevent multiple players from accessing the same object [_unit, _target, true] call EFUNC(common,claim); -_unit playActionNow "grabDrag"; +// can't play action that depends on weapon if it was added the same frame +[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame); [FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler; From 4235bd8b912291258b847c33a0f407f291f10905 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 17:57:55 +0100 Subject: [PATCH 73/73] restore lost files? --- .../fnc_actionCheckBloodPressure.sqf | 18 ++++++ .../fnc_actionCheckBloodPressureLocal.sqf | 60 +++++++++++++++++++ .../functions/fnc_actionCheckPulse.sqf | 18 ++++++ 3 files changed, 96 insertions(+) create mode 100644 addons/medical/functions/fnc_actionCheckBloodPressure.sqf create mode 100644 addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf create mode 100644 addons/medical/functions/fnc_actionCheckPulse.sqf diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf new file mode 100644 index 0000000000..7db155483e --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -0,0 +1,18 @@ +/* +* Author: Glowbal +* Action for checking the blood pressure of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ +#include "script_component.hpp" +private ["_caller","_target"]; +_caller = _this select 0; +_target = _this select 1; +[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf new file mode 100644 index 0000000000..f2d01573f0 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -0,0 +1,60 @@ +/* + * Author: Glowbal + * Local callback for checking the blood pressure of a patient + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * NONE + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; + +_bloodPressure = [_target] call FUNC(getBloodPressure); +if (!alive _target) then { + _bloodPressure = [0,0]; +}; + +_bloodPressureHigh = _bloodPressure select 1; +_bloodPressureLow = _bloodPressure select 0; +_output = ""; +_logOutPut = ""; +if ([_caller] call FUNC(isMedic)) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_1"; + _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; +} else { + if (_bloodPressureHigh > 20) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_2"; + _logOutPut = "Low"; + if (_bloodPressureHigh > 100) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_3"; + _logOutPut = "Normal"; + if (_bloodPressureHigh > 160) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_4"; + _logOutPut = "High"; + }; + + }; + } else { + if (random(10) > 3) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_5"; + _logOutPut = "No Blood Pressure"; + } else { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_6"; + }; + }; +}; + +["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); + +if (_logOutPut != "") then { + [_target,"examine", format["%1 checked Blood Pressure: %2", [_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); +}; diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf new file mode 100644 index 0000000000..9fa79b2183 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -0,0 +1,18 @@ +/* +* Author: Glowbal +* Action for checking the pulse or heart rate of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ +#include "script_component.hpp" +private ["_caller","_target","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; +[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */