GithubHelp home page GithubHelp logo

notle0n / betterchests Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 154 KB

This is a Terraria mod which adds more sorting options for chests

Home Page: https://steamcommunity.com/sharedfiles/filedetails/?id=2563410612

License: GNU General Public License v3.0

C# 100.00%
tmodloader tmodloader-mod mod terraria terrariamod

betterchests's Introduction

Better Chests

This mod improves some aspects of vanilla chests!

Special Thanks to: direwolf420, darthmorf & jopojelly for a UIElement! Setnour6 for making the icon!

If you have any problems, bugs, or suggestions contact me on my discord!

Changes:

More Sorting Options

Right clicking on "Sort Items" in a chest or right clicking "Sort Inventory" will open a menu with more sort options.

img

Content Display

Hovering over a chest shows its contents.

img

Multiplayer Chests

Multiple players can use a chest at the same time now! (might still have some bugs, it's the hardest feature to test)

Ownership

You can claim chest ownership. This prevents other players from opening or quick stacking into chests which you own.

Longer Chest Names

Increased the maximum chest name length from 20 to 80. You can finally write longer chest names!

img

Searchbar

A search bar to search for items inside a chest quickly.

img

Confirmation Buttons

"Deposit All", "Loot all", "Sort" have a confirmation button now (separately toggleable in the config).

img

Change Default Sort

Added a Config option to change the functionality of the "Sort Items" button.

Hotkeys

Hotkeys for Deposit All, Loot All, Quick Stack, Restock, Sort Chest and Sort Inventory.

betterchests's People

Contributors

notle0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

betterchests's Issues

DepositAll/LootAll hotkeys deposit/loot piggybank even though it's not open

Needs testing.

Seems to be vanilla behavior. Snippet from ChestUI.LootAll:

for (int l = 0; l < 40; l++)
{
  if (player.bank.item[l].type > 0)
  {
    player.bank.item[l].position = player.Center;
    player.bank.item[l] = player.GetItem(Main.myPlayer, player.bank.item[l], false, false);
  }
}

There is no check if the player has the piggybank open or not.

Personal Chests

Idea

Users can mark Chests as their personal chest which prevents others from quick stacking into it. Trying to should give a error message along the lines "This chest is owned by ".
Hovering over the chest should also say who owns it.

Maybe expand the "Chest Lock" functionality to allow it to work on every chest the player owns and let owners open locked chests (naturally spawned chests are owned by nobody)

Implementation

Store a unique identifier for each Steam user in the world data for the chest. This data gets checked every time a personal action is taken.

Multiplayer "loot all" being disabled.

I found a bug in multiplayer, if you click on "loot all" but press esc to close the chest when the confirmation button is up it will disable the "loot all" button from working for that session, it doesn't happen in single player though.

Hover doesn't work on multiplayer sometimes

The hover to see items feature only works on multiplayer if another player has opened the chest before. If the chest unloads (?) the other player has to open it again for the feature to function.

Causing Crashes upon reloading world, specifically in host and play.

Me and my friends were doing a playthrough with this mod and kept getting the same error

System.NullReferenceException: Object reference not set to an instance of an object.

After doing more digging, we found that this was being caused by the BetterChests mod. I'll attach an entire log to sift through, but I believe it has something to do with UIs.
client.log

Buggy behaviour while interacting with furniture in certain situations

When hovering the cursor over storage furniture that's not loaded fully, it freezes the character in place and pauses actions like swinging a pickaxe until the cursor is moved away. Also neither the furniture nor the blocks it is on can be broken or used.

How to reproduce:

  1. Run alongside Magic Builder https://steamcommunity.com/sharedfiles/filedetails/?id=3024322683
  2. Build a structure that creates dressers (e.g. large house)
  3. optional: disable Magic Builder
  4. hover over dresser while standing nearby

Testing showed that manually placed dressers work as intended and that problem persists while Better Chests is the only mod installed.

[02:45:32.655] [Main Thread/WARN] [tML]: Silently Caught Exception: 
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at BetterChests.Edits.ChestHoverEdits.MouseOver(Int32 i, Int32 j, Int32 type) in BetterChests\src\Edits\ChestHoverEdits.cs:line 29
   at Terraria.ModLoader.TileLoader.MouseOver(Int32 i, Int32 j) in tModLoader\Terraria\ModLoader\TileLoader.cs:line 947
   at Terraria.Player.TileInteractionsMouseOver(Int32 myX, Int32 myY) in tModLoader\Terraria\Player.cs:line 28250
   at Terraria.Player.TileInteractionsCheck(Int32 myX, Int32 myY) in tModLoader\Terraria\Player.cs:line 25574
   at Terraria.Player.LookForTileInteractions() in tModLoader\Terraria\Player.cs:line 25477
   at Terraria.Player.Update(Int32 i) in tModLoader\Terraria\Player.cs:line 22472
   at Terraria.Main.DoUpdateInWorld(Stopwatch sw) in tModLoader\Terraria\Main.cs:line 14967
   at Terraria.Main.DoUpdate(GameTime& gameTime) in tModLoader\Terraria\Main.cs:line 14603
   at Terraria.Main.Update(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 14141
   at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 546
   at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
   at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
   at Terraria.Program.RunGame() in tModLoader\Terraria\Program.cs:line 266
   at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 240
   at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs) in tModLoader\Terraria\Program.cs:line 213
   at Terraria.MonoLaunch.Main_End(String[] args) in tModLoader\Terraria\MonoLaunch.cs:line 78
   at Terraria.MonoLaunch.<>c__DisplayClass1_0.<Main>b__1() in tModLoader\Terraria\MonoLaunch.cs:line 64
   at System.Threading.Thread.StartCallback()

Error on mod load

Running on latest stable version of tmodloader.
The error:

[22:13:01.384] [.NET ThreadPool Worker/ERROR] [tML]: An error occurred while loading BetterChests v1.7.1.1
The mod(s) have been automatically disabled.
Newtonsoft.Json.JsonException: Exception of type 'Newtonsoft.Json.JsonException' was thrown.
   at BetterChests.SortOption.SortOptionToStringConverter.ReadJson(JsonReader reader, Type objectType, SortOption existingValue, Boolean hasExistingValue, JsonSerializer serializer) in BetterChests/src/SortOption.cs:line 52
   at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
   at Newtonsoft.Json.JsonSerializer.PopulateInternal(JsonReader reader, Object target)
   at Newtonsoft.Json.JsonConvert.PopulateObject(String value, Object target, JsonSerializerSettings settings)
   at Terraria.ModLoader.Config.ConfigManager.Load(ModConfig config) in tModLoader\Terraria\ModLoader\Config\ConfigManager.cs:line 208
   at Terraria.ModLoader.Config.ConfigManager.Add(ModConfig config) in tModLoader\Terraria\ModLoader\Config\ConfigManager.cs:line 70
   at Terraria.ModLoader.Mod.AddConfig(String name, ModConfig mc) in tModLoader\Terraria\ModLoader\Mod.cs:line 123
   at Terraria.ModLoader.Mod.AutoloadConfig() in tModLoader\Terraria\ModLoader\Mod.cs:line 113
   at Terraria.ModLoader.ModContent.<>c.<Load>b__42_0(Mod mod) in tModLoader\Terraria\ModLoader\ModContent.cs:line 281
   at Terraria.ModLoader.ModContent.LoadModContent(CancellationToken token, Action`1 loadAction) in tModLoader\Terraria\ModLoader\ModContent.cs:line 368
   at Terraria.ModLoader.ModContent.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModContent.cs:line 277
   at Terraria.ModLoader.ModLoader.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModLoader.cs:line 127
[22:13:01.386] [.NET ThreadPool Worker/INFO] [tML]: Disabling Mod: BetterChests

Full log: client.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.