Scale planet grid to planet radius (#8381)

* Scale planet grid to planet radius

* Fix skewed sector icons on small planets
This commit is contained in:
Pasu4
2023-03-25 18:50:06 +01:00
committed by GitHub
parent b030a51485
commit 58eef49284
2 changed files with 15 additions and 13 deletions

View File

@@ -785,7 +785,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
hoverLabel.touchable = Touchable.disabled;
hoverLabel.color.a = state.uiAlpha;
Vec3 pos = planets.cam.project(Tmp.v31.set(hovered.tile.v).setLength(PlanetRenderer.outlineRad).rotate(Vec3.Y, -state.planet.getRotation()).add(state.planet.position));
Vec3 pos = planets.cam.project(Tmp.v31.set(hovered.tile.v).setLength(PlanetRenderer.outlineRad * state.planet.radius).rotate(Vec3.Y, -state.planet.getRotation()).add(state.planet.position));
hoverLabel.setPosition(pos.x - Core.scene.marginLeft, pos.y - Core.scene.marginBottom, Align.center);
hoverLabel.getText().setLength(0);
@@ -831,7 +831,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
}
if(state.planet.hasGrid()){
hovered = Core.scene.getDialog() == this ? state.planet.getSector(planets.cam.getMouseRay(), PlanetRenderer.outlineRad) : null;
hovered = Core.scene.getDialog() == this ? state.planet.getSector(planets.cam.getMouseRay(), PlanetRenderer.outlineRad * state.planet.radius) : null;
}else if(state.planet.isLandable()){
boolean wasNull = selected == null;
//always have the first sector selected.