Sign in to follow this  
Film'z Crz

Help me make it to the middle [ Status Bar ]

11 posts in this topic

Currently i think your have setup your arma Video options incurectly.

make sure you have the perfect resolution for your setup.

and make sure your Interface since is "small"

you can find this Options in your Video settings.

Share this post


Link to post
Share on other sites
Advertisement
18 minutes ago, Sgt. ScrapMetal said:

Currently i think your have setup your arma Video options incurectly.

make sure you have the perfect resolution for your setup.

and make sure your Interface since is "small"

you can find this Options in your Video settings.

You know that video will teach me?.

Share this post


Link to post
Share on other sites

I still have this problem. My status bar is to the left of the screen and I want this centered.

155A1F6D5E7711318F5DC08097889BC452D2E4D2

 

/*
    @file Version: 0.1
    @file Name: statusBar.sqf
    @file  EpochMod StatusBar Port for Wasteland / EXILE by CRE4MPIE
    @file Created: 21/4/2015
    @notes: Added custom Icons and ported Wasteland info. Still
            needs to be cleaned up a bit.
*/

waitUntil {!(isNull (findDisplay 46))};
disableSerialization;

    _rscLayer = "osefStatusBarAdmin" call BIS_fnc_rscLayer;
    _rscLayer cutRsc["osefStatusBarAdmin","PLAIN"];
