Skip to content

Commit

Permalink
GUI - Fix Antenna Elevation indicator 3rd party compatibility (IDI-Sy…
Browse files Browse the repository at this point in the history
…stems#1022)

* GUI - Fix Antenna Elevation indicator 3rd party compatibility

* Use IGUI_BCG_COLOR
  • Loading branch information
jonpas authored Sep 17, 2020
1 parent 271b0c2 commit 0566a42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 58 deletions.
61 changes: 7 additions & 54 deletions addons/sys_gui/RscInGameUI.hpp
Original file line number Diff line number Diff line change
@@ -1,60 +1,13 @@
class RscInGameUI {
class RscStanceInfo {
idd = 303;
scriptName = "RscStanceInfo";
scriptPath = "IGUI";
onLoad = "['onLoad', _this, 'RscStanceInfo', 'IGUI'] call (uiNamespace getVariable 'BIS_fnc_initDisplay')";
onUnload = "['onUnload', _this, 'RscStanceInfo', 'IGUI'] call (uiNamespace getVariable 'BIS_fnc_initDisplay')";
controls[] = {
"StanceIndicatorBackground",
"StanceIndicator",
"AntennaElevationInfoControlsGroup"
};
class StanceIndicatorBackground: RscPicture {
colorText[] = {
"(profilenamespace getVariable ['IGUI_BCG_RGB_R', 0])",
"(profilenamespace getVariable ['IGUI_BCG_RGB_G', 1])",
"(profilenamespace getVariable ['IGUI_BCG_RGB_B', 1])",
"(profilenamespace getVariable ['IGUI_BCG_RGB_A', 0.8])"
};
idc = 1201;
text = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\gradient_ca.paa";
x = "(profilenamespace getVariable ['IGUI_GRID_STANCE_X', ((safezoneX + safezoneW) - (3.7 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])";
y = "(profilenamespace getVariable ['IGUI_GRID_STANCE_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
w = "(3.7 * (((safezoneW / safezoneH) min 1.2) / 40))";
h = "(3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
};
class StanceIndicator: RscPictureKeepAspect {
idc = 188;
text = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa";
x = "(profilenamespace getVariable ['IGUI_GRID_STANCE_X', ((safezoneX + safezoneW) - (3.7 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])";
y = "(profilenamespace getVariable ['IGUI_GRID_STANCE_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
w = "(3.7 * (((safezoneW / safezoneH) min 1.2) / 40))";
h = "(3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
};

class AntennaElevationInfoControlsGroup: RscControlsGroupNoScrollbars {
idc = 200;
x = "profileNamespace getVariable ['IGUI_grid_ACRE_antennaElevationInfo_X', profilenamespace getVariable ['IGUI_GRID_STANCE_X', ((safezoneX + safezoneW) - (3.7 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))]]";
y = "profileNamespace getVariable ['IGUI_grid_ACRE_antennaElevationInfo_Y', profilenamespace getVariable ['IGUI_GRID_STANCE_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]]";
w = "3.7 * (((safezoneW / safezoneH) min 1.2) / 40)";
controls[] += {"ACRE_AntennaElevationInfo"};
class ACRE_AntennaElevationInfo: RscPictureKeepAspect {
x = IGUI_GRID_STANCE_X;
y = IGUI_GRID_STANCE_Y;
w = IGUI_GRID_STANCE_WAbs;
onLoad = "uiNamespace setVariable ['ACRE_AntennaElevationInfo', _this select 0];";

class Controls {
class AntennaElevationInfo: RscPictureKeepAspect {
idc = 201;
x = 0;
y = 0;
w = "3.7 * (((safezoneW / safezoneH) min 1.2) / 40)";
text= QPATHTOF(data\ui\stand_straight.paa);
colorBackground[] = {
"profileNamespace getVariable ['IGUI_BCG_RGB_R', 0]",
"profileNamespace getVariable ['IGUI_BCG_RGB_G', 1]",
"profileNamespace getVariable ['IGUI_BCG_RGB_B', 1]",
"profileNamespace getVariable ['IGUI_BCG_RGB_A', 0.8]"
};
};
};
text = QPATHTOF(data\ui\stand_straight.paa);
colorBackground[] = IGUI_BCG_COLOR;
};
};
};
2 changes: 0 additions & 2 deletions addons/sys_gui/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"

class RscText;
class RscPicture;
class RscXSliderH;
class RscProgress;
class RscStructuredText;
class RscPictureKeepAspect;
Expand Down
4 changes: 2 additions & 2 deletions addons/sys_gui/fnc_antennaElevationDisplay.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

// Macro instead of func for performance (may be run each frame)
#define FNC_SETANTENNAELEVATIONTEXT(theText) \
private _ctrlGroup = uiNamespace getVariable [ARR_2("ACRE_AntennaElevationInfo", controlNull)]; \
if (!isNull _ctrlGroup) then { (_ctrlGroup controlsGroupCtrl 201) ctrlSetText theText; };
private _ctrl = uiNamespace getVariable [ARR_2("ACRE_AntennaElevationInfo", controlNull)]; \
if (!isNull _ctrl) then { _ctrl ctrlSetText theText; };


// Need to run this every frame. Otherwise there will be noticeable delays
Expand Down

0 comments on commit 0566a42

Please sign in to comment.