Skip to content

Commit

Permalink
RR 2024.2.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
t0stiman committed Feb 18, 2024
1 parent 96e5802 commit 4dd05ba
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Id": "tostilities",
"Version": "0.0.1",
"Version": "0.0.2",
"DisplayName": "Tostilities",
"Author": "Tostiman",
"EntryMethod": "tostilities.Main.Load",
Expand Down
5 changes: 5 additions & 0 deletions repository.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"Releases": [
{
"Id": "tostilities",
"Version": "0.0.2",
"DownloadUrl": "https://github.com/t0stiman/rr_tostilities/releases/download/v0.0.2/tostilities.zip"
},
{
"Id": "tostilities",
"Version": "0.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/Patches/Console_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ private static void Prefix(ref string text)
}

text = $"{DateTime.Now.ToString("HH:mm")} | " + text;
//todo PlayersManager.NotifyOfNewPlayers already has a timestamp
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using HarmonyLib;
using Model.Physics;

namespace tostilities.Patches;

/// <summary>
/// Super-human strength
/// </summary>
[HarmonyPatch(typeof(TrainController))]
[HarmonyPatch(nameof(TrainController.HandleManualMoveCar))]
public class TrainController_HandleManualMoveCar_Patch
[HarmonyPatch(typeof(IntegrationSet))]
[HarmonyPatch(nameof(IntegrationSet.AddVelocityToCar))]
public class IntegrationSet_AddVelocityToCar_Patch
{
private static void Prefix(ref float amount)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Settings : UnityModManager.ModSettings
public const string playername_replaceo = "<playername>";
private const int SPACE = 15;

public float PushForceMultiplier = 10;
public int PushForceMultiplier = 10;
private string PushForceMultiplier_text;

public bool DisableDerailing = false;
Expand Down Expand Up @@ -38,7 +38,7 @@ public void Draw(UnityModManager.ModEntry modEntry)
GUILayout.Label("These only work in multiplayer if you are the server host, and apply to ALL players:");
GUILayout.Space(SPACE);

DrawFloatInput("Car push force multiplier. Higher number -> bigger YEET.", ref PushForceMultiplier_text, ref PushForceMultiplier);
DrawIntInput("Car push force multiplier. Higher number -> bigger YEET.", ref PushForceMultiplier_text, ref PushForceMultiplier);

DisableDerailing = GUILayout.Toggle(DisableDerailing, "Disable derailing");
DisableDamage = GUILayout.Toggle(DisableDamage, "Disable damage to rolling stock");
Expand All @@ -53,14 +53,14 @@ public void Draw(UnityModManager.ModEntry modEntry)
}
}

private void DrawFloatInput(string descriptionText, ref string fieldText, ref float number)
private void DrawIntInput(string descriptionText, ref string fieldText, ref int number)
{
GUILayout.BeginHorizontal();
GUILayout.Label(descriptionText);
fieldText = GUILayout.TextField(fieldText);
GUILayout.EndHorizontal();

if (float.TryParse(fieldText, out float parsed))
if (int.TryParse(fieldText, out int parsed))
{
number = parsed;
}
Expand Down

0 comments on commit 4dd05ba

Please sign in to comment.