mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-07-08 19:58:07 +00:00
feat(models): add block model boxes + picking
This commit is contained in:
@@ -44,7 +44,7 @@ internal class ModManager
|
||||
{
|
||||
try
|
||||
{
|
||||
mod.Instance.OnTick();
|
||||
WithContext(mod, () => mod.Instance.OnTick());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ internal class ModManager
|
||||
{
|
||||
try
|
||||
{
|
||||
action();
|
||||
WithContext(mod, action);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -72,4 +72,19 @@ internal class ModManager
|
||||
Logger.Debug(ex.StackTrace ?? "");
|
||||
}
|
||||
}
|
||||
|
||||
private static void WithContext(ModDiscovery.DiscoveredMod mod, Action action)
|
||||
{
|
||||
ModContext.ModId = mod.Metadata.Id;
|
||||
ModContext.ModFolder = mod.Folder;
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ModContext.ModId = null;
|
||||
ModContext.ModFolder = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user