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 6 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
21 changes: 20 additions & 1 deletion data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ interface "hud"



# Targets.
# System / Radar
anchor top left
visible if "red alert"
sprite "ui/red alert"
Expand Down Expand Up @@ -804,7 +804,26 @@ interface "hud"
color "medium"
width 135
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
sprite "ui/target"
from 0 240
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 scan:"
`Allows scanning of stellar objects to determine their precise solar power output for display on the HUD.`

tip "ramscoop scan:"
`Allows scanning of stellar objects to determine their precise solar wind output for display on the HUD.`

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 scan" 1
"ramscoop scan" 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
7 changes: 5 additions & 2 deletions data/human/sales.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ outfitter "Common Outfits"
"Pilot's License"
"Laser Rifle"
"Fuel Bar Fixed Display"

"Astronomical Scanner"

Choose a reason for hiding this comment

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

Maybe you'd want to move this to a Deep Sky outfitter; it makes sense for this outfit to be an "improved ramscoop", and that would mean it should be sold alongside the Ramscoop, not separately.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I put it there as a draft for easier testing purposes and figured someone like yourself would have a better recommendation for where it should go permanently if implemented. I have plans to add more to that particular scanner as I get better at coding.

MadisonianX marked this conversation as resolved.
Show resolved Hide resolved

outfitter "Ammo North"
"Meteor Missile"
"Torpedo"
Expand Down Expand Up @@ -307,7 +308,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 +351,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 @@ -790,6 +790,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 scan"))
MadisonianX marked this conversation as resolved.
Show resolved Hide resolved
{
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("ramscoop scan"))
Copy link
Member

Choose a reason for hiding this comment

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

I think it might be less confusing to call this "wind scan" or perhaps "solar wind scan"; although in following with my comment about the solar scan, maybe "wind sensor" or "solar wind sensor"?

Copy link
Author

Choose a reason for hiding this comment

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

Sensor is fine, preferably "solar power sensor" and "solar wind sensor" so it's precise in what attribute each is sensing. Or if making them separate attributes is overkill then just "solar sensor"; I was just following the example of the tactical and strategic scanner modularity.

Copy link
Member

Choose a reason for hiding this comment

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

I personally like having them as separate values. :) could be good to have some fraction that just tracks, say, solar power.

{
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 @@ -2907,6 +2907,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 @@ -345,6 +345,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