Skip to content

Commit

Permalink
Add jump points to json systems
Browse files Browse the repository at this point in the history
  • Loading branch information
behindcurtain3 committed Apr 5, 2024
1 parent 83055e3 commit 390a90e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Pulsar4X/GameEngine/Engine/Factories/JPFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ public static Entity CreateJumpPoint(StarSystemFactory ssf, StarSystem system)
Y = -Y;
}

var x_km = Distance.AuToKm(X);
var y_km = Distance.AuToKm(Y);

NameDB jpNameDB = new NameDB("Jump Point");
PositionDB jpPositionDB = new PositionDB(X, Y, 0, system.Guid);
PositionDB jpPositionDB = new PositionDB(x_km * 1000, y_km * 1000, 0, system.Guid);
TransitableDB jpTransitableDB = new TransitableDB
{
IsStabilized = system.Game.Settings.AllJumpPointsStabilized ?? false
Expand Down
1 change: 1 addition & 0 deletions Pulsar4X/GameEngine/Engine/Factories/StarSystemFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ public StarSystem LoadSystemFromJson(Game game, string folder)
}

JPSurveyFactory.GenerateJPSurveyPoints(system);
JPFactory.GenerateJumpPoints(this, system);

// Go through all the created entities and set them to be neutral
foreach(var entity in system.GetAllEntites())
Expand Down
2 changes: 1 addition & 1 deletion Pulsar4X/Pulsar4X.Client/GameManagment/GlobalUIState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ internal GlobalUIState(ImGuiSDL2CSWindow viewport)
DrawNameZoomLvl.Add(UserOrbitSettings.OrbitBodyType.Comet, 96f);
DrawNameZoomLvl.Add(UserOrbitSettings.OrbitBodyType.Colony, 32f);
DrawNameZoomLvl.Add(UserOrbitSettings.OrbitBodyType.Ship, 64f);
DrawNameZoomLvl.Add(UserOrbitSettings.OrbitBodyType.Unknown, 96f);
DrawNameZoomLvl.Add(UserOrbitSettings.OrbitBodyType.Unknown, 16f);

for (int i = 0; i < (int)UserOrbitSettings.OrbitBodyType.NumberOf; i++)
{
Expand Down

0 comments on commit 390a90e

Please sign in to comment.