anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
46 stars 16 forks source link

Changing a ItemSlot's Background Icon/Color dynamically causes crash. #3305

Open severedskullz opened 11 months ago

severedskullz commented 11 months ago

Game Version

1.18.15

Platform

Windows

Modded

Modded

SP/MP

Singleplayer

Description

I have a GUI I have made in which I am trying to dynamically set the background color and icon based on input from the user to denote different slot filters. Upon changing a ItemSlot's Background Icon or Background Color while the GUI is open throws an error with the following stacktrace:

System.Collections.Generic.KeyNotFoundException: The given key 'vicon-boots-65d934' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Vintagestory.API.Client.GuiElementItemSlotGridBase.RenderInteractiveElements(Single deltaTime) in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Inventory\GuiElementItemSlotGridBase.cs:line 452
   at Vintagestory.API.Client.GuiComposer.Render(Single deltaTime) in VintagestoryApi\Client\UI\GuiComposer.cs:line 695
   at Vintagestory.API.Client.GuiDialog.OnRenderGUI(Single deltaTime) in VintagestoryApi\Client\UI\Dialog\GuiDialog.cs:line 375
   at Vintagestory.API.Client.GuiDialogBlockEntity.OnRenderGUI(Single deltaTime) in VintagestoryApi\Client\UI\Dialog\GuiDialogBlockEntity.cs:line 114
   at Vintagestory.Client.NoObf.GuiManager.OnRenderFrameGUI(Single deltaTime) in VintagestoryLib\Client\Systems\Gui\GuiManager.cs:line 301
   at Vintagestory.API.Client.DummyRenderer.OnRenderFrame(Single deltaTime, EnumRenderStage stage) in VintagestoryApi\Client\API\IClientEventAPI.cs:line 82
   at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 191
   at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\ClientMain.cs:line 787
   at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer(Single dt) in VintagestoryLib\Client\ClientMain.cs:line 965
   at Vintagestory.Client.GuiScreenRunningGame.RenderToDefaultFramebuffer(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 241
   at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 668
   at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 643
   at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 77
   at OpenTK.Windowing.Desktop.GameWindow.Run()
   at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 313
   at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 129
   at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 102
   at Vintagestory.Client.ClientProgram..ctor(String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 129
   at Vintagestory.Client.ClientProgram.Main(String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 48
   at VintagestoryClientWindows.ClientWindows.Main(String[] args) in VintagestoryClient\Windows\ClientWindows.cs:line 9

How to reproduce

No response

Screenshots

No response

Logs

No response

Hellaeh commented 10 months ago

I've made a PR, but cannot test it myself. Missing dep!

Hellaeh commented 10 months ago

Ok. I finally did test my PR, was a problem on my side... Was compiling with dotnet build --no-incremental -c release /p:Optimize=true /p:DebugType=None /p:DebugSymbols=false and VS didn't like that.