//    systemChat format["StatusBar Initialized", _rscLayer];
    [] spawn
    {

        uiSleep 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
        _colour108        = parseText "#FF7000";
        _colour107        = parseText "#FF9000";
        _colour106        = parseText "#FFBB00";
        _colour105        = parseText "#FFCC00";
        _colour104        = parseText "#81CCDD";
        _colour103        = parseText    "#33AACC";
        _colour102        = parseText "#3388CC";
        _colour101        = parseText "#3366CC";
        _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";
        _uid = getPlayerUID player;    
    
        
    while {true} do
    {
    
        uiSleep 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 "osefStatusBarAdmin")displayCtrl 55554)) then
        {
            diag_log "statusbar is null create";
            disableSerialization;
            _rscLayer = "osefStatusBarAdmin" call BIS_fnc_rscLayer;
            _rscLayer cutRsc["osefStatusBarAdmin","PLAIN"];
        };        
        
        //initialize variables and set values
        _unit = _this select 0;
        _damage = round ((1 - (damage player)) * 100);
        //_damage = (round(_damage * 100));
        _hunger = round (ExileClientPlayerAttributes select 2);
        _thirst = round (ExileClientPlayerAttributes select 3);
        _wallet =  (player getVariable ["ExileMoney", 0]);
        _lockers = (player getVariable ["ExileLocker", 0]);
        _stamina = ExileClientPlayerScore;
        _energy = 100;
        _energyPercent = 100;
        _serverFPS = round diag_fps;
        _pos = getPosATL player;
        _dir = round (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));
        
        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;
        if(_damage >= 100) then{_colourDamage = _colour100;};
        if((_damage >= 90) && (_damage < 100)) then {_colourDamage =  _colour100;};
        if((_damage >= 80) && (_damage < 90)) then {_colourDamage =  _colour80;};
        if((_damage >= 70) && (_damage < 80)) then {_colourDamage =  _colour70;};
        if((_damage >= 60) && (_damage < 70)) then {_colourDamage =  _colour60;};
        if((_damage >= 50) && (_damage < 60)) then {_colourDamage =  _colour50;};
        if((_damage >= 40) && (_damage < 50)) then {_colourDamage =  _colour40;};
        if((_damage >= 30) && (_damage < 40)) then {_colourDamage =  _colour30;};
        if((_damage >= 20) && (_damage < 30)) then {_colourDamage =  _colour20;};
        if((_damage >= 10) && (_damage < 20)) then {_colourDamage =  _colour10;};
        if((_damage >= 1) && (_damage < 10)) then {_colourDamage =  _colour0;};
        if(_damage < 1) then{_colourDamage =  _colourDead;};
        
        
        
        //Hunger
        _colourHunger = _colourDefault;
        if(_hunger >= 100) then{_colourHunger = _colour100;};
        if((_hunger >= 90) && (_hunger < 100)) then {_colourHunger =  _colour90;};
        if((_hunger >= 80) && (_hunger < 90)) then {_colourHunger =  _colour80;};
        if((_hunger >= 70) && (_hunger < 80)) then {_colourHunger =  _colour70;};
        if((_hunger >= 60) && (_hunger < 70)) then {_colourHunger =  _colour60;};
        if((_hunger >= 50) && (_hunger < 60)) then {_colourHunger =  _colour50;};
        if((_hunger >= 40) && (_hunger < 50)) then {_colourHunger =  _colour40;};
        if((_hunger >= 30) && (_hunger < 40)) then {_colourHunger =  _colour30;};
        if((_hunger >= 20) && (_hunger < 30)) then {_colourHunger =  _colour20;};
        if((_hunger >= 10) && (_hunger < 20)) then {_colourHunger =  _colour10;};
        if((_hunger >= 1) && (_hunger < 10)) then {_colourHunger =  _colour0;};
        if(_hunger < 1) then{_colourHunger =  _colourDead;};
        
                
                //Thirst
        _colourThirst = _colourDefault;        
        switch true do{
        
            case(_thirst >= 100) : {_colourThirst = _colour101;};
            case((_thirst >= 90) && (_thirst < 100)) :  {_colourThirst =  _colour102;};
            case((_thirst >= 80) && (_thirst < 90)) :  {_colourThirst =  _colour103;};
            case((_thirst >= 70) && (_thirst < 80)) :  {_colourThirst =  _colour104;};
            case((_thirst >= 60) && (_thirst < 70)) :  {_colourThirst =  _colour105;};
            case((_thirst >= 50) && (_thirst < 60)) :  {_colourThirst =  _colour106;};
            case((_thirst >= 40) && (_thirst < 50)) :  {_colourThirst =  _colour107;};
            case((_thirst >= 30) && (_thirst < 40)) :  {_colourThirst =  _colour108;};
            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;
        if(_energyPercent >= 100) then{_colourEnergy = _colour100;};
        if((_energyPercent >= 90) && (_energyPercent < 100)) then {_colourEnergy =  _colour90;};
        if((_energyPercent >= 80) && (_energyPercent < 90)) then {_colourEnergy =  _colour80;};
        if((_energyPercent >= 70) && (_energyPercent < 80)) then {_colourEnergy =  _colour70;};
        if((_energyPercent >= 60) && (_energyPercent < 70)) then {_colourEnergy =  _colour60;};
        if((_energyPercent >= 50) && (_energyPercent < 60)) then {_colourEnergy =  _colour50;};
        if((_energyPercent >= 40) && (_energyPercent < 50)) then {_colourEnergy =  _colour40;};
        if((_energyPercent >= 30) && (_energyPercent < 40)) then {_colourEnergy =  _colour30;};
        if((_energyPercent >= 20) && (_energyPercent < 30)) then {_colourEnergy =  _colour20;};
        if((_energyPercent >= 10) && (_energyPercent < 20)) then {_colourEnergy =  _colour10;};
        if((_energyPercent >= 1) && (_energyPercent < 10)) then {_colourEnergy =  _colour0;};
        if(_energyPercent < 1) then{_colourEnergy =  _colour0;};
        
        
        //Stamina
        _colourStamina = _colourDefault;
        
        //display the information
        ((uiNamespace getVariable "osefStatusBarAdmin")displayCtrl 55554)ctrlSetStructuredText parseText
            format["
            <t shadow='1' shadowColor='#000000' color='%10'><img size='1.3'  shadowColor='#000000' image='addons\statusbar\icons\players.paa' color='%10'/> %2</t>
            <t shadow='1' shadowColor='#000000' color='%11'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\health.paa' color='%11'/> %3%1</t>
            <t shadow='1' shadowColor='#000000' color='%10'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\poptab_ca.paa' color='%10'/> %4</t>
            <t shadow='1' shadowColor='#000000' color='%10'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\locker.paa' color='%10'/> %20</t>            
            <t shadow='1' shadowColor='#000000' color='%12'><img size='1.3'  shadowColor='#000000' image='addons\statusbar\icons\hunger.paa' color='%12'/> %5%1</t>
            <t shadow='1' shadowColor='#000000' color='%13'><img size='1.3'  shadowColor='#000000' image='addons\statusbar\icons\thirst.paa' color='%13'/> %6%1</t>
            <t shadow='1' shadowColor='#000000' color='%15'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\exile.paa' color='%10'/> %9</t>
            <t shadow='1' shadowColor='#000000' color='%15'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\fps.paa' color='%10'/> %7</t>
            <t shadow='1' shadowColor='#000000' color='%15'><img size='1.0'  shadowColor='#000000' image='addons\statusbar\icons\compass.paa' color='%10'/> %17</t>
            <t shadow='1' shadowColor='#000000' color='%10'><img size='1.2'  shadowColor='#000000' image='addons\statusbar\icons\restart.paa' color='%10'/>%18:%19</t>",
            
                    "%",
                    count playableUnits,
                    _damage,
                    _wallet,
                    _hunger,
                    _thirst,
                    _serverFPS,
                    _energyPercent,
                    _stamina,
                    _colourDefault,
                    _colourDamage,
                    _colourHunger,
                    _colourThirst,
                    _colourEnergy,
                    _colourStamina,
                    format["%1/%2",_xx,_yy],
                    _dir,
                    _hours,
                    _minutes,
                    _lockers                    
                ];
        
        };
};

