diff --git a/description.ext b/description.ext new file mode 100644 index 0000000..6cb1d7c --- /dev/null +++ b/description.ext @@ -0,0 +1,7 @@ + + +class RscTitles +{ + #include "addons\status_bar\dialog\statusBar.hpp" + +}; \ No newline at end of file diff --git a/init.sqf b/init.sqf new file mode 100644 index 0000000..cc41590 --- /dev/null +++ b/init.sqf @@ -0,0 +1,15 @@ + +// Status Bar + +[] execVM "addons\status_bar\fn_statusBar.sqf"; + + + + + + + + + + + diff --git a/status_bar/dialog/statusBar.hpp b/status_bar/dialog/statusBar.hpp new file mode 100644 index 0000000..58fef66 --- /dev/null +++ b/status_bar/dialog/statusBar.hpp @@ -0,0 +1,56 @@ +#define ST_RIGHT 0x01 + +class osefStatusBar { + idd = -1; + onLoad = "uiNamespace setVariable ['osefStatusBar', _this select 0]"; + onUnload = "uiNamespace setVariable ['osefStatusBar', objNull]"; + onDestroy = "uiNamespace setVariable ['osefStatusBar', objNull]"; + fadein = 0; + fadeout = 0; + duration = 10e10; + movingEnable = 0; + objects[] = {}; + + class controlsBackground + { + class statusBarImage + { + idc = 55557; + type = 0; + style = 48; + x = safezoneX + safezoneW - 0.913; + y = safezoneY + safezoneH - 0.077; //0.068 + w = 1.35; + h = 0.08; //0.06 + colorText[] = {1, 1, 1, 1}; + colorBackground[]={0,0,0,0}; + sizeEx = 0.4; + font = "PuristaSemibold"; + text = "addons\status_bar\StatusBarBackground.paa"; + }; + }; + + + class controls + { + class statusBarText + { + idc = 1000; + x = safezoneX + safezoneW - 1.08; + y = safezoneY + safezoneH - 0.060; + w = 1.35; + h = 0.06; + shadow = 2; + font = "PuristaSemibold"; + size = 0.035; + type = 13; + style = 2; + text = " "; + class Attributes { + align = "center"; + color = "#fffae2"; + font = "PuristaSemibold"; + }; + }; + }; +}; \ No newline at end of file diff --git a/status_bar/fn_statusBar.sqf b/status_bar/fn_statusBar.sqf new file mode 100644 index 0000000..667c53a --- /dev/null +++ b/status_bar/fn_statusBar.sqf @@ -0,0 +1,50 @@ +waitUntil {!(isNull (findDisplay 46))}; +disableSerialization; + +_rscLayer = "osefStatusBar" call BIS_fnc_rscLayer; +_rscLayer cutRsc["osefStatusBar","PLAIN"]; + +[] spawn { + sleep 5; + _counter = 180; + _timeSinceLastUpdate = 0; + while {true} do + { + + sleep 1; + _counter = _counter - 1; + _time = (round(300-(serverTime)/60)); //edit the '240' (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals + _hours = (floor(_time/60)); + _minutes = (_time - (_hours * 60)); + _damage = round ((1 - (damage player)) * 100); + _thirst = round((EPOCH_playerThirst/2500) * 100); + _hunger = round((EPOCH_playerHunger/5000) * 100); + + switch(_minutes) do + { + case 9: {_minutes = "09"}; + case 8: {_minutes = "08"}; + case 7: {_minutes = "07"}; + case 6: {_minutes = "06"}; + case 5: {_minutes = "05"}; + case 4: {_minutes = "04"}; + case 3: {_minutes = "03"}; + case 2: {_minutes = "02"}; + case 1: {_minutes = "01"}; + case 0: {_minutes = "00"}; + }; + + ((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetStructuredText parseText format + + [" + %1 + %2 + %3 + %4 + %5 + %6 + %7 + %8:%9", + round diag_fps, _hunger, _thirst, _damage, EPOCH_playerToxicity, EPOCH_playerRadiation, EPOCH_playerCrypto, _hours, _minutes, _counter]; + }; +}; diff --git a/status_bar/icons/biohazard.paa b/status_bar/icons/biohazard.paa new file mode 100644 index 0000000..05387a8 Binary files /dev/null and b/status_bar/icons/biohazard.paa differ diff --git a/status_bar/icons/fps.paa b/status_bar/icons/fps.paa new file mode 100644 index 0000000..2aef901 Binary files /dev/null and b/status_bar/icons/fps.paa differ diff --git a/status_bar/icons/health.paa b/status_bar/icons/health.paa new file mode 100644 index 0000000..3731b8b Binary files /dev/null and b/status_bar/icons/health.paa differ diff --git a/status_bar/icons/hunger.paa b/status_bar/icons/hunger.paa new file mode 100644 index 0000000..97db76c Binary files /dev/null and b/status_bar/icons/hunger.paa differ diff --git a/status_bar/icons/money.paa b/status_bar/icons/money.paa new file mode 100644 index 0000000..2655a56 Binary files /dev/null and b/status_bar/icons/money.paa differ diff --git a/status_bar/icons/nuclear.paa b/status_bar/icons/nuclear.paa new file mode 100644 index 0000000..b334cbd Binary files /dev/null and b/status_bar/icons/nuclear.paa differ diff --git a/status_bar/icons/restart.paa b/status_bar/icons/restart.paa new file mode 100644 index 0000000..001f512 Binary files /dev/null and b/status_bar/icons/restart.paa differ diff --git a/status_bar/icons/thirst.paa b/status_bar/icons/thirst.paa new file mode 100644 index 0000000..e0a3aac Binary files /dev/null and b/status_bar/icons/thirst.paa differ diff --git a/status_bar/statusBarBackground.paa b/status_bar/statusBarBackground.paa new file mode 100644 index 0000000..6e57aba Binary files /dev/null and b/status_bar/statusBarBackground.paa differ