Scopes - UI improvement (#5702)

* Displays U, D, L, R behind the MIL turret adjustment number
* Allows clients to select their preferred UI type
* Improves the text alignment
This commit is contained in:
ulteq 2017-11-08 14:04:09 +01:00 committed by GitHub
parent bacb7d069b
commit 28706c4dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 4 deletions

View File

@ -60,4 +60,12 @@ class ACE_Settings {
displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_displayName);
description = CSTRING(deduceBarometricPressureFromTerrainAltitude_description);
};
class GVAR(useLegacyUI) {
typeName = "BOOL";
value = 0;
isClientSettable = 1;
displayName = CSTRING(useLegacyUI_displayName);
description = CSTRING(useLegacyUI_description);
};
};

View File

@ -51,7 +51,7 @@ class RscTitles {
class ACE_Scopes_Zeroing_Horizontal : RscText {
idc = 13;
type = 0;
style = 0;
style = 2;
sizeEx = 0.04;
lineSpacing = 1;
font = "RobotoCondensed";
@ -62,7 +62,7 @@ class RscTitles {
x = (0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX;
y = (0 + 0.47*0.3) * safezoneH + safezoneY;
w = 0.04 * safezoneW;
w = 0.019 * safezoneW;
h = 0.025 * safezoneH;
};
};

View File

@ -35,8 +35,29 @@ private _zeroing = _adjustment select _weaponIndex;
_zeroing params ["_elevation", "_windage"];
private _vertical = _display displayCtrl 12;
private _horizontal = _display displayCtrl 13;
_vertical ctrlSetText (str _elevation);
_horizontal ctrlSetText (str _windage);
if (GVAR(useLegacyUI)) then {
_vertical ctrlSetText (str _elevation);
_horizontal ctrlSetText (str _windage);
} else {
if (_elevation == 0) then {
_vertical ctrlSetText "0";
} else {
if (_elevation > 0) then {
_vertical ctrlSetText format[localize LSTRING(DisplayAdjustmentUp), abs(_elevation)];
} else {
_vertical ctrlSetText format[localize LSTRING(DisplayAdjustmentDown), abs(_elevation)];
};
};
if (_windage == 0) then {
_horizontal ctrlSetText "0";
} else {
if (_windage > 0) then {
_horizontal ctrlSetText format[localize LSTRING(DisplayAdjustmentRight), abs(_windage)];
} else {
_horizontal ctrlSetText format[localize LSTRING(DisplayAdjustmentLeft), abs(_windage)];
};
};
};
// Set the time when to hide the knobs
GVAR(timeToHide) = diag_tickTime + 3.0;

View File

@ -210,6 +210,14 @@
<Chinesesimp>在不同高度上会有不同的大气压力</Chinesesimp>
<Chinese>在不同高度上會有不同的大氣壓力</Chinese>
</Key>
<Key ID="STR_ACE_Scopes_useLegacyUI_displayName">
<English>Use legacy UI</English>
<German>Vorheriges UI verwenden</German>
</Key>
<Key ID="STR_ACE_Scopes_useLegacyUI_description">
<English>Displays elevation and windage with signed numbers</English>
<German>Anzeige der Absehenverstellungen mit vorzeichenbehafteten Zahlen</German>
</Key>
<Key ID="STR_ACE_Scopes_AdjustUpMinor">
<English>Minor adjustment up</English>
<German>Kleine Korrektur hoch</German>
@ -365,5 +373,25 @@
<Chinesesimp>此模块可为高倍率瞄准镜新增归零风偏,距离用的调整纽。</Chinesesimp>
<Chinese>此模塊可為高倍率瞄準鏡新增歸零風偏,距離用的調整紐。</Chinese>
</Key>
<Key ID="STR_ACE_Scopes_DisplayAdjustmentUp">
<English>%1U</English>
<German>%1H</German>
<French>%1H</French>
</Key>
<Key ID="STR_ACE_Scopes_DisplayAdjustmentDown">
<English>%1D</English>
<German>%1T</German>
<French>%1B</French>
</Key>
<Key ID="STR_ACE_Scopes_DisplayAdjustmentLeft">
<English>%1L</English>
<German>%1L</German>
<French>%1G</French>
</Key>
<Key ID="STR_ACE_Scopes_DisplayAdjustmentRight">
<English>%1R</English>
<German>%1R</German>
<French>%1D</French>
</Key>
</Package>
</Project>