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

"fast" mode for flagship and target images in the HUD #9942

Merged
merged 9 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,15 @@ interface "hud"
color "medium"
align right

visible if "!fast flagship sprite"
outline "player sprite"
center -75 155
dimensions 70 70
visible if "fast flagship sprite"
image "player sprite"
center -75 155
dimensions 70 70
visible
ring "shields"
center -75 155
dimensions 120 120
Expand Down Expand Up @@ -684,10 +690,16 @@ interface "hud"
center 75 315
dimensions 140 140
value "target radius" 70
visible if "!fast target sprite"
outline "target sprite"
center 75 315
dimensions 70 70
colored
visible if "fast target sprite"
image "target sprite"
center 75 315
dimensions 70 70
visible
ring "target shields"
center 75 315
dimensions 120 120
Expand Down
6 changes: 6 additions & 0 deletions data/_ui/tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,12 @@ tip "Extended jump effects"
tip "Ship outlines in shops"
`Controls the display of your fleet ship icons when in the shipyard or outfitter. When fancy, applies a sobel filter to all ships. (This can result in high GPU load for large fleets.) When fast, just uses the ship's sprite.`

tip "Flagship outline in HUD"
`Controls the display of your flagship icon in the HUD. When fancy, applies a sobel filter to the sprite. (This can result in high GPU load for some ships on very old or low performance computers.) When fast, just uses the ship's sprite.`

tip "Target outline in HUD"
`Controls the display of your target ship icon in the HUD. When fancy, applies a sobel filter to the sprite. (This can result in high GPU load for some ships on very old or low performance computers.) When fast, just uses the ship's sprite.`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this can be a single preference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could even merge it with the other preference as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at the very least these two new ones should be combined. I'd be fine with having these be separate from the outfitter/shipyard preference.

tip "Show status overlays"
`Display status overlays over top of all ships when in flight. Status overlays display a ship's shields and hull. If the damaged option is chosen, overlays only appear on ships that have taken damage.`

Expand Down
4 changes: 4 additions & 0 deletions source/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,10 @@ void Engine::Step(bool isActive)
}
}
}
if(!Preferences::Has("Flagship outline in HUD"))
info.SetCondition("fast flagship sprite");
if(!Preferences::Has("Target outline in HUD"))
info.SetCondition("fast target sprite");
if(target && target->IsTargetable() && target->GetSystem() == currentSystem
&& (flagship->CargoScanFraction() || flagship->OutfitScanFraction()))
{
Expand Down
2 changes: 2 additions & 0 deletions source/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ void Preferences::Load()
settings["Hide unexplored map regions"] = true;
settings["Turrets focus fire"] = true;
settings["Ship outlines in shops"] = true;
settings["Flagship outline in HUD"] = true;
settings["Target outline in HUD"] = true;
settings["Extra fleet status messages"] = true;
settings["Target asteroid based on"] = true;

Expand Down
14 changes: 14 additions & 0 deletions source/PreferencesPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ namespace {
const string BACKGROUND_PARALLAX = "Parallax background";
const string EXTENDED_JUMP_EFFECTS = "Extended jump effects";
const string ALERT_INDICATOR = "Alert indicator";
const string HUD_FLAGSHIP_OUTLINE = "Flagship outline in HUD";
const string HUD_TARGET_OUTLINE = "Target outline in HUD";

// How many pages of controls and settings there are.
const int CONTROLS_PAGE_COUNT = 2;
Expand Down Expand Up @@ -642,6 +644,8 @@ void PreferencesPanel::DrawSettings()
"Show hyperspace flash",
EXTENDED_JUMP_EFFECTS,
SHIP_OUTLINES,
HUD_FLAGSHIP_OUTLINE,
HUD_TARGET_OUTLINE,
"\t",
"HUD",
STATUS_OVERLAYS_ALL,
Expand Down Expand Up @@ -818,6 +822,16 @@ void PreferencesPanel::DrawSettings()
isOn = true;
text = Preferences::Has(SHIP_OUTLINES) ? "fancy" : "fast";
}
else if(setting == HUD_FLAGSHIP_OUTLINE)
{
isOn = true;
text = Preferences::Has(HUD_FLAGSHIP_OUTLINE) ? "fancy" : "fast";
}
else if(setting == HUD_TARGET_OUTLINE)
{
isOn = true;
text = Preferences::Has(HUD_TARGET_OUTLINE) ? "fancy" : "fast";
}
else if(setting == BOARDING_PRIORITY)
{
isOn = true;
Expand Down
Loading