Skip to content

Commit

Permalink
Merge pull request #1396 from acemod/atragDayNightGUI
Browse files Browse the repository at this point in the history
Nighttime GUI for the ATragMX.
  • Loading branch information
ulteq committed May 26, 2015
2 parents 3a810ab + dc1bfa9 commit bfd31b2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addons/atragmx/RscTitles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ class ATragMX_Display {
type=0;
font="TahomaB";
SizeEX=0.025;
idc=-1;
idc=720000;
style=48;
x=0.55*safezoneW+safezoneX-0.256;
y=0.265*safezoneH+safezoneY-0.1;
w=1.024;
h=1.024*4/3;
colorBackground[]={1,1,1,1};
colorText[]={1,1,1,1};
text=PATHTOF(UI\atrag.paa);
text=PATHTOF(UI\atrag_d.paa);
};
class POWER: ATragMX_RscButton {
idc=-1;
Expand Down
File renamed without changes.
Binary file added addons/atragmx/UI/ATRAG_N.paa
Binary file not shown.
10 changes: 10 additions & 0 deletions addons/atragmx/functions/fnc_create_dialog.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
#include "script_component.hpp"

#define __dsp (uiNamespace getVariable "ATragMX_Display")
#define __ctrlBackground (__dsp displayCtrl 720000)

if (GVAR(active)) exitWith { false };
if (underwater ACE_player) exitWith { false };
if (!("ACE_ATragMX" in (uniformItems ACE_player)) && !("ACE_ATragMX" in (vestItems ACE_player))) exitWith { false };
Expand Down Expand Up @@ -49,4 +52,11 @@ GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);

GVAR(active) = true;

GVAR(DialogPFH) = [{
if (!GVAR(active)) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
};
__ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))];
}, 60, []] call cba_fnc_addPerFrameHandler;

true
3 changes: 2 additions & 1 deletion addons/atragmx/functions/fnc_on_close_dialog.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "script_component.hpp"

uiNamespace setVariable ['ATragMX_Display', nil];
GVAR(active) = false;
GVAR(active) = false;
[GVAR(DialogPFH)] call removePerFrameHandler;

0 comments on commit bfd31b2

Please sign in to comment.