Change fuel amount text color/position?Solved
Hey Oryx. Great addon btw! I was wondering if you could point me in the right direction in the .cs file to edit either the text color of the fuel amount or to slightly adjust the position. I chose a fuel gauge icon that has the same background as the fuel amounts text, and they overlap slighty so I cannot read some of it. I am not asking for an update by any means, but maybe you could let me know where to adjust the text position. 

Starting from line 292 is where UI is being created.

        public void CreateUI(VehicleCache vehicle)
        {
            var element = UIHelper.NewCuiElement("SHOWFUEL_UI", UIHelper.HexToRGBA(backgroundColor, backgroundTransparency), GetMinDock(), GetMaxDock());

            if (ImageLibrary == null || !useIcon)
            {
                UIHelper.CreatePanel(ref element, "SHOWFUEL_UI", UIHelper.HexToRGBA(backgroundColor, backgroundTransparency), "0.0 0.0", "1.0 1.0");
                UIHelper.CreateLabel(ref element, "SHOWFUEL_UI", "x" + vehicle.GetFuelAmount(), 14, "0.1 0.1", "0.9 0.9");
                CuiHelper.AddUi(vehicle.player, element);
            }
            else
            {
                string icon = GetImage(imageURL);
                UIHelper.CreatePanel(ref element, "SHOWFUEL_UI", UIHelper.HexToRGBA(backgroundColor, backgroundTransparency), "0.0 0.0", "1.0 1.0");
                UIHelper.LoadImage(ref element, "SHOWFUEL_UI", icon, "0.1 0.2", "0.7 0.8");
                UIHelper.CreateLabel(ref element, "SHOWFUEL_UI", "x" + vehicle.GetFuelAmount(), 11, "0.1 0.1", "0.9 0.4", TextAnchor.MiddleRight);
                CuiHelper.AddUi(vehicle.player, element);
            }
        }

The line you're looking for starts at line 307

An example would be:

UIHelper.CreateLabel(ref element, "SHOWFUEL_UI", "INSERT TEXT HERE" + vehicle.GetFuelAmount(), 14, "0.1 0.1", "0.9 0.4", TextAnchor.MiddleRight, UI.Color("#HEXCOLOR", 1.0f));

For text color, edit "HEXCOLOR" and 1.0f is the transparency 

For positioning, edit "0.1 0.1" and "0.9 0.9" the below image should make it clear

7P7FIEX.png

Thank you so much Oryx! Yes that is the line I was editing while trying to figure it out. I really appreciate the help on this <3
Correction, "0.9" "0.4" not "0.9 0.9"
Locked automatically