Skip to content

Commit

Permalink
Fix for v45
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Oct 9, 2024
1 parent b96f953 commit 6292398
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x # net6 can still build older as well
dotnet-version: 8.0.x


- name: Build
run: dotnet build -c Release -p:BloonsTD6="../${{ env.BLOONSTD6 }}" "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj"


- name: Upload Mod DLL
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: ${{ env.PROJECT_NAME }}.dll
path: ${{ env.BLOONSTD6 }}/Mods/${{ env.PROJECT_NAME }}.dll
Expand Down
2 changes: 1 addition & 1 deletion FasterForward.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Configurations>Debug;Release</Configurations>
<Nullable>enable</Nullable>
<AssemblyName>FasterForward</AssemblyName>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<Optimize>False</Optimize>
<DebugType>embedded</DebugType>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion FasterForward.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CBloonsTD6_005CMelonLoader_005CManaged_005CUnhollowerBaseLib_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CBloonsTD6_005CMelonLoader_005CMelonLoader_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CBloonsTD6_005CMods_005CBloonsTD6_0020Mod_0020Helper_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CBloonsTD6_005CMods_005CBloonsTD6_0020Mod_0020Helper_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATimeManager_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Ff210f749c6514a77be4b242fafec974e19b6000_003F2b_003F963ec366_003FTimeManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
35 changes: 11 additions & 24 deletions FasterForwardMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using MelonLoader;
using Il2CppAssets.Scripts.Utils;
using BTD_Mod_Helper;
using BTD_Mod_Helper.Api.Helpers;
using BTD_Mod_Helper.Api.ModOptions;
using BTD_Mod_Helper.Extensions;
using FasterForward;
Expand Down Expand Up @@ -48,6 +49,7 @@ public class FasterForwardMod : BloonsTD6Mod
public override void OnUpdate()
{
var lastSpeed = speed;

if (Speed3.JustPressed())
{
speed = 3;
Expand All @@ -68,20 +70,7 @@ public override void OnUpdate()
speed = 25;
}

if (InGame.instance == null) return;

UpdateInGame();

if (speed != lastSpeed)
{
Game.instance.ShowMessage("Fast Forward Speed is now " + speed + "x" + (speed == 3 ? " (Default)" : ""),
1f);
}
}

public static void UpdateInGame()
{
if (SpeedCustom.JustPressed())
if (SpeedCustom.JustPressed() && InGame.instance != null)
{
PopupScreen.instance.ShowSetValuePopup("Custom Fast Forward Speed",
"Sets the Fast Forward speed to the specified value",
Expand All @@ -103,17 +92,15 @@ public static void UpdateInGame()
}), speed);
}

if (TimeManager.FastForwardActive)
{
TimeManager.timeScaleWithoutNetwork = speed;
TimeManager.networkScale = speed;
}
else
if (InGame.instance == null || InGame.Bridge == null) return;

if (speed != lastSpeed)
{
TimeManager.timeScaleWithoutNetwork = 1;
TimeManager.networkScale = 1;
}
Game.instance.ShowMessage("Fast Forward Speed is now " + speed + "x" + (speed == 3 ? " (Default)" : ""),
1f);

TimeManager.maxSimulationStepsPerUpdate = speed;
TimeHelper.OverrideFastForwardTimeScale = speed;
TimeHelper.OverrideMaxSimulationStepsPerUpdate = speed;
}
}
}
19 changes: 11 additions & 8 deletions ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

public static class ModHelperData
{
public const string WorksOnVersion = "35.0";
public const string Version = "1.1.2";
public const string WorksOnVersion = "45.0";
public const string Version = "1.1.3";
public const string RepoOwner = "doombubbles";
public const string RepoName = "faster-forward";
public const string Name = "Faster Forward";

public const string Description =
"Allows you to increase the Fast Forward speed using the FN keys.<br><br>" +
"F1: 3x Speed (Default)<br>" +
"F2: 5x Speed<br>" +
"F3: 10x Speed<br>" +
"F4: 25x Speed<br>" +
"F5: Custom Speed";
"""
Allows you to increase the Fast Forward speed using the FN keys.

F1: 3x Speed (Default)
F2: 5x Speed
F3: 10x Speed
F4: 25x Speed
F5: Custom Speed
""";
}
5 changes: 3 additions & 2 deletions Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"BloonsTD6": {
"commandName": "Executable",
"executablePath": "$(BloonsTD6)/BloonsTD6.exe",
"workingDirectory": "$(BloonsTD6)"
"workingDirectory": "$(BloonsTD6)",
"commandLineArgs": "moddingDev"
},
"BloonsTD6 (ML Debug)": {
"commandName": "Executable",
"executablePath": "$(BloonsTD6)/BloonsTD6.exe",
"workingDirectory": "$(BloonsTD6)",
"commandLineArgs": "--melonloader.debug"
"commandLineArgs": "moddingDev --melonloader.debug"
}
}
}

0 comments on commit 6292398

Please sign in to comment.