Skip to content

Commit

Permalink
Merge pull request #59 from Vapok/vapok/r1.6.3
Browse files Browse the repository at this point in the history
Release 1.6.3
  • Loading branch information
Vapok authored Feb 10, 2023
2 parents 11855b8 + 670d47c commit 6d47a43
Show file tree
Hide file tree
Showing 23 changed files with 201 additions and 229 deletions.
1 change: 1 addition & 0 deletions AdventureBackpacks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Translations", "Translation
Translations\AdventureBackpacks.Russian.json = Translations\AdventureBackpacks.Russian.json
Translations\AdventureBackpacks.Korean.json = Translations\AdventureBackpacks.Korean.json
Translations\AdventureBackpacks.Czech.json = Translations\AdventureBackpacks.Czech.json
Translations\AdventureBackpacks.Swedish.json = Translations\AdventureBackpacks.Swedish.json
EndProjectSection
EndProject
Global
Expand Down
4 changes: 2 additions & 2 deletions AdventureBackpacks/AdventureBackpacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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.6.2";
private const string _version = "1.6.3";

//Interface Properties
public string PluginId => _pluginId;
Expand Down Expand Up @@ -114,7 +114,7 @@ private void Update()
Player.m_localPlayer.QuickDropBackpack();
}

InventoryPatches.ProcessItemsAddedCache();
InventoryPatches.ProcessItemsAddedQueue();
}

public void InitializeBackpacks(object send, EventArgs args)
Expand Down
1 change: 1 addition & 0 deletions AdventureBackpacks/AdventureBackpacks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="Extensions\ItemDataExtensions.cs" />
<Compile Include="Extensions\PlayerExtensions.cs" />
<Compile Include="Features\QuickTransfer.cs" />
<Compile Include="Patches\Door.cs" />
<Compile Include="Patches\FejdStartup.cs" />
<Compile Include="Patches\GuiBar.cs" />
<Compile Include="Patches\Humanoid.cs" />
Expand Down
1 change: 0 additions & 1 deletion AdventureBackpacks/Assets/Factories/FactoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ internal FactoryBase(ILogIt logger, ConfigSyncBase configs)
_logger = logger;
_config = configs;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;

}
}
11 changes: 0 additions & 11 deletions AdventureBackpacks/Assets/Items/BackpackItems/BackpackMeadows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public BackpackMistlands(string prefabName, string itemName) : base(prefabName,
internal sealed override void RegisterConfigSettings()
{
RegisterBackpackBiome(BackpackBiomes.Mistlands);
RegisterBackpackSize(1,4,4);
RegisterBackpackSize(1,8,2);
RegisterBackpackSize(2,5,4);
RegisterBackpackSize(3,6,4);
RegisterBackpackSize(4,7,4);
Expand All @@ -51,18 +51,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;

}
}
12 changes: 0 additions & 12 deletions AdventureBackpacks/Assets/Items/BackpackItems/BackpackMountains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;

}
}
12 changes: 0 additions & 12 deletions AdventureBackpacks/Assets/Items/BackpackItems/BackpackPlains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;

}
}
12 changes: 0 additions & 12 deletions AdventureBackpacks/Assets/Items/BackpackItems/BackpackSwamp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ internal override void UpdateStatusEffects(int quality, CustomSE statusEffects,
{
itemData.m_shared.m_movementModifier = SpeedMod.Value/quality;

switch (quality)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
((SE_Stats)statusEffects.Effect).m_addMaxCarryWeight = CarryBonus.Value * quality;

}
}
6 changes: 2 additions & 4 deletions AdventureBackpacks/Extensions/PlayerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public static void OpenBackpack(this Player player, bool track = true)

public static void QuickDropBackpack(this Player player)
{
AdventureBackpacks.Log.Message("Quick dropping backpack.");

if (player == null)
return;

Expand All @@ -76,7 +74,7 @@ public static void QuickDropBackpack(this Player player)
return;

AdventureBackpacks.QuickDropping = true;

AdventureBackpacks.Log.Message("Quick dropping backpack.");
// Unequip and remove backpack from player's back
// We need to unequip the item BEFORE we drop it, otherwise when we pick it up again the game thinks
// we had it equipped all along and fails to update player model, resulting in invisible backpack.
Expand All @@ -85,7 +83,7 @@ public static void QuickDropBackpack(this Player player)
player.m_inventory.RemoveItem(backpack.Item);

// This drops a copy of the backpack itemDrop.itemData
var itemDrop = ItemDrop.DropItem(backpack.Item, 1, player.transform.position + player.transform.forward + player.transform.up, player.transform.rotation);
var itemDrop = ItemDrop.DropItem(backpack.Item, 1, player.transform.position - player.transform.up - player.transform.up, player.transform.rotation);
itemDrop.Save();

InventoryGuiPatches.BackpackIsOpen = false;
Expand Down
23 changes: 23 additions & 0 deletions AdventureBackpacks/Patches/Door.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using AdventureBackpacks.Extensions;
using HarmonyLib;

namespace AdventureBackpacks.Patches;

public static class DoorPatches
{
[HarmonyPatch(typeof(Door), nameof(Door.HaveKey))]
static class HaveDoorKeyPatch
{
static void Postfix(Door __instance, ref bool __result)
{
if (__instance == null || Player.m_localPlayer == null)
return;

if (Player.m_localPlayer.IsBackpackEquipped() && __result == false)
{
var backpack = Player.m_localPlayer.GetEquippedBackpack();
__result = (__instance.m_keyItem == null || backpack.GetInventory().HaveItem(__instance.m_keyItem.m_itemData.m_shared.m_name));
}
}
}
}
2 changes: 0 additions & 2 deletions AdventureBackpacks/Patches/FejdStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace AdventureBackpacks.Patches;

public class FejdStartupPatches
{

[HarmonyPatch(typeof(FejdStartup), nameof(FejdStartup.Awake))]
[HarmonyAfter("org.bepinex.helpers.LocalizationManager")]
[HarmonyBefore("org.bepinex.helpers.ItemManager")]
Expand All @@ -15,5 +14,4 @@ static void Prefix()
AdventureBackpacks.Waiter.ValheimIsAwake(true);
}
}

}
2 changes: 0 additions & 2 deletions AdventureBackpacks/Patches/Humanoid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ static void Postfix(ItemDrop.ItemData __0, bool __result)

if ( Player.m_localPlayer == null && !__result)
return;

var player = Player.m_localPlayer;

var item = __0;

Expand Down
Loading

0 comments on commit 6d47a43

Please sign in to comment.