From dfca7b2f4426ecf049fb6eeac60a44d1ab9a8dfa Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 15 Jul 2015 05:51:13 +0200 Subject: [PATCH 01/56] Split UI configs, Removed Vignette, Initial work on selective UI --- addons/ui/$PBOPREFIX$ | 2 +- addons/ui/ACE_Settings.hpp | 37 +++++++++++++++ addons/ui/CfgEventHandlers.hpp | 11 +++++ addons/ui/CfgVehicles.hpp | 58 ++++++++++++++++++++++++ addons/ui/README.md | 3 +- addons/ui/RscChat.hpp | 15 ++++++ addons/ui/RscVignette.hpp | 4 ++ addons/ui/XEH_clientInit.sqf | 63 ++++++++++++++++++++++++++ addons/ui/XEH_preInit.sqf | 7 +++ addons/ui/config.cpp | 24 +++------- addons/ui/functions/fnc_moduleInit.sqf | 29 ++++++++++++ addons/ui/stringtable.xml | 50 ++++++++++++++++++++ 12 files changed, 284 insertions(+), 19 deletions(-) create mode 100644 addons/ui/ACE_Settings.hpp create mode 100644 addons/ui/CfgEventHandlers.hpp create mode 100644 addons/ui/CfgVehicles.hpp create mode 100644 addons/ui/RscChat.hpp create mode 100644 addons/ui/RscVignette.hpp create mode 100644 addons/ui/XEH_clientInit.sqf create mode 100644 addons/ui/XEH_preInit.sqf create mode 100644 addons/ui/functions/fnc_moduleInit.sqf create mode 100644 addons/ui/stringtable.xml diff --git a/addons/ui/$PBOPREFIX$ b/addons/ui/$PBOPREFIX$ index 601bbd5f60..9b6ac48f4f 100644 --- a/addons/ui/$PBOPREFIX$ +++ b/addons/ui/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\ui \ No newline at end of file +z\ace\addons\ui \ No newline at end of file diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp new file mode 100644 index 0000000000..09bdb47634 --- /dev/null +++ b/addons/ui/ACE_Settings.hpp @@ -0,0 +1,37 @@ +class ACE_Settings { + class GVAR(weaponInfo) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(WeaponInfo); + }; + class GVAR(weaponName) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(WeaponName); + }; + /*class GVAR(ammoCount) { // Disabled in config by ace_reload + value = 1; + typeName = "BOOL"; + displayName = CSTRING(AmmoCount); + };*/ + class GVAR(magCount) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(MagCount); + }; + class GVAR(grenadeName) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(GrenadeName); + }; + class GVAR(grenadeCount) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(GrenadeCount); + }; + class GVAR(zeroing) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(Zeroing); + }; +}; diff --git a/addons/ui/CfgEventHandlers.hpp b/addons/ui/CfgEventHandlers.hpp new file mode 100644 index 0000000000..423993f757 --- /dev/null +++ b/addons/ui/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_clientInit)); + }; +}; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp new file mode 100644 index 0000000000..f918360518 --- /dev/null +++ b/addons/ui/CfgVehicles.hpp @@ -0,0 +1,58 @@ +class CfgVehicles { + class ACE_Module; + class ACE_ModuleUI: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleDisplayName); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + class Arguments { + class weaponInfo { + displayName = CSTRING(WeaponInfo); + description = CSTRING(WeaponInfoDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponName { + displayName = CSTRING(WeaponName); + description = CSTRING(WeaponNameDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + /*class ammoCount { // Disabled in config by ace_reload + displayName = CSTRING(AmmoCount); + description = CSTRING(AmmoCountDesc); + typeName = "BOOL"; + defaultValue = 1; + };*/ + class magCount { + displayName = CSTRING(MagCount); + description = CSTRING(MagCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeName { + displayName = CSTRING(GrenadeName); + description = CSTRING(GrenadeNameDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeCount { + displayName = CSTRING(GrenadeCount); + description = CSTRING(GrenadeCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class zeroing { + displayName = CSTRING(Zeroing); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(ModuleDescription); + }; + }; +}; diff --git a/addons/ui/README.md b/addons/ui/README.md index f11027038f..b3c2b3acb7 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,9 +1,10 @@ ace_ui ======= -Changes the chat contrast on the map to allow easier reading +Changes the chat contrast on the map to allow easier reading, removes vignette and provides settings to toggle different UI elements unavailable in Vanilla. ## Maintainers The people responsible for merging changes to this component or answering potential questions. +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/ui/RscChat.hpp b/addons/ui/RscChat.hpp new file mode 100644 index 0000000000..6b091d73bc --- /dev/null +++ b/addons/ui/RscChat.hpp @@ -0,0 +1,15 @@ +class RscText; +class RscDisplayChat { + class controls { + delete Line; + delete Background; + class CA_Background: RscText { + colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker + }; + }; +}; + +class RscChatListDefault { + colorBackground[] = {0,0,0,0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter +}; diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp new file mode 100644 index 0000000000..118fad96e6 --- /dev/null +++ b/addons/ui/RscVignette.hpp @@ -0,0 +1,4 @@ +class RscPicture; +class RscVignette: RscPicture { + colorText[] = {0, 0, 0, 0}; // Hide Vignette +}; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf new file mode 100644 index 0000000000..fec845d49a --- /dev/null +++ b/addons/ui/XEH_clientInit.sqf @@ -0,0 +1,63 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +// Exit on Headless +if !(hasInterface) exitWith {}; + +["SettingsInitialized", { + // On load and entering/exiting a vehicle + ["infoDisplayChanged", { + LOG("UI infoDisplayChanged"); + + private ["_elements", "_display"]; + + // All elements with their show/hide, IDD and IDC + _elements = [ + [GVAR(weaponInfo), 300, 2302], + [GVAR(weaponName), 300, 118], + //[GVAR(ammoCount), 300, 184], // Disabled in config by ace_reload + [GVAR(magCount), 300, 185], + [GVAR(grenadeName), 300, 152], + [GVAR(grenadeCount), 300, 151], + [GVAR(zeroing), 300, 168] + ]; + + disableSerialization; + { + _display = _x; + { + EXPLODE_3_PVT(_x,_show,_idd,_idc); + + //_idd = 300; //debug + //_idc = 122; //debug + if (_idd == ctrlIDD _display) then { + _show = if (_show) then {0} else {1}; + + (_display displayCtrl _idc) ctrlSetFade _show; + (_display displayCtrl _idc) ctrlCommit 0; + }; + } forEach _elements; + } forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason + }] call EFUNC(common,addEventHandler); +}] call EFUNC(common,addEventHandler); + + +/* +RscUnitInfo = 300 +-------- +Alt = 122 (UNKNOWN) +Ammo = 119 (UNKNOWN) +AmmoCount = 184 (Ammo Count) +MagCount = 185 (Magazine Count) +CA_TextFlares = 151 (Grenade Count) +CA_TextFlaresMode = 152 (Grenade Name) +CA_Zeroing = 168 (Zeroing) +Weapon = 118 (Weapon Name) +WeaponInfoControlsGroupLeft = 2302 (entire Weapon Info without Zeroing and Stance) +WeaponInfoControlsGroupRight = 2303 (UNKNOWN) + + +RscStanceInfo = 303 +------- +StanceIndicator = 188 (UNKNOWN) +*/ diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf new file mode 100644 index 0000000000..7e1c3ec9ed --- /dev/null +++ b/addons/ui/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(moduleInit); + +ADDON = true; diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index e7ea4b32eb..fa10420277 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -6,25 +6,15 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"VKing"}; - authorUrl = "https://github.com/ACEMod/"; + author[] = {"VKing", "Jonpas"}; + authorUrl = "https://github.com/acemod/ACE3"; VERSION_CONFIG; }; }; -class RscText; +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "ACE_Settings.hpp" -class RscDisplayChat { - class controls { - delete Line; - delete Background; - class CA_Background: RscText { - colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker - }; - }; -}; - -class RscChatListDefault { - colorBackground[] = {0,0,0,0.5}; // Make the chat background darker - colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter -}; +#include "RscChat.hpp" +#include "RscVignette.hpp" diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..02d9c2ecbf --- /dev/null +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -0,0 +1,29 @@ +/* + * Author: Jonpas + * Initializes the UI module. + * + * Arguments: + * 0: Module Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + */ +#include "script_component.hpp" + +if !(isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); + +if !(_activated) exitWith {}; + +[_logic, QGVAR(weaponInfo), "weaponInfo"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeName), "grenadeName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeCount), "grenadeCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: UI Module Initialized."; diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml new file mode 100644 index 0000000000..b33c28292d --- /dev/null +++ b/addons/ui/stringtable.xml @@ -0,0 +1,50 @@ + + + + + Weapon Info + + + Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing. + + + Weapon Name + + + Requires enabled Weapon Info + + + Ammo Count + + + Requires enabled Weapon Info + + + Magazine Count + + + Requires enabled Weapon Info + + + Grenade Name + + + Requires enabled Weapon Info + + + Grenade Count + + + Requires enabled Weapon Info + + + Zeroing + + + User Interface + + + This module allows hiding of specific user interface parts. + + + \ No newline at end of file From 7d792f9d1471ba99e25e125be7573524b5c5355d Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 20 Jul 2015 04:50:25 +0200 Subject: [PATCH 02/56] Proper Vignette removal, Fixed stringtable typo --- addons/ui/RscVignette.hpp | 2 +- addons/ui/XEH_clientInit.sqf | 2 +- addons/ui/stringtable.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp index 118fad96e6..1da39c2118 100644 --- a/addons/ui/RscVignette.hpp +++ b/addons/ui/RscVignette.hpp @@ -1,4 +1,4 @@ class RscPicture; class RscVignette: RscPicture { - colorText[] = {0, 0, 0, 0}; // Hide Vignette + text = ""; // Remove Vignette Texture }; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index fec845d49a..d6b0883d4d 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -53,7 +53,7 @@ CA_TextFlares = 151 (Grenade Count) CA_TextFlaresMode = 152 (Grenade Name) CA_Zeroing = 168 (Zeroing) Weapon = 118 (Weapon Name) -WeaponInfoControlsGroupLeft = 2302 (entire Weapon Info without Zeroing and Stance) +WeaponInfoControlsGroupLeft = 2302 (entire RscUnitInfo without Zeroing) WeaponInfoControlsGroupRight = 2303 (UNKNOWN) diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index b33c28292d..daabe80453 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -10,7 +10,7 @@ Weapon Name - + Requires enabled Weapon Info From 94ce49fedc8e37e3f408be0cd43a9d6a152729ca Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 28 Oct 2015 23:23:02 +0100 Subject: [PATCH 03/56] Add selective UI --- addons/ui/ACE_Settings.hpp | 161 +++++++++++++++++- addons/ui/CfgVehicles.hpp | 160 ++++++++++++++--- addons/ui/XEH_clientInit.sqf | 84 ++++----- addons/ui/XEH_preInit.sqf | 3 + addons/ui/functions/fnc_moduleInit.sqf | 25 +-- .../ui/functions/fnc_moduleInitAdvanced.sqf | 42 +++++ .../ui/functions/fnc_setAdvancedElement.sqf | 43 +++++ addons/ui/functions/fnc_setElements.sqf | 44 +++++ addons/ui/functions/script_component.hpp | 1 + addons/ui/script_component.hpp | 72 ++++++++ addons/ui/stringtable.xml | 103 ++++++++--- 11 files changed, 613 insertions(+), 125 deletions(-) create mode 100644 addons/ui/functions/fnc_moduleInitAdvanced.sqf create mode 100644 addons/ui/functions/fnc_setAdvancedElement.sqf create mode 100644 addons/ui/functions/fnc_setElements.sqf create mode 100644 addons/ui/functions/script_component.hpp diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 09bdb47634..53e1496b38 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -1,37 +1,182 @@ class ACE_Settings { - class GVAR(weaponInfo) { +// BASIC + class GVAR(soldierVehicleWeaponInfo) { value = 1; typeName = "BOOL"; - displayName = CSTRING(WeaponInfo); + isClientSettable = 1; + displayName = CSTRING(SoldierVehicleWeaponInfo); + category = CSTRING(Category); }; + class GVAR(vehicleRadar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleRadar); + category = CSTRING(Category); + }; + class GVAR(vehicleCompass) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleCompass); + category = CSTRING(Category); + }; + class GVAR(commandMenu) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(CommandMenu); + category = CSTRING(Category); + }; + class GVAR(groupBar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(GroupBar); + category = CSTRING(Category); + }; + +// ADVANCED + // Upper Weapon Info class GVAR(weaponName) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(WeaponName); + category = CSTRING(Category); }; - /*class GVAR(ammoCount) { // Disabled in config by ace_reload + class GVAR(weaponNameBackground) { value = 1; typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(WeaponNameBackground); + category = CSTRING(Category); + }; + class GVAR(firingMode) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(FiringMode); + category = CSTRING(Category); + }; + + // Lower Weapon Info + class GVAR(ammoType) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(AmmoType); + category = CSTRING(Category); + }; + class GVAR(ammoCount) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(AmmoCount); - };*/ + description = CSTRING(AmmoCountDesc); + category = CSTRING(Category); + }; class GVAR(magCount) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(MagCount); + category = CSTRING(Category); }; - class GVAR(grenadeName) { + class GVAR(grenadeFlareType) { value = 1; typeName = "BOOL"; - displayName = CSTRING(GrenadeName); + isClientSettable = 1; + displayName = CSTRING(GrenadeFlareType); + category = CSTRING(Category); }; - class GVAR(grenadeCount) { + class GVAR(grenadeFlareCount) { value = 1; typeName = "BOOL"; - displayName = CSTRING(GrenadeCount); + isClientSettable = 1; + displayName = CSTRING(GrenadeFlareCount); + category = CSTRING(Category); }; class GVAR(zeroing) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(Zeroing); + category = CSTRING(Category); + }; + class GVAR(weaponLowerInfoBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(WeaponLowerInfoBackground); //todo + category = CSTRING(Category); + }; + + // Stance + class GVAR(stance) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(Stance); + category = CSTRING(Category); + }; + + + // Vehicle + class GVAR(vehicleName) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleName); + category = CSTRING(Category); + }; + class GVAR(vehicleNameBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleNameBackground); + category = CSTRING(Category); + }; + class GVAR(vehicleFuelBar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleFuelBar); + category = CSTRING(Category); + }; + class GVAR(vehicleSpeed) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleSpeed); + category = CSTRING(Category); + }; + class GVAR(vehicleAltitude) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleAltitude); + category = CSTRING(Category); + }; + class GVAR(vehicleDamage) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleDamage); + category = CSTRING(Category); + }; + class GVAR(vehicleInfoBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleInfoBackground); + category = CSTRING(Category); + }; + class GVAR(vehicleGunnerWeapon) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleGunnerWeapon); + category = CSTRING(Category); }; }; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index f918360518..69f28f955e 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -1,52 +1,38 @@ class CfgVehicles { class ACE_Module; + + // Basic class ACE_ModuleUI: ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = CSTRING(ModuleDisplayName); + displayName = CSTRING(ModuleName); function = QFUNC(moduleInit); scope = 2; isGlobal = 1; //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { - class weaponInfo { - displayName = CSTRING(WeaponInfo); - description = CSTRING(WeaponInfoDesc); + class soldierVehicleWeaponInfo { + displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class weaponName { - displayName = CSTRING(WeaponName); - description = CSTRING(WeaponNameDesc); + class vehicleRadar { + displayName = CSTRING(VehicleRadar); typeName = "BOOL"; defaultValue = 1; }; - /*class ammoCount { // Disabled in config by ace_reload - displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); - typeName = "BOOL"; - defaultValue = 1; - };*/ - class magCount { - displayName = CSTRING(MagCount); - description = CSTRING(MagCountDesc); + class vehicleCompass { + displayName = CSTRING(VehicleCompass); typeName = "BOOL"; defaultValue = 1; }; - class grenadeName { - displayName = CSTRING(GrenadeName); - description = CSTRING(GrenadeNameDesc); + class commandMenu { + displayName = CSTRING(CommandMenu); typeName = "BOOL"; defaultValue = 1; }; - class grenadeCount { - displayName = CSTRING(GrenadeCount); - description = CSTRING(GrenadeCountDesc); - typeName = "BOOL"; - defaultValue = 1; - }; - class zeroing { - displayName = CSTRING(Zeroing); + class groupBar { + displayName = CSTRING(GroupBar); typeName = "BOOL"; defaultValue = 1; }; @@ -55,4 +41,124 @@ class CfgVehicles { description = CSTRING(ModuleDescription); }; }; + + // Advanced + class ACE_ModuleUI_Advanced: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleName_Advanced); + function = QFUNC(moduleInitAdvanced); + scope = 2; + isGlobal = 1; + //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + class Arguments { + // Upper Weapon Info + class weaponName { + displayName = CSTRING(WeaponName); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponNameBackground { + displayName = CSTRING(WeaponNameBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class firingMode { + displayName = CSTRING(FiringMode); + typeName = "BOOL"; + defaultValue = 1; + }; + + // Lower Weapon Info + class ammoType { + displayName = CSTRING(AmmoType); + typeName = "BOOL"; + defaultValue = 1; + }; + class ammoCount { + displayName = CSTRING(AmmoCount); + description = CSTRING(AmmoCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class magCount { + displayName = CSTRING(MagCount); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeFlareType { + displayName = CSTRING(GrenadeFlareType); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeFlareCount { + displayName = CSTRING(GrenadeFlareCount); + typeName = "BOOL"; + defaultValue = 1; + }; + class zeroing { + displayName = CSTRING(Zeroing); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponLowerInfoBackground { + displayName = CSTRING(WeaponLowerInfoBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + + // Stance + class stance { + displayName = CSTRING(Stance); + typeName = "BOOL"; + defaultValue = 1; + }; + + + // Vehicle + class vehicleName { + displayName = CSTRING(VehicleName); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleNameBackground { + displayName = CSTRING(VehicleNameBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleFuelBar { + displayName = CSTRING(VehicleFuelBar); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleSpeed { + displayName = CSTRING(VehicleSpeed); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleAltitude { + displayName = CSTRING(VehicleAltitude); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleDamage { + displayName = CSTRING(VehicleDamage); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleInfoBackground { + displayName = CSTRING(VehicleInfoBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleGunnerWeapon { + displayName = CSTRING(VehicleGunnerWeapon); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(ModuleDescription_Advanced); + }; + }; }; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d6b0883d4d..d778fb2746 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,63 +1,41 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" // Exit on Headless -if !(hasInterface) exitWith {}; +if (!hasInterface) exitWith {}; ["SettingsInitialized", { + // Selective UI Basic + call FUNC(setElements); + + // On load and entering/exiting a vehicle ["infoDisplayChanged", { - LOG("UI infoDisplayChanged"); - - private ["_elements", "_display"]; - - // All elements with their show/hide, IDD and IDC - _elements = [ - [GVAR(weaponInfo), 300, 2302], - [GVAR(weaponName), 300, 118], - //[GVAR(ammoCount), 300, 184], // Disabled in config by ace_reload - [GVAR(magCount), 300, 185], - [GVAR(grenadeName), 300, 152], - [GVAR(grenadeCount), 300, 151], - [GVAR(zeroing), 300, 168] - ]; - - disableSerialization; + // Selective UI Advanced { - _display = _x; - { - EXPLODE_3_PVT(_x,_show,_idd,_idc); - - //_idd = 300; //debug - //_idc = 122; //debug - if (_idd == ctrlIDD _display) then { - _show = if (_show) then {0} else {1}; - - (_display displayCtrl _idc) ctrlSetFade _show; - (_display displayCtrl _idc) ctrlCommit 0; - }; - } forEach _elements; - } forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason + _x call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); + + + ["SettingChanged", { + params ["_name"]; + + // Selective UI Basic + if (_name in ELEMENTS_BASIC) then { + call FUNC(setElements); + }; + + // Selective UI Advanced + { + _x params ["_element"]; + + if (_name == _element) then { + _x call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_element); + }; + } forEach ELEMENTS_ADVANCED; + + }] call EFUNC(common,addEventHandler); + }] call EFUNC(common,addEventHandler); - - -/* -RscUnitInfo = 300 --------- -Alt = 122 (UNKNOWN) -Ammo = 119 (UNKNOWN) -AmmoCount = 184 (Ammo Count) -MagCount = 185 (Magazine Count) -CA_TextFlares = 151 (Grenade Count) -CA_TextFlaresMode = 152 (Grenade Name) -CA_Zeroing = 168 (Zeroing) -Weapon = 118 (Weapon Name) -WeaponInfoControlsGroupLeft = 2302 (entire RscUnitInfo without Zeroing) -WeaponInfoControlsGroupRight = 2303 (UNKNOWN) - - -RscStanceInfo = 303 -------- -StanceIndicator = 188 (UNKNOWN) -*/ diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index 7e1c3ec9ed..8a86e3ec32 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -3,5 +3,8 @@ ADDON = false; PREP(moduleInit); +PREP(moduleInitAdvanced); +PREP(setAdvancedElement); +PREP(setElements); ADDON = true; diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 02d9c2ecbf..f4a57831c8 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -12,18 +12,21 @@ */ #include "script_component.hpp" -if !(isServer) exitWith {}; +if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +if (!_activated) exitWith {}; -[_logic, QGVAR(weaponInfo), "weaponInfo"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); -//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload -[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeName), "grenadeName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeCount), "grenadeCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden +if (isArray (missionConfigFile >> "showHUD")) exitWith { + ACE_LOGINFO("User Interface (Basic) Module Failed to Initialize - showHUD overriden in mission config!"); +}; -diag_log text "[ACE]: UI Module Initialized."; +[_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO("User Interface (Basic) Module Initialized."); diff --git a/addons/ui/functions/fnc_moduleInitAdvanced.sqf b/addons/ui/functions/fnc_moduleInitAdvanced.sqf new file mode 100644 index 0000000000..ab5666af69 --- /dev/null +++ b/addons/ui/functions/fnc_moduleInitAdvanced.sqf @@ -0,0 +1,42 @@ +/* + * Author: Jonpas + * Initializes the UI module. + * + * Arguments: + * 0: Module Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "_units", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeFlareType), "grenadeFlareType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeFlareCount), "grenadeFlareCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); + +[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO("User Interface (Advanced) Module Initialized."); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf new file mode 100644 index 0000000000..c87a79ffae --- /dev/null +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -0,0 +1,43 @@ +/* + * Author: Jonpas + * Sets advanced visible element of the UI using displays and controls. + * + * Arguments: + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * + * Return Value: + * None + * + * Example: + * [show, 303, [188] ] call ace_ui_fnc_setAdvancedElement + * + * Public: No + */ +#include "script_component.hpp" + +params ["_show", "_idd", "_elements"]; + + +// Get show/hide boolean from mission namespace if it's a string +if (typeName _show == "STRING") then { + _show = missionNamespace getVariable _show; +}; +_show = [1, 0] select _show; + + +// Disable/Enable elements +{ + local _idc = _x; + + // Loop through IGUI displays as they can be present several times for some reason + { + if (_idd == ctrlIDD _x) then { + TRACE_3("Setting Element Visibility",_show,_idd,_idc); + + (_x displayCtrl _idc) ctrlSetFade _show; + (_x displayCtrl _idc) ctrlCommit 0; + }; + } forEach (uiNamespace getVariable "IGUI_displays"); +} forEach _elements; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf new file mode 100644 index 0000000000..3952d8e337 --- /dev/null +++ b/addons/ui/functions/fnc_setElements.sqf @@ -0,0 +1,44 @@ +/* + * Author: Jonpas + * Sets basic visible elements of the UI using showHUD setter. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_ui_fnc_setBasicElements + * + * Public: No + */ +#include "script_component.hpp" + +//@todo - change to EFUNC(common,showHud) setter + +local _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] + +showHUD [ + _shownHUD select 0, + GVAR(soldierVehicleWeaponInfo), + GVAR(vehicleRadar), + GVAR(vehicleCompass), + _shownHUD select 4, + GVAR(commandMenu), + GVAR(groupBar), + _shownHUD select 7 +]; + +/* +["UIselective", [ + _shownHUD select 0, + _shownHUD select 1, + _shownHUD select 2, + _shownHUD select 3, + _shownHUD select 4, + GVAR(commandMenu), + _shownHUD select 6, + _shownHUD select 7 +]] call EFUNC(common,showHud); +*/ diff --git a/addons/ui/functions/script_component.hpp b/addons/ui/functions/script_component.hpp new file mode 100644 index 0000000000..656228f742 --- /dev/null +++ b/addons/ui/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\ui\script_component.hpp" diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index a0fa713f9f..2a9e582306 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -10,3 +10,75 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +// Elements +#define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] + +// Element, IDD, IDC +#define ELEMENTS_ADVANCED [ \ + [QGVAR(weaponName), 300, [118] ], \ + [QGVAR(weaponNameBackground), 300, [1001, 1008] ], \ + [QGVAR(firingMode), 300, [187, 1203] ], \ + [QGVAR(ammoType), 300, [155] ], \ + [QGVAR(ammoCount), 300, [184] ], \ + [QGVAR(magCount), 300, [185] ], \ + [QGVAR(grenadeName), 300, [152] ], \ + [QGVAR(grenadeCount), 300, [151] ], \ + [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ + [QGVAR(zeroing), 300, [168] ], \ + [QGVAR(stance), 303, [188, 1201] ], \ + [QGVAR(vehicleName), 300, [120] ], \ + [QGVAR(vehicleNameBackground), 300, [1000, 1013] ], \ + [QGVAR(vehicleFuelBar), 300, [113, 1202] ], \ + [QGVAR(vehicleSpeed), 300, [121, 1004, 1006] ], \ + [QGVAR(vehicleAltitude), 300, [122, 1005, 1014] ], \ + [QGVAR(vehicleDamage), 300, [111] ], \ + [QGVAR(vehicleInfoBackground), 300, [1200] ], \ + [QGVAR(vehicleGunnerWeapon), 300, [150] ] \ +] + + +/* +RscUnitInfo = 300 +-------------------- +118 (Weapon Name) ++ 1001 (Weapon Name Background 1/2) ++ 1008 (Weapon Name Background 2/2) + +187 (Firing Mode) ++ 1203 (Firing Mode Background) + +155 (Ammo Type) +184 (Ammo Count) - disabled in config by ace_reload +185 (Magazine Count) +152 (Grenade/Flare Type) +151 (Grenade/Flare Count) +1202 (Lower Weapon Info Background) +168 (Zeroing) + + +120 (Vehicle Name) +1000 (Vehicle Name Background 1/2) ++ 1013 (Vehicle Name Background 2/2) + +113 (Vehicle Fuel Bar) ++ 1202 (Vehicle Fuel Bar Background) + +121 (Vehicle Speed Number) ++ 1004 (Vehicle Speed Unit) ++ 1006 (Vehicle Speed Background) +122 (Vehicle Altitude Number) ++ 1005 (Vehicle Altitude Units) ++ 1014 (Vehicle Altitude Background) +111 (Vehicle Damage) +1200 (Vehicle Info Background) + +150 (Vehicle Gunner Weapon) + + +RscStanceInfo = 303 +-------------------- +188 (Stance) ++ 1201 (Stance Background) +*/ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index daabe80453..e320d3ce39 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -1,50 +1,101 @@ - + - - Weapon Info + + User Interface - - Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing. + + + User Interface (Basic) + + This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable. + + + + Soldier/Vehicle/Weapon Information + + + Vehicle Radar + + + Vehicle Compass + + + Command Menu + + + Group Bar + + + + + User Interface (Advanced) + + + This module allows hiding of specific user interface parts, more detailed than basic. User Interface (Basic) settings will make some of the settings inoperable. + + Weapon Name - - Requires enabled Weapon Info + + Weapon Name Background + + + Firing Mode + + + Ammo Type Ammo Count - Requires enabled Weapon Info + Always disabled on foot by ace_reload. Magazine Count - - Requires enabled Weapon Info + + Grenade/Flare Type - - Grenade Name - - - Requires enabled Weapon Info - - - Grenade Count - - - Requires enabled Weapon Info + + Grenade/Flare Count Zeroing - - User Interface + + Weapon Lower Info Background - - This module allows hiding of specific user interface parts. + + Stance + + + + Vehicle Name + + + Vehicle Name Background + + + Vehicle Fuel Bar + + + Vehicle Speed + + + Vehicle Altitude + + + Vehicle Damage + + + Vehicle Info Background + + + Vehicle Gunner Weapon - \ No newline at end of file + From a064c0c98db5b5e98a82ac0478bbd5d929c916fa Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Mar 2016 12:50:16 +0100 Subject: [PATCH 04/56] Modernize code --- addons/ui/CfgEventHandlers.hpp | 6 ++++++ addons/ui/XEH_PREP.hpp | 4 ++++ addons/ui/XEH_preInit.sqf | 5 +---- addons/ui/XEH_preStart.sqf | 3 +++ .../ui/functions/fnc_setAdvancedElement.sqf | 4 ++-- addons/ui/functions/fnc_setElements.sqf | 21 +++---------------- 6 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 addons/ui/XEH_PREP.hpp create mode 100644 addons/ui/XEH_preStart.sqf diff --git a/addons/ui/CfgEventHandlers.hpp b/addons/ui/CfgEventHandlers.hpp index 423993f757..36c0fca8a3 100644 --- a/addons/ui/CfgEventHandlers.hpp +++ b/addons/ui/CfgEventHandlers.hpp @@ -1,3 +1,9 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp new file mode 100644 index 0000000000..222afadf25 --- /dev/null +++ b/addons/ui/XEH_PREP.hpp @@ -0,0 +1,4 @@ +PREP(moduleInit); +PREP(moduleInitAdvanced); +PREP(setAdvancedElement); +PREP(setElements); diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index 8a86e3ec32..a7feade1c3 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -2,9 +2,6 @@ ADDON = false; -PREP(moduleInit); -PREP(moduleInitAdvanced); -PREP(setAdvancedElement); -PREP(setElements); +#include "XEH_PREP.hpp" ADDON = true; diff --git a/addons/ui/XEH_preStart.sqf b/addons/ui/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/ui/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index c87a79ffae..e5fc66d565 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [show, 303, [188] ] call ace_ui_fnc_setAdvancedElement + * [show, 303, [188]] call ace_ui_fnc_setAdvancedElement * * Public: No */ @@ -29,7 +29,7 @@ _show = [1, 0] select _show; // Disable/Enable elements { - local _idc = _x; + private _idc = _x; // Loop through IGUI displays as they can be present several times for some reason { diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 3952d8e337..1a9ca73399 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -9,17 +9,15 @@ * None * * Example: - * call ace_ui_fnc_setBasicElements + * [] call ace_ui_fnc_setElements * * Public: No */ #include "script_component.hpp" -//@todo - change to EFUNC(common,showHud) setter +private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] -local _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] - -showHUD [ +["ui", [ _shownHUD select 0, GVAR(soldierVehicleWeaponInfo), GVAR(vehicleRadar), @@ -28,17 +26,4 @@ showHUD [ GVAR(commandMenu), GVAR(groupBar), _shownHUD select 7 -]; - -/* -["UIselective", [ - _shownHUD select 0, - _shownHUD select 1, - _shownHUD select 2, - _shownHUD select 3, - _shownHUD select 4, - GVAR(commandMenu), - _shownHUD select 6, - _shownHUD select 7 ]] call EFUNC(common,showHud); -*/ From 9b46e8856e800359503174dff788bdf7c91fad47 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Mar 2016 15:41:17 +0100 Subject: [PATCH 05/56] Merge modules, Add base allow client settings toggle, Add requires descriptions --- addons/reload/RscInGameUI.hpp | 24 -- addons/reload/config.cpp | 2 - addons/ui/ACE_Settings.hpp | 224 ++++++++++-------- addons/ui/CfgVehicles.hpp | 62 ++--- addons/ui/XEH_PREP.hpp | 1 - addons/ui/XEH_clientInit.sqf | 22 +- addons/ui/functions/fnc_moduleInit.sqf | 27 ++- .../ui/functions/fnc_moduleInitAdvanced.sqf | 42 ---- .../ui/functions/fnc_setAdvancedElement.sqf | 18 +- addons/ui/functions/fnc_setElements.sqf | 10 +- addons/ui/script_component.hpp | 8 +- addons/ui/stringtable.xml | 39 ++- 12 files changed, 240 insertions(+), 239 deletions(-) delete mode 100644 addons/reload/RscInGameUI.hpp delete mode 100644 addons/ui/functions/fnc_moduleInitAdvanced.sqf diff --git a/addons/reload/RscInGameUI.hpp b/addons/reload/RscInGameUI.hpp deleted file mode 100644 index 7310690f16..0000000000 --- a/addons/reload/RscInGameUI.hpp +++ /dev/null @@ -1,24 +0,0 @@ - -class RscControlsGroup; -class RscText; - -class RscInGameUI { - class RscUnitInfo { - // Soldiers - class WeaponInfoControlsGroupLeft: RscControlsGroup { - class controls { - class CA_AmmoCount: RscText { - sizeEx = 0; - }; - }; - }; - // Vehicles - /*class WeaponInfoControlsGroupRight: RscControlsGroup { - class controls { - class CA_AmmoCount: RscText { - sizeEx = 0; - }; - }; - };*/ - }; -}; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 6ded1cd687..86ba809a93 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -20,6 +20,4 @@ class CfgPatches { #include "CfgActions.hpp" -#include "RscInGameUI.hpp" - #include "ACE_Settings.hpp" diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 53e1496b38..3e5c53d328 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -1,182 +1,208 @@ class ACE_Settings { + class GVAR(allowSelectiveUI) { + category = CSTRING(Category); + displayName = CSTRING(AllowSelectiveUI); + description = CSTRING(AllowSelectiveUI_Description); + typeName = "BOOL"; + value = 1; + }; + // BASIC class GVAR(soldierVehicleWeaponInfo) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(SoldierVehicleWeaponInfo); category = CSTRING(Category); + displayName = CSTRING(SoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleRadar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleRadar); category = CSTRING(Category); + displayName = CSTRING(VehicleRadar); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleCompass) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleCompass); category = CSTRING(Category); + displayName = CSTRING(VehicleCompass); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(commandMenu) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(CommandMenu); category = CSTRING(Category); + displayName = CSTRING(CommandMenu); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(groupBar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(GroupBar); category = CSTRING(Category); + displayName = CSTRING(GroupBar); + typeName = "BOOL"; + value = 0; + isClientSettable = 1; }; // ADVANCED // Upper Weapon Info class GVAR(weaponName) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponName); category = CSTRING(Category); + displayName = CSTRING(WeaponName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(weaponNameBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponNameBackground); category = CSTRING(Category); + displayName = CSTRING(WeaponNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(firingMode) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(FiringMode); category = CSTRING(Category); + displayName = CSTRING(FiringMode); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Lower Weapon Info class GVAR(ammoType) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(AmmoType); category = CSTRING(Category); + displayName = CSTRING(AmmoType); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(ammoCount) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); category = CSTRING(Category); + displayName = CSTRING(AmmoCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 0; + isClientSettable = 1; }; class GVAR(magCount) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; + category = CSTRING(Category); displayName = CSTRING(MagCount); - category = CSTRING(Category); - }; - class GVAR(grenadeFlareType) { - value = 1; + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(GrenadeFlareType); - category = CSTRING(Category); - }; - class GVAR(grenadeFlareCount) { value = 1; - typeName = "BOOL"; isClientSettable = 1; - displayName = CSTRING(GrenadeFlareCount); + }; + class GVAR(throwableName) { category = CSTRING(Category); + displayName = CSTRING(throwableName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; + class GVAR(throwableCount) { + category = CSTRING(Category); + displayName = CSTRING(throwableCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(zeroing) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(Zeroing); category = CSTRING(Category); + displayName = CSTRING(Zeroing); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(weaponLowerInfoBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponLowerInfoBackground); //todo category = CSTRING(Category); + displayName = CSTRING(WeaponLowerInfoBackground); //todo + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Stance class GVAR(stance) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(Stance); category = CSTRING(Category); + displayName = CSTRING(Stance); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Vehicle class GVAR(vehicleName) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleName); category = CSTRING(Category); + displayName = CSTRING(VehicleName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleNameBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleNameBackground); category = CSTRING(Category); + displayName = CSTRING(VehicleNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleFuelBar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleFuelBar); category = CSTRING(Category); + displayName = CSTRING(VehicleFuelBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleSpeed) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleSpeed); category = CSTRING(Category); + displayName = CSTRING(VehicleSpeed); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleAltitude) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleAltitude); category = CSTRING(Category); + displayName = CSTRING(VehicleAltitude); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleDamage) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleDamage); category = CSTRING(Category); + displayName = CSTRING(VehicleDamage); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleInfoBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleInfoBackground); category = CSTRING(Category); + displayName = CSTRING(VehicleInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleGunnerWeapon) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleGunnerWeapon); category = CSTRING(Category); + displayName = CSTRING(VehicleGunnerWeapon); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; }; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 69f28f955e..1441d97217 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -1,8 +1,6 @@ class CfgVehicles { class ACE_Module; - - // Basic - class ACE_ModuleUI: ACE_Module { + class GVAR(Module): ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; displayName = CSTRING(ModuleName); @@ -11,6 +9,13 @@ class CfgVehicles { isGlobal = 1; //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { + // BASIC + class allowSelectiveUI { + displayName = CSTRING(AllowSelectiveUI); + description = CSTRING(AllowSelectiveUI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class soldierVehicleWeaponInfo { displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; @@ -34,37 +39,26 @@ class CfgVehicles { class groupBar { displayName = CSTRING(GroupBar); typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; - }; - class ModuleDescription { - description = CSTRING(ModuleDescription); - }; - }; - // Advanced - class ACE_ModuleUI_Advanced: ACE_Module { - author = ECSTRING(common,ACETeam); - category = "ACE"; - displayName = CSTRING(ModuleName_Advanced); - function = QFUNC(moduleInitAdvanced); - scope = 2; - isGlobal = 1; - //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); - class Arguments { + // ADVANCED // Upper Weapon Info class weaponName { displayName = CSTRING(WeaponName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class weaponNameBackground { displayName = CSTRING(WeaponNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class firingMode { displayName = CSTRING(FiringMode); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; @@ -72,37 +66,43 @@ class CfgVehicles { // Lower Weapon Info class ammoType { displayName = CSTRING(AmmoType); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class ammoCount { displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class magCount { displayName = CSTRING(MagCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class grenadeFlareType { - displayName = CSTRING(GrenadeFlareType); + class throwableName { + displayName = CSTRING(throwableName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class grenadeFlareCount { - displayName = CSTRING(GrenadeFlareCount); + class throwableCount { + displayName = CSTRING(throwableCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class zeroing { displayName = CSTRING(Zeroing); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class weaponLowerInfoBackground { displayName = CSTRING(WeaponLowerInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; @@ -110,55 +110,63 @@ class CfgVehicles { // Stance class stance { displayName = CSTRING(Stance); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - // Vehicle class vehicleName { displayName = CSTRING(VehicleName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleNameBackground { displayName = CSTRING(VehicleNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleFuelBar { displayName = CSTRING(VehicleFuelBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleSpeed { displayName = CSTRING(VehicleSpeed); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleAltitude { displayName = CSTRING(VehicleAltitude); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleDamage { displayName = CSTRING(VehicleDamage); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleInfoBackground { displayName = CSTRING(VehicleInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleGunnerWeapon { displayName = CSTRING(VehicleGunnerWeapon); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = CSTRING(ModuleDescription_Advanced); + description = CSTRING(ModuleDescription); }; }; }; diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp index 222afadf25..6660470ba8 100644 --- a/addons/ui/XEH_PREP.hpp +++ b/addons/ui/XEH_PREP.hpp @@ -1,4 +1,3 @@ PREP(moduleInit); -PREP(moduleInitAdvanced); PREP(setAdvancedElement); PREP(setElements); diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d778fb2746..23fa19af11 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -5,19 +5,24 @@ if (!hasInterface) exitWith {}; ["SettingsInitialized", { - // Selective UI Basic - call FUNC(setElements); - + // Initial settings + [true] call FUNC(setElements); // On load and entering/exiting a vehicle ["infoDisplayChanged", { // Selective UI Advanced - { - _x call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; + // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified + if (!GVAR(allowSelectiveUI)) then { + { + [_x, true] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; + } else { + { + [_x] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; + }; }] call EFUNC(common,addEventHandler); - ["SettingChanged", { params ["_name"]; @@ -31,11 +36,10 @@ if (!hasInterface) exitWith {}; _x params ["_element"]; if (_name == _element) then { - _x call FUNC(setAdvancedElement); + [_x] call FUNC(setAdvancedElement); TRACE_2("Setting Changed",_name,_element); }; } forEach ELEMENTS_ADVANCED; - }] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler); diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index f4a57831c8..fe0f07709a 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -20,13 +20,36 @@ if (!_activated) exitWith {}; // Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden if (isArray (missionConfigFile >> "showHUD")) exitWith { - ACE_LOGINFO("User Interface (Basic) Module Failed to Initialize - showHUD overriden in mission config!"); + ACE_LOGINFO("User Interface Module Failed to Initialize - showHUD overriden in mission config!"); }; +// Basic +[_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); -ACE_LOGINFO("User Interface (Basic) Module Initialized."); +// Advanced +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(throwableName), "throwableName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(throwableCount), "throwableCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO_1("User Interface Module Initialized. Allow client modifications: %1",GVAR(allowSelectiveUI)); diff --git a/addons/ui/functions/fnc_moduleInitAdvanced.sqf b/addons/ui/functions/fnc_moduleInitAdvanced.sqf deleted file mode 100644 index ab5666af69..0000000000 --- a/addons/ui/functions/fnc_moduleInitAdvanced.sqf +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Author: Jonpas - * Initializes the UI module. - * - * Arguments: - * 0: Module Logic - * 1: Units - * 2: Activated - * - * Return Value: - * None - */ -#include "script_component.hpp" - -if (!isServer) exitWith {}; - -params ["_logic", "_units", "_activated"]; - -if (!_activated) exitWith {}; - -[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeFlareType), "grenadeFlareType"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeFlareCount), "grenadeFlareCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); - -[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); - -ACE_LOGINFO("User Interface (Advanced) Module Initialized."); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index e5fc66d565..21910f0042 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -3,22 +3,29 @@ * Sets advanced visible element of the UI using displays and controls. * * Arguments: - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs + * 0: Element info + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * 1: Force change even when disallowed * * Return Value: * None * * Example: - * [show, 303, [188]] call ace_ui_fnc_setAdvancedElement + * [[show, 303, [188]], false] call ace_ui_fnc_setAdvancedElement * * Public: No */ #include "script_component.hpp" -params ["_show", "_idd", "_elements"]; +params ["_elementInfo", ["_force", false, [true]] ]; +if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) +}; + +_elementInfo params ["_show", "_idd", "_elements"]; // Get show/hide boolean from mission namespace if it's a string if (typeName _show == "STRING") then { @@ -26,7 +33,6 @@ if (typeName _show == "STRING") then { }; _show = [1, 0] select _show; - // Disable/Enable elements { private _idc = _x; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 1a9ca73399..c1bb131db5 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -3,18 +3,24 @@ * Sets basic visible elements of the UI using showHUD setter. * * Arguments: - * None + * 0: Force change even when disallowed * * Return Value: * None * * Example: - * [] call ace_ui_fnc_setElements + * [false] call ace_ui_fnc_setElements * * Public: No */ #include "script_component.hpp" +params [ ["_force", false, [true]] ]; + +if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) +}; + private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] ["ui", [ diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 72f9066f1b..15f0b731b6 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -1,8 +1,8 @@ #define COMPONENT ui #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE + #define DEBUG_MODE_FULL + #define DISABLE_COMPILE_CACHE // #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS @@ -28,8 +28,8 @@ [QGVAR(ammoType), 300, [155] ], \ [QGVAR(ammoCount), 300, [184] ], \ [QGVAR(magCount), 300, [185] ], \ - [QGVAR(grenadeName), 300, [152] ], \ - [QGVAR(grenadeCount), 300, [151] ], \ + [QGVAR(throwableName), 300, [152] ], \ + [QGVAR(throwableCount), 300, [151] ], \ [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ [QGVAR(zeroing), 300, [168] ], \ [QGVAR(stance), 303, [188, 1201] ], \ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index e320d3ce39..21932cb98e 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -4,14 +4,18 @@ User Interface - - User Interface (Basic) + User Interface - This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable. + This module allows toggling visible user interface parts. + + + Allow Selective UI + + + Allow client to modify their UI. - Soldier/Vehicle/Weapon Information @@ -27,15 +31,6 @@ Group Bar - - - - User Interface (Advanced) - - - This module allows hiding of specific user interface parts, more detailed than basic. User Interface (Basic) settings will make some of the settings inoperable. - - Weapon Name @@ -51,17 +46,14 @@ Ammo Count - - Always disabled on foot by ace_reload. - Magazine Count - - Grenade/Flare Type + + Throwable Type - - Grenade/Flare Count + + Throwable Count Zeroing @@ -72,7 +64,6 @@ Stance - Vehicle Name @@ -97,5 +88,11 @@ Vehicle Gunner Weapon + + Requires Soldier/Vehicle/Weapons Information. + + + Modifying User Interface is disabled. + From 64fe944b0fdbf7d7db271a0ea488fb1f6e347b6a Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:12:01 +0100 Subject: [PATCH 06/56] Add public setter function, Optimize some checks --- addons/ui/XEH_PREP.hpp | 1 + addons/ui/XEH_preInit.sqf | 2 + addons/ui/functions/fnc_moduleInit.sqf | 22 ++++---- .../ui/functions/fnc_setAdvancedElement.sqf | 7 +++ .../ui/functions/fnc_setElementVisibility.sqf | 52 +++++++++++++++++++ addons/ui/functions/fnc_setElements.sqf | 2 + 6 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 addons/ui/functions/fnc_setElementVisibility.sqf diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp index 6660470ba8..8a6b4d2ce1 100644 --- a/addons/ui/XEH_PREP.hpp +++ b/addons/ui/XEH_PREP.hpp @@ -1,3 +1,4 @@ PREP(moduleInit); PREP(setAdvancedElement); PREP(setElements); +PREP(setElementVisibility); diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index a7feade1c3..4a5638fc03 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -4,4 +4,6 @@ ADDON = false; #include "XEH_PREP.hpp" +GVAR(elementsSet) = []; + ADDON = true; diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index fe0f07709a..8327b09e72 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -18,18 +18,18 @@ params ["_logic", "_units", "_activated"]; if (!_activated) exitWith {}; -// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden -if (isArray (missionConfigFile >> "showHUD")) exitWith { - ACE_LOGINFO("User Interface Module Failed to Initialize - showHUD overriden in mission config!"); -}; - // Basic -[_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); +if (isArray (missionConfigFile >> "showHUD")) then { + // HUD visibility is hardcoded in mission config and showHUD command is overriden + ACE_LOGINFO("User Interface Module Failed to Initialize Basic settings - showHUD overriden in mission config!"); +} else { + [_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); +}; // Advanced [_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 21910f0042..9e001d7d9c 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -21,6 +21,8 @@ params ["_elementInfo", ["_force", false, [true]] ]; +if (_elementInfo in GVAR(elementsSet)) exitWith {}; + if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) }; @@ -34,6 +36,7 @@ if (typeName _show == "STRING") then { _show = [1, 0] select _show; // Disable/Enable elements +private _success = false; { private _idc = _x; @@ -44,6 +47,10 @@ _show = [1, 0] select _show; (_x displayCtrl _idc) ctrlSetFade _show; (_x displayCtrl _idc) ctrlCommit 0; + + _success = true; }; } forEach (uiNamespace getVariable "IGUI_displays"); } forEach _elements; + +_success diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf new file mode 100644 index 0000000000..f09fe061f1 --- /dev/null +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -0,0 +1,52 @@ +/* + * Author: Jonpas + * Wrapper for setting advanced element visibility. + * + * Arguments: + * 0: Set/Unset (default: true) + * 1: Element info + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * + * Return Value: + * None + * + * Example: + * [false] call ace_ui_fnc_setElementVisibility + * + * Public: Yes + */ +#include "script_component.hpp" + +params [ + ["_set", true, [true]], + ["_elementInfo", [true, 0, []], [[]], 3] +]; + +_elementInfo params [ + ["_show", false, [true, ""]], + ["_idd", 0, [0]], + ["_elements", [], [[]]] +]; + +if (_set) then { + if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_2("Element already set",_elementInfo,GVAR(elementsSet)); }; + + TRACE_2("Setting element",_elementInfo,GVAR(elementsSet)); + private _success = [_elementInfo] call FUNC(setAdvancedElement); + + if (_success) then { + GVAR(elementsSet) pushBack [_idd, _elements]; + }; +} else { + if ([_idd, _elements] in GVAR(elementsSet)) then { + TRACE_2("Unsetting element",_elementInfo,GVAR(elementsSet)); + + TRACE_2("Toggling element",_elementInfo,GVAR(elementsSet)); + [_elementInfo] call FUNC(setAdvancedElement); + + private _index = GVAR(elementsSet) find [_idd, _elements]; + GVAR(elementsSet) deleteAt _index; + }; +}; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index c1bb131db5..71fbfdf945 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +if (isArray (missionConfigFile >> "showHUD")) exitWith {}; + params [ ["_force", false, [true]] ]; if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { From 23e2617db8c97868d888b7f9e7e34e70f083b031 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:40:23 +0100 Subject: [PATCH 07/56] Change params order and improve clientInit --- addons/ui/XEH_clientInit.sqf | 22 +++++----- .../ui/functions/fnc_setAdvancedElement.sqf | 17 ++++---- .../ui/functions/fnc_setElementVisibility.sqf | 33 +++++++-------- addons/ui/functions/fnc_setElements.sqf | 2 +- addons/ui/script_component.hpp | 40 +++++++++---------- 5 files changed, 51 insertions(+), 63 deletions(-) diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 23fa19af11..47fb36cb14 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -12,17 +12,13 @@ if (!hasInterface) exitWith {}; ["infoDisplayChanged", { // Selective UI Advanced // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified - if (!GVAR(allowSelectiveUI)) then { - { - [_x, true] call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; - } else { - { - [_x] call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; - }; + private _force = [true, false] select (GVAR(allowSelectiveUI)); + { + [_x select 0, _x select 1, _x select 2, _force] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); + // On changing settings ["SettingChanged", { params ["_name"]; @@ -33,11 +29,11 @@ if (!hasInterface) exitWith {}; // Selective UI Advanced { - _x params ["_element"]; + params ["_idd", "_elements", "_name"]; - if (_name == _element) then { - [_x] call FUNC(setAdvancedElement); - TRACE_2("Setting Changed",_name,_element); + if (_name == _name) then { + [_idd, _elements, _name] call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_name); }; } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 9e001d7d9c..2ef88d5868 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -3,23 +3,22 @@ * Sets advanced visible element of the UI using displays and controls. * * Arguments: - * 0: Element info - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs - * 1: Force change even when disallowed + * 0: Element IDD + * 1: Element IDCs + * 2: Show/Hide Element OR Element ACE Settings Variable + * 3: Force change even when disallowed (default: false) * * Return Value: - * None + * Successfully Set * * Example: - * [[show, 303, [188]], false] call ace_ui_fnc_setAdvancedElement + * [303, [188], true, false] call ace_ui_fnc_setAdvancedElement * * Public: No */ #include "script_component.hpp" -params ["_elementInfo", ["_force", false, [true]] ]; +params ["_idd", "_elements", "_show", ["_force", false, [true]] ]; if (_elementInfo in GVAR(elementsSet)) exitWith {}; @@ -27,8 +26,6 @@ if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) }; -_elementInfo params ["_show", "_idd", "_elements"]; - // Get show/hide boolean from mission namespace if it's a string if (typeName _show == "STRING") then { _show = missionNamespace getVariable _show; diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index f09fe061f1..d2ec34d7ba 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -1,19 +1,18 @@ /* * Author: Jonpas - * Wrapper for setting advanced element visibility. + * Setter for toggling advanced element visibility. * * Arguments: * 0: Set/Unset (default: true) - * 1: Element info - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs + * 1: Element IDD (default: 0) + * 2: Element IDCs (default: []) + * 3: Show/Hide Element OR Element ACE Settings Variable (default: false) * * Return Value: * None * * Example: - * [false] call ace_ui_fnc_setElementVisibility + * [true, 300, [188], false] call ace_ui_fnc_setElementVisibility * * Public: Yes */ @@ -21,32 +20,28 @@ params [ ["_set", true, [true]], - ["_elementInfo", [true, 0, []], [[]], 3] -]; - -_elementInfo params [ - ["_show", false, [true, ""]], ["_idd", 0, [0]], - ["_elements", [], [[]]] + ["_elements", [], [[]]], + ["_show", false, [true, ""]] ]; if (_set) then { - if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_2("Element already set",_elementInfo,GVAR(elementsSet)); }; + if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_3("Element already set",_idd,_elements,GVAR(elementsSet)); }; - TRACE_2("Setting element",_elementInfo,GVAR(elementsSet)); - private _success = [_elementInfo] call FUNC(setAdvancedElement); + TRACE_4("Setting element",_idd,_elements,_show,GVAR(elementsSet)); + private _success = [_idd, _elements, _show] call FUNC(setAdvancedElement); if (_success) then { GVAR(elementsSet) pushBack [_idd, _elements]; }; } else { if ([_idd, _elements] in GVAR(elementsSet)) then { - TRACE_2("Unsetting element",_elementInfo,GVAR(elementsSet)); - - TRACE_2("Toggling element",_elementInfo,GVAR(elementsSet)); - [_elementInfo] call FUNC(setAdvancedElement); + TRACE_4("Setting element",_idd,_elements,_show,GVAR(elementsSet)); + [_idd, _elements, _show] call FUNC(setAdvancedElement); private _index = GVAR(elementsSet) find [_idd, _elements]; GVAR(elementsSet) deleteAt _index; }; }; + +TRACE_1("Visibility set",GVAR(elementsSet)); diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 71fbfdf945..92cc981065 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -3,7 +3,7 @@ * Sets basic visible elements of the UI using showHUD setter. * * Arguments: - * 0: Force change even when disallowed + * 0: Force change even when disallowed (default: false) * * Return Value: * None diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 15f0b731b6..14392f5af2 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -20,27 +20,27 @@ // Elements #define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] -// Element, IDD, IDC +// IDD, IDC, Element (must be string to compare to changed setting name) #define ELEMENTS_ADVANCED [ \ - [QGVAR(weaponName), 300, [118] ], \ - [QGVAR(weaponNameBackground), 300, [1001, 1008] ], \ - [QGVAR(firingMode), 300, [187, 1203] ], \ - [QGVAR(ammoType), 300, [155] ], \ - [QGVAR(ammoCount), 300, [184] ], \ - [QGVAR(magCount), 300, [185] ], \ - [QGVAR(throwableName), 300, [152] ], \ - [QGVAR(throwableCount), 300, [151] ], \ - [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ - [QGVAR(zeroing), 300, [168] ], \ - [QGVAR(stance), 303, [188, 1201] ], \ - [QGVAR(vehicleName), 300, [120] ], \ - [QGVAR(vehicleNameBackground), 300, [1000, 1013] ], \ - [QGVAR(vehicleFuelBar), 300, [113, 1202] ], \ - [QGVAR(vehicleSpeed), 300, [121, 1004, 1006] ], \ - [QGVAR(vehicleAltitude), 300, [122, 1005, 1014] ], \ - [QGVAR(vehicleDamage), 300, [111] ], \ - [QGVAR(vehicleInfoBackground), 300, [1200] ], \ - [QGVAR(vehicleGunnerWeapon), 300, [150] ] \ + [300, [118], QGVAR(weaponName)], \ + [300, [1001, 1008], QGVAR(weaponNameBackground)], \ + [300, [187, 1203], QGVAR(firingMode)], \ + [300, [155], QGVAR(ammoType)], \ + [300, [184], QGVAR(ammoCount)], \ + [300, [185], QGVAR(magCount)], \ + [300, [152], QGVAR(throwableName)], \ + [300, [151], QGVAR(throwableCount)], \ + [300, [1202], QGVAR(weaponLowerInfoBackground)], \ + [300, [168], QGVAR(zeroing)], \ + [303, [188, 1201], QGVAR(stance)], \ + [300, [120], QGVAR(vehicleName)], \ + [300, [1000, 1013], QGVAR(vehicleNameBackground)], \ + [300, [113, 1202], QGVAR(vehicleFuelBar)], \ + [300, [121, 1004, 1006], QGVAR(vehicleSpeed)], \ + [300, [122, 1005, 1014], QGVAR(vehicleAltitude)], \ + [300, [111], QGVAR(vehicleDamage)], \ + [300, [1200], QGVAR(vehicleInfoBackground)], \ + [300, [150], QGVAR(vehicleGunnerWeapon)] \ ] From e90ef30904cd4ea73f03be9d81ef82d5ce06a8cd Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:42:37 +0100 Subject: [PATCH 08/56] Add return value to public setElementVisibility function --- addons/ui/functions/fnc_setElementVisibility.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index d2ec34d7ba..b019c4c081 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -25,6 +25,8 @@ params [ ["_show", false, [true, ""]] ]; +private _return = false; + if (_set) then { if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_3("Element already set",_idd,_elements,GVAR(elementsSet)); }; @@ -33,6 +35,7 @@ if (_set) then { if (_success) then { GVAR(elementsSet) pushBack [_idd, _elements]; + _return = true; }; } else { if ([_idd, _elements] in GVAR(elementsSet)) then { @@ -41,7 +44,9 @@ if (_set) then { private _index = GVAR(elementsSet) find [_idd, _elements]; GVAR(elementsSet) deleteAt _index; + _return = true; }; }; -TRACE_1("Visibility set",GVAR(elementsSet)); +TRACE_2("Visibility set",_return,GVAR(elementsSet)); +_return From 70100825cf23de1ca2d0ef9ffb4528b420fa1994 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:49:19 +0100 Subject: [PATCH 09/56] Fix params in clientInit --- addons/ui/XEH_clientInit.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 47fb36cb14..97cc3e026b 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -29,11 +29,11 @@ if (!hasInterface) exitWith {}; // Selective UI Advanced { - params ["_idd", "_elements", "_name"]; + _x params ["_idd", "_elements", "_elementName"]; - if (_name == _name) then { - [_idd, _elements, _name] call FUNC(setAdvancedElement); - TRACE_2("Setting Changed",_name,_name); + if (_name == _elementName) then { + [_idd, _elements, _elementName] call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_elementName); }; } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); From 32c32b6cc556385d4854440b9f805e51e8ee30d3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 9 Mar 2016 18:58:46 +0100 Subject: [PATCH 10/56] Add stamina bar selective UI --- addons/ui/ACE_Settings.hpp | 9 +++++++++ addons/ui/CfgVehicles.hpp | 8 ++++++++ addons/ui/functions/fnc_moduleInit.sqf | 1 + addons/ui/script_component.hpp | 6 ++++++ addons/ui/stringtable.xml | 3 +++ 5 files changed, 27 insertions(+) diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 3e5c53d328..89ddc8d35d 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -139,6 +139,15 @@ class ACE_Settings { isClientSettable = 1; }; + // Stamina Bar + class GVAR(staminaBar) { + category = CSTRING(Category); + displayName = CSTRING(StaminaBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; // Vehicle class GVAR(vehicleName) { diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 1441d97217..ccd79684f5 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -115,6 +115,14 @@ class CfgVehicles { defaultValue = 1; }; + // Stamina Bar + class staminaBar { + displayName = CSTRING(StaminaBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + defaultValue = 1; + }; + // Vehicle class vehicleName { displayName = CSTRING(VehicleName); diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 8327b09e72..10f18f94f3 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -43,6 +43,7 @@ if (isArray (missionConfigFile >> "showHUD")) then { [_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(staminaBar), "staminaBar"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 14392f5af2..e9051beeac 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -32,6 +32,7 @@ [300, [151], QGVAR(throwableCount)], \ [300, [1202], QGVAR(weaponLowerInfoBackground)], \ [300, [168], QGVAR(zeroing)], \ + [305, [193], QGVAR(staminaBar)], \ [303, [188, 1201], QGVAR(stance)], \ [300, [120], QGVAR(vehicleName)], \ [300, [1000, 1013], QGVAR(vehicleNameBackground)], \ @@ -86,4 +87,9 @@ RscStanceInfo = 303 -------------------- 188 (Stance) + 1201 (Stance Background) + + +RscStaminaBar = 305 +-------------------- +193 (Stamina Bar) */ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 21932cb98e..42e7932411 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -64,6 +64,9 @@ Stance + + Stamina Bar + Vehicle Name From 89924e927a53520c643402d5b73f09ce803623ad Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 14 Mar 2016 17:25:20 +0100 Subject: [PATCH 11/56] Disable debug --- addons/ui/script_component.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index e9051beeac..a7410a49b8 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -1,8 +1,8 @@ #define COMPONENT ui #include "\z\ace\addons\main\script_mod.hpp" - #define DEBUG_MODE_FULL - #define DISABLE_COMPILE_CACHE +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE // #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS From c568c18865102bf28cdada9b13f472995a859e51 Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 14 Mar 2016 19:14:52 +0100 Subject: [PATCH 12/56] Add module icon --- addons/ui/CfgVehicles.hpp | 2 +- addons/ui/README.md | 4 ++-- addons/ui/UI/Icon_Module_UI_ca.paa | Bin 0 -> 5625 bytes .../Icon_Module_png/Icon_Module_UI_ca.png | Bin 0 -> 2999 bytes extras/assets/icons/Icons_Modules.psd | Bin 2357207 -> 2371272 bytes 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 addons/ui/UI/Icon_Module_UI_ca.paa create mode 100644 extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index ccd79684f5..24340db031 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -7,7 +7,7 @@ class CfgVehicles { function = QFUNC(moduleInit); scope = 2; isGlobal = 1; - //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { // BASIC class allowSelectiveUI { diff --git a/addons/ui/README.md b/addons/ui/README.md index 7fac3a4946..c55ffbc5c7 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,7 +1,7 @@ ace_ui ======= -Removes vignette, changes the chat contrast on the map to allow easier reading and provides settings to toggle different UI elements unavailable in Vanilla. +Removes vignette, changes the chat contrast on the map to allow easier reading and provides settings to hide or show different UI elements. ## Maintainers @@ -9,4 +9,4 @@ Removes vignette, changes the chat contrast on the map to allow easier reading a The people responsible for merging changes to this component or answering potential questions. - [VKing](https://github.com/VKing6) -- [Jonpas] (https://github.com/jonpas) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/ui/UI/Icon_Module_UI_ca.paa b/addons/ui/UI/Icon_Module_UI_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..f23b8b40c9eaa9a2aedc73f5de9adfb4e42814a7 GIT binary patch literal 5625 zcmeHLPe>F|82?r_Rxc${AxJsO(jn~HDcH9Jt}BIyLhKT$$CB{k(S0Rkfz+@ObV$5+ z5)TWVW}=gax)#|%DCoLbU=C^H!4=k z(17sQpJHvqZpjNkbmZ|i@}SG5+u&WcAH~W1@I6Z(xcPE5hO=ci+f09||Hu&cCn-O! zPgLWW`47r2Xy=aciN;eh8~EinEob6h)L z$k75b`~QCa(SNka#1F8z(r~N#SNV_2!<5D3x5N}cJ3d(a!%@8xl`c!3i}l|$zKYxC zr+=FBr{|06C9C*MB(C=fMk2}?msZTCX@mI52 z-_Gmp{fFdNjeVS-%in9<7(lE?Ym#fkZymahXwcfbM2g7mQAD)ra8?LrKby&Ch^ zaF9g#)~D$qwvN#tb8{P+qZ={$vAP)xVHB-4mtLhF*AJUP3;no0HfH#-NNqFH95cut zSomr5qrJ;{>$OD4%5%TAWZGEB+ElNFK^9#5HHNQG;@la>lAol<^((q{>2;0U^*^j%loPGT=CCk+@KbwgLm$YpVs2o*9wdIo zAz^rteVop5H+~AlkBkBfXkv78LNAlvR%Ll>rl7GSE35srCxaRzf8YA(abvdd?`EJp zX~N+6GXv%FK#%5k{I#=)g~r0inPKshsdO2-eEhWs?+BOXKI5&i;*R)3x2!Sbcn@C& z_v^$ShQV=5eOnj48_fATp_4v~eiROMjz4=dH#@Sb@oj(c c&HD%EM>NjjM8$ZDm9-bsHx^Inzm>JW0G*1dMgRZ+ literal 0 HcmV?d00001 diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png new file mode 100644 index 0000000000000000000000000000000000000000..e69102a216a99605b99cecef622f09bc0f1afb14 GIT binary patch literal 2999 zcmV;o3rO^dP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002uNkl^9t6u{dZdFP)c0sznh!XtSv$Tkrm0)?hQD&WI)K>G-Ib$K%l(gOeh;BRAz zzavHk002O-g^;NL003y+14IP?06^;=u<9CI!Q0OK4ix|Z00000000000000000000 z006K9z?0vX0f@e>u9G6*%x8a$JugW)>)DU2fU-}Qu0+{Yb%2?J&`CW&FSDN_HY=N8 tiRqD*V0Qpsk|F{C^d3I|009600|4I#8k=$v3e^Ar002ovPDHLkV1l;Pfg1n- literal 0 HcmV?d00001 diff --git a/extras/assets/icons/Icons_Modules.psd b/extras/assets/icons/Icons_Modules.psd index 553449898aaed4cb6dce26e0cbd677c500206448..0da44ea68106022ee9fa90f40c6db5af943219c0 100644 GIT binary patch delta 6738 zcmc&&3s@9Kwyx?KU_?Y^d_;xV1QcBZGd)kxL_mc2enbgIBQWv`2*}gN_2R5I4|1cc z#)+vluB&d$-2`3HjHJ~Y9d%t}b~jPftcivIf>9U*MtKMf^gZ3vJ$j9sc)y#^rN6)D zoT^jjRQ*+_s+ub;oAJ4-EqDv)Ut@9%KkrYeN~`LMCD&!%Woa$?#*8LHTg$1U17( zH7gfU*25l&6cs<+vfgtt|8vswEvuhmH$`hBw2U@Jt7X)&(Xo1liI@_hkJIXO(V94e zfzeE154I^k@%ULYa^ap*|ETb!hEvY48V0Y{TF*=!g9ii)S+BrImgNb8#~tQ|POF0}Q57Rc+2#W!IX<@J$uY{CY) z*_T5HY)hH4;;!e%zkBgqRoZVmEB-L2@@UIpW5dvwYz|BN+t)_LFFJDmP`!R*&Poz- z=Ff}&v7z^?f)ze*$*!#*d@bIYxA8wa3;N9{zjXJdFI&2ls^J(RcIP<~9!P=uuVn6?WO~CH>dof;lHX>&^f3{w3tngwOZy+|yCHcH}G3 zlU7asN6+!Hg(bz^4VDEf&Nj?CM!vc>;q&8Ps#oqTPy5g|jSdP-okI0SYSPA?`*lJ6 z*pRn;pZ=h2tJ#wMO1OFERnqlQNm*xYpE=}SIam3^*6CyR-);F*?^+I>Ik2jCIfo(_ zes;c*L(b!u%&k?UyBr%XO+L<{>j{(kDmb*OEHR_q+?Uv3yO+D!dG9X?@AYLRX7p`X zyOTpjF@KG0+uLcYGxkM)z@Y(F4n6;UdGA!-^T6I!;CV6gk$Gcvm*-}u;k>i+-)!wl z4*4C4Y_E3qX1&FsqjkL=Hr!jTPGjxO$_g}eO>Xj zcj5anG1t~~+?RT}QM2w~{nD9r z#VhsAnXetmO}VqdylzW;Gj&GOdUnYszwc_l2vb_ThE2-}3+GUEL{ipv(ks6AFhC4YWx^DQFp= z@yIhT+mw=)x-fRpLeR!Qn+JVsALTpvah#JA{wi#Z8ALuzH*|-~OzNpL%cW z2Tety>`zPuc$ih&{GwQ(w&0wh*4-^CQI8SGWF0Ot>t7bsz`LTF3)Zyti@VcA>({Kq z+ZT%RyVm@UR8cMy?0P!qiTVla{I08%(7pPLR>rwVEWatZ&+il6_gWma!PWroIal=! zzltO*&iIWn>>-Rr|2HP_{@F<~JXN%uCya~TA;%NNl2kAW*jnYm_IhBAShj`_M}{k~ zE8dMwf*YH{9b^wX*xRjC2-dMalJ#E&>)Sp!%u5)_jT#a-1kbn7-+Nec+O?!?2>zR^ zqML7tFOsNWyk02z!Iy74bTrKSAV35_jpY2Pf^}q`4AYjkk7#6YZj#wWSUqrj*sZy{ zeT$-Iy|H`G)gL~w^c@NDkfC@q-LlD&O8krQFf6yM$Q??i6=SUo%Gq_r_$#?WrwvmZ zj1fkw?L?`Jy;g!xj~oG~5S&k7!)HSFnoP(9BnRBE)Ku>Y;g=y#QCApBO5m;f_ZC8gw2L;pY;@nIy{b#N(3!w^AigW5R-_){s%ZhH#9DSIeqjgQK!$4M*b_|N66 z?oqxUD`#2A+3lV#O1={)i42w~x#L>PRl&GfCRj9hv6bVnm~#yyglYoS-fZNrqzq_K z0g*%5-%r3LVxw3#P$jM9hQ)j>f!hA${C<3z#4}>Fh84mD^fFk?$%fb2C0Z%b8ny|2 z`=eg6E+foKIG9~vz&ck>HQ3nS7~P$?AebMGkj(4Z=!y7M(efT!J_(DPcB3~t^m!>{ z<0!UpvJ|pWZJFN{%;G4?X=4mKGa8G#Oyf&Jgwhx>LSv?jjihP7hH9!rQez2Q5-SC6 z+{D`B+_Cn!*o6jjT>WZ1{D6x~(;=`xdgD2E#7v35#&6sS{u@B_P)Ba=YO>*S3cVl>C=E?Su1!9)pH3&#ile4k3!rD%R~pQ_mT;69a( zbZ|$|JZdlbh4v}_j`E{>%j4}+-|vz3DF-XeK+?w&Cx3UZPS&eTTK$geZ2UfHF*@4s zo4~ds9@cjh?1%$Wa^4AGOUrSM>uzv|VRJr_8sAAKU`DeytvF_e*&991!l8%#*!_c;vxT+3J-ELgz{s5)rZ5DQ;TcJ;!LVD za2l+rWvBq&t6+7#2)`Mq7-hrFw_rT2VrT>Fn?)5Uu$En4K<$%}k=fKBqRORwyw$YI zKtJ~!J$W)|$)ZM(xofHZzJ> zo4=9@#3cD3m8#Iw;FK}Y1n&fg%lA>SBzY(GjIW+%Xq7gchEEZdUQ15xry@z;Mk>ieDZS_*xoRpDg)HcCnMuclN)y_(w9 zUuC4zP1%KM{76n_QbSm%dSMvc=r(Pq!r*8AUg~+0yqOxHU^HP78b+@p7dBHveAHnO zS1PgXg@KoErY3rcMWkgjHNmaWTPWJC#BHHQyM2ASg9_|NezTogGVb&*|V1# z?pDBYf?GLMPK|RbHRV)*Tgm(Iz5*`a@8_=h1-wBAD-QgE9ei&G6(!tvqjyl}vJ_SlxX~MEosQPhpoag*>myr5{K(9p57QZRM&ti-&M3r03!e+0iyu^fB?YLfYAUN5D0k2GAK@` z9;~Gv?%z*-nV0UXpa3#}9N+=)1b6`yfPMgPK!1P_U;w}uFc2^ZFc{#+?yFE<(U5ia zAPY%8i#?6L=y9L>=MaS`GN&mh=3nfAopU?L51UUR{&B!TART*-C#jhs@DmOAP`ngZ z`1|Ll1GR#Qbb|8Q{UemuT!*LwwTQ>412u~WsRP{>k5UJ+yAD$r8nDY=Xbn;V(JuknAS7wg{4o-&36Mko>lw0Fu`hG=yww3;M=OgUbN>Um CuzYm@ delta 6401 zcmcInd0Z3M_P=)mh;>C=Dq8|#)mNhlA%H7&p<374pHI}f4U1601*)yKVys;Ti-;O@ zpr~N2T3a`acBE8st83M21*}vkiy}+F0AUNseP<>aq|2v2|9H>wz&-c-z2}^J?l*VH zwMW}2`LA|Ch6USl0GhXSW-;CE@9|s+|pUx6LY{(-?u`%`;x> ztMkBm+*2)A_{)9#W-EP1!he-g>nid4%cPE$WZCJ;95X1HLJ>3~KpmtW;jdB!sg=qA z)%bA}CX62+q*C~*eEijHwXv6r?p&7?`~RPs;UG~v|G9uy6-w>CZd0_sFX^Il?zLRS z?G2KQ!reTD(kZ@lbeoOAoo=&=(b&$>P9aQ1X!lKeTYF+sS7#&;<-)83!tnc+w)^Bk zy2Q!bdJMcPfL(deF%*9A@M|_Zj}RZraguKQ+ypyK1VN=~`8hv_Xi_6A?3~t!{Pd%7 z!SXX}=ceqMub+AHeBP1<%U+cijPk_T(%M ztV<&(JT|c5%WFoSP9Jk*Ls;38g#AxH z=vzHHy}9W03WClD56L~39T#2Ef5qinmoJBJoVvi3j!H8bv-6wODz_us9VaXs*${Tq zqi6SNse_$7Gg?v!(tfcpKr^H9fMuC<*_{p2@;c4u1d+Q>b`{;XB+i^yHSOxPe2;^! zMpM27-OG@nl>5b@>^R?%kFP)7n4pH{^ zil}=~@)*UE~+~M-x$Se8WF9aPu_U(T2f(uXc!;3VV0uS_j za>BAi(sFQAlYdr3NZh>E%se00{2|{wI9<5^@cPV837VFbJ0?5lC(W0}%*J5{Omm-f zt-XKqy|_>E^_HA(D>b9C>&@!dV-r_hDLr&#YQtBRA)nNKzGjSOPUxcey*ZE8YX^M0 zhFLQxyddt#t*D<;Wv9;*jRY;t zQ?9vPu~6AELHQs#dvO1LeSObODqopcz{-uKl?1(A*|K_+)2;8nNGTa|?`-<(ixxFm zb~b8$e(+WQ&=Hr$b@#|=8tU`7JgM)(88b#^1XhfV-SJ!NRb$BQj}kYnJT-6o&PrF8 zq72Vldw1oXE_wsb+_d{d?$_5Q&%N(EsPp&*KD{UDHRRrt9oh?v`)kt|IcYd!5C1`` zO7qI=ny)MOR;Da*43)UPJtiZr&)uQj6O5W~RxcQy8B+dcYZH6x%$;HEq?)C9MYn>@ z9%l)9R~gvY_l~)CcKOAy$zGccs|_(%-6npycH{mdn%X_~cgzv3w`Ptz`Ehvn9R1MD z{ZShe59|%hpYM^hh@h;LbW@iIi>B$w*rP@-%eM>r{F*jn%-Sm#uiV}8Wb^5ZH>aMR zc2hHY;FbyTG3hg#C*O!ok**k&aNyYw<@uT;?t#Zb8wyVR_I_|xmv7cGitL{Yvg_jt zH0sy{sOyRjPD0b%$iTJut>f0ky38}yac+N;ZffB)%yV*G2E&@cx*v-IZ2rH&FVQ|O7DDE_ ztQA5gmQ2L23H0xT3+2t|X<=|(l&y*mod%bL#M@WlN2>$ELgXsdhyb}#8LpO(P^wh& z(14JD09v8;^YdG(b1JLD8eh0p{1A=QC;)|_5F|$`ct(IHM@o3Y0g;2R6z1h96p#?G z09c~{%ujfhLRN$vRz=gH;bF6b=FSFhAhO2xM@x}E@Kt{o+xta=vm1kOt1hElYG>_H zgU};=)lh4XT>I&y`qj3vlEwD8ukLuwTegWAK<=Y+dp6wWzoVOF2(yhDz)G}x>aERn zJqWH$7t}D>24B@_jkB#|H!M)^G+C)`GJ*Pj^P4t!tl;ZgzNdr|-R9|zw#~I+{F#+# z^%mRGodR_ydCdlAo-V+)(|5bUQ`sI8Y~xn2bU*CPWlOM)?e4(A{%l#@`6}G`H;p~F z&H?*a1GZ+Ece>$WorHb3-(>gn z#B5?X?%i!E8j7QcmM+~MiCOk!muaoSnf zrZ11f9Kg1N@_5L`SM&k&B83VGgkaqc=qNB-W7Z0DYwF~$hJq%Dc0t4?}^2EMsW6P#o|0S zSerZU16u;mJyw3j2kjBEIn{dcbLW|B&^Akh<)s4+Ie}};eD?Gq~v)?RkegJ_?mj$Yfn~;WWuQ~7S z+(*0dZsFaSJMlwyz(stHm3P7$gip=HLo6&VVJBU-<(hcg+K~Foa6ZCi6XfuZmrd9| zUN-Mv`Rip9_IDS;f9bN}->83i%f8rUlW{}5Y=XRn{(IiD^(1JbRkPRci5d?I;riVd zH5e4f!3AQwY=Y9bf;{m97nH@l@c{pBeQ^clbHfY7HLs6jfd=>2Z+OBKZp9F4SQIs_ z8@o4|YSL!>+?VUIi|X&lIvk*AR#Qwp;B-~ga*DmZk8)t=rc%Aw6T4tkd70|Vjr@}O z5VJ@2*d}oRYuH0MvkMMUJ6X*kDu@gGntHh}d*&&%+{Z^fOs()!`pAYW)iVEKYL&vr z7sj%;Wr|@6nY=8nvzyELQ|5{MhtDs$aWvwvY;LcU+68!R^kJBFeqpS<%r6tfUm&uw2UE z$R_;qzX-gnb9>_dMzN#*c%U~W6XEsAe=&_-5#@tC{Tzk2sgsI|e&=-_qF(5aO(wgp z7nn0xZ?HaKeZl&Hy$seL%mvI9%ni&P%mYjcCIj;X^Ww7W2ITvwh5U%x`se)r{0Bu& zEw#G6)PKAVnBY1JOaf*HW)J27)(OlJtTWh4U|qnvf^`Gy4%P##Czul(T-R&3@b#bF zHPAb0Qg_rlJV3|8d0rP-Fl08a<#+zQ$fJRO7}$-frxMLEgRD-GjUzsEU!J@0RcGf_u&q!g|M#yIns;ZUXEJ+)}|EdSpUI8j5L0wn%{BB-~0B(vzIPiaEecBB?y(hRnozS%DZl{!qr4#t|G;HfeVht zuK2lgDXIya&SDrnmpjDU8EcAZ$B)jGwV11~CWltir8JJd2_ks>Q59WA<26q~1TD$c z^kW*oQwkzz*`%ipbf=JA*Git;JGjhDqtj+$-*Sdoul>bLaCvAAT}R^&ia{FnJ861( z3rM4GLmQ2b!GWaK(DgKqGxE~Npws!8Rt=5r!7<*cp&Mu%UST1f3-%?StS7|8-iNjI zp{+F94g>>FKwrYtnGg$&V=6!?k6LK77NUgI0%n&_$kR~B^f@3;0QneJS@>0wMnbYo zG!AJ5WF5rQ0a7U-W}+ddV5S~4bsrYv51RqIBw*Eq6qsoAA!zFUTAB{g8Xy%TlyLz_ zX=d6X9CAK8e7X(x^Z3_iZ3NxZL%z-*SqL$IuZc}6v=GTLI^-HOu4Waa2{A$gP&P>K zX-sr<%w3S4M!#tp)E0Z6hj8dM&|Y;LO{FvtBXp7q*MMpr64u4ufo} zO9`n4?ZIJCvFG#tID_IqdmS0;Dh(YOwKPfg v{Ebg*oe&B;X6WEU<%!p=Ft5EvV$cg*a4u~&Ja From dc1af390cdf70459f284a44860b7b531c0e3390b Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 28 Mar 2016 18:44:30 +0200 Subject: [PATCH 13/56] Allow custom texture for tagging (only direct function call) --- addons/tagging/CfgVehicles.hpp | 2 +- addons/tagging/functions/fnc_createTag.sqf | 18 ++++++++++++------ addons/tagging/functions/fnc_tagDirection.sqf | 6 +++--- addons/tagging/functions/fnc_tagGround.sqf | 6 +++--- addons/tagging/functions/fnc_tagWall.sqf | 6 +++--- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index 602ee41d33..ac0b82147c 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -98,4 +98,4 @@ class CfgVehicles { MACRO_ADDITEM(ACE_SpraypaintGreen,5); }; }; -}; \ No newline at end of file +}; diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index fdb2cd08b0..81758f8bdb 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: Position ASL * 1: Vector dir and up - * 2: Colour of the tag (valid colours are black, red, green and blue) + * 2: Colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * 3: Object it should be tied too * * Return Value: @@ -19,15 +19,21 @@ #include "script_component.hpp" -params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object"]; -TRACE_4("createTag:", _tagPosASL, _vectorDirAndUp, _color, _object); +params ["_tagPosASL", "_vectorDirAndUp", "_colorTexture", "_object"]; +TRACE_4("createTag:",_tagPosASL,_vectorDirAndUp,_colorTexture,_object); -if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { - ACE_LOGERROR_1("%1 is not a valid tag colour.", _color); +private _customTexture = [true, false] select (_colorTexture find ".paa" == -1); + +if (!_customTexture && {!((toLower _colorTexture) in ["black", "red", "green", "blue"])}) exitWith { + ACE_LOGERROR_1("%1 is not a valid tag colour.",_colorTexture); }; private _tag = "UserTexture1m_F" createVehicle [0,0,0]; -_tag setObjectTextureGlobal [0, '\z\ace\addons\tagging\UI\tags\' + _color + '\' + str (floor (random 3)) + '.paa']; +if (!_customTexture) then { + _tag setObjectTextureGlobal [0, "\z\ace\addons\tagging\UI\tags\" + _colorTexture + "\" + str (floor (random 3)) + ".paa"]; +} else { + _tag setObjectTextureGlobal [0, _colorTexture]; +}; _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; diff --git a/addons/tagging/functions/fnc_tagDirection.sqf b/addons/tagging/functions/fnc_tagDirection.sqf index 2c03d97fd0..9dbb65f68e 100644 --- a/addons/tagging/functions/fnc_tagDirection.sqf +++ b/addons/tagging/functions/fnc_tagDirection.sqf @@ -6,7 +6,7 @@ * 0: Unit * 1: Start position ASL * 2: End position ASL - * 3: The colour of the tag (valid colours are black, red, green and blue) + * 3: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * Sucess @@ -19,7 +19,7 @@ #include "script_component.hpp" -params ["_unit", "_startPosASL", "_endPosASL", "_color"]; +params ["_unit", "_startPosASL", "_endPosASL", "_colorTexture"]; // Check for intersections below the unit private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, _unit, objNull, true, 1, "GEOM", "FIRE"]; @@ -102,6 +102,6 @@ _unit playActionNow "PutDown"; // Tell the server to create the tag and handle its destruction ["createTag", _this] call EFUNC(common,serverEvent); -}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _color, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); +}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _colorTexture, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); true diff --git a/addons/tagging/functions/fnc_tagGround.sqf b/addons/tagging/functions/fnc_tagGround.sqf index fa8d1795bf..dee9261e1e 100644 --- a/addons/tagging/functions/fnc_tagGround.sqf +++ b/addons/tagging/functions/fnc_tagGround.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue) + * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * None @@ -17,9 +17,9 @@ #include "script_component.hpp" -params ["_unit", "_color"]; +params ["_unit", "_colorTexture"]; private _startPosASL = getPosASL _unit; private _endPosASL = _startPosASL vectorAdd [0, 0, -2] vectorAdd eyeDirection _unit; -[_unit, _startPosASL, _endPosASL, _color] call FUNC(tagDirection); +[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection); diff --git a/addons/tagging/functions/fnc_tagWall.sqf b/addons/tagging/functions/fnc_tagWall.sqf index 9b6485f4e8..85b24f7b92 100644 --- a/addons/tagging/functions/fnc_tagWall.sqf +++ b/addons/tagging/functions/fnc_tagWall.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue) + * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * None @@ -17,11 +17,11 @@ #include "script_component.hpp" -params ["_unit", "_color"]; +params ["_unit", "_colorTexture"]; private _startPosASL = eyePos _unit; private _cameraPosASL = AGLToASL positionCameraToWorld [0, 0, 0]; private _cameraDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff _cameraPosASL; private _endPosASL = _startPosASL vectorAdd (_cameraDir vectorMultiply 2.5); -[_unit, _startPosASL, _endPosASL, _color] call FUNC(tagDirection); +[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection); From 6469b11f3cd62defa0bf02c348872ccc195e476a Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 28 Mar 2016 20:07:02 +0200 Subject: [PATCH 14/56] Cleanup tagging, use internal getTexture for getting texture from color, move tag size definition --- addons/tagging/CfgVehicles.hpp | 50 +++++-------------- addons/tagging/XEH_PREP.hpp | 6 +-- .../tagging/functions/fnc_checkTaggable.sqf | 2 +- addons/tagging/functions/fnc_createTag.sqf | 25 ++++------ addons/tagging/functions/fnc_getTexture.sqf | 26 ++++++++++ .../{fnc_tagDirection.sqf => fnc_tag.sqf} | 34 ++++++++----- addons/tagging/functions/fnc_tagGround.sqf | 25 ---------- addons/tagging/functions/fnc_tagWall.sqf | 27 ---------- addons/tagging/script_component.hpp | 3 ++ addons/tagging/stringtable.xml | 46 ++++------------- 10 files changed, 85 insertions(+), 159 deletions(-) create mode 100644 addons/tagging/functions/fnc_getTexture.sqf rename addons/tagging/functions/{fnc_tagDirection.sqf => fnc_tag.sqf} (78%) delete mode 100644 addons/tagging/functions/fnc_tagGround.sqf delete mode 100644 addons/tagging/functions/fnc_tagWall.sqf diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index ac0b82147c..af4daf6799 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -4,57 +4,31 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class ACE_tagWallBlack { - displayName = CSTRING(tagWallBlack); + displayName = CSTRING(TagBlack); condition = QUOTE(('ACE_SpraypaintBlack' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'black')] call FUNC(tagWall)); + statement = QUOTE([ARR_2(ACE_player,'black' call FUNC(getTexture))] call FUNC(tag)); showDisabled = 0; priority = 3; icon = QUOTE(PATHTOF(UI\icons\iconTaggingBlack.paa)); }; class ACE_tagWallRed: ACE_tagWallBlack { - displayName = CSTRING(tagWallRed); + displayName = CSTRING(TagRed); condition = QUOTE(('ACE_SpraypaintRed' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'red')] call FUNC(tagWall)); + statement = QUOTE([ARR_2(ACE_player,'red' call FUNC(getTexture))] call FUNC(tag)); icon = QUOTE(PATHTOF(UI\icons\iconTaggingRed.paa)); }; class ACE_tagWallGreen: ACE_tagWallBlack { - displayName = CSTRING(tagWallGreen); + displayName = CSTRING(TagGreen); condition = QUOTE(('ACE_SpraypaintGreen' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'green')] call FUNC(tagWall)); + statement = QUOTE([ARR_2(ACE_player,'green' call FUNC(getTexture))] call FUNC(tag)); icon = QUOTE(PATHTOF(UI\icons\iconTaggingGreen.paa)); }; class ACE_tagWallBlue: ACE_tagWallBlack { - displayName = CSTRING(tagWallBlue); + displayName = CSTRING(TagBlue); condition = QUOTE(('ACE_SpraypaintBlue' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'blue')] call FUNC(tagWall)); + statement = QUOTE([ARR_2(ACE_player,'blue' call FUNC(getTexture))] call FUNC(tag)); icon = QUOTE(PATHTOF(UI\icons\iconTaggingBlue.paa)); }; - /*class ACE_tagGroundBlack { - displayName = CSTRING(tagGroundBlack); - condition = QUOTE('ACE_SpraypaintBlack' in items ACE_player); - statement = QUOTE([ARR_2(ACE_player, 'black')] call FUNC(tagGround)); - showDisabled = 0; - priority = 3; - icon = QUOTE(PATHTOF(UI\icons\iconTaggingBlack.paa)); - }; - class ACE_tagGroundRed: ACE_tagGroundBlack { - displayName = CSTRING(tagGroundRed); - condition = QUOTE('ACE_SpraypaintRed' in items ACE_player); - statement = QUOTE([ARR_2(ACE_player, 'red')] call FUNC(tagGround)); - icon = QUOTE(PATHTOF(UI\icons\iconTaggingRed.paa)); - }; - class ACE_tagGroundGreen: ACE_tagGroundBlack { - displayName = CSTRING(tagGroundGreen); - condition = QUOTE('ACE_SpraypaintGreen' in items ACE_player); - statement = QUOTE([ARR_2(ACE_player, 'green')] call FUNC(tagGround)); - icon = QUOTE(PATHTOF(UI\icons\iconTaggingGreen.paa)); - }; - class ACE_tagGroundBlue: ACE_tagGroundBlack { - displayName = CSTRING(tagGroundBlue); - condition = QUOTE('ACE_SpraypaintBlue' in items ACE_player); - statement = QUOTE([ARR_2(ACE_player, 'blue')] call FUNC(tagGround)); - icon = QUOTE(PATHTOF(UI\icons\iconTaggingBlue.paa)); - };*/ }; }; }; @@ -64,26 +38,26 @@ class CfgVehicles { author = "jokoho48"; scope = 2; scopeCurator = 2; - displayName = CSTRING(spraypaintBlack); + displayName = CSTRING(SpraypaintBlack); vehicleClass = "Items"; class TransportItems { MACRO_ADDITEM(ACE_SpraypaintBlack,1); }; }; class ACE_Item_SpraypaintRed: ACE_Item_SpraypaintBlack { - displayName = CSTRING(spraypaintRed); + displayName = CSTRING(SpraypaintRed); class TransportItems { MACRO_ADDITEM(ACE_SpraypaintRed,1); }; }; class ACE_Item_SpraypaintGreen: ACE_Item_SpraypaintBlack { - displayName = CSTRING(spraypaintGreen); + displayName = CSTRING(SpraypaintGreen); class TransportItems { MACRO_ADDITEM(ACE_SpraypaintGreen,1); }; }; class ACE_Item_SpraypaintBlue: ACE_Item_SpraypaintBlack { - displayName = CSTRING(spraypaintBlue); + displayName = CSTRING(SpraypaintBlue); class TransportItems { MACRO_ADDITEM(ACE_SpraypaintBlue,1); }; diff --git a/addons/tagging/XEH_PREP.hpp b/addons/tagging/XEH_PREP.hpp index eb29d5a9e3..f8a8598cd7 100644 --- a/addons/tagging/XEH_PREP.hpp +++ b/addons/tagging/XEH_PREP.hpp @@ -1,7 +1,5 @@ - PREP(checkTaggable); PREP(createTag); -PREP(tagDirection); -PREP(tagGround); -PREP(tagWall); +PREP(getTexture); +PREP(tag); PREP(tagTestingThread); diff --git a/addons/tagging/functions/fnc_checkTaggable.sqf b/addons/tagging/functions/fnc_checkTaggable.sqf index 4c8f0c750a..b77473f25b 100644 --- a/addons/tagging/functions/fnc_checkTaggable.sqf +++ b/addons/tagging/functions/fnc_checkTaggable.sqf @@ -1,5 +1,5 @@ /* - * Author: BaerMitUmlaut and esteldunedain + * Author: BaerMitUmlaut, esteldunedain * Checks if there is a taggable surface within 2.5m in front of the player. * * Arguments: diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 81758f8bdb..924fc5582c 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -1,5 +1,5 @@ /* - * Author: BaerMitUmlaut and esteldunedain + * Author: BaerMitUmlaut, esteldunedain * Creates a tag and handle its destruction. Only execute on the server. * * Arguments: @@ -9,7 +9,7 @@ * 3: Object it should be tied too * * Return Value: - * None + * Tag created * * Example: * [positionASL, vectorDirAndUp, "black", object] call ace_tagging_fnc_createTag @@ -19,25 +19,20 @@ #include "script_component.hpp" -params ["_tagPosASL", "_vectorDirAndUp", "_colorTexture", "_object"]; -TRACE_4("createTag:",_tagPosASL,_vectorDirAndUp,_colorTexture,_object); +params ["_tagPosASL", "_vectorDirAndUp", "_texture", "_object"]; +TRACE_4("createTag:",_tagPosASL,_vectorDirAndUp,_texture,_object); -private _customTexture = [true, false] select (_colorTexture find ".paa" == -1); - -if (!_customTexture && {!((toLower _colorTexture) in ["black", "red", "green", "blue"])}) exitWith { - ACE_LOGERROR_1("%1 is not a valid tag colour.",_colorTexture); +if (_texture == "") exitWith { + ACE_LOGERROR_1("%1 is not a valid tag texture.",_texture); + false }; private _tag = "UserTexture1m_F" createVehicle [0,0,0]; -if (!_customTexture) then { - _tag setObjectTextureGlobal [0, "\z\ace\addons\tagging\UI\tags\" + _colorTexture + "\" + str (floor (random 3)) + ".paa"]; -} else { - _tag setObjectTextureGlobal [0, _colorTexture]; -}; +_tag setObjectTextureGlobal [0, _texture]; _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; -if (isNull _object) exitWith {}; +if (isNull _object) exitWith {true}; // If the tag is applied to an object, handle its destruction _object setVariable [QGVAR(testVar), true]; @@ -75,3 +70,5 @@ GVAR(tagsToTest) pushBack [_tag, _tagPosASL, _vectorDirAndUp]; if (!GVAR(testingThread)) then { call FUNC(tagTestingThread); }; + +true diff --git a/addons/tagging/functions/fnc_getTexture.sqf b/addons/tagging/functions/fnc_getTexture.sqf new file mode 100644 index 0000000000..f7f6d7e5e2 --- /dev/null +++ b/addons/tagging/functions/fnc_getTexture.sqf @@ -0,0 +1,26 @@ +/* + * Author: BaerMitUmlaut, esteldunedain, Jonpas + * Puts together a full path to the given tag color texture. Internal ACE3 textures only. + * + * Arguments: + * 0: The colour of the tag (valid colours are black, red, green and blue) + * + * Return Value: + * Texture (full path), "" if not found + * + * Example: + * texture = ["blue"] call ace_tagging_fnc_getTexture + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_color"]; + +if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { + ACE_LOGERROR_1("%1 is not a valid tag colour.",_color); + "" +}; + +QUOTE(PATHTOF(UI)) + "\tags\" + _color + "\" + str (floor (random 3)) + ".paa" diff --git a/addons/tagging/functions/fnc_tagDirection.sqf b/addons/tagging/functions/fnc_tag.sqf similarity index 78% rename from addons/tagging/functions/fnc_tagDirection.sqf rename to addons/tagging/functions/fnc_tag.sqf index 9dbb65f68e..3bd559f702 100644 --- a/addons/tagging/functions/fnc_tagDirection.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -1,25 +1,35 @@ /* - * Author: BaerMitUmlaut and esteldunedain - * If possible, create a tag on the first surface between Start and End positions + * Author: BaerMitUmlaut, esteldunedain + * Creates a tag on a wall that is on the closest surface within 2m on front of the unit. * * Arguments: - * 0: Unit - * 1: Start position ASL - * 2: End position ASL - * 3: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) + * 0: Unit + * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: - * Sucess + * Sucess * * Example: - * [startPosASL, directiom "blue"] call ace_tagging_fnc_tagDirection + * success = [player, "blue"] call ace_tagging_fnc_tag * - * Public: No + * Public: Yes */ #include "script_component.hpp" -params ["_unit", "_startPosASL", "_endPosASL", "_colorTexture"]; +params [ + ["_unit", objNull, [objNull]], + ["_texture", "", [""]] +]; + +if (isNull _unit || {_texture == ""}) exitWith { + ACE_LOGERROR_2("Tag parameters invalid. Unit: %1, Texture: %2",_unit,_texture); +}; + +private _startPosASL = eyePos _unit; +private _cameraPosASL = AGLToASL positionCameraToWorld [0, 0, 0]; +private _cameraDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff _cameraPosASL; +private _endPosASL = _startPosASL vectorAdd (_cameraDir vectorMultiply 2.5); // Check for intersections below the unit private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, _unit, objNull, true, 1, "GEOM", "FIRE"]; @@ -79,8 +89,6 @@ _fnc_isOk = { true }; -#define TAG_SIZE 0.6 - if ( !([ 0.5*TAG_SIZE, 0.5*TAG_SIZE] call _fnc_isOk) || {!([ 0.5*TAG_SIZE,-0.5*TAG_SIZE] call _fnc_isOk) || {!([-0.5*TAG_SIZE, 0.5*TAG_SIZE] call _fnc_isOk) || @@ -102,6 +110,6 @@ _unit playActionNow "PutDown"; // Tell the server to create the tag and handle its destruction ["createTag", _this] call EFUNC(common,serverEvent); -}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _colorTexture, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); +}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _texture, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); true diff --git a/addons/tagging/functions/fnc_tagGround.sqf b/addons/tagging/functions/fnc_tagGround.sqf deleted file mode 100644 index dee9261e1e..0000000000 --- a/addons/tagging/functions/fnc_tagGround.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: BaerMitUmlaut and esteldunedain - * Creates a tag on the ground beneath the unit - * - * Arguments: - * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) - * - * Return Value: - * None - * - * Example: - * [player, "blue"] call ace_tagging_fnc_tagGround - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_unit", "_colorTexture"]; - -private _startPosASL = getPosASL _unit; -private _endPosASL = _startPosASL vectorAdd [0, 0, -2] vectorAdd eyeDirection _unit; - -[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection); diff --git a/addons/tagging/functions/fnc_tagWall.sqf b/addons/tagging/functions/fnc_tagWall.sqf deleted file mode 100644 index 85b24f7b92..0000000000 --- a/addons/tagging/functions/fnc_tagWall.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: BaerMitUmlaut and esteldunedain - * Creates a tag on a wall that is on the closest surface within 2m on front of the unit. - * - * Arguments: - * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) - * - * Return Value: - * None - * - * Example: - * [player, "blue"] call ace_tagging_fnc_tagWall - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_unit", "_colorTexture"]; - -private _startPosASL = eyePos _unit; -private _cameraPosASL = AGLToASL positionCameraToWorld [0, 0, 0]; -private _cameraDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff _cameraPosASL; -private _endPosASL = _startPosASL vectorAdd (_cameraDir vectorMultiply 2.5); - -[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection); diff --git a/addons/tagging/script_component.hpp b/addons/tagging/script_component.hpp index bb94aae3ff..4836d2f209 100644 --- a/addons/tagging/script_component.hpp +++ b/addons/tagging/script_component.hpp @@ -15,3 +15,6 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +#define TAG_SIZE 0.6 diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index 392de0d24f..0bab4f29c1 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -1,91 +1,63 @@  - + Tag black Schwarz markieren Marcar en negro Oznakuj na czarno Tag noir - + Tag red Rot markieren Marcar en rojo Oznakuj na czerwono Tag rouge - + Tag green Grün markieren Marcar en verde Oznakuj na zielono Tag vert - + Tag blue Blau markieren Marcar en azul Oznakuj na niebiesko Tag bleu - - Tag ground black - Boden schwarz markieren - Oznakuj ziemię na czarno - Marcar suelo en negro - Tag fond noir - - - Tag ground red - Boden rot markieren - Oznakuj ziemię na czerwono - Marcar suelo en rojo - Tag fond rouge - - - Tag ground green - Boden grün markieren - Oznakuj ziemię na zielono - Marcar suelo en verde - Tag fond vert - - - Tag ground blue - Boden blau markieren - Oznakuj ziemię na niebiesko - Marcar suelo en azul - Tag font bleu - - + Black spray paint Schwarze Sprühfarbe Pintura negra Czarna farba w sprayu Peinture pulvérisée noire - + Red spray paint Rote Sprühfarbe Pintura roja Czerwona farba w sprayu Peinture pulvérisée rouge - + Green spray paint Grüne Sprühfarbe Pintura verde Zielona farba w sprayu Peinture pulvérisée verte - + Blue spray paint Blaue Sprühfarbe Pintura azul Niebieska farba w sprayu Peinture pulvérisée bleue - + A can of spray paint for tagging walls. Eine Farbsprühdose um Wände zu markieren. Lata de pintura en aerosol para marcar. From fbaae2beb39805197cfc26f8a879f41f54bcead0 Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 1 Apr 2016 21:25:00 +0200 Subject: [PATCH 15/56] Fix stringtable casing --- addons/tagging/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index c19e00b46c..1849206963 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -25,7 +25,7 @@ Tag vert Marca verde - + Tag blue Blau markieren Marcar en azul From 723d27fc99a1edf6bf52dcfc82236f60a1a25cea Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 1 Apr 2016 21:29:03 +0200 Subject: [PATCH 16/56] Rename tagging action classes --- addons/tagging/CfgVehicles.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index af4daf6799..4425b646ad 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -3,7 +3,7 @@ class CfgVehicles { class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { - class ACE_tagWallBlack { + class ACE_TagBlack { displayName = CSTRING(TagBlack); condition = QUOTE(('ACE_SpraypaintBlack' in items ACE_player) && {[] call FUNC(checkTaggable)}); statement = QUOTE([ARR_2(ACE_player,'black' call FUNC(getTexture))] call FUNC(tag)); @@ -11,19 +11,19 @@ class CfgVehicles { priority = 3; icon = QUOTE(PATHTOF(UI\icons\iconTaggingBlack.paa)); }; - class ACE_tagWallRed: ACE_tagWallBlack { + class ACE_TagRed: ACE_TagBlack { displayName = CSTRING(TagRed); condition = QUOTE(('ACE_SpraypaintRed' in items ACE_player) && {[] call FUNC(checkTaggable)}); statement = QUOTE([ARR_2(ACE_player,'red' call FUNC(getTexture))] call FUNC(tag)); icon = QUOTE(PATHTOF(UI\icons\iconTaggingRed.paa)); }; - class ACE_tagWallGreen: ACE_tagWallBlack { + class ACE_TagGreen: ACE_TagBlack { displayName = CSTRING(TagGreen); condition = QUOTE(('ACE_SpraypaintGreen' in items ACE_player) && {[] call FUNC(checkTaggable)}); statement = QUOTE([ARR_2(ACE_player,'green' call FUNC(getTexture))] call FUNC(tag)); icon = QUOTE(PATHTOF(UI\icons\iconTaggingGreen.paa)); }; - class ACE_tagWallBlue: ACE_tagWallBlack { + class ACE_TagBlue: ACE_TagBlack { displayName = CSTRING(TagBlue); condition = QUOTE(('ACE_SpraypaintBlue' in items ACE_player) && {[] call FUNC(checkTaggable)}); statement = QUOTE([ARR_2(ACE_player,'blue' call FUNC(getTexture))] call FUNC(tag)); From a9fd7c4d6fd18cf508e92505b9341ad100f9cb75 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 3 Apr 2016 02:27:23 +0200 Subject: [PATCH 17/56] Always use junctions for dev environment setup --- tools/setup.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/setup.py b/tools/setup.py index 62925a6066..edab37dbcb 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -25,19 +25,19 @@ def main(): ###################################### This script will create your ACE3 dev environment for you. - + Before you run this, you should already have: - The Arma 3 Tools installed properly via Steam - A properly set up P-drive - + If you have not done those things yet, please abort this script in the next step and do so first. - + This script will create two hard links on your system, both pointing to your ACE3 project folder: [Arma 3 installation directory]\\{} => ACE3 project folder P:\\{} => ACE3 project folder - + It will also copy the required CBA includes to {}, if you do not have the CBA source code already.""".format(FULLDIR,FULLDIR,CBA)) - print("\n") + print("\n") try: reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) @@ -79,12 +79,8 @@ def main(): if not os.path.exists(os.path.join(armapath, MAINDIR)): os.mkdir(os.path.join(armapath, MAINDIR)) - if platform.win32_ver()[0] == "7": - subprocess.call(["cmd", "/c", "mklink", "/D", "P:\\{}\\{}".format(MAINDIR,PROJECTDIR), projectpath]) - subprocess.call(["cmd", "/c", "mklink", "/D", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath]) - else: - subprocess.call(["cmd", "/c", "mklink", "/D", "/J", "P:\\{}\\{}".format(MAINDIR,PROJECTDIR), projectpath]) - subprocess.call(["cmd", "/c", "mklink", "/D", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/D", "/J", "P:\\{}\\{}".format(MAINDIR,PROJECTDIR), projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/D", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath]) except: raise print("Something went wrong during the link creation. Please finish the setup manually.") From 2a7e0b2a4852e87a79da02e9679f185255e57ed8 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 3 Apr 2016 13:23:20 +0200 Subject: [PATCH 18/56] Remove redundant directory symlink directive --- tools/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup.py b/tools/setup.py index edab37dbcb..af1b224cbb 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -79,8 +79,8 @@ def main(): if not os.path.exists(os.path.join(armapath, MAINDIR)): os.mkdir(os.path.join(armapath, MAINDIR)) - subprocess.call(["cmd", "/c", "mklink", "/D", "/J", "P:\\{}\\{}".format(MAINDIR,PROJECTDIR), projectpath]) - subprocess.call(["cmd", "/c", "mklink", "/D", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/J", "P:\\{}\\{}".format(MAINDIR,PROJECTDIR), projectpath]) + subprocess.call(["cmd", "/c", "mklink", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath]) except: raise print("Something went wrong during the link creation. Please finish the setup manually.") From d931eb4e15ff70e0d94f01dd381fe0ad206010e2 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 3 Apr 2016 14:17:16 +0200 Subject: [PATCH 19/56] Improve XEH adding in cargo --- addons/cargo/CfgEventHandlers.hpp | 56 ++-------------------- addons/cargo/functions/fnc_initVehicle.sqf | 3 +- 2 files changed, 5 insertions(+), 54 deletions(-) diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 391c3a662d..ff4a88693e 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -27,27 +27,7 @@ class Extended_Killed_EventHandlers { //Need initPost or we have problems with setVariable with 'ACE_Cargo' class Extended_InitPost_EventHandlers { - class StaticWeapon { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class ReammoBox_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class Cargo_base_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class CargoNet_01_box_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class Land_CargoBox_V1_F { + class ThingX { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; @@ -62,32 +42,12 @@ class Extended_InitPost_EventHandlers { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class MetalCase_01_base_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class RoadCone_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class Car { + class LandVehicle { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Tank { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Helicopter { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Plane { + class Air { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; @@ -97,16 +57,6 @@ class Extended_InitPost_EventHandlers { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class ACE_RepairItem_Base { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class ACE_bodyBagObject { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; class ACE_ConcertinaWireCoil { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index c0b312146b..7e19b0acd0 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -20,6 +20,8 @@ TRACE_1("params", _vehicle); private _type = typeOf _vehicle; +if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; + if (isServer) then { { if (isClass _x) then { @@ -38,7 +40,6 @@ if (_type in GVAR(initializedVehicleClasses)) exitWith {}; GVAR(initializedVehicleClasses) pushBack _type; if (!hasInterface) exitWith {}; -if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; TRACE_1("Adding unload cargo action to class", _type); From 121c45eb84939ae2ec67b32ec83d3f63bf3216b2 Mon Sep 17 00:00:00 2001 From: James McCartney Date: Mon, 11 Apr 2016 22:29:33 +0100 Subject: [PATCH 20/56] Raise a local event when a weapon is jammed --- addons/overheating/functions/fnc_jamWeapon.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 38184808d2..ee6f86f388 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -43,6 +43,9 @@ if (_ammo > 0) then { // only display the hint once, after you try to shoot an already jammed weapon GVAR(knowAboutJam) = false; +["overheating_jammed", [_unit,_weapon]] call EFUNC(common,localEvent); + + if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private _condition = { From 153cd28f94579505dd10321e07f634d2cfca2ffb Mon Sep 17 00:00:00 2001 From: James McCartney Date: Mon, 11 Apr 2016 23:09:45 +0100 Subject: [PATCH 21/56] Change event name to weaponJammed --- addons/overheating/functions/fnc_jamWeapon.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index ee6f86f388..b6cacdbea3 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -43,7 +43,7 @@ if (_ammo > 0) then { // only display the hint once, after you try to shoot an already jammed weapon GVAR(knowAboutJam) = false; -["overheating_jammed", [_unit,_weapon]] call EFUNC(common,localEvent); +["weaponJammed", [_unit,_weapon]] call EFUNC(common,localEvent); if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { From 2869a53e6dad4ca8ec53363c48da11b90fd0c47c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 00:19:24 -0500 Subject: [PATCH 22/56] Googles - Only play wipe anim for primary weapon Close #3638 Animation only makes sense for primary weapon, so skip for others. --- addons/goggles/functions/fnc_clearGlasses.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index d0b14e4f90..e7d5584938 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -26,7 +26,7 @@ _effects set [BROKEN, _broken]; SETGLASSES(_unit,_effects); -if (stance _unit != "PRONE") then { +if ((stance _unit != "PRONE") && {primaryWeapon _unit != ""} && {currentWeapon _unit == primaryWeapon _unit}) then { _unit playActionNow "gestureWipeFace"; }; From 3744b980f49128946e21aed055a5d2bbbec6f778 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 02:14:06 -0500 Subject: [PATCH 23/56] Javelin - Verify player has LOS to cursorTarget Fix #3668 --- addons/javelin/functions/fnc_onOpticDraw.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index f561806eaa..4bf80641e3 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -99,7 +99,10 @@ if (_range > 50 && {_range < 2500}) then { }; if (isNull _newTarget) then { - _newTarget = cursorTarget; + private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + _newTarget = cursorTarget; + }; }; // Create constants From 5d70db3d9b12ef5131f1aae87cc0b43fb805f592 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 12:12:49 -0500 Subject: [PATCH 24/56] LoadPerson - Only try vehicles that have room Fix #2965 The FRIES is a "Helicopter" so we were trying to load into it, because it was closest. Also disable Cargo system on it so we don't load other things into it And remove all interactions on it as well. --- addons/common/XEH_postInit.sqf | 1 + addons/common/functions/fnc_loadPerson.sqf | 29 ++++++---------------- addons/fastroping/CfgVehicles.hpp | 4 +++ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index ae1014ddc8..4c05b1cf7a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -133,6 +133,7 @@ if (isServer) then { ["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler); ["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); +["loadPersonEvent", FUNC(loadPersonLocal)] call FUNC(addEventhandler); ["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler); ["lockVehicle", { diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 3071ffbd47..6c728134d1 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -21,33 +21,18 @@ private _vehicle = objNull; if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; -private _loadcar = nearestObject [_unit, "Car"]; +private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F"], 10]; -if (_unit distance _loadcar <= 10) then { - _vehicle = _loadcar; -} else { - private _loadair = nearestObject [_unit, "Air"]; - - if (_unit distance _loadair <= 10) then { - _vehicle = _loadair; - } else { - private _loadtank = nearestObject [_unit, "Tank"]; - - if (_unit distance _loadtank <= 10) then { - _vehicle = _loadtank; - } else { - private _loadboat = nearestObject [_unit, "Ship_F"]; - - if (_unit distance _loadboat <= 10) then { - _vehicle = _loadboat; - }; - }; +{ + TRACE_1("",_x); + if ((_x emptyPositions "cargo" > 0) || {_x emptyPositions "gunner" > 0}) exitWith { + _vehicle = _x; }; -}; +} forEach _nearVehicles; if (!isNull _vehicle) then { [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); - [[_unit, _vehicle, _caller], QFUNC(loadPersonLocal), _unit, false] call FUNC(execRemoteFnc); + ["loadPersonEvent", _unit, [_unit, _vehicle, _caller]] call FUNC(objectEvent); }; _vehicle diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index a9f5ebfbad..dcd399508b 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -73,6 +73,10 @@ class CfgVehicles { class ACE_friesBase: Helicopter_Base_F { destrType = ""; class Turrets {}; + class ACE_Actions {}; + class ACE_SelfActions {}; + EGVAR(cargo,hasCargo) = 0; + EGVAR(cargo,space) = 0; }; class ACE_friesAnchorBar: ACE_friesBase { author = "jokoho48"; From d7b0bde1ca3e6c455d63538f773733a615bc9b0b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 12:28:48 -0500 Subject: [PATCH 25/56] Fix Wildcat attach point --- addons/fastroping/CfgVehicles.hpp | 2 +- addons/fastroping/script_component.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index dcd399508b..609e386e68 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -209,7 +209,7 @@ class CfgVehicles { GVAR(enabled) = 2; GVAR(ropeOrigins)[] = {"ropeOriginRight", "ropeOriginLeft"}; GVAR(friesType) = "ACE_friesGantryReverse"; - GVAR(friesAttachmentPoint)[] = {1.04, 2.5, -0.34}; + GVAR(friesAttachmentPoint)[] = {-1.04, 2.5, -0.34}; EQUIP_FRIES_ATTRIBUTE; }; class Heli_light_03_unarmed_base_F: Heli_light_03_base_F { diff --git a/addons/fastroping/script_component.hpp b/addons/fastroping/script_component.hpp index ccfa2c3e56..3770bfe0d4 100644 --- a/addons/fastroping/script_component.hpp +++ b/addons/fastroping/script_component.hpp @@ -1,6 +1,11 @@ #define COMPONENT fastroping #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define CBA_DEBUG_SYNCHRONOUS +// #define ENABLE_PERFORMANCE_COUNTERS + #ifdef DEBUG_ENABLED_FASTROPING #define DEBUG_MODE_FULL #endif From 4f6b11c2a6de9a313c194bfaf67e731aa9508001 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 20:04:12 -0500 Subject: [PATCH 26/56] Clarify repair while engine is running #3348 - Show action, but exit and show warning when selected - Optional (default off) setting to auto shut off engine to keep compatibility with missions --- addons/common/XEH_postInit.sqf | 1 + addons/repair/ACE_Settings.hpp | 5 +++++ addons/repair/functions/fnc_canRepair.sqf | 3 ++- addons/repair/functions/fnc_repair.sqf | 9 ++++++++- addons/repair/stringtable.xml | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index ae1014ddc8..c10246212c 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -146,6 +146,7 @@ if (isServer) then { ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); +["engineOn", {(_this select 0) engineOn (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); ["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); ["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index c3c8daad16..9f6d20ae97 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -77,4 +77,9 @@ class ACE_Settings { values[] = {"None", "ToolKit"}; _values[] = {{}, {"ToolKit"}}; }; + class GVAR(autoShutOffEngineWhenStartingRepair) { + typeName = "BOOL"; + value = 1; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; }; diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index f7c3f60a8a..6027a34fd5 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -25,7 +25,8 @@ private ["_config", "_engineerRequired", "_items", "_return", "_condition", "_ve _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? -if(isEngineOn _target) exitWith {false}; + +// if(isEngineOn _target) exitWith {false}; // Ignore here so action shows, then exit and show warning when selected #3348 _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { getNumber (_config >> "requiredEngineer"); diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 25e58151c5..f5b7d8cbfc 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -36,7 +36,14 @@ _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { 0; }; if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; -if (isEngineOn _target) exitWith {false}; + +if ((isEngineOn _target) && {GVAR(autoShutOffEngineWhenStartingRepair)}) then { + ["engineOn", _target, [_target, false]] call EFUNC(common,objectEvent); +}; +if ((isEngineOn _target) && {!GVAR(autoShutOffEngineWhenStartingRepair)}) exitWith { + ["displayTextStructured", [LSTRING(shutOffEngineWarning), 1.5, _caller]] call EFUNC(common,localEvent); + false +}; //Items can be an array of required items or a string to a ACE_Setting array _items = if (isArray (_config >> "items")) then { diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index fb505f4f4e..ee79a1d427 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1316,5 +1316,10 @@ Oggetti richiesti per riparare/rimuovere ruote Items exigés pour enlever/remplacer les roues + + Engine must be off to repair + Motor muss ausgeschaltet zu reparieren sein + El motor necesita desactivado para la reparación + From f16a65f3815f6da47eab963467fc6b39f1a00d64 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 20:05:56 -0500 Subject: [PATCH 27/56] Fix default --- addons/repair/ACE_Settings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 9f6d20ae97..9ee40529e7 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -79,7 +79,7 @@ class ACE_Settings { }; class GVAR(autoShutOffEngineWhenStartingRepair) { typeName = "BOOL"; - value = 1; + value = 0; category = ECSTRING(OptionsMenu,CategoryLogistics); }; }; From 33600472045af602797df69c9beb9d5146470e20 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 13 Apr 2016 13:05:32 -0500 Subject: [PATCH 28/56] Better handle unloading on slopes Close #3667 --- addons/common/functions/fnc_findUnloadPosition.sqf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/common/functions/fnc_findUnloadPosition.sqf b/addons/common/functions/fnc_findUnloadPosition.sqf index f7155fd87b..c3b0dc3f34 100644 --- a/addons/common/functions/fnc_findUnloadPosition.sqf +++ b/addons/common/functions/fnc_findUnloadPosition.sqf @@ -92,6 +92,15 @@ while {_rangeToCheck < _maxDistance} do { private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, (_radiusOfItem + 0.5)]; private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; + if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { + private _hitGroundASL = (_testIntersections select 0) select 0; + private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); + private _hit2dOffset = _roundAGL distance2D _hitGroundASL; + private _slope = _hitHeightOffset atan2 _hit2dOffset; + if (_slope < 25) then { //Ignore ground hit if slope is reasonable + _testIntersections = []; + }; + }; if (!(_testIntersections isEqualTo [])) exitWith { TRACE_2("collision low/high",_roundAGL,_testIntersections); _roundPointIsValid = false; From dec266a5462470ab077fc33aca264e160ff073d6 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 14 Apr 2016 13:52:20 +0200 Subject: [PATCH 29/56] Fix ship view distance using foot instead of vehicle setting, Cleanup view distance component --- addons/viewdistance/CfgVehicles.hpp | 4 +- addons/viewdistance/XEH_PREP.hpp | 1 - addons/viewdistance/XEH_clientInit.sqf | 2 +- .../functions/fnc_adaptViewDistance.sqf | 23 ++++++----- .../functions/fnc_changeViewDistance.sqf | 34 ++++++++-------- .../functions/fnc_returnObjectCoeff.sqf | 6 +-- .../functions/fnc_returnValue.sqf | 39 ++++++++----------- .../functions/fnc_setFovBasedOvdPFH.sqf | 31 ++++++--------- addons/viewdistance/script_component.hpp | 5 +++ 9 files changed, 64 insertions(+), 81 deletions(-) diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 86d906bfce..4c6639370c 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -1,6 +1,6 @@ class CfgVehicles { class ACE_Module; - class GVAR(ModuleSettings) : ACE_Module { + class GVAR(ModuleSettings): ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; function = QUOTE(DFUNC(initModule)); @@ -28,4 +28,4 @@ class CfgVehicles { sync[] = {}; }; }; -}; \ No newline at end of file +}; diff --git a/addons/viewdistance/XEH_PREP.hpp b/addons/viewdistance/XEH_PREP.hpp index fea5de5a4f..c040baf334 100644 --- a/addons/viewdistance/XEH_PREP.hpp +++ b/addons/viewdistance/XEH_PREP.hpp @@ -1,4 +1,3 @@ - PREP(adaptViewDistance); PREP(changeViewDistance); PREP(initModule); diff --git a/addons/viewdistance/XEH_clientInit.sqf b/addons/viewdistance/XEH_clientInit.sqf index 45b86d944d..dfcfd7e405 100644 --- a/addons/viewdistance/XEH_clientInit.sqf +++ b/addons/viewdistance/XEH_clientInit.sqf @@ -24,6 +24,6 @@ if (!hasInterface) exitWith {}; // Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle // Also run when SettingsInitialized runs (not guaranteed) ["playerVehicleChanged",{ - [false] call FUNC(adaptViewDistance) + [false] call FUNC(adaptViewDistance); }] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler); diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index f1ea7121b2..87b6232e99 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -2,7 +2,6 @@ * Author: Winter * Sets the player's current view distance according to whether s/he is on foot, in a land vehicle or in an air vehicle. * - * * Arguments: * 0: Show Prompt * @@ -17,23 +16,23 @@ #include "script_component.hpp" -private["_land_vehicle","_air_vehicle"]; - -params ["_show_prompt"]; +params ["_showPrompt"]; if (!GVAR(enabled) || isNull ACE_player) exitWith {}; -_land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; -_air_vehicle = (vehicle ACE_player) isKindOf "Air"; +private _vehicle = vehicle ACE_player; -if (!_land_vehicle && !_air_vehicle) exitWith { - [GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance); +private _landVehicle = _vehicle isKindOf "LandVehicle" || _vehicle isKindOf "Ship_F"; +private _airVehicle = _vehicle isKindOf "Air"; + +if (!_landVehicle && !_airVehicle) exitWith { + [GVAR(viewDistanceOnFoot), _showPrompt] call FUNC(changeViewDistance); }; -if (_land_vehicle) exitWith { - [GVAR(viewDistanceLandVehicle),_show_prompt] call FUNC(changeViewDistance); +if (_landVehicle) exitWith { + [GVAR(viewDistanceLandVehicle), _showPrompt] call FUNC(changeViewDistance); }; -if (_air_vehicle) exitWith { - [GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance); +if (_airVehicle) exitWith { + [GVAR(viewDistanceAirVehicle), _showPrompt] call FUNC(changeViewDistance); }; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 28bba29b67..c5f39ff2f8 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -16,20 +16,18 @@ */ #include "script_component.hpp" -private ["_text", "_new_view_distance", "_view_distance_limit", "_object_view_distance_coeff"]; +params ["_indexRequested", "_showPrompt"]; -params ["_index_requested", "_show_prompt"]; +private _newViewDistance = [_indexRequested] call FUNC(returnValue); // changes the setting index into an actual view distance value +private _objectViewDistanceCoeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient. +private _viewDistanceLimit = GVAR(limitViewDistance); // Grab the limit -_new_view_distance = [_index_requested] call FUNC(returnValue); // changes the setting index into an actual view distance value -_object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient. -_view_distance_limit = GVAR(limitViewDistance); // Grab the limit +TRACE_3("Limit",_newViewDistance,_viewDistanceLimit,_showPrompt); +setViewDistance (_newViewDistance min _viewDistanceLimit); -TRACE_2("Limit",_new_view_distance,_view_distance_limit); -setViewDistance (_new_view_distance min _view_distance_limit); - -if (typeName _object_view_distance_coeff == "SCALAR") then { - if (_object_view_distance_coeff > 0) then { - setObjectViewDistance (_object_view_distance_coeff * viewDistance); +if (_objectViewDistanceCoeff isEqualType 0) then { + if (_objectViewDistanceCoeff > 0) then { + setObjectViewDistance (_objectViewDistanceCoeff * viewDistance); } else { // Restore correct view distance when changing from FoV Based to Off // Restoring directly inside PFH's self-exit resulted in the need of selecting another option to take effect @@ -42,18 +40,18 @@ if (typeName _object_view_distance_coeff == "SCALAR") then { }; }; -if (_show_prompt) then { +if (_showPrompt) then { if (GVAR(objectViewDistanceCoeff) > 0) then { + private _text = ""; // FoV Based or % if (GVAR(objectViewDistanceCoeff) == 6) then { _text = format ["%1 %2
Min. %3
Max. %4
", localize LSTRING(objectinfotext), localize LSTRING(object_fovBased), GVAR(fovBasedPFHminimalViewDistance), viewDistance]; } else { - _text = if (_new_view_distance <= _view_distance_limit) then { - format ["%1 %2m", localize LSTRING(infotext), viewDistance]; - } else { - format ["%1 %2m", localize LSTRING(invalid), viewDistance]; - }; - _text = _text + format ["
%1 %2%3", localize LSTRING(objectinfotext), _object_view_distance_coeff * 100, "%"]; + _text = [ + format ["%1 %2m", localize LSTRING(invalid), viewDistance], + format ["%1 %2m", localize LSTRING(infotext), viewDistance] + ] select (_newViewDistance <= _viewDistanceLimit); + _text = _text + format ["
%1 %2%3", localize LSTRING(objectinfotext), _objectViewDistanceCoeff * 100, "%"]; }; [parseText _text, 2] call EFUNC(common,displayTextStructured); }; diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf index 90c70b810c..257dca2995 100644 --- a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -16,11 +16,9 @@ #include "script_component.hpp" -private ["_return"]; - params ["_index"]; -_return = switch (_index) do { +switch (_index) do { case 0: {0.00}; // Off case 1: {0.20}; // Very Low case 2: {0.40}; // Low @@ -30,5 +28,3 @@ _return = switch (_index) do { case 6: {"fov"}; // FoV Based default {0.50}; // something broke if this returns }; - -_return; diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index 7224292fa4..35c0894520 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -16,28 +16,23 @@ #include "script_component.hpp" -private ["_return"]; - params ["_index"]; -_return = switch (_index) do { - case 0: {viewDistance}; // Video Settings option - case 1: {500}; - case 2: {1000}; - case 3: {1500}; - case 4: {2000}; - case 5: {2500}; - case 6: {3000}; - case 7: {3500}; - case 8: {4000}; - case 9: {5000}; - case 10: {6000}; - case 11: {7000}; - case 12: {8000}; - case 13: {9000}; - case 14: {10000}; - default {1000}; +switch (_index) do { + case 0: {viewDistance}; // Video Settings option + case 1: {500}; + case 2: {1000}; + case 3: {1500}; + case 4: {2000}; + case 5: {2500}; + case 6: {3000}; + case 7: {3500}; + case 8: {4000}; + case 9: {5000}; + case 10: {6000}; + case 11: {7000}; + case 12: {8000}; + case 13: {9000}; + case 14: {10000}; + default {1000}; }; - -TRACE_1("VD Index Return",_return); -_return diff --git a/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf b/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf index bcde34316a..4a57747d97 100644 --- a/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf +++ b/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf @@ -17,10 +17,6 @@ #include "script_component.hpp" -#define VD_ZOOM_NORMAL 1.00041 -#define VD_ZOOM_DIVISION 35 -#define VD_ZOOM_DIVISION_AIR 10 - params ["", "_idPFH"]; // Remove PFH and set Object View Distance back to what it was before @@ -29,25 +25,20 @@ if (GVAR(objectViewDistanceCoeff) < 6) exitWith { GVAR(fovBasedPFHminimalViewDistance) = nil; }; -private ["_zoom"]; -_zoom = (call CBA_fnc_getFov) select 1; +private _zoom = (call CBA_fnc_getFov) select 1; -// Air -if ((vehicle ACE_player) isKindOf "Air") exitWith { - if (_zoom > VD_ZOOM_NORMAL) then { - // Dynamically set Object View Distance based on player's Zoom Level and View Distance - setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION_AIR * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); - } else { - setObjectViewDistance (GVAR(fovBasedPFHminimalViewDistance) + viewDistance / 10); - }; - TRACE_2("FoV Based",getObjectViewDistance select 0,_zoom); -}; - -// Land if (_zoom > VD_ZOOM_NORMAL) then { // Dynamically set Object View Distance based on player's Zoom Level and View Distance - setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); + if ((vehicle ACE_player) isKindOf "Air") then { + setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION_AIR * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); + } else { + setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); + }; } else { - setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); + if ((vehicle ACE_player) isKindOf "Air") then { + setObjectViewDistance (GVAR(fovBasedPFHminimalViewDistance) + viewDistance / 10); + } else { + setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); + }; }; TRACE_2("FoV Based",getObjectViewDistance select 0,_zoom); diff --git a/addons/viewdistance/script_component.hpp b/addons/viewdistance/script_component.hpp index dfd04bbf9d..f5cd31f8ce 100644 --- a/addons/viewdistance/script_component.hpp +++ b/addons/viewdistance/script_component.hpp @@ -15,3 +15,8 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +#define VD_ZOOM_NORMAL 1.00041 +#define VD_ZOOM_DIVISION 35 +#define VD_ZOOM_DIVISION_AIR 10 From 04831267f24557e3da260d8db366643c7a0e2792 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 14 Apr 2016 13:55:15 +0200 Subject: [PATCH 30/56] Use lazy evaluation --- addons/viewdistance/functions/fnc_adaptViewDistance.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 87b6232e99..4816ee946e 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -22,7 +22,7 @@ if (!GVAR(enabled) || isNull ACE_player) exitWith {}; private _vehicle = vehicle ACE_player; -private _landVehicle = _vehicle isKindOf "LandVehicle" || _vehicle isKindOf "Ship_F"; +private _landVehicle = _vehicle isKindOf "LandVehicle" || {_vehicle isKindOf "Ship_F"}; private _airVehicle = _vehicle isKindOf "Air"; if (!_landVehicle && !_airVehicle) exitWith { From 300d069e782e7877f67d367536cc9da2dee49f32 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 14 Apr 2016 13:59:31 +0200 Subject: [PATCH 31/56] Exclude FRIES from repair interactions --- addons/repair/CfgEventHandlers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index ffd75a38bc..3de22a2da4 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -35,7 +35,7 @@ class Extended_InitPost_EventHandlers { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); - exclude[] = {QEGVAR(fastroping,helper)}; + exclude[] = {QEGVAR(fastroping,helper), "ACE_friesAnchorBar"}; }; }; class Plane { From 839d06779789a481d033f5d60f57183aeb37af57 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 14 Apr 2016 17:38:11 +0200 Subject: [PATCH 32/56] Exclude base FRIES class --- addons/repair/CfgEventHandlers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 3de22a2da4..06647d8dd5 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -35,7 +35,7 @@ class Extended_InitPost_EventHandlers { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); - exclude[] = {QEGVAR(fastroping,helper), "ACE_friesAnchorBar"}; + exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase"}; }; }; class Plane { From d523ef1fcd8ee75b852fa35a0893658edb29c120 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 14 Apr 2016 10:57:36 -0500 Subject: [PATCH 33/56] Try to use cursorObject first --- addons/javelin/functions/fnc_onOpticDraw.sqf | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 4bf80641e3..67e337291b 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -98,11 +98,17 @@ if (_range > 50 && {_range < 2500}) then { }; }; -if (isNull _newTarget) then { - private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; - if (_intersectionsToCursorTarget isEqualTo []) then { - _newTarget = cursorTarget; - }; +if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then { + private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + _newTarget = cursorObject; + }; +}; +if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then { + private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + _newTarget = cursorTarget; + }; }; // Create constants From d90fc3dd06a90c87d7aacc4c92186a9cca4eca2d Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 14 Apr 2016 18:58:01 +0200 Subject: [PATCH 34/56] Fix variable name and header examples --- addons/tagging/functions/fnc_createTag.sqf | 8 ++++---- addons/tagging/functions/fnc_tag.sqf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 5fa31478e2..4f83196524 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -13,15 +13,15 @@ * Tag created * * Example: - * [positionASL, vectorDirAndUp, "black", object] call ace_tagging_fnc_createTag + * [positionASL, vectorDirAndUp, "z\ace\addons\tagging\UI\tags\black\0.paa", object] call ace_tagging_fnc_createTag * * Public: No */ #include "script_component.hpp" -params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object", "_unit"]; -TRACE_5("createTag:",_tagPosASL,_vectorDirAndUp,_color,_object,_unit); +params ["_tagPosASL", "_vectorDirAndUp", "_texture", "_object", "_unit"]; +TRACE_5("createTag:",_tagPosASL,_vectorDirAndUp,_texture,_object,_unit); if (_texture == "") exitWith { ACE_LOGERROR_1("%1 is not a valid tag texture.",_texture); @@ -34,7 +34,7 @@ _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; // Throw a global event for mision makers -["tagCreated", [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); +["tagCreated", [_tag, _texture, _object, _unit]] call EFUNC(common,globalEvent); if (isNull _object) exitWith {true}; diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index 3bd559f702..43e951629e 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -10,7 +10,7 @@ * Sucess * * Example: - * success = [player, "blue"] call ace_tagging_fnc_tag + * success = [player, "z\ace\addons\tagging\UI\tags\black\0.paa"] call ace_tagging_fnc_tag * * Public: Yes */ From 7bd2378c41bf6b6275ecd25e1755ec7bfed34393 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 16 Apr 2016 12:54:33 -0500 Subject: [PATCH 35/56] Concertina Wire - Don't recoil broken wire, fix killer Close #3695 - Don't recoil broken wire - Use midpoint to search for nearby cars, and ensure the veh was moving. --- addons/concertina_wire/CfgVehicles.hpp | 2 +- addons/concertina_wire/functions/fnc_handleKilled.sqf | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp index dd18c07209..88975ea7e9 100644 --- a/addons/concertina_wire/CfgVehicles.hpp +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -86,7 +86,7 @@ class CfgVehicles { selection = ""; displayName = "$STR_ACE_UNROLLWIRE"; distance = 5; - condition = "true"; + condition = "alive _target"; statement = QUOTE([ARR_2(_target,_player)] call FUNC(dismount)); showDisabled = 0; exceptions[] = {}; diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index ac59798d10..1af3f93151 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -14,13 +14,17 @@ */ #include "script_component.hpp" params ["_wire", "_killer"]; +TRACE_2("params",_wire,_killer); private ["_distance", "_vehicle"]; if (isNull _killer) then { _killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull]; if (isNull _killer) then { - _killer = nearestObject [_wire, "car"]; + private _midPoint = ((_wire selectionPosition "start") vectorAdd (_wire selectionPosition "deploy")) vectorMultiply 0.5; + { + if ((vectorMagnitude velocity _x) > 0) exitWith {_killer = _x}; + } forEach (nearestObjects [(_wire modelToWorld _midPoint), ["Car"], 8]); }; }; if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {}; From 23632281cfe8c1f3bed73833dfd0cb574b7686ef Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 17 Apr 2016 23:22:41 -0500 Subject: [PATCH 36/56] Add day (non night vision) version of the vector 21 --- .../functions/fnc_handleFired.sqf | 2 +- addons/dagr/functions/fnc_menuInit.sqf | 2 +- addons/vector/CfgWeapons.hpp | 5 +++++ addons/vector/config.cpp | 2 +- addons/vector/functions/fnc_onKeyHold.sqf | 2 +- addons/vector/initKeybinds.sqf | 4 ++-- addons/vector/stringtable.xml | 12 ++++++++++++ 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 9646f065d4..aa6922946a 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -88,7 +88,7 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { _bulletTraceVisible = false; if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { - if (currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) then { + if (currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay", "Binocular", "Rangefinder", "Laserdesignator"]) then { _bulletTraceVisible = true; } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index e4fb341537..471150dd1c 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -522,7 +522,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __mainText) ctrlSetText "Connecting..."; }; if (ACE_time - GVAR(busyTimer) > 0.6) then { - if (ACE_player hasWeapon "ACE_Vector") then { + if ((ACE_player hasWeapon "ACE_Vector") || {ACE_player hasWeapon "ACE_VectorDay"}) then { GVAR(displaySelection) = "VECTOR"; (__dsp displayCtrl __mainText) ctrlSetText "Vector Connected"; GVAR(vectorConnected) = true; diff --git a/addons/vector/CfgWeapons.hpp b/addons/vector/CfgWeapons.hpp index 019d774da8..a28321bdc8 100644 --- a/addons/vector/CfgWeapons.hpp +++ b/addons/vector/CfgWeapons.hpp @@ -13,4 +13,9 @@ class CfgWeapons { opticsZoomMin = 0.06621; weaponInfoType = "ACE_RscOptics_vector"; }; + class ACE_VectorDay: ACE_Vector { + author = ECSTRING(common,ACETeam); + displayName = CSTRING(VectorDayName); + visionMode[] = {"Normal"}; + }; }; diff --git a/addons/vector/config.cpp b/addons/vector/config.cpp index e2a52b47ef..e4cdf9a55b 100644 --- a/addons/vector/config.cpp +++ b/addons/vector/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {"ACE_Item_Vector"}; - weapons[] = {"ACE_Vector"}; + weapons[] = {"ACE_Vector", "ACE_VectorDay"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"Ghost","Hamburger SV","commy2","bux578"}; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index ff4e5fc6ad..b76fe0ad0c 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -7,7 +7,7 @@ PFH executed while holding a vector key down. */ #include "script_component.hpp" -if (currentWeapon ACE_player != "ACE_Vector") exitWith { +if (!(currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"])) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; GVAR(currentMode) = ""; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index babef0819c..0d4bb59d27 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -5,7 +5,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {cameraView == "GUNNER"}) exitWith {false}; + if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false}; // prevent holding down if (GETGVAR(isDownStateKey1,false)) exitWith {false}; @@ -34,7 +34,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {cameraView == "GUNNER"}) exitWith {false}; + if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false}; // prevent holding down if (GETGVAR(isDownStateKey2,false)) exitWith {false}; diff --git a/addons/vector/stringtable.xml b/addons/vector/stringtable.xml index 80135294d4..fd8d73858c 100644 --- a/addons/vector/stringtable.xml +++ b/addons/vector/stringtable.xml @@ -2,6 +2,18 @@ + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite + + Vector 21 Vector 21 Vector 21 From 65ccf66d004cacdad823c109fe7f9a1d27ce43ed Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Mon, 18 Apr 2016 15:20:35 +0200 Subject: [PATCH 37/56] Fixed redundant privates in setCardiacArrest --- addons/medical/functions/fnc_setCardiacArrest.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 7b2c195f10..bf4a679bdc 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -27,11 +27,10 @@ _unit setVariable [QGVAR(heartRate), 0]; _timeInCardiacArrest = 120 + round(random(600)); [{ - private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"]; params ["_args", "_idPFH"]; _args params ["_unit", "_startTime", "_timeInCardiacArrest"]; - _heartRate = _unit getVariable [QGVAR(heartRate), 80]; + private _heartRate = _unit getVariable [QGVAR(heartRate), 80]; if (_heartRate > 0 || !alive _unit) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; _unit setVariable [QGVAR(inCardiacArrest), nil,true]; From 236ad912af949e3b077d33326ab46fc9afb5c808 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 19 Apr 2016 12:59:41 -0500 Subject: [PATCH 38/56] Gforces - Add ace_setting to only run in aircraft --- addons/gforces/ACE_Settings.hpp | 8 ++++ addons/gforces/XEH_PREP.hpp | 2 +- addons/gforces/XEH_postInit.sqf | 42 +++++++++++++++---- addons/gforces/functions/fnc_addPFEH.sqf | 29 +++++++++++++ .../functions/fnc_pfhUpdateGForces.sqf | 6 ++- addons/gforces/stringtable.xml | 15 +++++++ 6 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 addons/gforces/ACE_Settings.hpp create mode 100644 addons/gforces/functions/fnc_addPFEH.sqf create mode 100644 addons/gforces/stringtable.xml diff --git a/addons/gforces/ACE_Settings.hpp b/addons/gforces/ACE_Settings.hpp new file mode 100644 index 0000000000..617adb21da --- /dev/null +++ b/addons/gforces/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(enabledFor) { + displayName = CSTRING(enabledFor_displayName); + typeName = "SCALAR"; + value = 2; + values[] = {ECSTRING(Common,Disabled), CSTRING(enabledFor_onlyAircraft), ECSTRING(Common,Enabled)}; + }; +}; diff --git a/addons/gforces/XEH_PREP.hpp b/addons/gforces/XEH_PREP.hpp index 1d3d8dac05..d7ef509174 100644 --- a/addons/gforces/XEH_PREP.hpp +++ b/addons/gforces/XEH_PREP.hpp @@ -1,2 +1,2 @@ - +PREP(addPFEH); PREP(pfhUpdateGForces); diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index 23abe8e826..d1df112606 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -2,14 +2,38 @@ if (!hasInterface) exitWith {}; -// Setup ppEffect -GVAR(GForces_CC) = ppEffectCreate ["ColorCorrections", 4215]; -GVAR(GForces_CC) ppEffectEnable true; -GVAR(GForces_CC) ppEffectForceInNVG true; -GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; -GVAR(GForces_CC) ppEffectCommit 0.4; +GVAR(pfID) = -1; -GVAR(lastUpdateTime) = 0; -GVAR(oldVel) = [0,0,0]; +["SettingsInitialized", { + TRACE_1("SettingsInitialized eh",GVAR(enabledFor)); -[DFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; + if (GVAR(enabledFor) == 0) exitWith {}; //Module has no effect if enabledFor is "None" + if (GVAR(enabledFor) == 2) exitWith { //PFEH is always on when enabledFor is "All" + [] call FUNC(addPFEH); + TRACE_1("adding perm PFEH",GVAR(pfID)); + }; + + //PFEH only runs when player is in a type "Air" vehicle when enabledFor is "Aircraft" + + if ((!isNull (vehicle ACE_player)) && {(vehicle ACE_player) isKindOf "Air"}) then { //"playerVehicleChanged" can happen before "settingInit" + [] call FUNC(addPFEH); + TRACE_1("adding temp PFEH [start in]",GVAR(pfID)); + }; + ["playerVehicleChanged", { + params ["", "_vehicle"]; + TRACE_2("playerVehicleChanged",_vehicle,typeOf _vehicle); + if (_vehicle isKindOf "Air") then { + if (GVAR(pfID) == -1) then { + [] call FUNC(addPFEH); + TRACE_1("adding temp PFEH",GVAR(pfID)); + }; + } else { + if (GVAR(pfID) != -1) then { + TRACE_1("removing temp PFEH",GVAR(pfID)); + ppEffectDestroy GVAR(GForces_CC); + [GVAR(pfID)] call CBA_fnc_removePerFrameHandler; + GVAR(pfID) = -1; + }; + }; + }] call EFUNC(common,addEventHandler); +}] call EFUNC(common,addEventHandler); diff --git a/addons/gforces/functions/fnc_addPFEH.sqf b/addons/gforces/functions/fnc_addPFEH.sqf new file mode 100644 index 0000000000..50311c3a06 --- /dev/null +++ b/addons/gforces/functions/fnc_addPFEH.sqf @@ -0,0 +1,29 @@ +/* + * Author: KoffeinFlummi and esteldunedain + * Adds the PFEH + * + * Argument: + * None + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +//Reset forces array +GVAR(GForces) = []; +GVAR(GForces_Index) = 0; + +// Setup ppEffect +GVAR(GForces_CC) = ppEffectCreate ["ColorCorrections", 4215]; +GVAR(GForces_CC) ppEffectEnable true; +GVAR(GForces_CC) ppEffectForceInNVG true; +GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; +GVAR(GForces_CC) ppEffectCommit 0.4; + +GVAR(lastUpdateTime) = 0; +GVAR(oldVel) = [0,0,0]; + +GVAR(pfID) = [DFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index dd569781e7..dc6f11ee39 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -13,14 +13,14 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_params,_pfhId); - // Update the g-forces at constant mission time intervals (taking accTime into account) if ((ACE_time - GVAR(lastUpdateTime)) < INTERVAL) exitWith {}; GVAR(lastUpdateTime) = ACE_time; if (isNull ACE_player || !(alive ACE_player)) exitWith {}; +BEGIN_COUNTER(everyInterval); + private _newVel = velocity (vehicle ACE_player); private _accel = ((_newVel vectorDiff GVAR(oldVel)) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8]; // Cap maximum G's to +- 10 to avoid g-effects when the update is low fps. @@ -91,3 +91,5 @@ if !(ACE_player getVariable ["ACE_isUnconscious", false]) then { }; GVAR(GForces_CC) ppEffectCommit INTERVAL; + +END_COUNTER(everyInterval); diff --git a/addons/gforces/stringtable.xml b/addons/gforces/stringtable.xml new file mode 100644 index 0000000000..ee57af2f86 --- /dev/null +++ b/addons/gforces/stringtable.xml @@ -0,0 +1,15 @@ + + + + + Gforces Effects + Gforces Effekte + Efectos Gforces + + + Only Aircraft + Nur Luftfahrzeug + Sólo Aeronave + + + \ No newline at end of file From 3adbb59f048cd1c46fbcfd03917e841cad75dec0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 19 Apr 2016 23:04:51 -0500 Subject: [PATCH 39/56] Geforce - Change default to aircraft only --- addons/gforces/ACE_Settings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/gforces/ACE_Settings.hpp b/addons/gforces/ACE_Settings.hpp index 617adb21da..dbe6dec13a 100644 --- a/addons/gforces/ACE_Settings.hpp +++ b/addons/gforces/ACE_Settings.hpp @@ -2,7 +2,7 @@ class ACE_Settings { class GVAR(enabledFor) { displayName = CSTRING(enabledFor_displayName); typeName = "SCALAR"; - value = 2; + value = 1; values[] = {ECSTRING(Common,Disabled), CSTRING(enabledFor_onlyAircraft), ECSTRING(Common,Enabled)}; }; }; From cf9479efabbed227ee553af9f0b8a1edc24375e8 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 20 Apr 2016 10:40:00 -0500 Subject: [PATCH 40/56] Non-hardcoded binocular / vector detection --- addons/advanced_ballistics/functions/fnc_handleFired.sqf | 2 +- addons/dagr/functions/fnc_menuInit.sqf | 2 +- addons/vector/functions/fnc_onKeyHold.sqf | 2 +- addons/vector/initKeybinds.sqf | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index aa6922946a..c73cbda3d7 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -88,7 +88,7 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { _bulletTraceVisible = false; if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { - if (currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay", "Binocular", "Rangefinder", "Laserdesignator"]) then { + if ((currentWeapon ACE_player == binocular ACE_player) && {binocular ACE_player != ""}) then { _bulletTraceVisible = true; } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 471150dd1c..54cb4467c5 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -522,7 +522,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __mainText) ctrlSetText "Connecting..."; }; if (ACE_time - GVAR(busyTimer) > 0.6) then { - if ((ACE_player hasWeapon "ACE_Vector") || {ACE_player hasWeapon "ACE_VectorDay"}) then { + if (({_x isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]} count (weapons ACE_player)) > 0) then { GVAR(displaySelection) = "VECTOR"; (__dsp displayCtrl __mainText) ctrlSetText "Vector Connected"; GVAR(vectorConnected) = true; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index b76fe0ad0c..517cf3ea37 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -7,7 +7,7 @@ PFH executed while holding a vector key down. */ #include "script_component.hpp" -if (!(currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"])) exitWith { +if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"])) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; GVAR(currentMode) = ""; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index 0d4bb59d27..5b099235da 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -5,7 +5,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false}; + if !(((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) && {cameraView == "GUNNER"}) exitWith {false}; // prevent holding down if (GETGVAR(isDownStateKey1,false)) exitWith {false}; @@ -34,7 +34,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false}; + if !(((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) && {cameraView == "GUNNER"}) exitWith {false}; // prevent holding down if (GETGVAR(isDownStateKey2,false)) exitWith {false}; From c2126c3bd42b5e14d37bebdced6101d38414cf70 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 20 Apr 2016 10:48:25 -0500 Subject: [PATCH 41/56] Simplify binocular check --- addons/advanced_ballistics/functions/fnc_handleFired.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index c73cbda3d7..7844e8a53a 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -88,7 +88,7 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { _bulletTraceVisible = false; if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { - if ((currentWeapon ACE_player == binocular ACE_player) && {binocular ACE_player != ""}) then { + if (currentWeapon ACE_player == binocular ACE_player) then { _bulletTraceVisible = true; } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { From 4214e31678fd6bd1e2c3c95f4694d23dcc054ece Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 21 Apr 2016 13:15:35 -0500 Subject: [PATCH 42/56] Fix BIS gesture keybinds - From #3635 - FUNC(playSignal) needs "BIgesture" prefix - Interaction conditions are checked on parent, don't need on every child --- addons/gestures/CfgVehicles.hpp | 28 ++++++++++++++-------------- addons/gestures/XEH_postInit.sqf | 7 ++++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/gestures/CfgVehicles.hpp b/addons/gestures/CfgVehicles.hpp index 4bf98f4978..8294f43759 100644 --- a/addons/gestures/CfgVehicles.hpp +++ b/addons/gestures/CfgVehicles.hpp @@ -13,98 +13,98 @@ class CfgVehicles { class GVAR(Advance) { displayName = CSTRING(Advance); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow 'gestureAdvance';); showDisabled = 1; priority = 1.9; }; class GVAR(Go) { displayName = CSTRING(Go); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); showDisabled = 1; priority = 1.8; }; class GVAR(Follow) { displayName = CSTRING(Follow); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow 'gestureFollow';); showDisabled = 1; priority = 1.7; }; class GVAR(Up) { displayName = CSTRING(Up); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow 'gestureUp';); showDisabled = 1; priority = 1.5; }; class GVAR(CeaseFire) { displayName = CSTRING(CeaseFire); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow 'gestureCeaseFire';); showDisabled = 1; priority = 1.3; }; class GVAR(Stop) { displayName = CSTRING(Stop); - condition = QUOTE(canStand _target); + condition = QUOTE(true); statement = QUOTE(_target playActionNow 'gestureFreeze';); // BI animation - is actualls "stop" in all stances but prone showDisabled = 1; priority = 1.2; }; class GVAR(Forward) { displayName = CSTRING(Forward); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(forward)) call FUNC(playSignal)); showDisabled = 1; priority = 1.9; }; class GVAR(Regroup) { displayName = CSTRING(Regroup); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(regroup)) call FUNC(playSignal)); showDisabled = 1; priority = 1.8; }; class GVAR(Freeze) { displayName = CSTRING(Freeze); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(freeze)) call FUNC(playSignal)); showDisabled = 1; priority = 1.7; }; class GVAR(Cover) { displayName = CSTRING(Cover); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(cover)) call FUNC(playSignal)); showDisabled = 1; priority = 1.6; }; class GVAR(Point) { displayName = CSTRING(Point); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(point)) call FUNC(playSignal)); showDisabled = 1; priority = 1.5; }; class GVAR(Engage) { displayName = CSTRING(Engage); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(engage)) call FUNC(playSignal)); showDisabled = 1; priority = 1.4; }; class GVAR(Hold) { displayName = CSTRING(Hold); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(hold)) call FUNC(playSignal)); showDisabled = 1; priority = 1.3; }; class GVAR(Warning) { displayName = CSTRING(Warning); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(warning)) call FUNC(playSignal)); showDisabled = 1; priority = 1.2; diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index b764aeb176..5aa1de9874 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -10,9 +10,10 @@ GVAR(ReloadMutex) = true; _x params ["_currentName", "_key", ["_vanillaKey", false] ]; // Don't add "ace_gestures_" prefix to BI gestures - private _signalName = _currentName; - if (!_vanillaKey) then { - _signalName = format [QGVAR(%1), _currentName]; + private _signalName = if (_vanillaKey) then { + format ["BIgesture%1", _currentName]; + } else { + format [QGVAR(%1), _currentName]; }; private _code = compile format [QUOTE('%1' call FUNC(playSignal)), _signalName]; From 097bba9b6867e1aa1b2c4f0b09182f7f0eca4bc0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 21 Apr 2016 13:21:55 -0500 Subject: [PATCH 43/56] Spaces --- addons/gestures/XEH_postInit.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index 5aa1de9874..6d9e057e29 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -10,10 +10,10 @@ GVAR(ReloadMutex) = true; _x params ["_currentName", "_key", ["_vanillaKey", false] ]; // Don't add "ace_gestures_" prefix to BI gestures - private _signalName = if (_vanillaKey) then { - format ["BIgesture%1", _currentName]; + private _signalName = if (_vanillaKey) then { + format ["BIgesture%1", _currentName]; } else { - format [QGVAR(%1), _currentName]; + format [QGVAR(%1), _currentName]; }; private _code = compile format [QUOTE('%1' call FUNC(playSignal)), _signalName]; From c432ce714e89ea891fb396e43aa212c5b572b00e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 21 Apr 2016 13:56:32 -0500 Subject: [PATCH 44/56] Make explosives helpers hidden in eden. --- addons/explosives/CfgVehicles.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 5f81bde127..d5e7e5c968 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -50,7 +50,7 @@ class CfgVehicles { mapSize = 0.2; icon = "iconObject_1x2"; model = "\A3\Weapons_f\dummyweapon.p3d"; - scope = 2; + scope = 1; scopeCurator = 1; vehicleClass = "Cargo"; class ACE_Actions { @@ -81,7 +81,7 @@ class CfgVehicles { mapSize = 0.2; icon = "iconObject_1x2"; model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; - scope = 2; + scope = 1; scopeCurator = 1; vehicleClass = "Cargo"; class ACE_Actions { From 9bd66bc40f01699776031d05fcc4a0b6d3c5dea9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 21 Apr 2016 15:07:13 -0500 Subject: [PATCH 45/56] Cleanup scopeCurator --- addons/explosives/CfgVehicles.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index d5e7e5c968..3db6546208 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -51,7 +51,6 @@ class CfgVehicles { icon = "iconObject_1x2"; model = "\A3\Weapons_f\dummyweapon.p3d"; scope = 1; - scopeCurator = 1; vehicleClass = "Cargo"; class ACE_Actions { class ACE_MainActions { @@ -82,7 +81,6 @@ class CfgVehicles { icon = "iconObject_1x2"; model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; scope = 1; - scopeCurator = 1; vehicleClass = "Cargo"; class ACE_Actions { class ACE_MainActions { From b06659a2e40e4d1136e2fa614b15e27a1fea0635 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 23 Apr 2016 00:29:58 +0200 Subject: [PATCH 46/56] Fix params error --- addons/ui/CfgVehicles.hpp | 3 ++- addons/ui/XEH_clientInit.sqf | 3 +-- addons/ui/functions/fnc_setElements.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 24340db031..391b3627eb 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -9,13 +9,14 @@ class CfgVehicles { isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { - // BASIC class allowSelectiveUI { displayName = CSTRING(AllowSelectiveUI); description = CSTRING(AllowSelectiveUI_Description); typeName = "BOOL"; defaultValue = 1; }; + + // BASIC class soldierVehicleWeaponInfo { displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 97cc3e026b..d228696fc0 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,4 +1,3 @@ -//#define DEBUG_MODE_FULL #include "script_component.hpp" // Exit on Headless @@ -24,7 +23,7 @@ if (!hasInterface) exitWith {}; // Selective UI Basic if (_name in ELEMENTS_BASIC) then { - call FUNC(setElements); + [false] call FUNC(setElements); }; // Selective UI Advanced diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 92cc981065..b94b0f9a22 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -20,7 +20,7 @@ if (isArray (missionConfigFile >> "showHUD")) exitWith {}; params [ ["_force", false, [true]] ]; if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { - [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured); }; private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] From 27c55981358383e00ad0a6b4774005c896a98f6d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 24 Apr 2016 11:26:13 -0500 Subject: [PATCH 47/56] vehicle inventory lock - compatibility with acre --- addons/vehiclelock/CfgEventHandlers.hpp | 8 ----- addons/vehiclelock/XEH_postInit.sqf | 10 +++++++ .../functions/fnc_onOpenInventory.sqf | 29 ++++++++++--------- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/addons/vehiclelock/CfgEventHandlers.hpp b/addons/vehiclelock/CfgEventHandlers.hpp index 705415e65d..712cc2be1c 100644 --- a/addons/vehiclelock/CfgEventHandlers.hpp +++ b/addons/vehiclelock/CfgEventHandlers.hpp @@ -17,14 +17,6 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_InventoryOpened_EventHandlers { - class CAManBase { - class ADDON { - clientInventoryOpened = QUOTE(_this call FUNC(onOpenInventory);); - }; - }; -}; - class Extended_InitPost_EventHandlers { class Car { class ADDON { diff --git a/addons/vehiclelock/XEH_postInit.sqf b/addons/vehiclelock/XEH_postInit.sqf index c635de2bd3..93d8bd6426 100644 --- a/addons/vehiclelock/XEH_postInit.sqf +++ b/addons/vehiclelock/XEH_postInit.sqf @@ -3,3 +3,13 @@ //Add Event Handlers ["VehicleLock_SetupCustomKey", {_this call FUNC(serverSetupCustomKeyEH)}] call EFUNC(common,addEventHandler); ["VehicleLock_SetVehicleLock", {_this call FUNC(setVehicleLockEH)}] call EFUNC(common,addEventHandler); + +if (!hasInterface) exitwith {}; + +["SettingsInitialized", { + TRACE_1("SettingsInitialized eh",GVAR(LockVehicleInventory)); + + if (GVAR(LockVehicleInventory)) then { + ["CAManBase", "InventoryOpened", {_this call FUNC(onOpenInventory);}] call CBA_fnc_addClassEventHandler; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 17682c72de..5ac9ee427e 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -7,7 +7,7 @@ * 1: Container * * Return Value: - * Handeled + * None * * Example: * [player, car] call ACE_VehicleLock_fnc_onOpenInventory; @@ -20,10 +20,7 @@ params ["_unit", "_container"]; TRACE_2("params",_unit,_container); //Only check for player: -if (_unit != ace_player) exitWith {false}; - -private "_handeled"; -_handeled = false; +if (_unit != ace_player) exitWith {}; if (GVAR(LockVehicleInventory) && //if setting not enabled {(vehicle ace_player) == ace_player} && //Player dismounted @@ -33,15 +30,19 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled ) then { //Give feedback that vehicle is locked playSound "ACE_Sound_Click"; - //don't open the vehicles inventory - _handeled = true; - // As of 1.54 the action needs to be delayed a frame to work, which used not to be the case + //For compatibiltiy with ACRE, wait until the display is open, close it and then reopen the player's own inventory + //ref: http://gitlab.idi-systems.com/idi-systems/acre2-public/issues/70 [{ - TRACE_1("delaying a frame", ace_player); - //Just opens a dummy groundContainer (so the player can still see their own inventory) - ACE_player action ["Gear", objNull]; - }, []] call EFUNC(common,execNextFrame); + !isNull (findDisplay 602) + }, + { + TRACE_1("car display open: closing", _this); + (findDisplay 602) closeDisplay 0; + [{ + TRACE_1("Opening Player Inventory", _this); + ACE_player action ["Gear", objNull] + }, []] call EFUNC(common,execNextFrame); + }, + []] call EFUNC(common,waitUntilAndExecute); }; - -_handeled From 5c3f5f5751d35751335e9e01099a809f37775b6c Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 25 Apr 2016 21:34:25 +0200 Subject: [PATCH 48/56] fix wrong macro names --- addons/recoil/CfgMoves.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/recoil/CfgMoves.hpp b/addons/recoil/CfgMoves.hpp index ecad382cb5..29bca9c81a 100644 --- a/addons/recoil/CfgMoves.hpp +++ b/addons/recoil/CfgMoves.hpp @@ -7,7 +7,7 @@ // Go through all modes that have a camshakefire defined and change it to ours. class CfgMovesBasic { class Default { - camShakeFire = ACE_CAMSHAKEFIRE_NORMAL; + camShakeFire = ACE_CAMSHAKEFIRE_BASE; }; }; @@ -69,7 +69,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { class AmovPknlMstpSrasWrflDnon; class AmovPknlMwlkSrasWrflDf: AmovPknlMstpSrasWrflDnon { - camShakeFire = ACE_CAMSHAKEFIRE_NORMAL; + camShakeFire = ACE_CAMSHAKEFIRE_BASE; }; class AmovPknlMrunSrasWrflDf; From d40735d5c2a1a3fdd1f624b3ceea772c12363a56 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 25 Apr 2016 15:48:24 -0500 Subject: [PATCH 49/56] Improve synced event error logging --- addons/common/functions/fnc__handleRequestSyncedEvent.sqf | 2 +- addons/common/functions/fnc__handleSyncedEvent.sqf | 2 +- addons/common/functions/fnc_addSyncedEventHandler.sqf | 5 ++++- addons/common/functions/fnc_removeSyncedEventHandler.sqf | 2 +- addons/common/functions/fnc_syncedEvent.sqf | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 605af2fa85..9d6c062ac2 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -23,7 +23,7 @@ if (isServer) then { params ["_eventName", "_client"]; if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { - ACE_LOGERROR("Request for synced event - key not found."); + ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName); false }; diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index f8fe21d760..db8151dbd7 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -17,7 +17,7 @@ params ["_name", "_args", "_ttl"]; if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { - ACE_LOGERROR("Synced event key not found."); + ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name); false }; diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 0964e419bc..126bb6a957 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -10,6 +10,9 @@ * Return Value: * Boolean of success * + * Example: + * ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler + * * Public: Yes */ #include "script_component.hpp" @@ -17,7 +20,7 @@ params ["_name", "_handler", ["_ttl", 0]]; if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { - ACE_LOGERROR("Duplicate synced event creation."); + ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name); false }; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 126bf0b70f..23803acdd1 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -15,7 +15,7 @@ params ["_name"]; if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { - ACE_LOGERROR("Synced event key not found."); + ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name); false }; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 4ed8107330..c752d1eba2 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -17,7 +17,7 @@ params ["_name", "_args", ["_ttl", 0]]; if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { - ACE_LOGERROR("Synced event key not found."); + ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name); false }; From 3389bc5e1b0005c808c8b8f835b9d7a8c6c6d3ee Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 28 Apr 2016 04:44:57 +0200 Subject: [PATCH 50/56] Add cargo to Taru pods --- addons/cargo/CfgVehicles.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index dfeab3b017..3b2239019d 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -304,6 +304,25 @@ class CfgVehicles { GVAR(canLoad) = 1; }; + // Taru pods + class Pod_Heli_Transport_04_base_F; + class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_box_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 20; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_medevac_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 12; + GVAR(hasCargo) = 1; + }; + class StaticMortar; class Mortar_01_base_F: StaticMortar { GVAR(size) = 2; // 1 = small, 2 = large From 7d0fcde9fa695c4612ad656a712d2c5236c3598f Mon Sep 17 00:00:00 2001 From: ProfessorCZ Date: Sat, 30 Apr 2016 00:57:24 +0200 Subject: [PATCH 51/56] CZ Translate - Update 04/30/2016 --- addons/cargo/stringtable.xml | 5 +- addons/common/stringtable.xml | 1 + addons/explosives/stringtable.xml | 6 ++ addons/fastroping/stringtable.xml | 8 +++ addons/gforces/stringtable.xml | 2 + addons/interaction/stringtable.xml | 5 +- addons/medical/stringtable.xml | 77 +++++++++++++++----------- addons/medical_menu/stringtable.xml | 10 ++-- addons/missileguidance/stringtable.xml | 4 +- addons/mk6mortar/stringtable.xml | 18 ++++++ addons/overheating/stringtable.xml | 10 +++- addons/repair/stringtable.xml | 3 +- addons/spectator/stringtable.xml | 6 +- addons/tagging/stringtable.xml | 11 +++- addons/trenches/stringtable.xml | 11 +++- addons/ui/stringtable.xml | 34 +++++++++++- 16 files changed, 160 insertions(+), 51 deletions(-) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 57daacd207..e3cb368362 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -175,6 +175,7 @@ Rendi oggetto caricabile Hacer objeto cargable Rendre l'objet chargeable + Vytvořit objekt nakladatelným Sets the synced object as loadable by the cargo system. @@ -183,6 +184,7 @@ Imposta l'oggetto sincronizzato come caricabile dal sistema cargo Sincronizar un objecto para hacerlo cargable. Rend l'objet synchronisé comme chargeable par le système de cargaison. + Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému. Object's Size @@ -191,6 +193,7 @@ Dimensioni dell'oggetto Tamaño del objeto Taille de l'objet + Velikost objektu - + \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 32a979653f..820712189f 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -802,6 +802,7 @@ Non c'è spazio per scaricare No hay espacio para descargar. Pas de place pour décharger + Nedostatek místa k vyložení \ No newline at end of file diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 4cabe2ce06..c49d09502f 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -648,6 +648,7 @@ Mina M6 SLAM (Ataque Inferior) Mine M6 SLAM (par le bas) Mina M6 SLAM (base) + M6 SLAM (Útok zespoda) M6 SLAM Mine (Side Attack) @@ -663,6 +664,7 @@ Mina M6 SLAM (Ataque Lateral) Mine M6 SLAM (de flanc) STR_ACE_Explosives_Module_SLAMBottomAttack_DisplayName M6 SLAM Mine (Bottom Attack) Mine M6 SLAM (par le bas) M6-SLAM-Mine (Bodenangriff) Mina M6 SLAM (base) Mina M6 SLAM (atak od dołu) Mina M6 SLAM (Laterale) + M6 SLAM (Útok do strany) Large IED (Urban, Pressure Plate) @@ -678,6 +680,7 @@ IED Grande (Urbano, Placa de presión) Grand EEI (Urbain, plaque de pression) IED grande (urbano, a pressione) + IED, Velké (Městské, Nášlapné) Large IED (Dug-in, Pressure Plate) @@ -693,6 +696,7 @@ IED Grande (Enterrado, Placa de presión) Grand EEI (Enterré, plaque de pression) IED grande (interrato, a pressione) + IED, Velké (Zakopané, Nášlapné) Small IED (Urban, Pressure Plate) @@ -708,6 +712,7 @@ IED Pequeño (Urbano, Placa de presión) Petit EEI (Urbain, plaque de pression) IED piccolo (urbano, a pressione) + IED, Malé (Městské, Nášlapné) Small IED (Dug-in, Pressure Plate) @@ -723,6 +728,7 @@ IED Pequeño (Enterrado, Placa de presión) Petit EEI (Enterré, plaque de pression) IED piccolo (interrato, a pressione) + IED, Malé (Zakopané, Nášlapné) Connect to %1 diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 1a03e59409..7b0e4ad1f8 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -8,6 +8,7 @@ Equiper le FRIES Equipar FRIES Equipaggia la FRIES + Vybavit FRIES Equips compatible helicopters with a Fast Rope Insertion Extraction System. @@ -16,6 +17,7 @@ Equipe les hélicoptères compatibles avec un Module Fast Rope Insertion Extraction System. Equipar helicoptero compatible con un Sistema de Inserción Extracción Fast Rope. Equipagga l'elicottero compatibile con il Fast Rope Insertion Exstraction System + Vybavit kompatibilní vrtulníky systémem Fast Rope Insertion Extraction (FRIES). Prepare fast roping system @@ -24,6 +26,7 @@ Préparer le système de corde lisse Preparar el sistema fast roping Prepara le corde + Připravit systém slaňování Deploy ropes @@ -32,6 +35,7 @@ Déployer les cordes Desplegar cuerdas Srotola le corde + Připravit lana Fast rope @@ -40,6 +44,7 @@ Descendre à la corde Descender por la cuerda Scendi sulla corda + SLANIT Cut ropes @@ -48,6 +53,7 @@ Détacher les cordes Cortar cuerdas Taglia le corde + Odříznout lano Equip helicopter with FRIES @@ -56,6 +62,7 @@ Equiper l'hélicoptère avec le FRIED Equipar helicoptero con FRIES Equipaggia l'elicottero con FRIES + Vybavit vrtulník pomocí FRIES Equips the selected helicopter with a Fast Rope Insertion Extraction System @@ -64,6 +71,7 @@ Equipe l'hélicoptère sélectionné avec un Fast Rope Insertion Extraction System Equipa el helicoptero seleccionado con un Sistema de Inserción Extracción Fast Rope Equipaggia l'elicottero selezionato con il Fast Rope Insertion Extraction System + Vybavit vybraný vrtulník systémem Fast Rope Insertion Extraction (FRIES) LET UNITS FAST ROPE diff --git a/addons/gforces/stringtable.xml b/addons/gforces/stringtable.xml index ee57af2f86..f5d5f1b12d 100644 --- a/addons/gforces/stringtable.xml +++ b/addons/gforces/stringtable.xml @@ -5,11 +5,13 @@ Gforces Effects Gforces Effekte Efectos Gforces + G Force efekty Only Aircraft Nur Luftfahrzeug Sólo Aeronave + Pouze letadla \ No newline at end of file diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 0e1afa21a1..812964bbb7 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -356,6 +356,7 @@ Aussteigen! Sal del vehículo! Sortez ! + Vystupte Team Management @@ -712,6 +713,7 @@ Encender Allumer Accendi + Zapnout Turn off @@ -720,6 +722,7 @@ Apagar Eteindre Spegni + Vypnout Pass magazine @@ -760,7 +763,7 @@ %1 podał Ci magazynek %2. %1 передал вам магазин %2. %1 passou a você um carregador %2. - %1 ti podal %2 zásobník. + %1 ti podal zásobník %2. %1 ti ha passato un caricatore %2 . %1 te pasó un cargador %2. %1 vous a passé un chargeur %2. diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a3953be23b..ef0ccc68a2 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -56,6 +56,7 @@ Wstrzyknij adenozynę Injecter de l'adénosine Inietta andenosina + Aplikovat adenosine Inject Atropine @@ -256,6 +257,7 @@ Wstrzykiwanie adenozyny... Injection d'adénosine... Inietto l'andenosina + Aplikuji adenosine... Injecting Atropine... @@ -363,14 +365,14 @@ Bendaggio compressivo Bandage gauze Bandagem de Compressão - Tlakový obvaz + Obvaz Tlakový Elastic Bandage Elastischer Verband Vendaje elástico Давящая повязка - Elastické obinadlo + Obavaz Elastický Bandaż elastyczny Pansement élastique Rögzitő kötszer @@ -831,7 +833,7 @@ Nyomókötszer Bendaggio compressivo Bandagem de Compressão - Tlakový obvaz + Obvaz (Tlakový) Used to pack medium to large wounds and stem the bleeding @@ -864,7 +866,7 @@ Vendaje (Elástico) Bandage (Élastique) Bandaż (elastyczny) - Obvaz (elastický) + Obvaz (Elastický) Rögzító kötszer Benda (elastica) Bandagem (Elástica) @@ -936,7 +938,7 @@ Morfina auto-inyectable Auto-injecteur de Morphine Autostrzykawka z morfiną - Autoinjektor morfin + Auto-morfin Morfium autoinjektor Autoiniettore di morfina Auto-injetor de morfina @@ -972,6 +974,7 @@ Autostrzykawka z adenozyną Auto-injécteur d'adénosine Autoiniettore di adenosina + Auto-adenosine Used to counter effects of Epinephrine @@ -980,6 +983,7 @@ Adenozyna. Stosowana do zwalczania efektów działania adrenaliny. Utilisé pour contrer les effets de l'adrénaline Usato per contrastare l'effetto dell'epinefrina + Slouží jako protiváha Adrenalinu A drug used to counter the effects of Epinephrine @@ -988,6 +992,7 @@ Organiczny związek chemiczny z grupy nukleozydów. Skuteczna w leczeniu częstoskurczu komorowego. Działa rozszerzająco na naczynia krwionośne. Un composé utilisé pour contrer les effets de l'adrénaline Medicamento usato per contrastare l'effetto dell'epinefrina + Droga používaná k tlumení efektu Adrenalinu Atropine autoinjector @@ -996,7 +1001,7 @@ Auto-injecteur d'Atropine Autostrzykawka AtroPen Atropin-Autoinjektor - Autoinjektor atropin + Auto-atropine Atropin autoinjektor Autoiniettore di atropina Auto-injetor de Atropina @@ -1032,7 +1037,7 @@ Auto-injecteur d'épinéphrine Autostrzykawka EpiPen Epiniphrin-Autoinjektor - Autoinjektor adrenalin + Auto-adrenalin Epinefrin autoinjektor Autoiniettore di adrenalina Auto-injetor de epinefrina @@ -1287,7 +1292,7 @@ Elsősegélycsomag Pronto soccorso personale Kit De Primeiros Socorros Pessoal - Osobní lékárnička + Osobní lékárnička (PAK) Includes various treatment kit needed for stitching or advanced treatment @@ -1322,7 +1327,7 @@ Usar equipo de primeros auxilios Elsősegélycsomag használata Usar o kit de primeiros socorros - Použít osobní lékárničku + Použít osobní lékárničku (PAK) Usa il pronto soccorso personale @@ -1431,7 +1436,7 @@ Vérnyomás megmérése... Controllando la pressione sanguigna.. Aferindo Pressão Arterial... - Kontroluji krevní tlak... + Měřím krevní tlak... %1 checked Blood Pressure: %2 @@ -1442,7 +1447,7 @@ %1 sprawdził ciśnienie krwi: %2 %1 verificada la presión arterial: %2 %1 ellenőrizte a vérnyomást: %2 - %1 zkontrolován krevní tlak: %2 + %1 zkontroloval krevní tlak: %2 %1 verificou pressão arterial: %2 @@ -1467,7 +1472,7 @@ Wyczuwasz ciśnienie krwi o wartości %2/%3 Der Blutdruck liegt bei %2/%3 A Pressão Arterial é de %2/%3 - Našel jsi krevní tlak u %2/%3 + Naměřil si krevní tlak u %2/%3 You find a low blood pressure @@ -1479,7 +1484,7 @@ A vérnyomás alacsony La pressione sanguigna è bassa Pressão Arterial baixa - Naměřil jsi nízký krevní tlak + Naměřil si nízký krevní tlak You find a normal blood pressure @@ -1491,7 +1496,7 @@ A vérnyomás normális La pressione sanguigna è normale Pressão Arterial normal - Naměřil jsi normální krevní tlak + Naměřil si normální krevní tlak You find a high blood pressure @@ -1503,7 +1508,7 @@ A vérnyomás magas La pressione sanguigna è alta Pressão Arterial Alta - Naměřil jsi vysoký krevní tlak + Naměřil si vysoký krevní tlak You find no blood pressure @@ -1515,7 +1520,7 @@ Nem észlelhető vérnyomás La pressione sanguigna è assente Sem Pressão Arterial - Nenaměřil jsi žádný krevní tlak + Nenaměřil si žádný krevní tlak You fail to find a blood pressure @@ -1527,7 +1532,7 @@ Nem sikerült a vérnyomás megmérése Manca strumento per misurare pressione sanguigna Você falhou em aferir a Pressão Arterial - Nedokázal jsi změřit krevní tlak + Nedokázal si změřit krevní tlak Low @@ -1587,7 +1592,7 @@ Pulzus Polso Pulso - Tep + Puls Checking Heart Rate... @@ -1611,7 +1616,7 @@ A %1 ellenőrizve Hai diagnosticato %1 Você aferiu o paciente %1 - Zkontroloval jsi %1 + Zkontroloval si %1 %1 checked Heart Rate: %2 @@ -1695,7 +1700,7 @@ A szívverés-szám alacsony Hai riscontrato un debole battito cardiaco Freqüência Cardíaca baixa - Nahmatal jsi slabý srdeční tep + Nahmatal si slabý srdeční puls You find a strong Heart Rate @@ -1707,7 +1712,7 @@ A szívverés-szám magas Hai riscontrato un forte battito cardiaco Freqüência Cardíaca normal - Nahmatal jsi silný srdeční tep + Nahmatal si silný srdeční puls You find a normal Heart Rate @@ -1719,7 +1724,7 @@ A szívverés-szám normális Hai riscontrato un normale battito cardiaco Freqüência Cardíaca alta - Nahmatal jsi normální srdeční tep + Nahmatal si normální srdeční puls You find no Heart Rate @@ -1731,7 +1736,7 @@ Nem észlelhető szívverés Hai riscontrato una assenza di battito cardiaco Sem Freqüência Cardíaca - Nenašel jsi + Žádný puls Response @@ -2172,7 +2177,7 @@ Gravemente herido Lourdement blessé Erősen sérült - Těžce zraněn + Těžce raněn Gravemente ferido @@ -2184,7 +2189,7 @@ Levemente herido Légèrement blessé Enyhén sérült - Lehce zraněn + Lehce raněn Levemente ferido @@ -2196,7 +2201,7 @@ Muy levemente herido Très légèrement blessé Nagyon enyhén sérült - Velmi lehce zraněn + Velmi lehce raněn Muito levemente ferido @@ -3205,6 +3210,7 @@ Ajustes médicos básicos [ACE] Réglages du système médical basic [ACE] Impostazioni Mediche Di Base [ACE] + Základní zdravotnické nastavení [ACE] Advanced Medical Settings [ACE] @@ -3321,6 +3327,7 @@ Ograniczenia adrenaliny Autoriser l'adrénaline Permette epinefrina + Povolit adrenalin Who can use Epinephrine for full heal? (Basic medical only) @@ -3329,6 +3336,7 @@ Kto może skorzystać z adrenaliny w celu pełnego uleczenia? (Tylko podstawowy system medyczny) Qui peut utiliser l'adrénaline pour les soins complets ? (Médical basique seulement) Chi può usare l'epinefrina per la cura completa? (solo per sistema medico di base) + Kdo může použít adrenalin k úplnému vyléčení? (Pouze základní zdravotní systém) Allow PAK @@ -3336,7 +3344,7 @@ Ustawienie apteczek osobistych Permitir EPA Erlaube Erste-Hilfe-Set - Povolit osobní lékárničky + Povolit osobní lékárničky (PAK) Permitir Kit de Primeiros Socorros Permettre le kit de premier secours Elsősegélycsomag engedélyezése @@ -3421,6 +3429,7 @@ Ograniczenia adrenaliny Position des adrénalines Ubicazione epinefrina + Oblast k použití adrenalinu Where can the Epinephrine be used? (Basic Medical) @@ -3429,6 +3438,7 @@ Gdzie można korzystać z adrenaliny? (Podstawowy system medyczny) Où peuvent être utilisées les adrénalines ? (Médical basique) Dove si può usare l'epinefrina? (Sistema medico di base) + Kde může být použit adrenalin? (Pouze základní zdravotní systém) Locations PAK @@ -3436,7 +3446,7 @@ Ograniczenie apteczek osobistych Ubicaciones del EPA Orte für Erste-Hilfe-Set - Lokace osobní lékárničky + Oblast k použití PAK Localizações do KPS Lieu d'utilisation du KPS Elsősegélycsomag helyek @@ -3448,7 +3458,7 @@ Gdzie można korzystać z apteczek osobistych? ¿Dónde se puede utilizar el equipo de primeros auxilios? Wo kann das Erste-Hilfe-Set verwendet werden? - Kde může být použita osobní lékárnička? + Kde může být použita osobní lékárnička (PAK)? Onde o kit de primeiros socorros pode ser utilizado? Où le Kit de Premier Secour peut être utilisé Hol lehet az elsősegélycsomagot használni? @@ -3457,7 +3467,7 @@ Condition PAK Bedingungen für d. Erste-Hilfe-Set - Podmínka osobní lékárničky + Podmínky pro použití osobní lékárničky Condición EPA Condition d'utilisation du KPS Warunek apteczek @@ -3469,7 +3479,7 @@ When can the PAK be used? Wann kann das Erste-Hilfe-Set verwendet werden? - Kde může být použita osobní lékárnička? + Kdy může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? Quand peut être utilisé le Kit de Premier Secours Po spełnieniu jakich warunków apteczka osobista może zostać zastosowana na pacjencie? @@ -3484,7 +3494,7 @@ Wszędzie Donde sea Überall - Kdekoli + Kdekoliv Qualquer lugar PArtout Akárhol @@ -4124,6 +4134,7 @@ Sanitätsausbildung Entrenamiento médico Entraînement médical + Lékařský výcvik Whether or not the object will be a medical vehicle. @@ -4137,6 +4148,7 @@ Delay cease fire of AI while player is unconscious for medical reasons. Verzögert das Ende des KI-Beschusses auf einen Spieler, wenn dieser aus medizinischen Gründen bewustlos wird. Ritarda il cessate il fuoco dell'IA quando il giocatore è svenuto per motivi medici. + Prodleva zastavení palby pro AI, pokud je hráč v bezvědomí ze zdravotních důvodů. Delay cease fire of AI for unconsciousness @@ -4144,6 +4156,7 @@ Demora antes de volverse neutral al caer inconsciente Opóźnij status captive u nieprzytomnych osób Ritarda il cessate il fuoco dell'IA quando si è svenuti + Prodleva zastavení palby AI na bezvědomé \ No newline at end of file diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml index f825882be6..e9812128f4 100644 --- a/addons/medical_menu/stringtable.xml +++ b/addons/medical_menu/stringtable.xml @@ -295,7 +295,7 @@ Selectioner Bras Gauche Wybierz lewą rękę Selecionar Braço Esquerdo - Vybrat Levou Ruku + Vybrat Levou ruku Seleziona Braccio Sinistro @@ -306,7 +306,7 @@ Selectioner Bras Droit Wybierz prawą rękę Selecionar Braço Direito - Vybrat Pravou Ruku + Vybrat Pravou ruku Seleziona Braccio Destro @@ -317,7 +317,7 @@ Selectioner Jambe Gauche Wybierz lewą nogę Selecionar Perna Esquerda - Vybrat Levou Nohu + Vybrat Levou nohu Seleziona Gamba Sinistra @@ -328,7 +328,7 @@ Selectioner Jambe Droite Wybierz prawą nogę Selecionar Perna Direita - Vybrat Pravou Nohu + Vybrat Pravou nohu Seleziona Gamba Destra @@ -581,7 +581,7 @@ A Perdu Bcp de Sang Stracił dużo krwi Perdeu muito sangue - Ztratil hodně Krve + Ztratil hodně krve Perso molto Sangue diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index ff14fea9f7..35b947ce97 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -114,7 +114,7 @@ Tylko gracz Solo jugador Nur Spieler - Pouze hráči + Pouze hráč Somente jogador Seulement les joueurs Csak játékosok @@ -126,7 +126,7 @@ Gracz oraz AI Jugador e IA Spieler und KI - Hráči a AI + Hráč a AI Jogador e IA Joueurs et IA Játékosok és AI diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index f545bc8a35..1de69ece38 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -167,6 +167,7 @@ Wyładuj pocisk Enlever l'obus Togli proiettile + Odstranit náboj Load Mortar @@ -175,6 +176,7 @@ Załaduj moździerz Charger le mortier Carica mortaio + Nabít minomet Unloading Round @@ -191,6 +193,7 @@ Przygotowywanie pocisku Praparation de l'obus Prepara il proiettile + Připavuji náboj Load HE @@ -199,6 +202,7 @@ Załaduj pocisk wybuchowy Charger HE Carica proiettile esplosivo ad alto potenziale (HE) + Nabít HE Load Smoke @@ -207,6 +211,7 @@ Załaduj pocisk dymny Charger Fumigène Carica fumogeno + Nabít Dýmovnici Load Illumination @@ -215,6 +220,7 @@ Załaduj pocisk oświetlający Charger Eclairante Carica illuminante + Nabít Světlici Load Guided HE @@ -223,6 +229,7 @@ Załaduj kierowany pocisk wybuchowy Charger HE guidé Carica HE guidata + Nabít HE (Naváděné) Load Laser Guided HE @@ -231,6 +238,7 @@ Załaduj laserowo napr. pocisk wybuchowy Charger HE guidé au laser Carica HE a guida laser + Nabít HE (Naváděné laserem) 82mm HE Round @@ -239,6 +247,7 @@ Pocisk wybuchowy kal. 82mm Obus de 82mm HE Proiettile da 82mm HE + 82mm HE náboj 82mm Smoke Round @@ -247,6 +256,7 @@ Pocisk dymny kal. 82mm Obus de 82mm fumigène Proiettile Fumogeno da 82mm + 82mm Kouřový náboj 82mm Illumination Round @@ -255,6 +265,7 @@ Pocisk oświetlający kal. 82mm Obus de 82mm éclairant Proiettile illuminante da 82mm + 82mm Osvětlovací náboj 82mm Guided HE Round @@ -263,6 +274,7 @@ Kierowany pocisk wybuchowy kal. 82mm Obus de 82mm HE guidé Proiettile HE guidato + 82mm HE náboj (naváděný) 82mm Laser Guided HE Round @@ -271,6 +283,7 @@ Laserowo napr. pocisk wybuchowy kal. 82mm Obus de 82mm HE guidé au laser Proiettile HE a guida laser + 82mm HE náboj (naváděný laserem) Used in Mk6 mortar @@ -279,6 +292,7 @@ Używany w moździerzu Mk6 Utilisé dans le mortier Mk6 Usato nel mortaio Mk6 + Používá se u minometu Mk6 [ACE] 82mm HE Rounds Box @@ -287,6 +301,7 @@ [ACE] Skrzynka amunicji wybuchowej 82mm [ACE] Obus de 82mm HE [ACE] Scatola proiettili espolisvi ad alto potenziale (HE) da 82mm + [ACE] Bedna s municí (82mm HE) [ACE] 82mm Smoke Rounds Box @@ -295,6 +310,7 @@ [ACE] Skrzynka amunicji dymnej 82mm [ACE] Obus de 82mm fumigène [ACE] Scatola fumogeni da 82mm + [ACE] Bedna s municí (82mm Dýmovnice) [ACE] 82mm Illumination Rounds Box @@ -303,6 +319,7 @@ [ACE] Skrzynka amunicji oświetlającej 82mm [ACE] Obus de 82mm éclairants [ACE] Scatola illuminanti da 82mm + [ACE] Bedna s municí (82mm Světlice) [ACE] 82mm Default Loadout Box @@ -311,6 +328,7 @@ [ACE] Skrzynka amunicji standardowej 82mm [ACE] Obus de 82mm par défaut [ACE] Scatola proiettili 82mm standard + [ACE] Bedna se standardní 82mm municí \ No newline at end of file diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index 3269d9cf7e..abbf9533e7 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -32,6 +32,7 @@ Effetti Particelle Surriscaldamento Efectos de partículas Effet de surchauffe + Částicové efekty přehřívání Show particle effects when weapon overheats @@ -48,6 +49,7 @@ Effetti Particellari Surriscaldamento per tutti Efectos de partículas para todos Effets de surchauffe pour tout le monde. + Částicové efekty přehřívání pro všechny Show particle effects when other players weapon overheats @@ -80,6 +82,7 @@ Usuń zacięcie przy przeładowaniu Des-enrayer l'arme au rechargement. Disinceppa l'arma quando si ricarica + Uvolnit zbraň při přebití Reloading clears a weapon jam. @@ -88,6 +91,7 @@ Przeładowywanie usuwa zacięcie Recharger vide la chambre de l'arme L'arma si disinceppa quando si ricarica + Přebití uvolní zaseknutou zbraň. Chance of unjam failing @@ -96,6 +100,7 @@ Szansa na porażkę usuw. zacięcia Chance de rater le des-enrayement Probabilità di sbagliare a disinceppare l'arma + Šance, že uvolnění zbraně selže Probability that an unjam action might fail, requiring to be repeated. @@ -172,6 +177,7 @@ Porażka przy usuwaniu zacięcia Toujours enrayé ! Non si è disinceppata! + Zbrań se nepodařilo uvolnit Swap barrel @@ -190,7 +196,7 @@ Lauf wird gewechselt... Cambiando el cañón... Wymienianie lufy... - Vyměňuji hlaveň... + Měním hlaveň... Changement du canon... Смена ствола... Cső kicserélése folyamatban... @@ -216,7 +222,7 @@ Sprawdź temperaturę broni Vérifier la température de l'arme Fegyver hőmérsékletének ellenőrzése - Zjistit teplotu zbraně + Zkontrolovat teplotu zbraně Conferir temperatura da arma Controlla la temperatura della canna Проверить температуру оружия diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index ee79a1d427..0bce5cd685 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1320,6 +1320,7 @@ Engine must be off to repair Motor muss ausgeschaltet zu reparieren sein El motor necesita desactivado para la reparación + Pro opravu je zapotřebí vypnout motor - + \ No newline at end of file diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index b78febbef7..bdb88a2675 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -321,7 +321,7 @@ Noc Visão Norturna Ночное - Noc + Noční Nocturna Notturno Nuit @@ -332,7 +332,7 @@ Termo Térmica Тепловизор - Termál + Termální Térmica Termico Thermique @@ -689,4 +689,4 @@ RAZ vitesse - + \ No newline at end of file diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index 1849206963..bf4056df49 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -8,6 +8,7 @@ Oznakuj na czarno Tag noir Marca nero + Označit černě Tag red @@ -16,6 +17,7 @@ Oznakuj na czerwono Tag rouge Marca rosso + Označit červeně Tag green @@ -24,6 +26,7 @@ Oznakuj na zielono Tag vert Marca verde + Označit zeleně Tag blue @@ -32,6 +35,7 @@ Oznakuj na niebiesko Tag bleu Marca blu + Označit modře Black spray paint @@ -40,6 +44,7 @@ Czarna farba w sprayu Peinture pulvérisée noire Bomboletta spray nera + Černý sprej Red spray paint @@ -48,6 +53,7 @@ Czerwona farba w sprayu Peinture pulvérisée rouge Bomboletta spray rossa + Červený sprej Green spray paint @@ -56,6 +62,7 @@ Zielona farba w sprayu Peinture pulvérisée verte Bomboletta spray verde + Zelený sprej Blue spray paint @@ -64,6 +71,7 @@ Niebieska farba w sprayu Peinture pulvérisée bleue Bomboletta spray blu + Modrý sprej A can of spray paint for tagging walls. @@ -72,6 +80,7 @@ Farba w sprayu, służy do oznakowywania terenu. Un spray de peinture pour taguer les murs. Una bomboletta di spay per contrassegnare i muri. + Plechovka se sprejem k vytváření značek. - + \ No newline at end of file diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 617a604457..440b3537ba 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -8,6 +8,7 @@ Pala Pala para trincheras Outil de tranchée + Polní lopatka Entrenching Tool @@ -16,6 +17,7 @@ Pala Pala para trincheras Outil de tranchée + Polní lopatky se používají k zákopovým a jiným pracem. Envelope - Small @@ -32,6 +34,7 @@ Piccola Trincea Personale Trinchera personal pequeña Petite tranchée personelle + Malý zákop pro jednoho Dig Small Trench @@ -40,6 +43,7 @@ Scava Trincea Piccola Cavar trinchera pequeña Creuser une petite tranchée + Vykopat malý zákop Envelope - Big @@ -56,6 +60,7 @@ Grande Trincea Personale Trinchera personal grande Grande tranchée personelle + Velký zákop pro jednoho Dig Big Trench @@ -64,6 +69,7 @@ Scava Trincea Grande Cavar trinchera grande Creuser une grande tranchée + Vykopat velký zákop Confirm Dig @@ -72,6 +78,7 @@ Conferma Scava Confirmar cavado Confirmer la creusée + Potvrdit kopání Cancel Dig @@ -80,6 +87,7 @@ Cancella Scava Cancelar cavado Annuler la creusée + Zrušit kopání Rotate @@ -100,6 +108,7 @@ Sto Scavando la Trincea Cavando trinchera Creuse la tranchée + Vykopat zákop - + \ No newline at end of file diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 42e7932411..74cd89e93b 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -1,101 +1,131 @@ - + User Interface + Uživatelské rozhraní User Interface + Uživatelské rozhraní This module allows toggling visible user interface parts. Allow Selective UI + Povolit selektivní UI Allow client to modify their UI. + Povolit klientovi měnit jeho UI Soldier/Vehicle/Weapon Information + Informace o Vojákovi/Vozidlu/Zbrani Vehicle Radar + Radar vozidla Vehicle Compass + Kompas vozidla Command Menu + Menu rozkazů Group Bar + Panel skupiny Weapon Name + Název zbraně Weapon Name Background + Název zbraně v pozadí Firing Mode + Režim palby Ammo Type + Typ munice Ammo Count + Počet munice Magazine Count + Počet zásobníků Throwable Type + Typ granátů apod. Throwable Count + Počet granátů apod. Zeroing + Náměr Weapon Lower Info Background Stance + Postoj Stamina Bar + Panel výdrže Vehicle Name + Název vozidla Vehicle Name Background + Název vozidla v pozadí Vehicle Fuel Bar + Ukazatel paliva Vehicle Speed + Rychlost vozidla Vehicle Altitude + Výška vozidla Vehicle Damage + Poškození vozidla Vehicle Info Background + Info o vozidle v pozadí Vehicle Gunner Weapon + Střelcova zbraň ve vozidle Requires Soldier/Vehicle/Weapons Information. + Vyžaduje informace o Vojákovi/Vozidlu/Zbrani Modifying User Interface is disabled. + Změna uživatelského rozhraní je zakázána. - + \ No newline at end of file From 75cbe7df4f98f2973db779da1cca9b3654717a83 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 3 May 2016 15:15:10 +0200 Subject: [PATCH 52/56] Change start line count of config validation at 1 --- tools/config_style_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config_style_checker.py b/tools/config_style_checker.py index 65bd57a449..03d8f222fe 100644 --- a/tools/config_style_checker.py +++ b/tools/config_style_checker.py @@ -40,7 +40,7 @@ def check_config_style(filepath): checkForSemiColumn = False # Extra information so we know what line we find errors at - lineNumber = 0 + lineNumber = 1 indexOfCharacter = 0 # Parse all characters in the content of this file to search for potential errors From 0c55d0ca0639438452fbce55e9c6083f5544f9ab Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 3 May 2016 15:15:55 +0200 Subject: [PATCH 53/56] Change start line number count sqf validation at 1 --- tools/sqf_validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 7414d7d715..7a905a3315 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -50,7 +50,7 @@ def check_sqf_syntax(filepath): checkForSemiColumn = False # Extra information so we know what line we find errors at - lineNumber = 0 + lineNumber = 1 indexOfCharacter = 0 # Parse all characters in the content of this file to search for potential errors From 8585ea568845ef63f6ed1b2b6a487906c33a14c1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 3 May 2016 18:12:47 +0200 Subject: [PATCH 54/56] add framework to add virtual mass to containers --- addons/movement/XEH_PREP.hpp | 2 + addons/movement/XEH_postInit.sqf | 3 ++ .../functions/fnc_addLoadToUnitContainer.sqf | 31 ++++++++++++++ .../functions/fnc_handleVirtualMass.sqf | 42 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 addons/movement/functions/fnc_addLoadToUnitContainer.sqf create mode 100644 addons/movement/functions/fnc_handleVirtualMass.sqf diff --git a/addons/movement/XEH_PREP.hpp b/addons/movement/XEH_PREP.hpp index 8e465970eb..04913f7670 100644 --- a/addons/movement/XEH_PREP.hpp +++ b/addons/movement/XEH_PREP.hpp @@ -1,5 +1,7 @@ +PREP(addLoadToUnitContainer); PREP(getWeight); PREP(canClimb); PREP(climb); PREP(handleClimb); +PREP(handleVirtualMass); diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 806823f4c4..d9179a912a 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -3,6 +3,9 @@ if (!hasInterface) exitWith {}; +["playerChanged", FUNC(handleVirtualMass)] call FUNC(addEventHandler); +["playerInventoryChanged", FUNC(handleVirtualMass)] call FUNC(addEventHandler); + ["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract diff --git a/addons/movement/functions/fnc_addLoadToUnitContainer.sqf b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf new file mode 100644 index 0000000000..28fea8f697 --- /dev/null +++ b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * Add (negative numbers to subtract) a virtual mass to a units container. + * + * Arguments: + * 0: The Unit + * 1: The Container + * 2: The Virtual Load + * + * Return Value: + * Success? + * + * Public: No + */ +#include "script_component.hpp" + +params [["_unit", objNull, [objNull]], ["_container", objNull, [objNull]], ["_virtualLoadToAdd", 0, [0]]]; + +if !(_container in [ + uniformContainer _unit, + vestContainer _unit, + backpackContainer _unit +]) exitWith {false}; + +private _virtualLoad = (_container getVariable [QGVAR(vLoad), 0]) + _virtualLoadToAdd; +_container setVariable [QGVAR(vLoad), _virtualLoad]; + +// update +_unit call FUNC(handleVirtualMass); + +true diff --git a/addons/movement/functions/fnc_handleVirtualMass.sqf b/addons/movement/functions/fnc_handleVirtualMass.sqf new file mode 100644 index 0000000000..5d71c58df4 --- /dev/null +++ b/addons/movement/functions/fnc_handleVirtualMass.sqf @@ -0,0 +1,42 @@ +/* + * Author: commy2 + * Recalculate the units loadCoef to emulate a mass added to uniform, vest or backpack. + * + * Arguments: + * 0: The Unit (usually the player) + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +// add sum of virtual loads +private _virtualLoad = 0; + +{ + _virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]); +} forEach [ + uniformContainer _unit, + vestContainer _unit, + backpackContainer _unit +]; + +// get absolute vanilla load +private _absLoad = loadAbs _unit / load _unit; + +// try to preserve other changes to the "LoadCoef" unitTrait +private _loadCoef = _unit getVariable QGVAR(loadCoef); + +if (isNil "_loadCoef") then { + _loadCoef = _unit getUnitTrait "loadCoef"; + _unit setVariable [QGVAR(loadCoef), _loadCoef, true]; +}; + +// calc. new "virtual" loadCoef +private _virtualLoadCoef = (1 + _virtualLoad / _absLoad) * _loadCoef; + +_unit setUnitTrait ["loadCoef", _virtualLoadCoef]; From 736807f994f62405333a591fcf4c261a21b87a67 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 3 May 2016 18:16:39 +0200 Subject: [PATCH 55/56] fix typo, make variable global --- addons/movement/functions/fnc_addLoadToUnitContainer.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/movement/functions/fnc_addLoadToUnitContainer.sqf b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf index 28fea8f697..3928d1c822 100644 --- a/addons/movement/functions/fnc_addLoadToUnitContainer.sqf +++ b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: The Unit - * 1: The Container + * 1: The Container * 2: The Virtual Load * * Return Value: @@ -23,7 +23,7 @@ if !(_container in [ ]) exitWith {false}; private _virtualLoad = (_container getVariable [QGVAR(vLoad), 0]) + _virtualLoadToAdd; -_container setVariable [QGVAR(vLoad), _virtualLoad]; +_container setVariable [QGVAR(vLoad), _virtualLoad, true]; // update _unit call FUNC(handleVirtualMass); From 66c2bf050625d51ae453a662d3d7d78253840b04 Mon Sep 17 00:00:00 2001 From: Cuel Date: Tue, 3 May 2016 20:10:28 +0200 Subject: [PATCH 56/56] Fix dead bodies removal, when forced = 1 - Removed unused(?) GVAR(Module) - Removed "white space alignment" in module.sqf --- addons/respawn/CfgEventHandlers.hpp | 1 + addons/respawn/XEH_serverPostInit.sqf | 17 +++++++++++++++++ addons/respawn/functions/fnc_module.sqf | 20 ++------------------ 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 addons/respawn/XEH_serverPostInit.sqf diff --git a/addons/respawn/CfgEventHandlers.hpp b/addons/respawn/CfgEventHandlers.hpp index a4601c6f95..481d36cf30 100644 --- a/addons/respawn/CfgEventHandlers.hpp +++ b/addons/respawn/CfgEventHandlers.hpp @@ -14,6 +14,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); + serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit)); }; }; diff --git a/addons/respawn/XEH_serverPostInit.sqf b/addons/respawn/XEH_serverPostInit.sqf new file mode 100644 index 0000000000..d472bb0d5c --- /dev/null +++ b/addons/respawn/XEH_serverPostInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +["SettingsInitialized", { + if (GVAR(RemoveDeadBodiesDisconnected)) then { + addMissionEventHandler ["HandleDisconnect", { + [{ + params ["_unit"]; + + if (!alive _unit) then { + deleteVehicle _unit; + }; + }, + _this, 4] call EFUNC(common,waitAndExecute); + false + }]; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index ea6ba555d5..bc4f197c07 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -19,25 +19,9 @@ params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +if (!_activated) exitWith {}; -GVAR(Module) = true; - -[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule); -if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then { - addMissionEventHandler ["HandleDisconnect", { - [{ - params ["_unit"]; - - if (!alive _unit) then { - deleteVehicle _unit; - }; - }, - _this, 4] call EFUNC(common,waitAndExecute); - false - }]; -}; - ACE_LOGINFO("Respawn Module Initialized.");