Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
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
4 changes: 2 additions & 2 deletions ABearCodes.Valheim.SimpleRecycling/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.13")]
[assembly: AssemblyFileVersion("0.0.13")]
[assembly: AssemblyVersion("0.0.15")]
[assembly: AssemblyFileVersion("0.0.15")]
4 changes: 2 additions & 2 deletions ABearCodes.Valheim.SimpleRecycling/UI/InventoryGuiPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void OnTabCraftPressedAlsoEnableRecycling1(InventoryGui __instance)
{
Plugin.RecyclingTabButtonHolder.SetInteractable(true);
// temporary fix for compatibility with EpicLoot
InventoryGui.instance.UpdateCraftingPanel(false);
__instance.UpdateCraftingPanel(false);
}

[HarmonyPrefix]
Expand Down Expand Up @@ -90,7 +90,7 @@ public static void SetRecipe(this InventoryGui __instance, int index, bool cente

[HarmonyReversePatch]
[HarmonyPatch(typeof(InventoryGui), "GetSelectedRecipeIndex")]
public static int GetSelectedRecipeIndex(this InventoryGui __instance)
public static int GetSelectedRecipeIndex(this InventoryGui __instance, bool acceptOneLevelHigher)
{
throw new NotImplementedException("stub");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void UpdateCraftingPanel()
if (igui.get_m_availableRecipes().Count > 0)
{
if (igui.get_m_selectedRecipe().Key != null)
igui.SetRecipe(igui.GetSelectedRecipeIndex(), true);
igui.SetRecipe(igui.GetSelectedRecipeIndex(false), true);
else
igui.SetRecipe(0, true);
}
Expand Down Expand Up @@ -185,8 +185,8 @@ public void UpdateRecipe(Player player, float dt)
//todo: optimize reflection calls
var igui = InventoryGui.instance;

var selectedRecipeIndex = igui.GetSelectedRecipeIndex();
if (selectedRecipeIndex != -1 && selectedRecipeIndex < _recyclingAnalysisContexts.Count)
var selectedRecipeIndex = igui.GetSelectedRecipeIndex(false);
if (selectedRecipeIndex > -1 && _recyclingAnalysisContexts.Count > 0 && selectedRecipeIndex < _recyclingAnalysisContexts.Count)
{
var context = _recyclingAnalysisContexts[selectedRecipeIndex];
var newContext = new RecyclingAnalysisContext(context.Item);
Expand All @@ -211,7 +211,7 @@ public void UpdateRecipe(Player player, float dt)
}
if (igui.get_m_selectedRecipe().Key)
{
var analysisContext = _recyclingAnalysisContexts[igui.GetSelectedRecipeIndex()];
var analysisContext = _recyclingAnalysisContexts[igui.GetSelectedRecipeIndex(false)];
igui.m_recipeIcon.enabled = true;
igui.m_recipeName.enabled = true;
igui.m_recipeDecription.enabled = true;
Expand Down