Merge pull request #3369 from acemod/usedisplayloadxeh

displayLoad xeh for imenu
This commit is contained in:
commy2 2016-02-22 16:15:12 +01:00
commit 939cd65721
40 changed files with 255 additions and 206 deletions

View File

@ -16,6 +16,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 {

View File

@ -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);

View File

@ -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;
};

View File

@ -19,6 +19,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) {

View File

@ -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 {
@ -112,25 +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)]);
};
};
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););
};
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););
};

View File

@ -90,9 +90,7 @@ PREP(goKneeling);
PREP(hadamardProduct);
PREP(handleModifierKey);
PREP(handleModifierKeyUp);
PREP(handleModifierKeyInit);
PREP(handleScrollWheel);
PREP(handleScrollWheelInit);
PREP(hasItem);
PREP(hasMagazine);
PREP(headBugFix);

View File

@ -0,0 +1,6 @@
#include "script_component.hpp"
GVAR(ScrollWheelFrame) = diag_frameno;
call COMPILE_FILE(init_handleScrollWheel);
call COMPILE_FILE(init_handleModifierKey);

View File

@ -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;
@ -341,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);
@ -441,14 +405,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 {

View File

@ -8,7 +8,7 @@ class CfgPatches {
requiredAddons[] = {"ace_main","ace_modules"};
author[] = {"KoffeinFlummi"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
VERSION_CONFIG_COMMON;
};
};
@ -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[] = {};
};

View File

@ -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)];

View File

@ -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)];

View File

@ -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))];

View File

@ -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;
};
}];

View File

@ -14,4 +14,8 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define VERSION_CONFIG_COMMON VERSION_CONFIG;\
versionDesc = "ACE 3";\
versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip))

View File

@ -17,6 +17,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 {

View File

@ -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);

View File

@ -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

View File

@ -16,3 +16,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));
};
};

View File

@ -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
}];

View File

@ -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);

View File

@ -13,7 +13,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));
};
};
@ -24,3 +24,9 @@ class Extended_InitPost_EventHandlers {
};
};
};
class Extended_DisplayLoad_EventHandlers {
class RscDiary {
ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad));
};
};

View File

@ -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

View File

@ -0,0 +1,9 @@
#include "script_component.hpp"
disableSerialization;
params ["_display"];
if (ctrlIDD _display == 12) then { // RscDisplayMainMap
(_display displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)];
};

View File

@ -16,3 +16,9 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_DisplayLoad_EventHandlers {
class RscDisplayInventory {
ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad));
};
};

View File

@ -2,7 +2,7 @@
PREP(addCustomFilter);
PREP(currentItemListBox);
PREP(forceItemListUpdate);
PREP(inventoryDisplayLoaded);
PREP(inventoryDisplayLoad);
PREP(onLBSelChanged);
PREP(filterWeapons);

View File

@ -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

View File

@ -17,6 +17,12 @@ class Extended_PostInit_EventHandlers {
};
};
class Extended_DisplayLoad_EventHandlers {
class RscUnitInfo {
ADDON = QUOTE(_this call FUNC(turretDisplayLoaded));
};
};
class Extended_FiredBIS_EventHandlers {
class Mortar_01_base_F {
class ADDON {

View File

@ -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);

View File

@ -16,3 +16,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));
};
};

View File

@ -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;

View File

@ -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

View File

@ -13,6 +13,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
};
};

View File

@ -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);

View File

@ -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;

View File

@ -16,3 +16,12 @@ class Extended_PostInit_EventHandlers {
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 != '');";
};
};

View File

@ -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';};";

View File

@ -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];";
};
};
*/

View File

@ -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"};