Skip to content

Commit

Permalink
Merge pull request #58 from RimNauts/main
Browse files Browse the repository at this point in the history
Decrease minimum altitude
  • Loading branch information
sindre0830 authored Mar 28, 2023
2 parents bf4c167 + 19fe430 commit c04bd23
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
Binary file modified Assemblies/RimNauts2.dll
Binary file not shown.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Changelog
- Decrease minimum altitude allowing users to zoom in as much as possible
2 changes: 1 addition & 1 deletion Source/RimNauts2/RimNauts2/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace RimNauts2 {
public static class Info {
public static readonly string name = "RimNauts 2";
public static readonly string version = "4.14.2";
public static readonly string version = "4.14.3";
}

public static class Style {
Expand Down
1 change: 1 addition & 0 deletions Source/RimNauts2/RimNauts2/Defs/Of.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static class Of {

public class General : Def {
public float max_altitude = 1600.0f;
public float min_altitude = 80.0f;
public float field_of_view = 40.0f;
public float drag_sensitivity_multiplier = 0.50f;
public float drag_velocity_multiplier = 0.50f;
Expand Down
8 changes: 8 additions & 0 deletions Source/RimNauts2/RimNauts2/World/Patch/CameraDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,12 @@ public static bool Prefix(ref RimWorld.Planet.WorldCameraDriver __instance) {
return false;
}
}

[HarmonyPatch(typeof(RimWorld.Planet.WorldCameraDriver), "MinAltitude", MethodType.Getter)]
class WorldCameraDriver_MinAltitude {
public static bool Prefix(ref float __result) {
__result = (float) ((double) Defs.Of.general.min_altitude + (SteamDeck.IsSteamDeck ? 17.0 : 25.0));
return false;
}
}
}
2 changes: 1 addition & 1 deletion Source/RimNauts2/RimNauts2/World/Patch/HideIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static bool check(Vector3 pos) {
}
Vector3 normalized = pos.normalized;
float mag = pos.magnitude;
float min_alt = 125;
float min_alt = RimWorld.Planet.WorldCameraDriver.MinAltitude;
float max_alt = Defs.Of.general.max_altitude;
float alt = RenderingManager.altitude_percent * (max_alt - min_alt) + max_alt;
bool hide = Vector3.Angle(normalized, RenderingManager.center) > (Math.Acos(115 / alt) + Math.Acos(115 / mag)) * (degree / 3.14d);
Expand Down

0 comments on commit c04bd23

Please sign in to comment.