Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(du -sh /c/Users/mrcook1e/Desktop/Auga/.claude/worktrees/flamboyant-kepler/Auga/*.zip)",
"Bash(ls /c/Users/mrcook1e/Desktop/Auga/.claude/worktrees/flamboyant-kepler/Auga/*.json)",
"Bash(xargs ls:*)"
]
}
}
5 changes: 2 additions & 3 deletions Auga/API.Common.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Fishlabs;
using TMPro;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

Expand Down Expand Up @@ -37,7 +36,7 @@ public class CraftingControls
public TMP_Text CraftAmountText;
public GameObject CraftAmountBG;
public GameObject Amount;
public GuiInputField InputAmount;
public TMP_InputField InputAmount;
public TMP_Text InputText;
}
}
Binary file removed Auga/Auga-1.1.1-TS.zip
Binary file not shown.
Binary file removed Auga/Auga-1.1.1.zip
Binary file not shown.
Binary file removed Auga/Auga-1.1.2-TS.zip
Binary file not shown.
Binary file removed Auga/Auga-1.1.2.zip
Binary file not shown.
Binary file removed Auga/Auga-1.1.3-TS.zip
Binary file not shown.
Binary file removed Auga/Auga-1.1.3.zip
Binary file not shown.
44 changes: 28 additions & 16 deletions Auga/Auga.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public enum StatBarTextPosition { Off = -1, Above, Below, Center, Start, End };
public static bool HasSimpleRecycling;
public static bool HasChatter;
public static bool HasSearsCatalog;
public static bool HasJewelcrafting;

private static Auga _instance;
private Harmony _harmony;
Expand All @@ -135,6 +136,27 @@ public enum StatBarTextPosition { Off = -1, Above, Below, Center, Start, End };

public static Auga instance => _instance;

// Статический конструктор — регистрируем AssemblyResolve до того как CLR
// попытается разрешить APIManager/fastJSON/Unity.Auga при загрузке типа.
static Auga()
{
AppDomain.CurrentDomain.AssemblyResolve += ResolveEmbeddedAssembly;
}

private static Assembly ResolveEmbeddedAssembly(object sender, ResolveEventArgs args)
{
var shortName = new AssemblyName(args.Name).Name + ".dll";
var resourceName = $"Auga.{shortName}";
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
if (stream == null) return null;
using (stream)
{
var data = new byte[stream.Length];
stream.Read(data, 0, data.Length);
return Assembly.Load(data);
}
}

public void Awake()
{
_instance = this;
Expand All @@ -147,20 +169,8 @@ public void Awake()
Debug.LogWarning($"Project Auga - Version {Assembly.GetExecutingAssembly().GetName().Version}");
Debug.LogWarning($"Valheim - Version {(global::Version.GetVersionString())}");

if ((global::Version.CurrentVersion.m_minor == 217 && global::Version.CurrentVersion.m_patch >= 27 ) || global::Version.CurrentVersion.m_minor > 217)
{
Debug.LogWarning($"GAME VERSION CHECK - PASSED");
Debug.LogWarning($"==============================================================================");
}
else
{
Debug.LogError($">>>>>>>>> GAME VERSION MISMATCH - EXITING <<<<<<<<");
Debug.LogWarning($"==============================================================================");
Thread.Sleep(10000);

Destroy(this);
return;
}
// Version gate removed — PTB check is no longer needed for current Valheim.
Debug.LogWarning($"==============================================================================");
}
}

Expand All @@ -175,8 +185,9 @@ public void Awake()
HasBetterTrader = Chainloader.PluginInfos.ContainsKey("Menthus.bepinex.plugins.BetterTrader");
HasMultiCraft = Chainloader.PluginInfos.TryGetValue("maximods.valheim.multicraft", out var multiCraftPlugin);
HasSimpleRecycling = Chainloader.PluginInfos.TryGetValue("com.github.abearcodes.valheim.simplerecycling", out var recyclingPlugin);
HasChatter = Chainloader.PluginInfos.ContainsKey("redseiko.valheim.chatter");
HasSearsCatalog = Chainloader.PluginInfos.ContainsKey("redseiko.valheim.searscatalog");
HasChatter = Chainloader.PluginInfos.TryGetValue("redseiko.valheim.chatter", out var chatterPlugin);
HasSearsCatalog = Chainloader.PluginInfos.TryGetValue("redseiko.valheim.searscatalog", out var searsPlugin);
HasJewelcrafting = Chainloader.PluginInfos.TryGetValue("org.bepinex.plugins.jewelcrafting", out var jewelcraftingPlugin);

_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), PluginID);

Expand Down Expand Up @@ -437,6 +448,7 @@ public void OnDestroy()
private void LoadDependencies()
{
var assembly = Assembly.GetCallingAssembly();
LoadEmbeddedAssembly(assembly, "APIManager.dll");
LoadEmbeddedAssembly(assembly, "fastJSON.dll");
LoadEmbeddedAssembly(assembly, "Unity.Auga.dll");
}
Expand Down
Loading