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-04-25 11:28:21 +00:00
|
|
|
GVAR(ParsedTextCached) = [];
|
|
|
|
|
2015-04-30 04:53:00 +00:00
|
|
|
//Setup text/shadow/size/color settings matrix
|
2015-04-20 23:28:01 +00:00
|
|
|
[] call FUNC(setupTextColors);
|
|
|
|
["SettingChanged", {
|
2015-04-29 06:26:13 +00:00
|
|
|
PARAMS_1(_name);
|
2015-04-30 04:53:00 +00:00
|
|
|
if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then {
|
2015-04-20 23:28:01 +00:00
|
|
|
[] call FUNC(setupTextColors);
|
|
|
|
};
|
|
|
|
}] call EFUNC(common,addEventhandler);
|
|
|
|
|
2015-03-23 21:26:20 +00:00
|
|
|
// Install the render EH on the main display
|
|
|
|
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
|
|
|
|
|
|
|
// 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)};
|
|
|
|
|
2015-04-03 05:42:25 +00:00
|
|
|
// Install the render EH on the map screen
|
2015-03-23 21:26:20 +00:00
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)];
|
2015-01-18 18:38:27 +00:00
|
|
|
};
|
2015-03-23 21:26:20 +00:00
|
|
|
|
2015-01-18 18:38:27 +00:00
|
|
|
|
2015-05-01 08:19:47 +00:00
|
|
|
["ACE3 Common", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"),
|
2015-04-04 15:20:14 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
|
|
// Statement
|
|
|
|
[0] call FUNC(keyDown)
|
2015-04-25 06:23:54 +00:00
|
|
|
},{[0,false] call FUNC(keyUp)},
|
2015-03-05 07:32:26 +00:00
|
|
|
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
|
2015-02-18 21:58:06 +00:00
|
|
|
|
2015-05-01 08:19:47 +00:00
|
|
|
["ACE3 Common", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"),
|
2015-04-04 15:20:14 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
|
|
|
// Statement
|
|
|
|
[1] call FUNC(keyDown)
|
2015-04-25 06:23:54 +00:00
|
|
|
},{[1,false] call FUNC(keyUp)},
|
2015-03-05 07:32:26 +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 {};
|
|
|
|
|
|
|
|
EXPLODE_2_PVT(_this,_unit,_isUnconscious);
|
|
|
|
|
|
|
|
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
|
|
|
|
|
|
|
GVAR(actionSelected) = false;
|
|
|
|
[] call FUNC(keyUp);
|
|
|
|
}] 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);
|