Overhauled AGM hint.

This commit is contained in:
Glowbal 2015-02-19 21:38:51 +01:00
parent 21199a4ee6
commit a81c1fbef5
6 changed files with 56 additions and 21 deletions

View File

@ -25,6 +25,7 @@ class RscTitles {
y = safeZoneY + 0.2 * safezoneH;
w = 0.2 * safeZoneW;
h = 0.1 * SafeZoneH;
font = "PuristaMedium";
};
};
};
@ -36,7 +37,6 @@ class RscTitles {
fadeIn = 0.2;
fadeOut = 0.2;
name = "ACE_RscErrorHint";
class controls {
class HintBox: RscStructuredText {
idc = 1;
@ -56,7 +56,7 @@ class RscTitles {
duration = 7;
idd = 86411;
movingenable = 0;
onLoad = "uiNamespace setVariable ['ACE_RscDisplayMessage', _this select 0];"
onLoad = "uiNamespace setVariable ['ACE_RscDisplayMessage', _this select 0];";
fadein = 0;
class controlsBackground {
class header: ACE_gui_staticBase {
@ -88,7 +88,7 @@ class RscTitles {
duration = 15;
idd = 86412;
movingenable = 0;
onLoad = "uiNamespace setVariable ['ACE_RscDisplayInformation', _this select 0];"
onLoad = "uiNamespace setVariable ['ACE_RscDisplayInformation', _this select 0];";
fadein = 0;
class controlsBackground {
class header: ACE_gui_staticBase {

View File

@ -103,6 +103,13 @@ class ACE_Settings {
description = "$STR_ACE_Common_SettingFeedbackIconsDesc";
values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"};
};
class GVAR(displayTextColor) {
value[] = {0,0,0,0};
typeName = "COLOR";
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingDisplayTextColorName";
description = "$STR_ACE_Common_SettingDisplayTextColorDesc";
};
};
#include "define.hpp"
@ -113,3 +120,23 @@ class ACE_Settings {
#include <FixAnimations.hpp>
#include <NoVoice.hpp>
class CfgUIGrids {
class IGUI {
class Presets {
class Arma3 {
class Variables {
grid_ACE_displayText[] = {{safeZoneW + safeZoneX - 0.175 * safezoneW, safeZoneY + 0.175 * safezoneH, 0.15 * safeZoneW, 0.125 * SafeZoneH}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
};
};
};
class Variables {
class grid_ACE_displayText {
displayName = "ACE Hint";
description = "Textual in game feedback to the player.";
preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa";
saveToProfile[] = {0,1};
};
};
};
};

View File

@ -22,7 +22,7 @@ if (typeName _text != "TEXT") then {
};
_text = composeText [
parseText format ["<img size='2.5' align='center' color='#ffffff' image='%1'/>", _image],
parseText format ["<img size='2' align='center' color='#ffffff' image='%1'/>", _image],
lineBreak,
_text
];

View File

@ -12,7 +12,7 @@
*/
#include "script_component.hpp"
private ["_text", "_size", "_isShown", "_ctrlHint"];
private ["_text", "_size", "_isShown", "_ctrlHint", "_yPos", "_xPos", "_wPos", "_hPos", "_position"];
_text = _this select 0;
_size = _this select 1;
@ -20,6 +20,9 @@ _size = _this select 1;
if (isNil "_size") then {_size = 1};
if (typeName _text != "TEXT") then {
if (typeName _text == "STRING" && {isLocalized _text}) then {
_text = localize _text;
};
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
};
@ -30,19 +33,17 @@ _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
disableSerialization;
_ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
_ctrlHint ctrlSetPosition [
safeZoneW + safeZoneX - 0 * safezoneW,
safeZoneY + 0.2 * safezoneH,
0.2 * safeZoneW,
_size * 0.1 * SafeZoneH
];
_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", safeZoneW + safeZoneX - 0.175 * safezoneW];
_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", 0.15 * safeZoneW];
_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", 0.125 * SafeZoneH];
_position = [_xPos, _yPos, _wPos, _size * _hPos];
_ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit 0;
_ctrlHint ctrlSetStructuredText _text;
_ctrlHint ctrlSetPosition [
safeZoneW + safeZoneX - 0.2 * safezoneW,
safeZoneY + 0.2 * safezoneH,
0.2 * safeZoneW,
_size * 0.1 * SafeZoneH
];
_ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit ([0.2, 0] select _isShown);

View File

@ -17,7 +17,8 @@ EXPLODE_1_PVT(_this,_optionEntry);
_fnc_getValueWithType = {
EXPLODE_2_PVT(_this,_optionEntry,_typeName);
_value = getNumber (_optionEntry >> "value");
_valueConfig = (_optionEntry >> "value");
_value = if (!(isArray _valueConfig) && !(isText _valueConfig)) then { getNumber (_optionEntry >> "value"); } else { 0 };
TRACE_3("_fnc_getValueWithType:", configName _optionEntry, _typeName, _value);
if (_typeName == "BOOL") exitWith {
_value > 0

View File

@ -321,6 +321,12 @@
<Key ID="STR_ACE_Common_SettingFeedbackIconsDesc">
<English>Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorName">
<English>Hint Background color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorDesc">
<English>The color of the background from the ACE hints.</English>
</Key>
</Package>
</Project>