Allow displayTextStructured to be moved via game layout settings (#6102)

* Allow displayTextStructured to be moved via game layout settings

Fix #6081

* Fix comment, add upperleft bounds check
This commit is contained in:
PabstMirror 2018-02-09 14:27:40 -06:00 committed by GitHub
parent 9e213f0e9a
commit ba5d44b848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 12 deletions

Binary file not shown.

View File

@ -71,7 +71,7 @@ class CfgUIGrids {
class Presets { class Presets {
class Arma3 { class Arma3 {
class Variables { class Variables {
grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"}; grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (3 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
}; };
}; };
}; };
@ -80,7 +80,7 @@ class CfgUIGrids {
class grid_ACE_displayText { class grid_ACE_displayText {
displayName = "ACE Hint"; displayName = "ACE Hint";
description = "Textual in game feedback to the player."; description = "Textual in game feedback to the player.";
preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa"; preview = QPATHTOF(UI\ace_hint_ca.paa);
saveToProfile[] = {0,1}; saveToProfile[] = {0,1};
}; };
}; };

View File

@ -49,25 +49,23 @@ private _ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor);
/*
// This does not function at the moment. Has been disabled until it fixed. // Use profile settings from CfgUIGrids.hpp
private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))];
private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
private _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))];
private _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
*/
private _xPos = ((safezoneX + safezoneW) - (_width *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
private _yPos = safeZoneY + 0.175 * safezoneH;
private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40)); private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40));
private _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); private _hPos = _size * (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
// Ensure still in bounds for large width/height
_xPos = safezoneX max (_xPos min (safezoneX + safezoneW - _wPos));
_yPos = safeZoneY max (_yPos min (safeZoneY + safezoneH - _hPos));
// Zeus Interface Open and Display would be under the "CREATE" list // Zeus Interface Open and Display would be under the "CREATE" list
if (!isNull curatorCamera) then { if (!isNull curatorCamera) then {
_xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos);
}; };
private _position = [_xPos, _yPos, _wPos, _size * _hPos]; private _position = [_xPos, _yPos, _wPos, _hPos];
_ctrlHint ctrlSetPosition _position; _ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit 0; _ctrlHint ctrlCommit 0;