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

Feat(code): Add HUD display for Solar Power and Solar Wind #164

Open
wants to merge 25 commits into
base: experimental
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bca70cb
Feat(code): Add HUD display for Solar Power and Solar Wind
MadisonianX Dec 2, 2024
1a7205f
Update source/Engine.cpp
MadisonianX Dec 2, 2024
058ea58
Update data/human/outfits.txt
MadisonianX Dec 2, 2024
17268d1
Feat(code): Add HUD display for Solar Power and Solar Wind
MadisonianX Dec 2, 2024
11bb06f
Update sales.txt
MadisonianX Dec 2, 2024
c82cfd7
update interface data to child of top left anchor
MadisonianX Dec 3, 2024
32c5fca
Merge branch 'endless-sky:experimental' into System-Solar-Display
MadisonianX Dec 4, 2024
ef6cb45
Merge branch 'experimental' into System-Solar-Display
Zitchas Dec 9, 2024
98ee2e5
Merge branch 'experimental' into System-Solar-Display
Zitchas Dec 11, 2024
5386f2d
Update data/human/sales.txt
MadisonianX Dec 14, 2024
057bbe1
Update Engine.cpp
MadisonianX Dec 14, 2024
8778f8a
Update outfits.txt
MadisonianX Dec 14, 2024
fc98542
Update tooltips.txt
MadisonianX Dec 14, 2024
4aeb0a8
Update sales.txt
MadisonianX Dec 14, 2024
db6e58a
Update interfaces.txt
MadisonianX Dec 14, 2024
13edc2a
Merge branch 'endless-sky:experimental' into System-Solar-Display
MadisonianX Dec 15, 2024
22b7f56
Merge branch 'endless-sky:experimental' into System-Solar-Display
MadisonianX Dec 16, 2024
b9d08c9
Update data/_ui/interfaces.txt
MadisonianX Dec 24, 2024
d2685d7
Update data/_ui/interfaces.txt
MadisonianX Dec 24, 2024
415079e
Update data/_ui/interfaces.txt
MadisonianX Dec 24, 2024
593d1ed
Merge branch 'experimental' into System-Solar-Display
Zitchas Jan 2, 2025
7e1ab27
Adding a template copyright
Zitchas Jan 2, 2025
702ba44
Update copyright
Zitchas Jan 21, 2025
995fedb
Merge branch 'experimental' into System-Solar-Display
Zitchas Jan 21, 2025
fa14bcd
Merge branch 'experimental' into System-Solar-Display
Zitchas Jan 22, 2025
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
28 changes: 22 additions & 6 deletions data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,8 @@ interface "hud"
from -70 320
color "medium"
align right



# Targets.

# Radar
MadisonianX marked this conversation as resolved.
Show resolved Hide resolved
anchor top left
visible if "red alert"
sprite "ui/red alert"
Expand All @@ -796,7 +794,6 @@ interface "hud"
value "radar radius" 110
value "radar pointer radius" 130

# Current system.
sprite "ui/current system"
from 43 0
align top left
Expand All @@ -811,7 +808,6 @@ interface "hud"
sprite "ui/navigation"
from 195 0
align top left

string "navigation mode"
from 215 20
align left
Expand All @@ -822,7 +818,27 @@ interface "hud"
color "medium"
width 130
truncate back

visible if "system solar display"
sprite "ui/tactical/solar"
from 252 67
MadisonianX marked this conversation as resolved.
Show resolved Hide resolved
align top left
string "system solar"
from 269 76
color "medium"
align left

visible if "system wind display"
sprite "ui/tactical/wind"
from 258 90
MadisonianX marked this conversation as resolved.
Show resolved Hide resolved
align top left
string "system wind"
from 275 99
color "medium"
align left

# Targets
visible
sprite "ui/target"
from 0 275
align top left
Expand Down
6 changes: 6 additions & 0 deletions data/_ui/tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ tip "asteroid scan power:"
tip "atmosphere scan:"
`This type of scanning cannot be performed by your ship, but this outfit might be useful for certain missions.`

tip "solar power sensor:"
`Automatically analyzes stellar objects to determine their precise solar power for display on the HUD, with combined output for multi-star systems.`

tip "solar wind sensor:"
`Automatically analyzes stellar objects to determine their precise solar wind for display on the HUD, with combined output for multi-star systems.`

tip "bunks:"
`The number of people (passengers or crew) your ship can hold.`

Expand Down
13 changes: 13 additions & 0 deletions data/human/outfits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,19 @@ outfit "Thermal Scanner"
"thermal scan power" 35
description "While thermal signatures have always been useful as a means of identifying and tracking ships, determining a ship's effective average thermal load was functionally useless until recently. With the development of the plasma cannon and then the flamethrower, attempting to overheat a ship has become a viable combat technique. As such, engineers with the Free World have begun assembling these sensor packages to support the daring captains who choose to use this tactic."


