Skip to content

Commit

Permalink
fixes #30 (oops, we skipped 2.4.1 in our 2.5 update)
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Nov 9, 2022
1 parent 0f0fdb0 commit 7a0a70e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Binary file modified 1.4/Assemblies/CameraPlus.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>net.pardeike.rimworld.mod.cameraplus</identifier>
<version>2.5.0.0</version>
<version>2.5.1.0</version>
<targetVersions>
<li>1.0.0</li>
<li>1.1.0</li>
Expand Down
2 changes: 1 addition & 1 deletion Source/CameraPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<OutputPath>..\1.4\Assemblies\</OutputPath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>2.5.0.0</Version>
<Version>2.5.1.0</Version>
<Copyright>Copyright Andreas Pardeike</Copyright>
</PropertyGroup>

Expand Down
19 changes: 12 additions & 7 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ static void SetRootSize(CameraDriver driver, float rootSize)
return;
}

driver.ApplyPositionToGameObject();
var oldMousePos = FastUI.MouseMapPosition;
driver.rootSize = rootSize;
driver.ApplyPositionToGameObject();
driver.rootPos += oldMousePos - UI.MouseMapPosition(); // dont use FastUI.MouseMapPosition here
if (driver.rootSize != rootSize)
{
driver.ApplyPositionToGameObject();
var oldMousePos = FastUI.MouseMapPosition;
driver.rootSize = rootSize;
driver.ApplyPositionToGameObject();
driver.rootPos += oldMousePos - UI.MouseMapPosition(); // dont use FastUI.MouseMapPosition here
}
}

public static void Prefix(CameraDriver __instance)
Expand Down Expand Up @@ -251,8 +254,10 @@ static class GenMapUI_DrawThingLabel_Patch

static GameFont GetAdaptedGameFont(float rootSize)
{
if (rootSize < 11f) return GameFont.Medium;
if (rootSize < 15f) return GameFont.Small;
if (rootSize < 11f)
return GameFont.Medium;
if (rootSize < 15f)
return GameFont.Small;
return GameFont.Tiny;
}

Expand Down

0 comments on commit 7a0a70e

Please sign in to comment.