Skip to content

Commit

Permalink
v2.6
Browse files Browse the repository at this point in the history
- Recompiled for the latest game version
- Fixed issues setting autohide speed
  • Loading branch information
Jaxe-Dev committed Aug 5, 2023
1 parent db19d75 commit 25e0422
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ _*
*.user
*.pdb
!/.gitignore
!/*.md
!/*.sln
!/source/
16 changes: 16 additions & 0 deletions Bubbles.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33920.266
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bubbles", "source\Bubbles.csproj", "{61B57A41-B985-4C1C-9BED-D25689996E89}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{61B57A41-B985-4C1C-9BED-D25689996E89}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61B57A41-B985-4C1C-9BED-D25689996E89}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interaction Bubbles

![Mod Version](https://img.shields.io/badge/Mod_Version-2.5-blue)
![Mod Version](https://img.shields.io/badge/Mod_Version-2.6-blue)
![RimWorld Version](https://img.shields.io/badge/Built_for_RimWorld-1.4-blue)
![Harmony Version](https://img.shields.io/badge/Powered_by_Harmony-2.2-blue)\
[![Steam Subscribers](https://img.shields.io/steam/downloads/1516158345?color=blue&label=Steam%20Downloads&logo=Steam)](https://steamcommunity.com/sharedfiles/filedetails/?id=1516158345)
Expand Down
14 changes: 6 additions & 8 deletions source/Bubbles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.2.1\lib\net472\0Harmony.dll</HintPath>
<Reference Include="System" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.2.2\lib\net472\0Harmony.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
Expand All @@ -34,8 +36,6 @@
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>UnityEngine.CoreModule.dll</HintPath>
Expand Down Expand Up @@ -83,10 +83,8 @@
<None Include="-\Textures\Bubbles\Icon.png" />
<None Include="-\Textures\Bubbles\Inner.png" />
<None Include="-\Textures\Bubbles\Outer.png" />
</ItemGroup>
<ItemGroup>
<Content Include="-\Legacy\1.3\Assemblies\Bubbles.dll" />
<Content Include="-\LoadFolders.xml" />
<None Include="-\Legacy\1.3\Assemblies\Bubbles.dll" />
<None Include="-\LoadFolders.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProjectDir)release.targets" />
Expand Down
4 changes: 2 additions & 2 deletions source/Configuration/Listing_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public void SliderLabeled(string label, ref float value, float min, float max, f

public void SliderLabeled(string label, ref int value, int min, int max, int roundTo = -1, string display = null)
{
var floatValue = (float) value;
var floatValue = (float)value;
SliderLabeled(label, ref floatValue, min, max, roundTo, display);
value = (int) floatValue;
value = (int)floatValue;
}

public void ColorEntry(string label, ref string buffer, ref Color original)
Expand Down
2 changes: 1 addition & 1 deletion source/Configuration/SettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void DrawSettings(Rect rect)
if (doTextColors != Settings.DoTextColors.Value) { Bubbler.Rebuild(); }
l.Gap();

l.SliderLabeled("Bubbles.AutoHideSpeed".Translate(), ref Settings.AutoHideSpeed.Value, 5, 1, display: Settings.AutoHideSpeed.Value == 5 ? "Bubbles.AutoHideSpeedOff".Translate().ToString() : Settings.AutoHideSpeed.Value.ToString());
l.SliderLabeled("Bubbles.AutoHideSpeed".Translate(), ref Settings.AutoHideSpeed.Value, 1, 4, display: Settings.AutoHideSpeed.Value == Settings.AutoHideSpeedDisabled ? "Bubbles.AutoHideSpeedOff".Translate().ToString() : Settings.AutoHideSpeed.Value.ToString());

l.SliderLabeled("Bubbles.AltitudeBase".Translate(), ref Settings.AltitudeBase.Value, 3, 44);
l.SliderLabeled("Bubbles.AltitudeMax".Translate(), ref Settings.AltitudeMax.Value, 20, 60);
Expand Down
4 changes: 2 additions & 2 deletions source/Core/Bubble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public bool Draw(Vector2 pos, bool isSelected, float scale)
private void ScaleFont(ref float scale)
{
Style.fontSize = Mathf.RoundToInt(Settings.FontSize.Value * scale);
scale = Style.fontSize / (float) Settings.FontSize.Value;
scale = Style.fontSize / (float)Settings.FontSize.Value;
}

private void ScalePadding(float scale)
Expand Down Expand Up @@ -99,7 +99,7 @@ private float GetFade()
if (elasped <= 0) { return Settings.OpacityStart.Value; }
if (elasped > Settings.FadeLength.Value) { return 0f; }

var fade = Settings.OpacityStart.Value * (1f - (elasped / (float) Settings.FadeLength.Value));
var fade = Settings.OpacityStart.Value * (1f - (elasped / (float)Settings.FadeLength.Value));
return fade;
}

Expand Down
2 changes: 1 addition & 1 deletion source/Core/Bubbler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static void DrawBubble(Pawn pawn, bool isSelected, float scale)
}
}

private static bool GetApplicable() => Settings.Activated && !WorldRendererUtility.WorldRenderedNow && (Settings.AutoHideSpeed.Value == 5 || (int) Find.TickManager.CurTimeSpeed < Settings.AutoHideSpeed.Value);
private static bool GetApplicable() => Settings.Activated && !WorldRendererUtility.WorldRenderedNow && (Settings.AutoHideSpeed.Value == Settings.AutoHideSpeedDisabled || (int)Find.TickManager.CurTimeSpeed < Settings.AutoHideSpeed.Value);

private static float GetAltitude()
{
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Compatibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static void ApplyCameraPlus(ref float scale)

if (_cameraPlusLerpRootSize == null) { _cameraPlusLerpRootSize = MethodInvoker.GetHandler(AccessTools.Method("CameraPlus.Tools:LerpRootSize")); }

scale = (float) _cameraPlusLerpRootSize(null, scale);
scale = (float)_cameraPlusLerpRootSize(null, scale);
}
}
}
2 changes: 1 addition & 1 deletion source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Mod : Verse.Mod
{
public const string Id = "Bubbles";
public const string Name = "Interaction Bubbles";
public const string Version = "2.5";
public const string Version = "2.6";

public static Mod Instance;

Expand Down
10 changes: 5 additions & 5 deletions source/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ namespace Bubbles
{
public class Settings : ModSettings
{
private static readonly string[] SameConfigVersions =
{
"2.4"
};
public const int AutoHideSpeedDisabled = 1;

private static readonly string[] SameConfigVersions = { };

private static bool _resetRequired;

public static bool Activated = true;

public static readonly Setting<int> AutoHideSpeed = new Setting<int>(nameof(AutoHideSpeed), 5);
public static readonly Setting<int> AutoHideSpeed = new Setting<int>(nameof(AutoHideSpeed), AutoHideSpeedDisabled);

public static readonly Setting<bool> DoNonPlayer = new Setting<bool>(nameof(DoNonPlayer), true);
public static readonly Setting<bool> DoAnimals = new Setting<bool>(nameof(DoAnimals), true);
Expand Down
2 changes: 1 addition & 1 deletion source/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.2.1" targetFramework="net472" />
<package id="Lib.Harmony" version="2.2.2" targetFramework="net472" />
</packages>

0 comments on commit 25e0422

Please sign in to comment.