Skip to content

Commit

Permalink
Merge pull request #134 from Vapok/vapok/1.7.9
Browse files Browse the repository at this point in the history
Additional Updates and Bug Fixes
  • Loading branch information
Vapok authored Nov 3, 2024
2 parents e3076dc + fb9b00a commit 2cc85cf
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion AdventureBackpacks/AdventureBackpacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AdventureBackpacks : BaseUnityPlugin, IPluginInfo
//Module Constants
private const string _pluginId = "vapok.mods.adventurebackpacks";
private const string _displayName = "Adventure Backpacks";
private const string _version = "1.7.8";
private const string _version = "1.7.9";

//Interface Properties
public string PluginId => _pluginId;
Expand Down
10 changes: 3 additions & 7 deletions AdventureBackpacks/Assets/Effects/EffectsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,17 @@ public void RegisterEffectConfiguration()

public virtual void AdditionalConfiguration(string configSection)
{
FillBiomeSettings();
return;
}
private void FillBiomeSettings()
{
foreach (BackpackBiomes backpackBiome in Enum.GetValues(typeof(BackpackBiomes)))
{
RegisterEffectBiomeQuality(backpackBiome,0,false);
RegisterEffectBiomeQuality(backpackBiome,0);
}
}
public void RegisterEffectBiomeQuality(BackpackBiomes biome, int defaultQuality = 0, bool fillUp = true)
public void RegisterEffectBiomeQuality(BackpackBiomes biome, int defaultQuality = 0)
{
if (biome == BackpackBiomes.None)
return;
Expand All @@ -165,10 +166,5 @@ public void RegisterEffectBiomeQuality(BackpackBiomes biome, int defaultQuality
}
}
}

if (fillUp)
{
FillBiomeSettings();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ internal sealed override void RegisterConfigSettings()
{
EffectsFactory.EffectList[BackpackEffect.FeatherFall].RegisterEffectBiomeQuality(BackpackBiomes.Mistlands, 3);
EffectsFactory.EffectList[BackpackEffect.Demister].RegisterEffectBiomeQuality(BackpackBiomes.Mistlands, 4);
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mistlands, 1);
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mistlands, 2);
EffectsFactory.EffectList[BackpackEffect.ColdResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mistlands, 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ internal sealed override void RegisterConfigSettings()
RegisterCarryBonus(20);
RegisterSpeedMod();
if ((BackpackBiome.Value & BackpackBiomes.Mountains) != 0)
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mountains, 1);
{
EffectsFactory.EffectList[BackpackEffect.FeatherFall].RegisterEffectBiomeQuality(BackpackBiomes.Mountains, 4);
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mountains, 1);
EffectsFactory.EffectList[BackpackEffect.ColdResistance].RegisterEffectBiomeQuality(BackpackBiomes.Mountains, 1);
}

}

internal override void UpdateStatusEffects(int quality, CustomSE statusEffects, List<HitData.DamageModPair> modifierList, ItemDrop.ItemData itemData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ internal sealed override void RegisterConfigSettings()
RegisterCarryBonus(25);
RegisterSpeedMod();
if ((BackpackBiome.Value & BackpackBiomes.Plains) != 0)
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Plains, 1);
{
EffectsFactory.EffectList[BackpackEffect.FrostResistance].RegisterEffectBiomeQuality(BackpackBiomes.Plains, 3);
EffectsFactory.EffectList[BackpackEffect.ColdResistance].RegisterEffectBiomeQuality(BackpackBiomes.Plains, 1);
}

}

internal override void UpdateStatusEffects(int quality, CustomSE statusEffects, List<HitData.DamageModPair> modifierList, ItemDrop.ItemData itemData)
Expand Down
8 changes: 4 additions & 4 deletions AdventureBackpacks/Patches/InventoryGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ static Exception Finalizer(Exception __exception, InventoryGrid grid, ItemDrop.I

public static bool CheckForTextInput()
{
var textInputVisible = false;
/*var textInputVisible = false;
var textInputPanel = GameObject.Find("_GameMain/LoadingGUI/PixelFix/IngameGui(Clone)/TextInput/panel");
if (textInputPanel != null)
{
if (textInputPanel.activeInHierarchy)
textInputVisible = true;
}
}*/

return textInputVisible;
return TextInput.IsVisible();
}

public static void ShowBackpack(Player player, InventoryGui instance)
Expand Down Expand Up @@ -287,7 +287,7 @@ CodeInstruction FindInstructionWithLabel(List<CodeInstruction> codeInstructions,
var menuVisibleMethod = AccessTools.DeclaredMethod(typeof(Menu), nameof(Menu.IsVisible));
var hideMethod = AccessTools.DeclaredMethod(typeof(InventoryGui), nameof(InventoryGui.Hide));
var showMethod = AccessTools.DeclaredMethod(typeof(InventoryGui), nameof(InventoryGui.Show));
var zInputKeyDown = AccessTools.DeclaredMethod(typeof(ZInput), nameof(ZInput.GetKeyDown));
var zInputKeyDown = AccessTools.DeclaredMethod(typeof(ZInput), nameof(ZInput.GetKeyDown), new []{typeof(KeyCode), typeof(bool)});
var zInputButtonDown = AccessTools.DeclaredMethod(typeof(ZInput), nameof(ZInput.GetButtonDown), new []{typeof(string)});

for (int i = 0; i < instrs.Count; ++i)
Expand Down
4 changes: 2 additions & 2 deletions AdventureBackpacks/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
#if ! API
[assembly: AssemblyVersion("1.7.8.0")]
[assembly: AssemblyFileVersion("1.7.8.0")]
[assembly: AssemblyVersion("1.7.9.0")]
[assembly: AssemblyFileVersion("1.7.9.0")]
#else
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
Expand Down
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# 1.7.8 - Forgot to increment the in-game version to 1.7.7
* In-game version now shows 1.7.8

# 1.7.9 - Additional Updates and Bug Fixes
* Updated Changes based on feedback from Pull Requests
* Fixed Bug that removed default effects from Backpacks
* Changed and updated default settings for Frost and Cold Resistances on Backpacks
* You may need to reset your Cold Resist configs for Cold Resist to show back up on Lox Hide Backpack

<details>
<summary><b>Changelog History</b> (<i>click to expand</i>)</summary>

# 1.7.8 - Forgot to increment the in-game version to 1.7.7
* In-game version now shows 1.7.8

# 1.7.7 - Updating for Ashland and Bog Witch Updates
* Updates to Valheim 0.219.14
* Updated ItemManager and Piece Manager
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AdventureBackpacks",
"version_number": "1.7.8",
"version_number": "1.7.9",
"website_url": "https://github.com/Vapok/AdventureBackpacks",
"description": "A Valheim Mod to add a catalogue of Adventuring Backpacks to the Game. These packs will grow and become more useful as the game progresses.",
"dependencies": [
Expand Down

0 comments on commit 2cc85cf

Please sign in to comment.