ProgressBar - Fixed Alignment

This commit is contained in:
PabstMirror
2015-04-15 12:55:16 -05:00
parent 134f48ba55
commit e54d8dc827
2 changed files with 76 additions and 78 deletions

View File

@ -1,77 +1,74 @@
class GVAR(ProgressBar_Dialog) { class GVAR(ProgressBar_Dialog) {
idd = -1; idd = -1;
movingEnable = false; movingEnable = false;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 2)];); onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 2)];);
objects[] = {}; objects[] = {};
class controlsBackground { class controlsBackground {
class Background { class Background {
idc = -1; idc = -1;
moving = 0; moving = 0;
font = "TahomaB"; font = "TahomaB";
text = ""; text = "";
sizeEx = 0; sizeEx = 0;
lineSpacing = 0; lineSpacing = 0;
access = 0; access = 0;
type = 0; type = 0;
style = 0; style = 0;
size = 1; size = 1;
colorBackground[] = {0, 0, 0, 0.0}; colorBackground[] = {0, 0, 0, 0.0};
colorText[] = {0, 0, 0, 0}; colorText[] = {0, 0, 0, 0};
x = "safezoneX"; x = "safezoneX";
y = "safezoneY"; y = "safezoneY";
w = "safezoneW"; w = "safezoneW";
h = "safezoneH"; h = "safezoneH";
};
class Progress: ACE_gui_RscProgress {
idc = 1;
x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "37.8 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
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)";
};
class Title_Bar : ACE_gui_staticBase {
idc = 2;
style = 0x22;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "0 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
}; };
class Progress: ACE_gui_RscProgress {
idc = 1;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
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.0};
colorBar[] = {0.27,0.5,0.31,0.8};
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
};
class Title_Bar : ACE_gui_staticBase {
idc = 2;
style = 0x22;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "0 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
}; };
class GVAR(DisableMouse_Dialog) { class GVAR(DisableMouse_Dialog) {
idd = -1; idd = -1;
movingEnable = false; movingEnable = false;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),_this select 0)];); onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),_this select 0)];);
objects[] = {}; objects[] = {};
class controlsBackground { class controlsBackground {
class Background { class Background {
idc = -1; idc = -1;
moving = 0; moving = 0;
font = "TahomaB"; font = "TahomaB";
text = ""; text = "";
sizeEx = 0; sizeEx = 0;
lineSpacing = 0; lineSpacing = 0;
access = 0; access = 0;
type = 0; type = 0;
style = 0; style = 0;
size = 1; size = 1;
colorBackground[] = {0, 0, 0, 0};//0.5 colorBackground[] = {0, 0, 0, 0};//0.5
colorText[] = {0, 0, 0, 0}; colorText[] = {0, 0, 0, 0};
x = "safezoneX"; x = "safezoneX";
y = "safezoneY"; y = "safezoneY";
w = "safezoneW"; w = "safezoneW";
h = "safezoneH"; h = "safezoneH";
};
}; };
};
}; };

View File

@ -26,7 +26,7 @@ PARAMS_4(_totalTime,_args,_onFinish,_onFail);
DEFAULT_PARAM(4,_localizedTitle,""); DEFAULT_PARAM(4,_localizedTitle,"");
DEFAULT_PARAM(5,_condition,{true}); DEFAULT_PARAM(5,_condition,{true});
DEFAULT_PARAM(6,_exceptions,[]); DEFAULT_PARAM(6,_exceptions,[]);
private ["_player", "_perFrameFunction"]; private ["_player", "_perFrameFunction", "_ctrlPos"];
_player = ACE_player; _player = ACE_player;
@ -35,14 +35,15 @@ closeDialog 0;
createDialog QGVAR(ProgressBar_Dialog); createDialog QGVAR(ProgressBar_Dialog);
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle;
if (GVAR(SettingProgressBarLocation) == 1) then { //Adjust position based on user setting:
private "_ctrlPos"; _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle));
_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)]; _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))];
(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos;
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0;
(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBar));
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; _ctrlPos set [1, ((0.1 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))];
}; (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos;
(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0;
_perFrameFunction = { _perFrameFunction = {