Merge pull request #2623 from acemod/interactMenuSet

Interact menu settings after init
This commit is contained in:
PabstMirror 2015-10-03 12:49:04 -05:00
commit 10950d5fab
2 changed files with 14 additions and 11 deletions

View File

@ -8,17 +8,19 @@ GVAR(cachedBuildingActionPairs) = [];
GVAR(ParsedTextCached) = [];
//Setup text/shadow/size/color settings matrix
[] call FUNC(setupTextColors);
["SettingChanged", {
PARAMS_1(_name);
if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then {
params ["_name"];
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
[] call FUNC(setupTextColors);
};
}] call EFUNC(common,addEventhandler);
// Install the render EH on the main display
addMissionEventHandler ["Draw3D", DFUNC(render)];
["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);
//Add Actions to Houses:
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
@ -54,7 +56,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
// If no menu is open just quit
if (GVAR(openedMenuType) < 0) exitWith {};
EXPLODE_2_PVT(_this,_unit,_isUnconscious);
params ["_unit", "_isUnconscious"];
if (_unit != ACE_player || !_isUnconscious) exitWith {};

View File

@ -14,13 +14,14 @@
BEGIN_COUNTER(fnc_render);
private ["_cursorPos1", "_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
_foundTarget = false;
_cursorPos1 = positionCameraToWorld [0, 0, 0];
_cursorPos2 = positionCameraToWorld [0, 0, 2];
private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
_foundTarget = false;
if (GVAR(openedMenuType) >= 0) then {
// _cursorPos1 = positionCameraToWorld [0, 0, 2];
_cursorPos2 = positionCameraToWorld [0, 0, 2];
// Render all available nearby interactions
call FUNC(renderActionPoints);