LucidSigma / ImprovedItemInfo

A Terraria mod that displays extra information about weapons.
Other
0 stars 0 forks source link

Ammo info render issue #1

Closed Metallonality closed 1 year ago

Metallonality commented 1 year ago

So, tmodloader only with this mod give no info (name, damage, amount, etc.) about ammo any type (throwable doesn't count) Log says (only once per start) when i try to recreate:

System.NullReferenceException: Object reference not set to an instance of an object. at Terraria.UI.Chat.ChatManager.ParseMessage(String text, Color baseColor) in tModLoader\Terraria\UI\Chat\ChatManager.cs:line 61 at Terraria.Main.MouseText_DrawItemTooltip(MouseTextCache info, Int32 rare, Byte diff, Int32 X, Int32 Y) in tModLoader\Terraria\Main.cs:line 15364 at Terraria.Main.MouseTextInner(MouseTextCache info) in tModLoader\Terraria\Main.cs:line 15279 at Terraria.Main.DrawPendingMouseText() in tModLoader\Terraria\Main.cs:line 34556 at Terraria.Main.DrawInterface_41_InterfaceLogic4() in tModLoader\Terraria\Main.cs:line 34549 at Terraria.Main.<>c."SetupDrawInterfaceLayers"b158538() in tModLoader\Terraria\Main.cs:line 34471 at Terraria.UI.GameInterfaceLayer.Draw() in tModLoader\Terraria\UI\GameInterfaceLayer.cs:line 41 at Terraria.Main.DrawInterface(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 34479 at Terraria.Main.DoDraw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 49341 at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48654 at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562 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.LaunchGame(Boolean isServer) in tModLoader\Terraria\Program.cs:line 231 at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs) in tModLoader\Terraria\Program.cs:line 192 at MonoLaunch.<>cDisplayClass1_0."Main"b__0() in tModLoader\Terraria\MonoLaunch.cs:line 56 at System.Threading.Thread.StartCallback()

Every "" replace <> because of github

LucidSigma commented 1 year ago

I've started looking into this but couldn't manage to replicate it. The stacktrace you've posted doesn't say much either (although the third line with MouseText_DrawItemTooltip gives me a rough idea, but its still very vague).

Here's what I suggest could be done:

In the meantime, I'll go through the code that touches the ammo tooltips to see if there is anything that might be causing this. If you find any other useful logs or screenshots hereafter, feel free to share.

Thanks!

Metallonality commented 1 year ago

This is ammo tooltips quite literally. Without it ammo info works fine

LucidSigma commented 1 year ago

Awesome; thanks for confirming. Just to make sure, it's only the Display Ammo Tooltips option that's causing thing, nothing else?

If so, I'm thinking of just removing the new ammo tooltips entirely. I've been having some other issues regarding them so I think the best call of action is for me to remove them.

Metallonality commented 1 year ago

So i'm just dumb and (mostly) blind because i'm miss first item

It's works FINE even with ammo tooltips but problem is that it's only works on english

I'm really sorry that i wasted your time

LucidSigma commented 1 year ago

No worries at all! You've actually found an issue. Even though there is no current support for other locales, it should just leave the tooltips untouched in other languages (it shouldn't remove them nor cause those exceptions in the logs). I'll change the language of my Terraria client and have a proper look at it to see what is causing these issues when I have the time.

I'll probably also implement some ad-hoc Google translate tooltips as basic support for other languages so that I know it works.

LucidSigma commented 1 year ago

Closing this issue. Adding support for other languages will be maintained with this issue.