2015-01-18 18:38:27 +00:00
|
|
|
//XEH_clientInit.sqf
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-03 05:42:25 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-05-04 19:06:33 +00:00
|
|
|
GVAR(cachedBuildingTypes) = [];
|
|
|
|
GVAR(cachedBuildingActionPairs) = [];
|
|
|
|
|
2015-04-25 11:28:21 +00:00
|
|
|
GVAR(ParsedTextCached) = [];
|
|
|
|
|
2015-04-20 23:28:01 +00:00
|
|
|
["SettingChanged", {
|
2015-09-27 03:02:05 +00:00
|
|
|
params ["_name"];
|
|
|
|
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
|
2015-04-20 23:28:01 +00:00
|
|
|
[] call FUNC(setupTextColors);
|
|
|
|
};
|
|
|
|
}] call EFUNC(common,addEventhandler);
|
|
|
|
|
2015-09-27 03:02:05 +00:00
|
|
|
["SettingsInitialized", {
|
|
|
|
//Setup text/shadow/size/color settings matrix
|
|
|
|
[] call FUNC(setupTextColors);
|
|
|
|
// Install the render EH on the main display
|
|
|
|
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
2015-03-23 21:26:20 +00:00
|
|
|
|
2015-04-14 03:19:38 +00:00
|
|
|
//Add Actions to Houses:
|
2015-05-03 04:13:35 +00:00
|
|
|
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
|
2015-04-14 03:19:38 +00:00
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)),
|
2015-04-04 15:20:14 +00:00
|
|
|
{
|
|
|
|
// Statement
|
|
|
|
[0] call FUNC(keyDown)
|
2015-04-25 06:23:54 +00:00
|
|
|
},{[0,false] call FUNC(keyUp)},
|
2015-11-30 15:45:20 +00:00
|
|
|
[219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key
|
2015-02-18 21:58:06 +00:00
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)),
|
2015-04-04 15:20:14 +00:00
|
|
|
{
|
|
|
|
// Statement
|
|
|
|
[1] call FUNC(keyDown)
|
2015-04-25 06:23:54 +00:00
|
|
|
},{[1,false] call FUNC(keyUp)},
|
2015-11-30 15:45:20 +00:00
|
|
|
[219, [false, true, false]], false] call CBA_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
|
2015-04-04 15:20:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Listens for the falling unconscious event, just in case the menu needs to be closed
|
|
|
|
["medical_onUnconscious", {
|
|
|
|
// If no menu is open just quit
|
|
|
|
if (GVAR(openedMenuType) < 0) exitWith {};
|
|
|
|
|
2015-09-27 03:02:05 +00:00
|
|
|
params ["_unit", "_isUnconscious"];
|
2015-04-04 15:20:14 +00:00
|
|
|
|
|
|
|
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
|
|
|
|
|
|
|
GVAR(actionSelected) = false;
|
2015-05-05 18:05:31 +00:00
|
|
|
[GVAR(openedMenuType), false] call FUNC(keyUp);
|
2015-04-04 15:20:14 +00:00
|
|
|
}] call EFUNC(common,addEventhandler);
|
2015-04-15 04:20:20 +00:00
|
|
|
|
|
|
|
// disable firing while the interact menu is is is opened
|
|
|
|
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler);
|
2015-05-29 19:56:07 +00:00
|
|
|
|
2015-06-03 04:04:47 +00:00
|
|
|
// background options
|
|
|
|
["interactMenuOpened", {
|
|
|
|
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);};
|
|
|
|
if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];};
|
|
|
|
}] call EFUNC(common,addEventHandler);
|
|
|
|
["interactMenuClosed", {
|
|
|
|
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);};
|
|
|
|
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
|
|
|
|
}] call EFUNC(common,addEventHandler);
|