From b0c27d107164af5d593e090a0532d6164b06b843 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 16 Sep 2017 21:20:32 +0100 Subject: [PATCH] Add uiNamespace variable to spectator display (#5520) * Add uiNamespace variable to spectator UI * Update spectator keys to match docs branch --- addons/spectator/functions/fnc_ui_handleKeyDown.sqf | 6 +++--- addons/spectator/ui.hpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf index 753bba7715..696ba2e652 100644 --- a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf +++ b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf @@ -147,20 +147,20 @@ if (_key == DIK_F1) exitWith { }; // Handle toggle focus info widget -if (_key == DIK_P) exitWith { +if (_key == DIK_I) exitWith { GVAR(uiWidgetVisible) = !GVAR(uiWidgetVisible); [] call FUNC(ui_updateWidget); true }; // Handle toggling projectile drawing -if (_key == DIK_O) exitWith { +if (_key == DIK_P) exitWith { GVAR(drawProjectiles) = !GVAR(drawProjectiles); true }; // Handle toggling unit drawing -if (_key == DIK_I) exitWith { +if (_key == DIK_O) exitWith { GVAR(drawUnits) = !GVAR(drawUnits); true }; diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp index 7ef4620489..faee6d7748 100644 --- a/addons/spectator/ui.hpp +++ b/addons/spectator/ui.hpp @@ -17,6 +17,8 @@ class GVAR(display) { enableSimulation = 1; movingEnable = 0; closeOnMissionEnd = 1; + + onLoad = QUOTE(SETUVAR(GVAR(display),_this select 0)); onKeyDown = QUOTE(_this call FUNC(ui_handleKeyDown)); onKeyUp = QUOTE(_this call FUNC(ui_handleKeyUp));