Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuel bar seems empty if there's too much fuel capacity #10688

Open
1 task done
TomGoodIdea opened this issue Oct 25, 2024 · 3 comments
Open
1 task done

Fuel bar seems empty if there's too much fuel capacity #10688

TomGoodIdea opened this issue Oct 25, 2024 · 3 comments
Labels
bug Something in the game is not behaving as intended UI Everything related to the User Interface & Design (both artwork and code)

Comments

@TomGoodIdea
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Because of lineshader's round edges, if you have high fuel capacity, the bar segments become so small that they're effectively not rendered at all.

Steps to Reproduce

  1. Increase your flagship's "fuel capacity" to 3300.
  2. Look at the fuel bar.

Expected Behavior

Probably would be best to just show it as a full line, or have the rounding only on the ends and not between the segments.

Screenshots

Before the recent lineshader changes:
1
After (the same fuel capacity):
2

Link to save file

No response

Operating System

Linux

Game Source

Built from source

Game Version

f4260e9

Additional Information

No response

@TomGoodIdea TomGoodIdea added bug Something in the game is not behaving as intended unconfirmed More information is needed to be sure this report is true UI Everything related to the User Interface & Design (both artwork and code) labels Oct 25, 2024
@Hecter94 Hecter94 removed the unconfirmed More information is needed to be sure this report is true label Oct 25, 2024
@VaelophisNyx
Copy link

interesting note, that this seems to not happen if it's a whole thousands number
ie: 3300 does it, but 3000 or 4000 does not (they display a non-segmented bar)

@JalisoCSP
Copy link

(I don't know anything about C++ so I don't know why I'm here — for fun, I guess)

This must be here:

info.SetBar("fuel", flagship->Fuel(), fuelCap * .01);

		// If the flagship has a large amount of fuel, display a solid bar.
		// Otherwise, display a segment for every 100 units of fuel.
		if(fuelCap <= MAX_FUEL_DISPLAY)
			info.SetBar("fuel", flagship->Fuel(), fuelCap * .01);
		else
			info.SetBar("fuel", flagship->Fuel());

If it's showing * .01 of a bar for each unit, that would cause this, right?

It might make more sense for this to be size related to your cap instead of per 100 units. 3300 * 0.01 is 100 units, 33 times.

But const double MAX_FUEL_DISPLAY = 5000.; 🤔

@warp-core
Copy link
Contributor

(I don't know anything about C++ so I don't know why I'm here — for fun, I guess)

This must be here:

info.SetBar("fuel", flagship->Fuel(), fuelCap * .01);

		// If the flagship has a large amount of fuel, display a solid bar.
		// Otherwise, display a segment for every 100 units of fuel.
		if(fuelCap <= MAX_FUEL_DISPLAY)
			info.SetBar("fuel", flagship->Fuel(), fuelCap * .01);
		else
			info.SetBar("fuel", flagship->Fuel());

If it's showing * .01 of a bar for each unit, that would cause this, right?

It might make more sense for this to be size related to your cap instead of per 100 units. 3300 * 0.01 is 100 units, 33 times.

But const double MAX_FUEL_DISPLAY = 5000.; 🤔

The MAX_FUEL_DISPLAY value determines how high the fuel capacity can be before the fuel bar will be displayed as a single solid line instead of a segmented line.

The fuelCap * .01 calculation is determining how many segments there should be in the bar. One segment for every hundred units of fuel. It doesn't affect how much of the bar is drawn.
You can find the definition of SetBar in Information.cpp.
Look in Interface.cpp at the method Interface::BarElement::Draw to see what is done with those values, and the LineShader class for how the bar is actually drawn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something in the game is not behaving as intended UI Everything related to the User Interface & Design (both artwork and code)
Projects
None yet
Development

No branches or pull requests

6 participants
@VaelophisNyx @Hecter94 @JalisoCSP @warp-core @TomGoodIdea and others