Skip to content

Commit

Permalink
Refactoring and force fetch star system when edit menu is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
8vogt committed Feb 21, 2021
1 parent 8711b33 commit 232cfb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
1 change: 1 addition & 0 deletions SEWorldGenPlugin/GUI/AdminMenu/MyPluginAdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public override void RecreateControls(bool constructor)
if (m_selectedMenuIndex == oldCount + 1)
{
ClearControls();
ForceFetchStarSystem = true;
BuildEditMenu();
}
m_isRecreating = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private void OnParentItemClicked(MyGuiControlListbox box)

m_asteroidSizesSlider.SetValues(32, 1024);

CameraLookAt(Vector3D.Zero, new Vector3D(0, 0, m_radiusSlider.Value * 2000));
m_parentScreenCameraLookAt(Vector3D.Zero, new Vector3D(0, 0, m_radiusSlider.Value * 2000));

RenderSpherePreview(GetDataFromGui());
return;
Expand Down Expand Up @@ -309,7 +309,7 @@ private void OnParentItemClicked(MyGuiControlListbox box)

m_asteroidSizesSlider.SetValues(32, 1024);

CameraLookAt(planet.CenterPosition, (float)planet.Diameter * 2f);
m_parentScreen.CameraLookAt(planet.CenterPosition, (float)planet.Diameter * 2f);

RenderSpherePreview(GetDataFromGui());
return;
Expand Down Expand Up @@ -354,30 +354,6 @@ private void RenderSpherePreview(MyAsteroidSphereData data)
}
}

/// <summary>
/// Makes the spectator cam look at the specific point from the given distance
/// </summary>
/// <param name="center">Point to look at</param>
/// <param name="distance">Distance to look from</param>
private void CameraLookAt(Vector3D center, float distance)
{
MySession.Static.SetCameraController(MyCameraControllerEnum.Spectator);
MySpectatorCameraController.Static.Position = center + distance;
MySpectatorCameraController.Static.Target = center;
}

/// <summary>
/// Makes the spectator cam look at the specific point from the given distance
/// </summary>
/// <param name="center">Point to look at</param>
/// <param name="distance">Distance to look from</param>
private void CameraLookAt(Vector3D center, Vector3D distance)
{
MySession.Static.SetCameraController(MyCameraControllerEnum.Spectator);
MySpectatorCameraController.Static.Position = center + distance;
MySpectatorCameraController.Static.Target = center;
}

/// <summary>
/// Action to remove the sphere for the remove sphere button
/// </summary>
Expand Down

0 comments on commit 232cfb5

Please sign in to comment.