outfit "Astronomical Scanner"
category "Systems"
cost 18000
thumbnail "outfit/astronomical scanner"
"mass" 2
"outfit space" -2
"energy consumption" .1
"solar power sensor" 1
"solar wind sensor" 1
description "An astronomical scanner provides data on the system's total solar power and wind output, allowing captains to see which systems are best for solar collection or ramscoop usage."


outfit "Surveillance Pod"
category "Systems"
cost 122500
Expand Down
4 changes: 3 additions & 1 deletion data/human/sales.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ outfitter "Deep Sky Basics"
"A370 Atomic Thruster"
"A375 Atomic Steering"
"AR120 Reverse Thruster"

"Astronomical Scanner"

outfitter "Deep Sky Advanced"
"Ramscoop"
"LP144a Battery Pack"
Expand Down Expand Up @@ -349,6 +350,7 @@ outfitter "Deep Sky Advanced"
"In-flight Mass Display"
"Hyperjump Fuel Display"
"Fuel Bar Hyperjump Display"
"Astronomical Scanner"
Copy link
Member

Choose a reason for hiding this comment

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

These are a good place for this outfit for now, although in the future it might be more interesting to have it in its own outfitter and have it only available from a few worlds that mention having universities or astronomy studies, and tie it into some research missions from said places.

Copy link
Author

Choose a reason for hiding this comment

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

I have it in Deep Sky Basics and Deep Sky Advanced currently, is just Advanced preferred?

Copy link
Member

Choose a reason for hiding this comment

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

Probably just advanced, I think.


outfitter "Lovelace Basics"
"Anti-Missile Turret"
Expand Down
Binary file added images/outfit/astronomical scanner.png
Copy link
Member

Choose a reason for hiding this comment

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

Nice artwork!

Don't forget to put an entry in the copyright file labelling where it comes from. It would also be appreciated to have a copy of the image that is double the size along side it, with @2x appended on the end of the filename.

Copy link
Author

@MadisonianX MadisonianX Dec 14, 2024

Choose a reason for hiding this comment

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

The scanner image is just a placeholder, I'm currently working on something original. The wind icon was just a generic free stock image I don't even remember from where, if it even matters?

Should @2x typically be added with each PR that has an image, or to a central @2x database like the main branch does?

Does it matter where in the copyright file things should go or just add info at the end?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please include the 2x here. We don't have a secondary high dpi location currently.

There isn't much of an order to the copyright, just so long as it is in the art section, and people go before organizations.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tactical/wind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions source/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,20 @@ void Engine::Step(bool isActive)
info.SetCondition("flagship solar display");
info.SetString("flagship solar", to_string(flagshipSolar));
}
// Display combined Solar Power for system
int displaySystemPower = (flagship->DisplaySystemSolar() * 100); // Multiplied to better display decimal inputs
if(displaySystemPower >= 0.01 && flagship->Attributes().Get("solar power sensor"))
{
info.SetCondition("system solar display");
info.SetString("system solar", to_string(displaySystemPower));
}
// Display combined Solar Wind for system
int displaySystemWind = (flagship->DisplaySystemWind() * 100); // Multiplied to better display decimal inputs
if(displaySystemWind >= 0.01 && flagship->Attributes().Get("solar wind sensor"))
{
info.SetCondition("system wind display");
info.SetString("system wind", to_string(displaySystemWind));
}
// These check for the attribute to determine if the pilot has installed
// outfits that give a live display of ship mass and jump fuel costs.
bool flagshipMassDisplay = flagship->DisplayMass();
Expand Down
16 changes: 16 additions & 0 deletions source/Ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,22 @@ double Ship::DisplayRamScoop() const



// Display combined solar power for the system.
double Ship::DisplaySystemSolar() const
{
return currentSystem->SolarPower();
}



// Display combined solar wind for the system.
double Ship::DisplaySystemWind() const
{
return currentSystem->SolarWind();
}



// These are for the thruster activity bars
double Ship::DisplayThrust() const
{
Expand Down
2 changes: 2 additions & 0 deletions source/Ship.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ class Ship : public Body, public std::enable_shared_from_this<Ship> {
bool DisplayJumpFuelCost() const;
double DisplaySolar() const;
double DisplayRamScoop() const;
double DisplaySystemSolar() const;
double DisplaySystemWind() const;
// These are for the thruster activity bars
double DisplayThrust() const;
double DisplayTurn() const;
Expand Down
Loading