Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/modify player inventory toggle #753

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public class InventoryConfiguration : ServerSyncConfig<InventoryConfiguration>
{
public bool inventoryFillTopToBottom { get; internal set; } = false;
public bool mergeWithExistingStacks { get; internal set; } = false;
public bool modifyPlayerInventory { get; internal set; } = true;
public int playerInventoryRows { get; internal set; } = 4;
public int woodChestColumns { get; internal set; } = 5;
public int woodChestRows { get; internal set; } = 2;
Expand Down
2 changes: 1 addition & 1 deletion ValheimPlus/GameClasses/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class Inventory_Constructor_Patch

public static void Prefix(string name, ref int w, ref int h)
{
if (Configuration.Current.Inventory.IsEnabled)
if (Configuration.Current.Inventory.IsEnabled && Configuration.Current.Inventory.modifyPlayerInventory)
{
// Player inventory
if (h == 4 && w == 8 || name == "Inventory")
Expand Down
2 changes: 1 addition & 1 deletion ValheimPlus/GameClasses/InventoryGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class InventoryGui_Show_Patch

public static void Postfix(ref InventoryGui __instance)
{
if (Configuration.Current.Inventory.IsEnabled)
if (Configuration.Current.Inventory.IsEnabled && Configuration.Current.Inventory.modifyPlayerInventory)
{
RectTransform container = __instance.m_container;
RectTransform player = __instance.m_player;
Expand Down
3 changes: 3 additions & 0 deletions valheim_plus.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@ wagonExtraMassFromItems=0
; Change false to true to enable this section. https://valheim.plus/documentation/list#Inventory
enabled=false

; Change to false to make V+ not touch the player inventory size (needed for compatibility with some mods)
modifyPlayerInventory=true

; Player inventory number of rows (inventory is resized up to 6 rows, higher values will add a scrollbar). default 4, min 4, max 20
playerInventoryRows=4

Expand Down
5 changes: 5 additions & 0 deletions vplusconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,11 @@
"defaultValue": "false",
"defaultType": "bool"
},
"modifyPlayerInventory": {
"description": "Change to false to make V+ not touch the player inventory size (needed for compatibility with some mods)",
"defaultValue": "true",
"defaultType": "bool"
},
"playerInventoryRows": {
"description": "Player inventory number of rows (inventory is resized up to 6 rows, higher values will add a scrollbar)",
"defaultValue": "4",
Expand Down