Jump to content

Fuel Bar Color

Not a Bug 0.1.2

Ahmed Alkaabi
Ahmed Alkaabi

Posted

Hi, I have a problem with the status color related to the fuel quantity. I am using "Stack Size Controller" and set it up to (225,000). It seems the plugin depends on that. Is there a way to fix that?

fuel status.png

IIIaKa

Posted

Changed Status from Pending to Work in Progress

IIIaKa

Posted

Changed Status from Work in Progress to Can't Reproduce

IIIaKa

Posted

@Ahmed Alkaabi

Hi, try restarting both plugins. Since I installed the StackSizeController plugin and set the same limit, everything works for me.

C3LkUew.png
Mq3s1KG.png

IIIaKa

Posted

Colors also work fine depending on the fuel level in the tank.
DkbHUyU.png
WfRbppa.png
2phtC9C.png

IIIaKa

Posted

Changed Status from Can't Reproduce to Not a Bug

IIIaKa

Posted

If the issue persists, feel free to report it in this thread.

Ahmed Alkaabi

Posted

I was not clear in explaining the issue. I want to set a custom amount of fuel, not that related to the stack size. For example, my low-grade fuel stack size is set to "225,000". I want to set "500" amount of fuel on the vehicle to be green. The colors should not be related to the percentage of the fuel stack size.

IIIaKa

Posted

3 minutes ago, Ahmed Alkaabi said:

I was not clear in explaining the issue. I want to set a custom amount of fuel, not that related to the stack size. For example, my low-grade fuel stack size is set to "225,000". I want to set "500" amount of fuel on the vehicle to be green. The colors should not be related to the percentage of the fuel stack size.

As far as I understand, you want the colors to change depending on the amount of fuel, not by percentage?

IIIaKa

Posted

10 minutes ago, Ahmed Alkaabi said:

I was not clear in explaining the issue. I want to set a custom amount of fuel, not that related to the stack size. For example, my low-grade fuel stack size is set to "225,000". I want to set "500" amount of fuel on the vehicle to be green. The colors should not be related to the percentage of the fuel stack size.

Since I don't quite understand what you want, I'll explain how the color change works. The maximum fuel stack size and the amount of fuel in the tank are taken, and from these two numbers, a percentage is calculated. This percentage is then used to set the position for the progress bar. You have the option to set your own limits in the config file under the 'List of Gauge Indicators' section.

Here is an example of a list of colors for different ranges. You can specify more or fewer values, but it's important that they do not overlap and that the first value equals the last value of the previous range.

"List of Gauge Indicators": [
    {
        "MaxRange": 1.0,
        "MinRange": 0.9,
        "Color": "#B1C06E"
    },
    {
        "MaxRange": 0.9,
        "MinRange": 0.8,
        "Color": "#F7BB00"
    },
    {
        "MaxRange": 0.8,
        "MinRange": 0.7,
        "Color": "#F70000"
    },
    {
        "MaxRange": 0.7,
        "MinRange": 0.6,
        "Color": "#008080"
    },
    {
        "MaxRange": 0.6,
        "MinRange": 0.5,
        "Color": "#4B0082"
    },
    {
        "MaxRange": 0.5,
        "MinRange": 0.4,
        "Color": "#00FFFF"
    },
    {
        "MaxRange": 0.4,
        "MinRange": 0.3,
        "Color": "#800080"
    },
    {
        "MaxRange": 0.3,
        "MinRange": 0.2,
        "Color": "#FF00FF"
    },
    {
        "MaxRange": 0.2,
        "MinRange": 0.1,
        "Color": "#00FF00"
    },
    {
        "MaxRange": 0.1,
        "MinRange": 0.0,
        "Color": "#FFA500"
    }
]

 

IIIaKa

Posted

6 minutes ago, Ahmed Alkaabi said:

That's right. Is there is a way to do that?

Unfortunately, colors can only be linked to percentages. For example, 500 units of fuel is approximately ~0.00222%. You need to create this range and assign it the desired color.
For example, a range from 0% to 0.1(10%) in your case would be from 0 to 22500 units of fuel.

Ahmed Alkaabi

Posted (edited)

Your calculations are logical. I have done that and the colors changed. However the progress bar did not change.

 

"List of Gauge Indicators": [
    {
        "MaxRange": 0.00222,
        "MinRange": 0.00200,
        "Color": "#00FF00"
    },
    {
        "MaxRange": 0.00200,
        "MinRange": 0.00180,
        "Color": "#FFFF00"
    },
    {
        "MaxRange": 0.00180,
        "MinRange": 0.00160,
        "Color": "#FFA500"
    },
    {
        "MaxRange": 0.00160,
        "MinRange": 0.00140,
        "Color": "#FF0000"
    },
    {
        "MaxRange": 0.00140,
        "MinRange": 0.00111,
        "Color": "#800000"
    }
]

 

f.status.png

Edited by Ahmed Alkaabi
IIIaKa

Posted

@Ahmed Alkaabi
You need to fill the range from 0 to 1. In your version, there is no color for the range from 0 to 0.00111 and from 0.00222 to 1.

Ahmed Alkaabi

Posted

I have changed the "Status. Progress - OffsetMax" and fixed it. Thanks for your support. I hope the next update we will get to set the desired max fuel tank that is not related to the percentage of the fuel stack size.

Thanks again for your support.

 

{
  "Fuel indicator refresh interval in seconds": 5.0,
  "Status. Bar - Height": 26,
  "Status. Bar - Order": 1,
  "Status. Background - Color": "#000000",
  "Status. Background - Transparency": 0.5,
  "Status. Background - Material(empty to disable)": "",
  "Status. Image - Url": "https://i.imgur.com/LP54lLZ.png",
  "Status. Image - Local(Leave empty to use Image_Url)": "FuelStatus_Fuel",
  "Status. Image - Sprite(Leave empty to use Image_Local or Image_Url)": "",
  "Status. Image - Is raw image": false,
  "Status. Image - Color": "#E2DBD6",
  "Status. Image - Transparency": 0.55,
  "Status. Text - Size": 15,
  "Status. Text - Color": "#E2DBD6",
  "Status. Text - Font(https://umod.org/guides/rust/basic-concepts-of-gui#fonts)": "RobotoCondensed-Bold.ttf",
  "Status. Text - Offset Horizontal": 7,
  "Status. Progress - Transparency": 0.8,
  "Status. Progress - OffsetMin": "25 2.5",
  "Status. Progress - OffsetMax": "250000 -3.5",
  "Status. Progress - Zero Text Size": 12,
  "Status. Progress - Zero Text Color": "#F70000",
  "List of Gauge Indicators": [
    {
      "MaxRange": 0.00222,
      "MinRange": 0.0005,
      "Color": "#B1C06E"
    },
    {
      "MaxRange": 0.0005,
      "MinRange": 0.0004,
      "Color": "#c2c234"
    },
    {
      "MaxRange": 0.0004,
      "MinRange": 0.0003,
      "Color": "#FFA500"
    },
    {
      "MaxRange": 0.0003,
      "MinRange": 0.0002,
      "Color": "#FF0000"
    },
    {
      "MaxRange": 0.0002,
      "MinRange": 1E-06,
      "Color": "#800000"
    }
  ],
  "Version": {
    "Major": 0,
    "Minor": 1,
    "Patch": 2
  }
}

 

f.status.1.png

f.status.2.png

f.status.3.png

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.4k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.