mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Handle the clock
This commit is contained in:
parent
619c2d780b
commit
3b1afe930e
@ -3,6 +3,7 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(handleCamera);
|
||||
PREP(handleClock);
|
||||
PREP(handleCompass);
|
||||
PREP(handleInterface);
|
||||
PREP(handleKilled);
|
||||
|
31
addons/spectator/functions/fnc_handleClock.sqf
Normal file
31
addons/spectator/functions/fnc_handleClock.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: Karel Moricky, SilentSpike
|
||||
* Handles the spectator UI clock
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleClock, 1, _display] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
// Kill PFH when display is closed
|
||||
if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
// Reduce overhead when toolbar is hidden
|
||||
if !(GVAR(showTool) && GVAR(showInterface)) exitWith {};
|
||||
|
||||
private "_clock";
|
||||
|
||||
_clock = (_display displayCtrl IDC_TOOL) controlsGroupCtrl IDC_TOOL_CLOCK;
|
||||
_clock ctrlSetText ([daytime,"HH:MM"] call BIS_fnc_timeToString);
|
@ -122,6 +122,9 @@ switch (toLower _mode) do {
|
||||
// Handle the compass heading
|
||||
[FUNC(handleCompass), 0, _display] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// Handle the clock time
|
||||
[FUNC(handleClock), 1, _display] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// Hacky way to enable keybindings
|
||||
//_display displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}];
|
||||
//_display displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}];
|
||||
|
Loading…
Reference in New Issue
Block a user