replace inventoryDisplayLoaded with DisplayLoad event

This commit is contained in:
commy2 2016-02-21 21:24:39 +01:00
parent e9808bf20b
commit 4335bfbfcf
10 changed files with 35 additions and 27 deletions

View File

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

View File

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

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

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

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

@ -5,7 +5,7 @@ ADDON = false;
PREP(addCustomFilter);
PREP(currentItemListBox);
PREP(forceItemListUpdate);
PREP(inventoryDisplayLoaded);
PREP(inventoryDisplayLoad);
PREP(onLBSelChanged);
// cache config

View File

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

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