From 5e0eb7323ac582e8a03fb1bb43e36dd9ff801bd5 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 22 Feb 2015 14:38:48 +0100 Subject: [PATCH] Added option to toggle between progressbar top and bottom --- addons/common/ProgressScreen.hpp | 4 ++-- addons/common/config.cpp | 9 +++++++++ addons/common/functions/fnc_progressBar.sqf | 13 +++++++++++++ addons/common/stringtable.xml | 6 ++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index d7df49efdf..751d48af9f 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -17,7 +17,7 @@ class GVAR(ProgressBar_Dialog) { type = 0; style = 0; size = 1; - colorBackground[] = {0, 0, 0, 0.1}; + colorBackground[] = {0, 0, 0, 0.0}; colorText[] = {0, 0, 0, 0}; x = "safezoneX"; y = "safezoneY"; @@ -31,7 +31,7 @@ class GVAR(ProgressBar_Dialog) { y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorFrame[] = {0,0,0,0.025}; + colorFrame[] = {0,0,0,0.0}; colorBar[] = {0.27,0.5,0.31,0.8}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; }; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index ed1f947db9..d562d185ec 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -103,6 +103,15 @@ 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(SettingProgressBarLocation) { + value = 0; + typeName = "SCALAR"; + force = 0; + isClientSetable = 1; + displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; + description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; + values[] = {"Top", "Bottom"}; + }; class GVAR(displayTextColor) { value[] = {0,0,0,0.1}; typeName = "COLOR"; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 1d73cccc79..0b8fcc7ac4 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -15,6 +15,9 @@ * * Return value: * Nothing +* +* Example: +* [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar */ #include "script_component.hpp" @@ -32,6 +35,16 @@ closeDialog 0; createDialog QGVAR(ProgressBar_Dialog); (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; +if (GVAR(SettingProgressBarLocation) == 1) then { + private "_ctrlPos"; + _ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; + (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; + (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; + (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; +}; + + _perFrameFunction = { PARAMS_2(_parameters,_pfhID); EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions); diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 7e2920f11c..d1462c1214 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -321,6 +321,12 @@ 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. + + Progress bar location + + + Set the desired location of the progress bar on your screen. + Hint Background color