#define ST_RIGHT 0x01
 
class osefStatusBarAdmin {
    idd = -1;
    onLoad = "uiNamespace setVariable ['osefStatusBarAdmin', _this select 0]";
    onUnload = "uiNamespace setVariable ['osefStatusBarAdmin', objNull]";
    onDestroy = "uiNamespace setVariable ['osefStatusBarAdmin', objNull]";
    fadein = 0;
    fadeout = 0;
    duration = 10e10;
    movingEnable = 0;
    controlsBackground[] = {};
    objects[] = {};
    class controls {
        class statusBarText {
            idc = 55554;
            x = safezoneX + safezoneW - 1.90;
            y = safezoneY + safezoneH - 0.063;
            w = 1.35;
            h = 0.06;
            shadow = 2;
//            colorBackground[] = { 0, 0, 0, 0.5 };  // uncomment and increase 4th number to have a background
            font = "PuristaSemibold";
            size = 0.04;
            type = 13;
            style = 2;
            text="";
            class Attributes {
                align="center";
                color = "#ffffff";//#5fe60c
            };
        };
    };
};

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;
    controlsBackground[] = {};
    objects[] = {};
    class controls {
        class statusBarText {
            idc = 55555;
            x = safezoneX + safezoneW - 1.50;
            y = safezoneY + safezoneH - 0.035;
            w = 1.3;
            h = 0.07;
            shadow = 2;
//            colorBackground[] = { 0, 0, 0, 0.5 };  // uncomment and increase 4th number to have a background
            font = "PuristaSemibold";
            size = 0.04;
            type = 13;
            style = 2;
            text="";
            class Attributes {
                align="left";
                color = "#ffffff";//#5fe60c
            };
        };
    };
};

 

Share this post


Link to post
Share on other sites

x = safezoneX + safezoneW - 1.90;
w = 1.35;

I think your positioning is related to these values. x is the position for x-axis, w is width .

Killzone_Kid has a pretty simple tutorial about it, maybe it helps you http://killzonekid.com/arma-scripting-tutorials-gui-part-3/

 

Cheers

Edited by LePasi [superturds]

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.