Skip to content

Commit

Permalink
Merge branch 'gurrenm3:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkTerraYT authored Dec 20, 2024
2 parents c5815f3 + a5125ad commit 860e2d8
Show file tree
Hide file tree
Showing 50 changed files with 486 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Download MelonLoader Artifact
if: env.MELONLOADER_BRANCH != ''
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
Expand Down
6 changes: 3 additions & 3 deletions BloonsTD6 Mod Helper/Api/Bloons/BloonModelUtils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Il2CppAssets.Scripts.Models.Bloons.Behaviors;
using Il2CppAssets.Scripts.Utils;
using Il2CppAssets.Scripts.Models.Bloons;
using Il2CppAssets.Scripts.Models.Bloons.Behaviors;
namespace BTD_Mod_Helper.Api.Bloons;

/// <summary>
Expand All @@ -19,7 +19,7 @@ public static string ConstructBloonId(string bloonName, bool camo, bool regrow,
{
var baseName = bloonName.Replace("Camo", "").Replace("Regrow", "").Replace("Fortified", "");

return BloonTypeUtility.BloonType(baseName, camo, regrow, fortified);
return BloonType.Construct(baseName, camo, regrow, fortified);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/Api/Bloons/ModRoundSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ internal RoundSetModel GetDefaultRoundSetModel()
roundSetModel.rounds[i] = i < baseRounds.Count
? baseRounds[i].Duplicate()
: new RoundModel("", new Il2CppReferenceArray<BloonGroupModel>(0));
roundSetModel.rounds[i].emissions_ = null;
roundSetModel.rounds[i]!.emissions_ = null;
}

return roundSetModel;
Expand Down
4 changes: 2 additions & 2 deletions BloonsTD6 Mod Helper/Api/Commands/ExportDisplayCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ private void Export(UnityDisplayNode node)
var i = 0;
foreach (var frame in customSpriteFrameAnimator.frames)
{
var path = Path.Combine(FileIOHelper.sandboxRoot, renderer.name + ".png");
var path = Path.Combine(FileIOHelper.sandboxRoot, $"{renderer.name}_{i}.png");
frame.TrySaveToPNG(path);
ModHelper.Msg($"Saved {path}");
i++;
}
}
else
{
var path = Path.Combine(FileIOHelper.sandboxRoot, renderer.name + ".png");
var path = Path.Combine(FileIOHelper.sandboxRoot, $"{renderer.name}.png");
if (renderer.Is(out SpriteRenderer spriteRenderer))
{
spriteRenderer.sprite.texture?.TrySaveToPNG(path);
Expand Down
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/Api/Commands/GenerateCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if DEBUG
namespace BTD_Mod_Helper.Api.Commands;

#if DEBUG
internal class GenerateCommand : ModCommand
{
public override string Command => "generate";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#if DEBUG
using BTD_Mod_Helper.Api.Internal;

namespace BTD_Mod_Helper.Api.Commands;

#if DEBUG
internal class GenerateUpgradeTypesCommand : ModCommand<GenerateCommand>
{
public override string Command => "upgrades";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if DEBUG
using BTD_Mod_Helper.Api.Internal;
namespace BTD_Mod_Helper.Api.Commands;

#if DEBUG
internal class GenerateVanillaSpritesCommand : ModCommand<GenerateCommand>
{
public override string Command => "sprites";
Expand Down
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/Api/Commands/ModCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal bool ExecuteInternal(out string resultText)
}
catch (Exception e)
{
ModHelper.Error(e);
ModHelper.Error(e.Message);
}

if (string.IsNullOrEmpty(resultText)) resultText = "Command failed.";
Expand Down
10 changes: 7 additions & 3 deletions BloonsTD6 Mod Helper/Api/Commands/OpenProfileFolderCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ internal class OpenProfileFolderCommand : ModCommand<OpenFolderCommand>
{
public override string Command => "profile";
public override string Help => "Opens the folder where profile data is stored";

public override bool Execute(ref string resultText)
{
ProcessHelper.OpenFolder(Path.GetDirectoryName(Game.Player.dataFile.file.path));
return true;
if (Game.Player.dataFile.file.TryGetLocalFilePath(out var path))
{
ProcessHelper.OpenFolder(path);
return true;
}
return false;
}
}
2 changes: 2 additions & 0 deletions BloonsTD6 Mod Helper/Api/Enums/UpgradeType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static class UpgradeType
public const string TackSprayer = "Tack Sprayer";
public const string Overdrive = "Overdrive";
public const string TheTackZone = "The Tack Zone";
public const string TackshooterParagon = "TackShooter Paragon";
public const string Permafrost = "Permafrost";
public const string ColdSnap = "Metal Freeze";
public const string IceShards = "Ice Shards";
Expand Down Expand Up @@ -740,6 +741,7 @@ public static class UpgradeType
{ "TackSprayer", TackSprayer },
{ "Overdrive", Overdrive },
{ "TheTackZone", TheTackZone },
{ "TackshooterParagon", TackshooterParagon },
{ "Permafrost", Permafrost },
{ "ColdSnap", ColdSnap },
{ "IceShards", IceShards },
Expand Down
Loading

0 comments on commit 860e2d8

Please sign in to comment.