Skip to content

Commit

Permalink
Added defines for IDD/IDCs
Browse files Browse the repository at this point in the history
  • Loading branch information
DartRuffian committed Oct 14, 2024
1 parent a7ac103 commit 6f1da97
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 17 deletions.
18 changes: 9 additions & 9 deletions addons/goggles/RscTitles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ class RscTitles {
idd = -1;
onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]";
onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]";
fadeIn=0.5;
fadeOut=0.5;
fadeIn = 0.5;
fadeOut = 0.5;
movingEnable = 0;
duration = 10e10;
name = "RscACE_Goggles_BaseTitle";
class controls;
};

class RscACE_Goggles: RscACE_Goggles_BaseTitle {
idd = 1044;
idd = IDD_GOGGLES;
name = "RscACE_Goggles";
class controls {
class gogglesImage: RscPicture {
idc = 10650;
idc = IDC_GOGGLES_OVERLAY;
x = "safeZoneX";
y = "safeZoneY";
w = "safeZoneW";
Expand All @@ -28,22 +28,22 @@ class RscTitles {
};

class RscACE_GogglesEffects: RscACE_Goggles_BaseTitle {
idd = 1045;
idd = IDD_GOGGLESEFFECTS;
onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]";
onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]";
name = "RscACE_GogglesEffects";
fadeIn=0;
fadeOut=0.5;
fadeIn = 0;
fadeOut = 0.5;
class controls {
class dirtImage: RscPicture {
idc = 10660;
idc = IDC_GOGGLESEFFECTS_DIRT;
x = "safeZoneX";
y = "safeZoneY";
w = "safeZoneW";
h = "safeZoneH";
};
class dustImage: RscPicture {
idc = 10662;
idc = IDC_GOGGLESEFFECTS_DUST;
x = "safeZoneX";
y = "safeZoneY";
w = "safeZoneW";
Expand Down
4 changes: 2 additions & 2 deletions addons/goggles/functions/fnc_applyDirtEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ if ([_unit] call FUNC(isGogglesVisible)) then {

if (_dirtImage != "") then {
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false, false];
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage;
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetText _dirtImage;

private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1];
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1];
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1];
[QGVAR(effect), [_unit, "dirt"]] call CBA_fnc_localEvent;
TRACE_1("dirt",_effectBrightness);
};
Expand Down
4 changes: 2 additions & 2 deletions addons/goggles/functions/fnc_applyDustEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ private _unit = ACE_player;
if ([_unit] call FUNC(isGogglesVisible)) exitWith {
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false, false];

((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1];
((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1];

private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1];
((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1];
((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1];
TRACE_1("dust",_effectBrightness);

SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,1));
Expand Down
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_applyGlassesEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private _angle = getNumber (_config >> "ACE_Overlay_Angle");

if (_imagePath != "") then {
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false];
private _overlay = (GLASSDISPLAY displayCtrl 10650);
private _overlay = (GLASSDISPLAY displayCtrl IDC_GOGGLES_OVERLAY);
_overlay ctrlSetText _imagePath;

if ((_angle != 0) && {((ctrlAngle _overlay) # 0) != _angle}) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_handleExplosion.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (getText (_config >> "ACE_OverlayCracked") != "") then {
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false];
};

(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked");
(GLASSDISPLAY displayCtrl IDC_GOGGLES_OVERLAY) ctrlSetText getText (_config >> "ACE_OverlayCracked");
};

["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent;
Expand Down
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_removeDirtEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
*/

if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText "";
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetText "";
};
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_removeDustEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
*/

if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText "";
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetText "";
};
7 changes: 7 additions & 0 deletions addons/goggles/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@
#define GLASSDISPLAY GETUVAR(GVAR(Display),displayNull)

#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})

#define IDD_GOGGLES 1044
#define IDC_GOGGLES_OVERLAY 10650

#define IDD_GOGGLESEFFECTS 1045
#define IDC_GOGGLESEFFECTS_DIRT 10660
#define IDC_GOGGLESEFFECTS_DUST 10662

0 comments on commit 6f1da97

Please sign in to comment.