diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/damage.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/damage.paa new file mode 100644 index 0000000..6e9403e Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/damage.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/energy.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/energy.paa new file mode 100644 index 0000000..9df36d6 Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/energy.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/hunger.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/hunger.paa new file mode 100644 index 0000000..97db76c Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/hunger.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/krypto.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/krypto.paa new file mode 100644 index 0000000..6eccd9e Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/krypto.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/players.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/players.paa new file mode 100644 index 0000000..90e2022 Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/players.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/restart.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/restart.paa new file mode 100644 index 0000000..001f512 Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/restart.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/stamina.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/stamina.paa new file mode 100644 index 0000000..05dfe45 Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/stamina.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/thirst.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/thirst.paa new file mode 100644 index 0000000..e0a3aac Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/thirst.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/toxicity.paa b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/toxicity.paa new file mode 100644 index 0000000..16477ed Binary files /dev/null and b/Server/mpmissions/epoch.Bornholm/addons/status_bar/Images/toxicity.paa differ diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf new file mode 100644 index 0000000..a190f8d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf @@ -0,0 +1,203 @@ +waitUntil {!(isNull (findDisplay 46))}; +disableSerialization; + + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + systemChat format["Loading Admin info...", _rscLayer]; + [] spawn { + + sleep 5; + //set the color values. + //Additional color codes can be found here: http://html-color-codes.com/ + _colourDefault = parseText "#ADADAD"; //set your default colour here + _colour100 = parseText "#336600"; + _colour90 = parseText "#339900"; + _colour80 = parseText "#33CC00"; + _colour70 = parseText "#33FF00"; + _colour60 = parseText "#66FF00"; + _colour50 = parseText "#CCFF00"; + _colour40 = parseText "#CCCC00"; + _colour30 = parseText "#CC9900"; + _colour20 = parseText "#CC6600"; + _colour10 = parseText "#CC3300"; + _colour0 = parseText "#CC0000"; + _colourDead = parseText "#000000"; + + + while {true} do + { + sleep 1; + + //moved the creation of the status bar inside the loop and create it if it is null, + //this is to handle instance where the status bar is disappearing + if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then + { + diag_log "statusbar is null create"; + disableSerialization; + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + }; + + //initialize variables and set values + _unit = _this select 0; + _damage = round ((1 - (damage player)) * 100); + _hunger = round((EPOCH_playerHunger/5000) * 100); + _thirst = round((EPOCH_playerThirst/2500) * 100); + _wallet = EPOCH_playerCrypto; + _stamina = round(EPOCH_playerStamina * 100) / 100; + _energy = round(EPOCH_playerEnergy); + _toxPercent = round (EPOCH_playerToxicity); + _energyPercent = floor((_energy / 2500 ) * 100); + _serverFPS = if (typeName EPOCH_diag_fps == "SCALAR") then [{EPOCH_diag_fps},{"MANIPULATED"}], + _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref + _dir = getDir (vehicle player); + _grid = mapGridPosition player; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; + _time = (round(240-(serverTime)/60)); //edit the '240' value (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)); + _players = (count playableUnits -1); + + 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"}; + }; + + //Colour coding + //Damage + _colourDamage = _colourDefault; + + switch true do { + case(_damage >= 100) : {_colourDamage = _colour100;}; + case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; + case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour80;}; + case((_damage >= 70) && (_damage < 80)) : {_colourDamage = _colour70;}; + case((_damage >= 60) && (_damage < 70)) : {_colourDamage = _colour60;}; + case((_damage >= 50) && (_damage < 60)) : {_colourDamage = _colour50;}; + case((_damage >= 40) && (_damage < 50)) : {_colourDamage = _colour40;}; + case((_damage >= 30) && (_damage < 40)) : {_colourDamage = _colour30;}; + case((_damage >= 20) && (_damage < 30)) : {_colourDamage = _colour20;}; + case((_damage >= 10) && (_damage < 20)) : {_colourDamage = _colour10;}; + case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; + case(_damage < 1) : {_colourDamage = _colourDead;}; + }; + + + //Hunger + _colourHunger = _colourDefault; + switch true do { + case(_hunger >= 100) : {_colourHunger = _colour100;}; + case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour90;}; + case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour80;}; + case((_hunger >= 70) && (_hunger < 80)) : {_colourHunger = _colour70;}; + case((_hunger >= 60) && (_hunger < 70)) : {_colourHunger = _colour60;}; + case((_hunger >= 50) && (_hunger < 60)) : {_colourHunger = _colour50;}; + case((_hunger >= 40) && (_hunger < 50)) : {_colourHunger = _colour40;}; + case((_hunger >= 30) && (_hunger < 40)) : {_colourHunger = _colour30;}; + case((_hunger >= 20) && (_hunger < 30)) : {_colourHunger = _colour20;}; + case((_hunger >= 10) && (_hunger < 20)) : {_colourHunger = _colour10;}; + case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; + case(_hunger < 1) : {_colourHunger = _colourDead;}; + }; + + //Thirst + _colourThirst = _colourDefault; + switch true do{ + case(_thirst >= 100) : {_colourThirst = _colour100;}; + case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; + case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;}; + case((_thirst >= 70) && (_thirst < 80)) : {_colourThirst = _colour70;}; + case((_thirst >= 60) && (_thirst < 70)) : {_colourThirst = _colour60;}; + case((_thirst >= 50) && (_thirst < 60)) : {_colourThirst = _colour50;}; + case((_thirst >= 40) && (_thirst < 50)) : {_colourThirst = _colour40;}; + case((_thirst >= 30) && (_thirst < 40)) : {_colourThirst = _colour30;}; + case((_thirst >= 20) && (_thirst < 30)) : {_colourThirst = _colour20;}; + case((_thirst >= 10) && (_thirst < 20)) : {_colourThirst = _colour10;}; + case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; + case(_thirst < 1) : {_colourThirst = _colourDead;}; + }; + + //Energy + _colourEnergy = _colourDefault; + switch true do{ + case(_energyPercent >= 100) : {_colourEnergy = _colour100;}; + case((_energyPercent >= 90) && (_energyPercent < 100)) : {_colourEnergy = _colour90;}; + case((_energyPercent >= 80) && (_energyPercent < 90)) : {_colourEnergy = _colour80;}; + case((_energyPercent >= 70) && (_energyPercent < 80)) : {_colourEnergy = _colour70;}; + case((_energyPercent >= 60) && (_energyPercent < 70)) : {_colourEnergy = _colour60;}; + case((_energyPercent >= 50) && (_energyPercent < 60)) : {_colourEnergy = _colour50;}; + case((_energyPercent >= 40) && (_energyPercent < 50)) : {_colourEnergy = _colour40;}; + case((_energyPercent >= 30) && (_energyPercent < 40)) : {_colourEnergy = _colour30;}; + case((_energyPercent >= 20) && (_energyPercent < 30)) : {_colourEnergy = _colour20;}; + case((_energyPercent >= 10) && (_energyPercent < 20)) : {_colourEnergy = _colour10;}; + case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; + case(_energyPercent < 1) : {_colourEnergy = _colour0;}; + }; + + //Toxicity + _colourToxicity = _colourDefault; + switch true do{ + case(_toxPercent >= 100) : {_colourToxicity = _colourDead;}; + case((_toxPercent >= 90) && (_toxPercent < 100)) : {_colourToxicity = _colour0;}; + case((_toxPercent >= 80) && (_toxPercent < 90)) : {_colourToxicity = _colour10;}; + case((_toxPercent >= 70) && (_toxPercent < 80)) : {_colourToxicity = _colour20;}; + case((_toxPercent >= 60) && (_toxPercent < 70)) : {_colourToxicity = _colour30;}; + case((_toxPercent >= 50) && (_toxPercent < 60)) : {_colourToxicity = _colour40;}; + case((_toxPercent >= 40) && (_toxPercent < 50)) : {_colourToxicity = _colour50;}; + case((_toxPercent >= 30) && (_toxPercent < 40)) : {_colourToxicity = _colour60;}; + case((_toxPercent >= 20) && (_toxPercent < 30)) : {_colourToxicity = _colour70;}; + case((_toxPercent >= 10) && (_toxPercent < 20)) : {_colourToxicity = _colour80;}; + case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; + case(_toxPercent < 1) : {_colourToxicity = _colour100;}; + }; + + //Stamina + _colourStamina = _colourDefault; + + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + format[" + %2 + %3%1 + %4 + %5%1 + %6%1 + %9 + %18 + %8%1 + %19:%20 + FPS: %7 + GRIDREF: %16", + "%", + _players, + _damage, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, + _colourDefault, + _colourDamage, + _colourHunger, + _colourThirst, + _colourEnergy, + _colourStamina, + format["%1/%2",_xx,_yy], + _colourToxicity, + _toxPercent, + _hours, + _minutes + + + ]; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf new file mode 100644 index 0000000..a0858b2 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf @@ -0,0 +1,203 @@ +waitUntil {!(isNull (findDisplay 46))}; +disableSerialization; + + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + systemChat format["Loading Admin info...", _rscLayer]; + [] spawn { + + sleep 5; + //set the color values. + //Additional color codes can be found here: http://html-color-codes.com/ + _colourDefault = parseText "#ADADAD"; //set your default colour here + _colour100 = parseText "#336600"; + _colour90 = parseText "#339900"; + _colour80 = parseText "#33CC00"; + _colour70 = parseText "#33FF00"; + _colour60 = parseText "#66FF00"; + _colour50 = parseText "#CCFF00"; + _colour40 = parseText "#CCCC00"; + _colour30 = parseText "#CC9900"; + _colour20 = parseText "#CC6600"; + _colour10 = parseText "#CC3300"; + _colour0 = parseText "#CC0000"; + _colourDead = parseText "#000000"; + + + + while {true} do + { + + sleep 1; + + //moved the creation of the status bar inside the loop and create it if it is null, + //this is to handle instance where the status bar is disappearing + if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then + { + diag_log "statusbar is null create"; + disableSerialization; + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + }; + + //initialize variables and set values + _unit = _this select 0; + _damage = round ((1 - (damage player)) * 100); + _hunger = round((EPOCH_playerHunger/5000) * 100); + _thirst = round((EPOCH_playerThirst/2500) * 100); + _wallet = EPOCH_playerCrypto; + _stamina = round(EPOCH_playerStamina * 100) / 100; + _energy = round(EPOCH_playerEnergy); + _toxPercent = round (EPOCH_playerToxicity); + _energyPercent = floor((_energy / 2500 ) * 100); + _serverFPS = if (typeName EPOCH_diag_fps == "SCALAR") then [{EPOCH_diag_fps},{"MANIPULATED"}], + _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref + _dir = getDir (vehicle player); + _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; + _time = (round(240-(serverTime)/60)); //edit the '240' value (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)); + _players = (count playableunits -1); + + 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"}; + }; + + //Colour coding + //Damage + _colourDamage = _colourDefault; + + switch true do { + case(_damage >= 100) : {_colourDamage = _colour100;}; + case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; + case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour80;}; + case((_damage >= 70) && (_damage < 80)) : {_colourDamage = _colour70;}; + case((_damage >= 60) && (_damage < 70)) : {_colourDamage = _colour60;}; + case((_damage >= 50) && (_damage < 60)) : {_colourDamage = _colour50;}; + case((_damage >= 40) && (_damage < 50)) : {_colourDamage = _colour40;}; + case((_damage >= 30) && (_damage < 40)) : {_colourDamage = _colour30;}; + case((_damage >= 20) && (_damage < 30)) : {_colourDamage = _colour20;}; + case((_damage >= 10) && (_damage < 20)) : {_colourDamage = _colour10;}; + case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; + case(_damage < 1) : {_colourDamage = _colourDead;}; + }; + + + //Hunger + _colourHunger = _colourDefault; + switch true do { + case(_hunger >= 100) : {_colourHunger = _colour100;}; + case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour90;}; + case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour80;}; + case((_hunger >= 70) && (_hunger < 80)) : {_colourHunger = _colour70;}; + case((_hunger >= 60) && (_hunger < 70)) : {_colourHunger = _colour60;}; + case((_hunger >= 50) && (_hunger < 60)) : {_colourHunger = _colour50;}; + case((_hunger >= 40) && (_hunger < 50)) : {_colourHunger = _colour40;}; + case((_hunger >= 30) && (_hunger < 40)) : {_colourHunger = _colour30;}; + case((_hunger >= 20) && (_hunger < 30)) : {_colourHunger = _colour20;}; + case((_hunger >= 10) && (_hunger < 20)) : {_colourHunger = _colour10;}; + case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; + case(_hunger < 1) : {_colourHunger = _colourDead;}; + }; + + //Thirst + _colourThirst = _colourDefault; + switch true do{ + case(_thirst >= 100) : {_colourThirst = _colour100;}; + case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; + case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;}; + case((_thirst >= 70) && (_thirst < 80)) : {_colourThirst = _colour70;}; + case((_thirst >= 60) && (_thirst < 70)) : {_colourThirst = _colour60;}; + case((_thirst >= 50) && (_thirst < 60)) : {_colourThirst = _colour50;}; + case((_thirst >= 40) && (_thirst < 50)) : {_colourThirst = _colour40;}; + case((_thirst >= 30) && (_thirst < 40)) : {_colourThirst = _colour30;}; + case((_thirst >= 20) && (_thirst < 30)) : {_colourThirst = _colour20;}; + case((_thirst >= 10) && (_thirst < 20)) : {_colourThirst = _colour10;}; + case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; + case(_thirst < 1) : {_colourThirst = _colourDead;}; + }; + + //Energy + _colourEnergy = _colourDefault; + switch true do{ + case(_energyPercent >= 100) : {_colourEnergy = _colour100;}; + case((_energyPercent >= 90) && (_energyPercent < 100)) : {_colourEnergy = _colour90;}; + case((_energyPercent >= 80) && (_energyPercent < 90)) : {_colourEnergy = _colour80;}; + case((_energyPercent >= 70) && (_energyPercent < 80)) : {_colourEnergy = _colour70;}; + case((_energyPercent >= 60) && (_energyPercent < 70)) : {_colourEnergy = _colour60;}; + case((_energyPercent >= 50) && (_energyPercent < 60)) : {_colourEnergy = _colour50;}; + case((_energyPercent >= 40) && (_energyPercent < 50)) : {_colourEnergy = _colour40;}; + case((_energyPercent >= 30) && (_energyPercent < 40)) : {_colourEnergy = _colour30;}; + case((_energyPercent >= 20) && (_energyPercent < 30)) : {_colourEnergy = _colour20;}; + case((_energyPercent >= 10) && (_energyPercent < 20)) : {_colourEnergy = _colour10;}; + case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; + case(_energyPercent < 1) : {_colourEnergy = _colour0;}; + }; + + //Toxicity + _colourToxicity = _colourDefault; + switch true do{ + case(_toxPercent >= 100) : {_colourToxicity = _colourDead;}; + case((_toxPercent >= 90) && (_toxPercent < 100)) : {_colourToxicity = _colour0;}; + case((_toxPercent >= 80) && (_toxPercent < 90)) : {_colourToxicity = _colour10;}; + case((_toxPercent >= 70) && (_toxPercent < 80)) : {_colourToxicity = _colour20;}; + case((_toxPercent >= 60) && (_toxPercent < 70)) : {_colourToxicity = _colour30;}; + case((_toxPercent >= 50) && (_toxPercent < 60)) : {_colourToxicity = _colour40;}; + case((_toxPercent >= 40) && (_toxPercent < 50)) : {_colourToxicity = _colour50;}; + case((_toxPercent >= 30) && (_toxPercent < 40)) : {_colourToxicity = _colour60;}; + case((_toxPercent >= 20) && (_toxPercent < 30)) : {_colourToxicity = _colour70;}; + case((_toxPercent >= 10) && (_toxPercent < 20)) : {_colourToxicity = _colour80;}; + case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; + case(_toxPercent < 1) : {_colourToxicity = _colour100;}; + }; + + //Stamina + _colourStamina = _colourDefault; + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + format[" + %2 + %3%1 + %4 + %5%1 + %6%1 + %9 + %19 + %8%1 + FPS: %7 + POS: %16 + DIR: %17", + "%", + _players, + _damage, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, + _colourDefault, + _colourDamage, + _colourHunger, + _colourThirst, + _colourEnergy, + _colourStamina, + _pos, + _dir, + _colourToxicity, + _toxPercent + ]; + + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/init_statusBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/init_statusBar.sqf new file mode 100644 index 0000000..11e51b5 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/init_statusBar.sqf @@ -0,0 +1,32 @@ +waitUntil {!isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])}; +waitUntil {isNuLL(uiNameSpace getVariable ["EPOCH_loadingScreen",displayNull])}; +waitUntil {!isNull player}; +waitUntil {!(isNull (findDisplay 46))}; + +//Status Bar Config and Startup Options + +//Choose Options +//-------------------------------------------------------------------------------------------------------------------------------------- +_WSC = false; //Option whether to use and display world space coords in the admin status bar (true or false) + + +_sb_admin_list = ["76561198031039372"]; +//-------------------------------------------------------------------------------------------------------------------------------------- + +//Start the Status Bar + +if ((getPlayerUID player) in _sb_admin_list) then //admins id here +{ + if (_WSC) then + { + [] execVM "addons\status_bar\adminbar_ws.sqf"; + } + else + { + [] execVM "addons\status_bar\adminbar.sqf"; + }; +} +else +{ + [] execVM "addons\status_bar\PlayerBar.sqf"; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf new file mode 100644 index 0000000..3334646 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf @@ -0,0 +1,209 @@ +waitUntil {!(isNull (findDisplay 46))}; +disableSerialization; + + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + systemChat format["Loading Player info...", _rscLayer]; + [] spawn { + + sleep 5; + //set the color values. + //Additional color codes can be found here: http://html-color-codes.com/ + _colourDefault = parseText "#ADADAD"; //set your default colour here + _colour100 = parseText "#336600"; + _colour90 = parseText "#339900"; + _colour80 = parseText "#33CC00"; + _colour70 = parseText "#33FF00"; + _colour60 = parseText "#66FF00"; + _colour50 = parseText "#CCFF00"; + _colour40 = parseText "#CCCC00"; + _colour30 = parseText "#CC9900"; + _colour20 = parseText "#CC6600"; + _colour10 = parseText "#CC3300"; + _colour0 = parseText "#CC0000"; + _colourDead = parseText "#000000"; + + + while {true} do + { + sleep 1; + + //moved the creation of the status bar inside the loop and create it if it is null, + //this is to handle instance where the status bar is disappearing + if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then + { + diag_log "statusbar is null create"; + disableSerialization; + _rscLayer = "statusBar" call BIS_fnc_rscLayer; + _rscLayer cutRsc["statusBar","PLAIN"]; + }; + + //initialize variables and set values + _unit = _this select 0; + _damage = round ((1 - (damage player)) * 100); + //_damage = (round(_damage * 100)); + _hunger = round((EPOCH_playerHunger/5000) * 100); + _thirst = round((EPOCH_playerThirst/2500) * 100); + _wallet = EPOCH_playerCrypto; + _stamina = round(EPOCH_playerStamina * 100) / 100; + _toxPercent = round (EPOCH_playerToxicity); + _energy = round(EPOCH_playerEnergy); + _energyPercent = floor((_energy / 2500 ) * 100); + _fps = format["%1", diag_fps]; + _grid = mapGridPosition player; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; + _time = (round(240-(serverTime)/60)); //edit the '240' value (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)); + _players = (count playableUnits -1); + + + 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"}; + }; + + + //Colour coding + //Damage + _colourDamage = _colourDefault; + + switch true do { + case(_damage >= 100) : {_colourDamage = _colour100;}; + case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; + case((_damage >= 80) && (_damage < 90)) : {_colourDamage = _colour80;}; + case((_damage >= 70) && (_damage < 80)) : {_colourDamage = _colour70;}; + case((_damage >= 60) && (_damage < 70)) : {_colourDamage = _colour60;}; + case((_damage >= 50) && (_damage < 60)) : {_colourDamage = _colour50;}; + case((_damage >= 40) && (_damage < 50)) : {_colourDamage = _colour40;}; + case((_damage >= 30) && (_damage < 40)) : {_colourDamage = _colour30;}; + case((_damage >= 20) && (_damage < 30)) : {_colourDamage = _colour20;}; + case((_damage >= 10) && (_damage < 20)) : {_colourDamage = _colour10;}; + case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; + case(_damage < 1) : {_colourDamage = _colourDead;}; + }; + + //Hunger + _colourHunger = _colourDefault; + switch true do { + case(_hunger >= 100) : {_colourHunger = _colour100;}; + case((_hunger >= 90) && (_hunger < 100)) : {_colourHunger = _colour90;}; + case((_hunger >= 80) && (_hunger < 90)) : {_colourHunger = _colour80;}; + case((_hunger >= 70) && (_hunger < 80)) : {_colourHunger = _colour70;}; + case((_hunger >= 60) && (_hunger < 70)) : {_colourHunger = _colour60;}; + case((_hunger >= 50) && (_hunger < 60)) : {_colourHunger = _colour50;}; + case((_hunger >= 40) && (_hunger < 50)) : {_colourHunger = _colour40;}; + case((_hunger >= 30) && (_hunger < 40)) : {_colourHunger = _colour30;}; + case((_hunger >= 20) && (_hunger < 30)) : {_colourHunger = _colour20;}; + case((_hunger >= 10) && (_hunger < 20)) : {_colourHunger = _colour10;}; + case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; + case(_hunger < 1) : {_colourHunger = _colourDead;}; + }; + + //Thirst + _colourThirst = _colourDefault; + switch true do{ + + case(_thirst >= 100) : {_colourThirst = _colour100;}; + case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; + case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;}; + case((_thirst >= 70) && (_thirst < 80)) : {_colourThirst = _colour70;}; + case((_thirst >= 60) && (_thirst < 70)) : {_colourThirst = _colour60;}; + case((_thirst >= 50) && (_thirst < 60)) : {_colourThirst = _colour50;}; + case((_thirst >= 40) && (_thirst < 50)) : {_colourThirst = _colour40;}; + case((_thirst >= 30) && (_thirst < 40)) : {_colourThirst = _colour30;}; + case((_thirst >= 20) && (_thirst < 30)) : {_colourThirst = _colour20;}; + case((_thirst >= 10) && (_thirst < 20)) : {_colourThirst = _colour10;}; + case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; + case(_thirst < 1) : {_colourThirst = _colourDead;}; + }; + + //Energy + _colourEnergy = _colourDefault; + switch true do{ + + case(_energyPercent >= 100) : {_colourEnergy = _colour100;}; + case((_energyPercent >= 90) && (_energyPercent < 100)) : {_colourEnergy = _colour90;}; + case((_energyPercent >= 80) && (_energyPercent < 90)) : {_colourEnergy = _colour80;}; + case((_energyPercent >= 70) && (_energyPercent < 80)) : {_colourEnergy = _colour70;}; + case((_energyPercent >= 60) && (_energyPercent < 70)) : {_colourEnergy = _colour60;}; + case((_energyPercent >= 50) && (_energyPercent < 60)) : {_colourEnergy = _colour50;}; + case((_energyPercent >= 40) && (_energyPercent < 50)) : {_colourEnergy = _colour40;}; + case((_energyPercent >= 30) && (_energyPercent < 40)) : {_colourEnergy = _colour30;}; + case((_energyPercent >= 20) && (_energyPercent < 30)) : {_colourEnergy = _colour20;}; + case((_energyPercent >= 10) && (_energyPercent < 20)) : {_colourEnergy = _colour10;}; + case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; + case(_energyPercent < 1) : {_colourEnergy = _colour0;}; + }; + + //Toxicity + _colourToxicity = _colourDefault; + switch true do{ + case(_toxPercent >= 100) : {_colourToxicity = _colourDead;}; + case((_toxPercent >= 90) && (_toxPercent < 100)) : {_colourToxicity = _colour0;}; + case((_toxPercent >= 80) && (_toxPercent < 90)) : {_colourToxicity = _colour10;}; + case((_toxPercent >= 70) && (_toxPercent < 80)) : {_colourToxicity = _colour20;}; + case((_toxPercent >= 60) && (_toxPercent < 70)) : {_colourToxicity = _colour30;}; + case((_toxPercent >= 50) && (_toxPercent < 60)) : {_colourToxicity = _colour40;}; + case((_toxPercent >= 40) && (_toxPercent < 50)) : {_colourToxicity = _colour50;}; + case((_toxPercent >= 30) && (_toxPercent < 40)) : {_colourToxicity = _colour60;}; + case((_toxPercent >= 20) && (_toxPercent < 30)) : {_colourToxicity = _colour70;}; + case((_toxPercent >= 10) && (_toxPercent < 20)) : {_colourToxicity = _colour80;}; + case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; + case(_toxPercent < 1) : {_colourToxicity = _colour100;}; + }; + + //Stamina + _colourStamina = _colourDefault; + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + format[" + %2 + %3%1 + %4 + %5%1 + %6%1 + %9 + %20 + %8%1 + FPS: %7 + GRIDREF: %16 + %17:%18", + "%", + _players, + _damage, + _wallet, + _hunger, + _thirst, + round diag_fps, + _energyPercent, + _stamina, + _colourDefault, + _colourDamage, + _colourHunger, + _colourThirst, + _colourEnergy, + _colourStamina, + format["%1/%2",_xx,_yy], + _hours, + _minutes, + _colourToxicity, + _toxPercent + + ]; + + + + + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/statusBar.hpp b/Server/mpmissions/epoch.Bornholm/addons/status_bar/statusBar.hpp new file mode 100644 index 0000000..fadc40a --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/statusBar.hpp @@ -0,0 +1,34 @@ +#define ST_RIGHT 0x01 + +class statusBar { + idd = -1; + onLoad = "uiNamespace setVariable ['statusBar', _this select 0]"; + onUnload = "uiNamespace setVariable ['statusBar', objNull]"; + onDestroy = "uiNamespace setVariable ['statusBar', objNull]"; + fadein = 0; + fadeout = 0; + duration = 10e10; + movingEnable = 0; + controlsBackground[] = {}; + objects[] = {}; + class controls { + class statusBarText { + idc = 55555; + x = 0.185 * safezoneW + safezoneX; + y = 0.940044 * safezoneH + safezoneY; + w = 0.65 * safezoneW; + h = 0.0330033 * safezoneH; + shadow = 1; + colorBackground[] = { 0, 0, 0, 0.5 }; // make the last number in the array 0 to get rid of the background + font = "PuristaSemibold"; + size = "0.02 * safezoneH"; + type = 13; + style = 2; + text="loading player stats ..."; + class Attributes { + align="center"; + color = "#ffffff";//#5fe60c + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/description.ext b/Server/mpmissions/epoch.Bornholm/description.ext index fff4605..4b4cf42 100644 --- a/Server/mpmissions/epoch.Bornholm/description.ext +++ b/Server/mpmissions/epoch.Bornholm/description.ext @@ -3,6 +3,7 @@ class RscTitles { + #include "addons\Status_Bar\statusBar.hpp" #include "VEMFr_client\gui\RscDisplayVEMFrClient.hpp" #include "VEMFr_client\gui\RscDisplayBaseAttack.hpp" }; diff --git a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index 7aa9e47..46ee7de 100644 --- a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -13,6 +13,16 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp */ +//added by Zepheris +class flip_vic +{ + condition = "dyna_isVehicle && !dyna_locked"; + action = "[dyna_cursorTarget] call FlipVic;"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_upgrade.paa"; + tooltip = "Flip Vehicle"; +}; +//end added by Zepheris + class build_upgrade { condition = "dyna_buildMode select 0"; @@ -615,5 +625,3 @@ class Defuse_Bomb icon = "x\addons\a3_epoch_code\Data\UI\buttons\Defuse.paa"; tooltip = "Defuse Bomb"; }; - - diff --git a/Server/mpmissions/epoch.Bornholm/init.sqf b/Server/mpmissions/epoch.Bornholm/init.sqf index bf59b6a..36ed58b 100644 --- a/Server/mpmissions/epoch.Bornholm/init.sqf +++ b/Server/mpmissions/epoch.Bornholm/init.sqf @@ -5,5 +5,15 @@ execVM "debug\blckClient.sqf"; if hasInterface then { + [] ExecVM "addons\Status_Bar\init_statusBar.sqf"; [] ExecVM "VEMFr_client\sqf\initClient.sqf"; // Client-side part of VEMFr + FlipVic = compileFinal preProcessFileLineNumbers "scripts\flip.sqf"; + execVM "scripts\playermarker.sqf"; }; + + + +//#include "A3EAI_Client\A3EAI_initclient.sqf"; + +//Advanced towing only tow 1 car +SA_MAX_TOWED_CARGO = 1; diff --git a/Server/mpmissions/epoch.Bornholm/scripts/flip.sqf b/Server/mpmissions/epoch.Bornholm/scripts/flip.sqf new file mode 100644 index 0000000..b98206c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/scripts/flip.sqf @@ -0,0 +1,22 @@ + +private _flpVcl = _this select 0; +//if (local _flpVcl) then +//{ + _bbr = boundingBoxReal _flpVcl; + _p1 = _bbr select 0; + _p2 = _bbr select 1; + _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); + _flpVcl allowDamage false; + _pos = getPosATL _flpVcl; + _pos set [2,(_pos select 2) + (_maxHeight)]; + _flpVcl setPosATL _pos; + _flpVcl setVectorUp [0, 0, 1]; + _flpVcl setVelocity [0,0,0]; + _flpVcl allowDamage true; + ["Flipped vehicle",5] call epoch_message; +//} else { + + // ["You were not the driver of this vehicle",5] call epoch_message; +//}; + + diff --git a/Server/mpmissions/epoch.Bornholm/scripts/playermarker.sqf b/Server/mpmissions/epoch.Bornholm/scripts/playermarker.sqf new file mode 100644 index 0000000..25b66e7 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/scripts/playermarker.sqf @@ -0,0 +1,51 @@ +/* +playerMarker.sqf +*/ +if (isServer) exitWith {}; + +private["_markers","_members"]; +_markers = []; +_members = []; + +while {true} do { + private["_hasGPS","_hasRadio"]; + sleep 1; + //diag_log format["assignedItems includes %1", assignedItems player]; + //diag_log format["Items includes %1", Items player]; + //diag_log format["magazines includes %1", magazines player]; + //diag_log format["weapons includes %1", weapons player]; + //_hasGPS = 'ItemGPS' in (assignedItems player); + //_hasRadio = "ItemRadio" in assignedItems player; + //diag_log format["_hasGPS = %1 and _hasRadio = %2",_hasGPS,_hasRadio]; + if(visibleMap) then { + _members = units (group player); + //Create markers + { + _marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x]; + _marker setMarkerColorLocal "ColorYellow"; + _marker setMarkerTypeLocal "Mil_dot"; + _marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]]; + + _markers pushBack [_marker,_x]; + } foreach _members; + + while {visibleMap} do { + { + private["_marker","_unit"]; + _marker = _x select 0; + _unit = _x select 1; + if(!isNil "_unit") then { + if(!isNull _unit) then { + _marker setMarkerPosLocal (visiblePosition _unit); + }; + }; + } foreach _markers; + if(!visibleMap) exitWith {}; + sleep 0.02; + }; + + {deleteMarkerLocal (_x select 0);} foreach _markers; + _markers = []; + _members = []; + }; +}; \ No newline at end of file