From f5ef7b6b2d17ed6c32d9cbd34104dff6117acdd4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 00:36:46 +0100 Subject: [PATCH 01/14] displayLoad xeh for imenu --- addons/interact_menu/CfgEventHandlers.hpp | 10 ++++++++-- addons/interact_menu/XEH_clientInit.sqf | 11 ----------- addons/interact_menu/XEH_displayLoad.sqf | 9 +++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 addons/interact_menu/XEH_displayLoad.sqf diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index 1301f022d3..854f008c56 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -6,7 +6,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); }; }; @@ -16,4 +16,10 @@ class Extended_InitPost_EventHandlers { init = QUOTE(_this call FUNC(compileMenu);_this call FUNC(compileMenuSelfAction)); }; }; -}; \ No newline at end of file +}; + +class Extended_DisplayLoad_EventHandlers { + class RscDiary { + ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad)); + }; +}; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 017c2b05b8..4e4e6025a3 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -25,17 +25,6 @@ GVAR(ParsedTextCached) = []; //Add Actions to Houses: ["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler); -// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. -// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. -[] spawn { - // Wait until the map display is detected - waitUntil {(!isNull findDisplay 12)}; - - // Install the render EH on the map screen - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)]; -}; - - ["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), { // Statement diff --git a/addons/interact_menu/XEH_displayLoad.sqf b/addons/interact_menu/XEH_displayLoad.sqf new file mode 100644 index 0000000000..ce58418c5d --- /dev/null +++ b/addons/interact_menu/XEH_displayLoad.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +disableSerialization; + +params ["_display"]; + +if (ctrlIDD _display == 12) then { // RscDisplayMainMap + (_display displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)]; +}; From 5e486869c0a5b6c88657fdbec26f469249ae793a Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 20:26:30 +0100 Subject: [PATCH 02/14] replace mainDisplayLoaded event with DisplayLoad XEH and add ACE version to main menu (CBA help) --- addons/common/CfgEventHandlers.hpp | 6 ++ addons/common/XEH_mainDislayLoad.sqf | 6 ++ addons/common/XEH_postInit.sqf | 25 -------- addons/common/XEH_preInit.sqf | 2 - addons/common/config.cpp | 2 +- .../functions/fnc_handleModifierKeyInit.sqf | 16 ----- addons/common/init_handleModifierKey.sqf | 20 +++++++ ...eelInit.sqf => init_handleScrollWheel.sqf} | 6 +- addons/common/init_versionTooltip.sqf | 59 +++++++++++++++++++ addons/common/script_component.hpp | 6 +- addons/gestures/CfgEventHandlers.hpp | 6 ++ addons/gestures/XEH_mainDislayLoad.sqf | 35 +++++++++++ addons/gestures/XEH_postInit.sqf | 33 ----------- 13 files changed, 143 insertions(+), 79 deletions(-) create mode 100644 addons/common/XEH_mainDislayLoad.sqf delete mode 100644 addons/common/functions/fnc_handleModifierKeyInit.sqf create mode 100644 addons/common/init_handleModifierKey.sqf rename addons/common/{functions/fnc_handleScrollWheelInit.sqf => init_handleScrollWheel.sqf} (55%) create mode 100644 addons/common/init_versionTooltip.sqf create mode 100644 addons/gestures/XEH_mainDislayLoad.sqf diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 1afbe16512..0320b32709 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -13,6 +13,12 @@ class Extended_PostInit_EventHandlers { }; }; +class Extended_DisplayLoad_EventHandlers { + class RscDisplayMission { + ADDON = QUOTE(_this call COMPILE_FILE(XEH_mainDislayLoad)); + }; +}; + class Extended_InitPost_EventHandlers { class All { class GVAR(executePersistent) { diff --git a/addons/common/XEH_mainDislayLoad.sqf b/addons/common/XEH_mainDislayLoad.sqf new file mode 100644 index 0000000000..57ace32f94 --- /dev/null +++ b/addons/common/XEH_mainDislayLoad.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +GVAR(ScrollWheelFrame) = diag_frameno; + +call COMPILE_FILE(init_handleScrollWheel); +call COMPILE_FILE(init_handleModifierKey); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index a265600d28..3034e73188 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -290,31 +290,6 @@ if (!hasInterface) exitWith {}; call FUNC(assignedItemFix); -GVAR(ScrollWheelFrame) = diag_frameno; - -["mainDisplayLoaded", { - [{ - call FUNC(handleScrollWheelInit); - call FUNC(handleModifierKeyInit); - }, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC -}] call FUNC(addEventHandler); - -// add PFH to execute event that fires when the main display (46) is created -private _fnc_initMainDisplayCheck = { - [{ - if !(isNull findDisplay 46) then { - // Raise ACE event locally - ["mainDisplayLoaded", [findDisplay 46]] call FUNC(localEvent); - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - }, 0, []] call CBA_fnc_addPerFrameHandler; -}; - -call _fnc_initMainDisplayCheck; - -// repeat this every time a savegame is loaded -addMissionEventHandler ["Loaded", _fnc_initMainDisplayCheck]; - // @todo remove? enableCamShake true; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index f96028c352..dd541c2126 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -94,9 +94,7 @@ PREP(goKneeling); PREP(hadamardProduct); PREP(handleModifierKey); PREP(handleModifierKeyUp); -PREP(handleModifierKeyInit); PREP(handleScrollWheel); -PREP(handleScrollWheelInit); PREP(hasItem); PREP(hasMagazine); PREP(headBugFix); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 8050943803..6ec74cb746 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredAddons[] = {"ace_main","ace_modules"}; author[] = {"KoffeinFlummi"}; authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; + VERSION_CONFIG_COMMON; }; }; diff --git a/addons/common/functions/fnc_handleModifierKeyInit.sqf b/addons/common/functions/fnc_handleModifierKeyInit.sqf deleted file mode 100644 index a945f5eba1..0000000000 --- a/addons/common/functions/fnc_handleModifierKeyInit.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Author: commy2 - * Initializes the modifier key handler. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Public : No - */ -#include "script_component.hpp" - -(findDisplay 46) displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)]; -(findDisplay 46) displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)]; diff --git a/addons/common/init_handleModifierKey.sqf b/addons/common/init_handleModifierKey.sqf new file mode 100644 index 0000000000..dd07db621c --- /dev/null +++ b/addons/common/init_handleModifierKey.sqf @@ -0,0 +1,20 @@ +/* + * Author: commy2 + * Initializes the modifier key handler. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +disableSerialization; + +params ["_display"]; + +_display displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)]; +_display displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)]; diff --git a/addons/common/functions/fnc_handleScrollWheelInit.sqf b/addons/common/init_handleScrollWheel.sqf similarity index 55% rename from addons/common/functions/fnc_handleScrollWheelInit.sqf rename to addons/common/init_handleScrollWheel.sqf index 12f8b5f337..0acb84a5f2 100644 --- a/addons/common/functions/fnc_handleScrollWheelInit.sqf +++ b/addons/common/init_handleScrollWheel.sqf @@ -12,4 +12,8 @@ */ #include "script_component.hpp" -(findDisplay 46) displayAddEventHandler ["MouseZChanged", QUOTE(_this call FUNC(handleScrollWheel))]; +disableSerialization; + +params ["_display"]; + +_display displayAddEventHandler ["MouseZChanged", QUOTE(_this call FUNC(handleScrollWheel))]; diff --git a/addons/common/init_versionTooltip.sqf b/addons/common/init_versionTooltip.sqf new file mode 100644 index 0000000000..7aef3f4786 --- /dev/null +++ b/addons/common/init_versionTooltip.sqf @@ -0,0 +1,59 @@ +#include "script_component.hpp" + +#define MAX_COUNT 30 +#define ANIM_TIME 10 + +private _display = findDisplay 0; + +if (!scriptDone (_display getVariable [QGVAR(versionTooltip), scriptNull])) exitWith {}; + +_display setVariable [QGVAR(versionTooltip), [_display] spawn { + disableSerialization; + + params ["_display"]; + + private _allControls = []; + + private _fnc_create = { + private _ctrl = _display ctrlCreate ["RscPicture", -1]; + + // randomize size + private _size = selectRandom [safezoneW / 30, safezoneW / 20, safezoneW / 15]; + private _position = [ + random safezoneW + safezoneX - _size / 2, + - random (safezoneH / 5) + safezoneY - _size, + _size, + _size + ]; + + _ctrl ctrlSetPosition _position; + _ctrl ctrlCommit 0; + + // pls ignore + _ctrl ctrlSetText QUOTE(PATHTOF(data\icon_banana_ca.paa)); + + // animate with random speed + _position set [1, 1 - safezoneY]; + _ctrl ctrlSetPosition _position; + _ctrl ctrlCommit (ANIM_TIME * random [0.5, 1, 1.5]); + + _allControls pushBack _ctrl; + }; + + while {!isNull _display} do { + _allControls = _allControls select { + if (ctrlCommitted _x) then { + ctrlDelete _x; + false + } else { + true + }; + }; + + while {count _allControls < MAX_COUNT} do { + call _fnc_create; + }; + + uiSleep 3; + }; +}]; diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index aa023e7c9f..4e941943fa 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -14,4 +14,8 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define VERSION_CONFIG_COMMON VERSION_CONFIG;\ + versionDesc = "ACE 3";\ + versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip)) diff --git a/addons/gestures/CfgEventHandlers.hpp b/addons/gestures/CfgEventHandlers.hpp index 7b003bbe8c..b426a3a580 100644 --- a/addons/gestures/CfgEventHandlers.hpp +++ b/addons/gestures/CfgEventHandlers.hpp @@ -9,3 +9,9 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayMission { + ADDON = QUOTE(_this call COMPILE_FILE(XEH_mainDislayLoad)); + }; +}; diff --git a/addons/gestures/XEH_mainDislayLoad.sqf b/addons/gestures/XEH_mainDislayLoad.sqf new file mode 100644 index 0000000000..4b5c2ca63b --- /dev/null +++ b/addons/gestures/XEH_mainDislayLoad.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" + +disableSerialization; + +params ["_display"]; + +// reload mutex, you can't play signal while reloading +GVAR(ReloadMutex) = true; + +_display displayAddEventHandler ["KeyDown", { + if ((_this select 1) in actionKeys "ReloadMagazine") then { + if (isNull ACE_player || {!alive ACE_player}) exitWith {false}; + + private _weapon = currentWeapon ACE_player; + + if (_weapon != "") then { + GVAR(ReloadMutex) = false; + + private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction"); + private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; + private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; + private _duration = getNumber (configfile >> _config >> "States" >> _gesture >> "speed"); + + if (_duration != 0) then { + _duration = if (_duration < 0) then { abs _duration } else { 1 / _duration }; + } else { + _duration = 3; + }; + + TRACE_2("Reloading, blocking gestures",_weapon,_duration); + [{GVAR(ReloadMutex) = true;}, [], _duration] call EFUNC(common,waitAndExecute); + }; + }; + false +}]; diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index fec57ab111..d9cfc74e04 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -3,36 +3,3 @@ if (!hasInterface) exitWith {}; #include "key.sqf" - -// reload mutex, you can't play signal while reloading -GVAR(ReloadMutex) = true; - -// Event for main display to be loaded: -["mainDisplayLoaded", { - // handle reloading - (findDisplay 46) displayAddEventHandler ["KeyDown", { - if ((_this select 1) in actionKeys "ReloadMagazine") then { - if ((isNull ACE_player) || {!alive ACE_player}) exitWith {false}; - private _weapon = currentWeapon ACE_player; - - if (_weapon != "") then { - GVAR(ReloadMutex) = false; - - private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction"); - private _isLauncher = _weapon isKindOf ["Launcher", (configFile >> "CfgWeapons")]; - private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; - private _duration = getNumber (configfile >> _config >> "States" >> _gesture >> "speed"); - - if (_duration != 0) then { - _duration = if (_duration < 0) then { abs _duration } else { 1 / _duration }; - } else { - _duration = 3; - }; - - TRACE_2("Reloading, blocking gestures",_weapon,_duration); - [{GVAR(ReloadMutex) = true;}, [], _duration] call EFUNC(common,waitAndExecute); - }; - }; - false - }]; -}] call EFUNC(common,addEventHandler); From e9808bf20b6d57ea169df7161717f628eb75afbc Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 20:42:06 +0100 Subject: [PATCH 03/14] remove unused PFH check --- addons/common/XEH_postInit.sqf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 3034e73188..b5647cd186 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -416,14 +416,6 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { ["visibleMapChanged", [ACE_player, _data]] call FUNC(localEvent); }; - // "inventoryDisplayChanged" event - _data = !(isNull findDisplay 602); - if !(_data isEqualTo GVAR(OldInventoryDisplayIsOpen)) then { - // Raise ACE event locally - GVAR(OldInventoryDisplayIsOpen) = _data; - ["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); - }; - // "activeCameraChanged" event _data = call FUNC(isfeatureCameraActive); if !(_data isEqualTo GVAR(OldIsCamera)) then { From 4335bfbfcf072ab8e4073c3c485931ddb83bd1d6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 21:24:39 +0100 Subject: [PATCH 04/14] replace inventoryDisplayLoaded with DisplayLoad event --- addons/common/RscInfoType.hpp | 4 ---- addons/disposable/CfgEventHandlers.hpp | 7 +++++++ addons/disposable/XEH_postInit.sqf | 4 ---- addons/inventory/CfgEventHandlers.hpp | 6 ++++++ addons/inventory/XEH_postInit.sqf | 2 -- addons/inventory/XEH_preInit.sqf | 2 +- ...ayLoaded.sqf => fnc_inventoryDisplayLoad.sqf} | 0 addons/movement/CfgEventHandlers.hpp | 7 +++++++ addons/movement/XEH_inventoryDisplayLoad.sqf | 14 ++++++++++++++ addons/movement/XEH_postInit.sqf | 16 ---------------- 10 files changed, 35 insertions(+), 27 deletions(-) rename addons/inventory/functions/{fnc_inventoryDisplayLoaded.sqf => fnc_inventoryDisplayLoad.sqf} (100%) create mode 100644 addons/movement/XEH_inventoryDisplayLoad.sqf diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 4d94f8ae2c..5b8eed46c6 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -113,10 +113,6 @@ class RscInGameUI { }; }; -class RscDisplayInventory { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayInventory"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('inventoryDisplayLoaded', _this)] call FUNC(localEvent);); -}; - // map class RscDisplayMainMap { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); diff --git a/addons/disposable/CfgEventHandlers.hpp b/addons/disposable/CfgEventHandlers.hpp index c236fb6f57..50bfab4e84 100644 --- a/addons/disposable/CfgEventHandlers.hpp +++ b/addons/disposable/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -10,6 +11,12 @@ class Extended_PostInit_EventHandlers { }; }; +class Extended_DisplayLoad_EventHandlers { + class RscDisplayInventory { + ADDON = QUOTE([ARR_2(ACE_player, _this select 0)] call FUNC(updateInventoryDisplay)); + }; +}; + // handle preloaded missile class Extended_InitPost_EventHandlers { class CAManBase { diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf index 5c4ddafe95..94ad62b1cc 100644 --- a/addons/disposable/XEH_postInit.sqf +++ b/addons/disposable/XEH_postInit.sqf @@ -3,10 +3,6 @@ if (!hasInterface) exitWith {}; -["inventoryDisplayLoaded", { - [ACE_player, _this select 0] call FUNC(updateInventoryDisplay) -}] call EFUNC(common,addEventHandler); - ["playerInventoryChanged", { params ["_unit"]; [_unit] call FUNC(takeLoadedATWeapon); diff --git a/addons/inventory/CfgEventHandlers.hpp b/addons/inventory/CfgEventHandlers.hpp index 0cd959a047..cf4e7e1abe 100644 --- a/addons/inventory/CfgEventHandlers.hpp +++ b/addons/inventory/CfgEventHandlers.hpp @@ -10,3 +10,9 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayInventory { + ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad)); + }; +}; diff --git a/addons/inventory/XEH_postInit.sqf b/addons/inventory/XEH_postInit.sqf index 586f10fc28..bf7adec77a 100644 --- a/addons/inventory/XEH_postInit.sqf +++ b/addons/inventory/XEH_postInit.sqf @@ -5,8 +5,6 @@ if (!hasInterface) exitWith {}; GVAR(customFilters) = []; GVAR(selectedFilterIndex) = -1; -["inventoryDisplayLoaded", {_this call FUNC(inventoryDisplayLoaded)}] call EFUNC(common,addEventHandler); - // add custom filters // generate list of grenades diff --git a/addons/inventory/XEH_preInit.sqf b/addons/inventory/XEH_preInit.sqf index d574cacf3b..3b08d245d5 100644 --- a/addons/inventory/XEH_preInit.sqf +++ b/addons/inventory/XEH_preInit.sqf @@ -5,7 +5,7 @@ ADDON = false; PREP(addCustomFilter); PREP(currentItemListBox); PREP(forceItemListUpdate); -PREP(inventoryDisplayLoaded); +PREP(inventoryDisplayLoad); PREP(onLBSelChanged); // cache config diff --git a/addons/inventory/functions/fnc_inventoryDisplayLoaded.sqf b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf similarity index 100% rename from addons/inventory/functions/fnc_inventoryDisplayLoaded.sqf rename to addons/inventory/functions/fnc_inventoryDisplayLoad.sqf diff --git a/addons/movement/CfgEventHandlers.hpp b/addons/movement/CfgEventHandlers.hpp index e75956f440..091f1526e2 100644 --- a/addons/movement/CfgEventHandlers.hpp +++ b/addons/movement/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -9,3 +10,9 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayInventory { + ADDON = QUOTE(_this call COMPILE_FILE(XEH_inventoryDisplayLoad)); + }; +}; diff --git a/addons/movement/XEH_inventoryDisplayLoad.sqf b/addons/movement/XEH_inventoryDisplayLoad.sqf new file mode 100644 index 0000000000..ae717e7b39 --- /dev/null +++ b/addons/movement/XEH_inventoryDisplayLoad.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +disableSerialization; + +[{ + disableSerialization; + params ["_dialog"]; + + if (isNull _dialog) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + (_dialog displayCtrl 111) ctrlSetText format ["%1 - %2 %3", [ACE_player, false, true] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; +}, 0, _this select 0] call CBA_fnc_addPerFrameHandler; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 7825134af3..806823f4c4 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -3,22 +3,6 @@ if (!hasInterface) exitWith {}; -["inventoryDisplayLoaded", { - - [{ - disableSerialization; - params ["_dialog"]; - - if (isNull _dialog) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - - _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player, false, true] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; - - }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; - -}] call EFUNC(common,addEventHandler); - ["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract From f43e88ff25222e1e70bd555fc06f2649cd1b5909 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:16:12 +0100 Subject: [PATCH 05/14] replace zeusDisplayChanged with DisplayLoad event --- addons/captives/CfgEventHandlers.hpp | 8 ++++++++ addons/captives/XEH_postInit.sqf | 1 - .../functions/fnc_handleZeusDisplayChanged.sqf | 17 ++++++----------- addons/common/XEH_postInit.sqf | 11 ----------- addons/nightvision/CfgEventHandlers.hpp | 15 ++++++++++++++- addons/nightvision/XEH_postInitClient.sqf | 2 +- .../functions/fnc_updatePPEffects.sqf | 10 +++++++++- 7 files changed, 38 insertions(+), 26 deletions(-) diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp index 4d12dc10c4..59351119c3 100644 --- a/addons/captives/CfgEventHandlers.hpp +++ b/addons/captives/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -9,6 +10,13 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayUnload_EventHandlers { + class RscDisplayCurator { + ADDON = QUOTE(call FUNC(handleZeusDisplayChanged)); + }; +}; + //release escorted captive when entering a vehicle class Extended_GetIn_EventHandlers { class All { diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 8f7109b81f..144d3efb9a 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -18,7 +18,6 @@ if (isServer) then { }]; }; -["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler); ["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); ["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index ef8aedbbe1..433c1fc259 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -17,15 +17,10 @@ */ #include "script_component.hpp" -params ["_unit","_zeusIsOpen"]; - -//set showHUD based on unit status: -if (!_zeusIsOpen) then { - if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then { - TRACE_1("Player Change (showHUD false)",_unit); - ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); - } else { - TRACE_1("Player Change (showHUD true)",_unit); - ["captive", []] call EFUNC(common,showHud); //same as showHud true; - }; +if ((ACE_player getVariable [QGVAR(isHandcuffed), false]) || {ACE_player getVariable [QGVAR(isSurrendering), false]}) then { + TRACE_1("Player Change (showHUD false)",ACE_player); + ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); +} else { + TRACE_1("Player Change (showHUD true)",ACE_player); + ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index b5647cd186..8bda027d1f 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -316,17 +316,6 @@ enableCamShake true; // Set up numerous eventhanders for player controlled units ////////////////////////////////////////////////// -//CBA has events for zeus's display onLoad and onUnload (Need to delay a frame for display to be ready) -private _zeusDisplayChangedFNC = { - [{ - private _data = !(isNull findDisplay 312); - ["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); - }, []] call FUNC(execNextFrame); -}; -["CBA_curatorOpened", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler; -["CBA_curatorClosed", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler; - - // default variables GVAR(OldPlayerVehicle) = vehicle objNull; GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex); diff --git a/addons/nightvision/CfgEventHandlers.hpp b/addons/nightvision/CfgEventHandlers.hpp index 49b87fb4fd..1e30aab27a 100644 --- a/addons/nightvision/CfgEventHandlers.hpp +++ b/addons/nightvision/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit) ); @@ -6,6 +7,18 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); + }; +}; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayCurator { + ADDON = QUOTE(_this call FUNC(updatePPEffects)); + }; +}; + +class Extended_DisplayUnload_EventHandlers { + class RscDisplayCurator { + ADDON = QUOTE(displayNull call FUNC(updatePPEffects)); // emulate zeus display being deleted }; }; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 1f73b12e93..17cb92f9cc 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -34,7 +34,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; _this call FUNC(updatePPEffects); _this call FUNC(onVisionModeChanged); }] call EFUNC(common,addEventHandler); -["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); + ["cameraViewChanged", { _this call FUNC(updatePPEffects); _this call FUNC(onCameraViewChanged); diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index 72cd6cbd0d..9bf8321353 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -17,12 +17,20 @@ if (!hasInterface) exitWith {}; +disableSerialization; + +params [["_display", displayNull]]; + +if !(_display isEqualType displayNull) then { + _display = displayNull; +}; + private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; _currentVehicle = vehicle ACE_player; // If the Zeus display is on or the player has no nightvision -if ((!isNull findDisplay 312) || ((currentVisionMode ACE_player) != 1)) exitWith { +if (ctrlIDD _display == 312 || currentVisionMode ACE_player != 1) exitWith { GVAR(ppEffectFilmGrain) ppEffectEnable false; GVAR(ppEffectBlur) ppEffectEnable false; GVAR(ppEffectRadialBlur) ppEffectEnable false; From 3f855298e2a30a2ae6e84fa8dda51a1be359b7b5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:23:46 +0100 Subject: [PATCH 06/14] remove unused mapDisplayLoaded event and ACE_dlgMap variable --- addons/common/RscInfoType.hpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 5b8eed46c6..8a14df0e66 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -112,21 +112,3 @@ class RscInGameUI { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); }; }; - -// map -class RscDisplayMainMap { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); -}; - -class RscDisplayGetReady: RscDisplayMainMap { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); -}; - -class RscDisplayServerGetReady: RscDisplayGetReady { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); -}; - - -class RscDisplayClientGetReady: RscDisplayGetReady { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); -}; From da0d37ed0dc03224aaa441d5eab802391bf007a7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:31:14 +0100 Subject: [PATCH 07/14] remove commented out code --- addons/common/config.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 6ec74cb746..cbe5c5df6a 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -86,14 +86,6 @@ class CfgUIGrids { }; }; -/* -// check dll -class RscStandardDisplay; -class RscDisplayMain: RscStandardDisplay { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); -}; -*/ - class ACE_Extensions { extensions[] = {}; }; From 2b9518bf813d08cf677fa7fc3e388edc47400032 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:41:11 +0100 Subject: [PATCH 08/14] use precompiled function for vector display --- addons/vector/RscInGameUI.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/vector/RscInGameUI.hpp b/addons/vector/RscInGameUI.hpp index 9be7f1ea1c..704dd4838c 100644 --- a/addons/vector/RscInGameUI.hpp +++ b/addons/vector/RscInGameUI.hpp @@ -11,8 +11,8 @@ class RscControlsGroup { class RscInGameUI { class RscUnitInfo; class ACE_RscOptics_vector: RscUnitInfo { - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgVector', _this select 0];"; - onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgVector', _this select 0];"; + onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; idd = 300; controls[] = {"CA_Distance","CA_Heading","CA_OpticsPitch","CA_Elev","CA_OpticsZoom","CA_VisionMode","ACE_ScriptedDisplayControlsGroup"}; From e1db193099b82b09ee720cba7317848897b2123c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:50:15 +0100 Subject: [PATCH 09/14] remove unused config and remove some wrong base classes --- addons/scopes/RscTitles.hpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index 3b83022dcb..4452c8456c 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -1,5 +1,6 @@ class RscText; +class RscPicture; class RscTitles { class ACE_Scopes_Zeroing { @@ -12,8 +13,6 @@ class RscTitles { fadein = 0; fadeout = 0; name = QGVAR(Zeroing); - class RscPicture; - class RscText; class controls { class ACE_Scopes_Zeroing_BG : RscPicture { idc = 11; @@ -69,13 +68,3 @@ class RscTitles { }; }; }; - -/* -class RscInGameUI { - class RscUnitInfo; - class RscWeaponZeroing : RscUnitInfo { - onLoad = QUOTE([ARR_4('onLoad',_this,'RscUnitInfo','IGUI')] call compile preprocessfilelinenumbers 'A3\ui_f\scripts\initDisplay.sqf'; uiNamespace setVariable [ARR_2('ACE_dlgWeaponZeroing', _this select 0)]; ); - //onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgWeaponZeroing', _this select 0];"; - }; -}; -*/ From 4c0a817ba85e96b1c7350864d85f433d3b3d6516 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 22:56:35 +0100 Subject: [PATCH 10/14] use precompiled function for optics display --- addons/fcs/CfgOptics.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index 91f83dd6f6..aa68a6f68a 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -123,7 +123,7 @@ class RscInGameUI { }; }; class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { - onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; class CA_IGUI_elements_group: RscControlsGroup { class controls { MACRO_RANGEFINDER From 9ac1f8fc479dee740d976f7653f1524a3bc63a0d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 23:13:26 +0100 Subject: [PATCH 11/14] use DisplayLoad for turretDisplayLoaded event --- addons/common/RscInfoType.hpp | 16 ++++++++-------- addons/mk6mortar/CfgEventHandlers.hpp | 9 +++++++++ addons/mk6mortar/XEH_postInit.sqf | 1 - 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 8a14df0e66..327a9814d1 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -1,7 +1,7 @@ class RscInGameUI { class RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); }; class RscUnitInfoNoHUD { @@ -9,19 +9,19 @@ class RscInGameUI { }; class RscUnitInfoSoldier: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent);); }; class RscUnitInfoTank: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent);); }; class RscUnitInfoAirNoWeapon: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); }; class RscUnitInfoAir: RscUnitInfoAirNoWeapon { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); }; class RscUnitInfo_AH64D_gunner { @@ -33,11 +33,11 @@ class RscInGameUI { }; class RscUnitInfoSubmarine: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent);); }; class RscUnitInfoShip: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent);); }; class RscWeaponEmpty { @@ -97,7 +97,7 @@ class RscInGameUI { }; class RscUnitInfoParachute: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent);); }; class RscUnitVehicle { diff --git a/addons/mk6mortar/CfgEventHandlers.hpp b/addons/mk6mortar/CfgEventHandlers.hpp index 3a04fae9f0..9a2899ca6e 100644 --- a/addons/mk6mortar/CfgEventHandlers.hpp +++ b/addons/mk6mortar/CfgEventHandlers.hpp @@ -1,13 +1,22 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscUnitInfo { + ADDON = QUOTE(_this call FUNC(turretDisplayLoaded)); + }; +}; + class Extended_FiredBIS_EventHandlers { class Mortar_01_base_F { class ADDON { diff --git a/addons/mk6mortar/XEH_postInit.sqf b/addons/mk6mortar/XEH_postInit.sqf index 5c82d55f50..ffe3b3b814 100644 --- a/addons/mk6mortar/XEH_postInit.sqf +++ b/addons/mk6mortar/XEH_postInit.sqf @@ -18,4 +18,3 @@ if (!hasInterface) exitWith {}; ["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler); -["infoDisplayChanged", {_this call FUNC(turretDisplayLoaded);}] call EFUNC(common,addEventHandler); From dd10fac4700695deac9c17fa73407e5dc69f7450 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 21 Feb 2016 23:28:02 +0100 Subject: [PATCH 12/14] use DisplayLoad for main menu box and to disable options when world=Empty --- addons/optionsmenu/CfgEventHandlers.hpp | 11 +++++++++++ addons/optionsmenu/gui/pauseMenu.hpp | 4 ---- ...t_loadMainMenuBox.sqf => init_loadMainMenuBox.sqf} | 0 3 files changed, 11 insertions(+), 4 deletions(-) rename addons/optionsmenu/{script_loadMainMenuBox.sqf => init_loadMainMenuBox.sqf} (100%) diff --git a/addons/optionsmenu/CfgEventHandlers.hpp b/addons/optionsmenu/CfgEventHandlers.hpp index 917a0acbd7..ea6f54eded 100644 --- a/addons/optionsmenu/CfgEventHandlers.hpp +++ b/addons/optionsmenu/CfgEventHandlers.hpp @@ -1,10 +1,21 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayMain { + GVAR(loadMainMenuBox) = QUOTE(_this call COMPILE_FILE(init_loadMainMenuBox)); + + //Hide the button if there is no world (-world=empty) + GVAR(hideButtonEmptyWorld) = "((_this select 0) displayCtrl 80085) ctrlShow (missionName != '');"; + }; +}; diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index 3333c5476f..2c14aecc99 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -101,10 +101,6 @@ class RscDisplayMovieInterrupt: RscStandardDisplay { }; }; class RscDisplayMain: RscStandardDisplay { - //Hide the button if there is no world (-world=empty) - //Seems odd to use onMouseMoving, but I don't want to overload onLoad - onMouseMoving = QUOTE(((_this select 0) displayCtrl 80085) ctrlShow (missionName != ''); _this execVM QUOTE(QUOTE(PATHTOF(script_loadMainMenuBox.sqf)));); - class controls { class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase { action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};"; diff --git a/addons/optionsmenu/script_loadMainMenuBox.sqf b/addons/optionsmenu/init_loadMainMenuBox.sqf similarity index 100% rename from addons/optionsmenu/script_loadMainMenuBox.sqf rename to addons/optionsmenu/init_loadMainMenuBox.sqf From ac3385fb832db85a69bff690c1bd90e6d01f6783 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 22 Feb 2016 16:08:24 +0100 Subject: [PATCH 13/14] manual merge --- addons/interact_menu/CfgEventHandlers.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index f33e404a01..fa53ccf57c 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -24,12 +24,9 @@ class Extended_InitPost_EventHandlers { }; }; }; -<<<<<<< HEAD class Extended_DisplayLoad_EventHandlers { class RscDiary { ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad)); }; }; -======= ->>>>>>> 0f7bfc0f6654cef08f84b36fbc4fd4be2774777b From 72fe155cda92ca4f80f75dc178af50c08f9e724c Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 22 Feb 2016 16:11:10 +0100 Subject: [PATCH 14/14] manual merge --- addons/mk6mortar/CfgEventHandlers.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/mk6mortar/CfgEventHandlers.hpp b/addons/mk6mortar/CfgEventHandlers.hpp index 99a7155fcb..b88088c6e4 100644 --- a/addons/mk6mortar/CfgEventHandlers.hpp +++ b/addons/mk6mortar/CfgEventHandlers.hpp @@ -17,15 +17,12 @@ class Extended_PostInit_EventHandlers { }; }; -<<<<<<< HEAD class Extended_DisplayLoad_EventHandlers { class RscUnitInfo { ADDON = QUOTE(_this call FUNC(turretDisplayLoaded)); }; }; -======= ->>>>>>> 0f7bfc0f6654cef08f84b36fbc4fd4be2774777b class Extended_FiredBIS_EventHandlers { class Mortar_01_base_F { class ADDON {