Skip to content

Commit

Permalink
feat(UI): Added a preference to turn off the sobel filter on your fla…
Browse files Browse the repository at this point in the history
…gship and target ship in the HUD (#9942)
  • Loading branch information
warp-core committed Mar 24, 2024
1 parent 3c7f4e5 commit 7260699
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
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 hud sprites"
outline "player sprite"
center -75 155
dimensions 70 70
visible if "fast hud sprites"
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 hud sprites"
outline "target sprite"
center 75 315
dimensions 70 70
colored
visible if "fast hud sprites"
image "target sprite"
center 75 315
dimensions 70 70
visible
ring "target shields"
center 75 315
dimensions 120 120
Expand Down
3 changes: 3 additions & 0 deletions data/_ui/tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,9 @@ 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 "Ship outlines in HUD"
`Controls the display of your flagship and target ship icons in the HUD. When fancy, applies a sobel filter to the sprites. (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 "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
2 changes: 2 additions & 0 deletions source/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,8 @@ void Engine::Step(bool isActive)
}
}
}
if(!Preferences::Has("Ship outlines in HUD"))
info.SetCondition("fast hud sprites");
if(target && target->IsTargetable() && target->GetSystem() == currentSystem
&& (flagship->CargoScanFraction() || flagship->OutfitScanFraction()))
{
Expand Down
1 change: 1 addition & 0 deletions source/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ void Preferences::Load()
settings["Hide unexplored map regions"] = true;
settings["Turrets focus fire"] = true;
settings["Ship outlines in shops"] = true;
settings["Ship outlines in HUD"] = true;
settings["Extra fleet status messages"] = true;
settings["Target asteroid based on"] = true;

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

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

0 comments on commit 7260699

Please sign in to comment.