Wider error notice boxes?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
jan1i3
Inserter
Inserter
Posts: 48
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

Wider error notice boxes?

Post by jan1i3 »

Intro
You can safely skip to the TL;DR. I just go over details and context.
Background
So with longer file names or bigger folder structures or function names, it's not uncommon to see error notice boxes like these:
Screenshot 2020-12-04 014858.png
Screenshot 2020-12-04 014858.png (35.61 KiB) Viewed 551 times
where the lines start with:
  • __modname__/
  • 'function_name'
  • <__modname__/file name because the function doesn't have a name:line>
and it might also start with other parts of the lines, depending on how they are wrapped

i personally had a hard time reading those kinds of stack traces, so i made this tiny mod

data.lua:

Code: Select all

local styles = data.raw["gui-style"]["default"]

styles.notice_textbox.maximal_width = 450 * 2 -- double the previous width
where that same notice box then looks like this:
Screenshot 2020-12-04 015417.png
Screenshot 2020-12-04 015417.png (33.37 KiB) Viewed 551 times
(this has a width of 690 right now, for the record)
Note
Yes this is a crafted error from a testing mod of mine, so not a "real world example". But i literally just have 1 actual mod which is too small to demonstrate what i mean, and imo this is still close enough to a real world example. I do work with my test mods after all, and i'm not the only one doing that.

And i know this might look minor especially with the debugger, but looking at screenshots of other people's errors in the discord i've especially noticed the difference to what i'm now used to - the wider boxes.
TL;DR / Question
i was wondering if i was the only one who likes looking at the wider box much more, because if there are a lot of people agreeing with me i would ask for this to be changed in the base game instead of me releasing that mod for the people who do care (which has the side effect of some other notice boxes potentially getting wider, but i couldn't find/think of one that would get stretched more)

And of course, as usual, i might be overlooking something.
Also known as JanSharp. jan1i3 was/is my old name ;)

robot256
Fast Inserter
Fast Inserter
Posts: 165
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Wider error notice boxes?

Post by robot256 »

I like it. Totally worth releasing IMO, to see if anyone can find a side effect and to show the devs that it works.

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1046
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Wider error notice boxes?

Post by NotRexButCaesar »

I like the wider box. Definitely much more readable and visually appealing.
: Alea jacta est. Determine what you intend to accomplish with an action before execution.
Have you ever heard the gospel? Most have not.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Wider error notice boxes?

Post by eradicator »

jan1i3 wrote:
Fri Dec 04, 2020 1:15 am
i was wondering if i was the only one who likes looking at the wider box much more,
Nope. Been doing almost exactly the same thing for ages in my local dev-only mod.

Code: Select all

data.raw["gui-style"].default .notice_textbox .width = 1920/2
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

PFQNiet
Fast Inserter
Fast Inserter
Posts: 235
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Wider error notice boxes?

Post by PFQNiet »

I'll just weigh in with my opinion: that box isn't there for us modders. It's there for players to copy the stack trace and send to us.

With debugadapter and VSCode you get immediate access to not only the line that broke, but a full stack trace, complete with variables (including up-values) and the global table. Everything you need to effectively debug.

So personally, I don't mind the extra width, although looking at images in this thread, yeah, I can see the benefit to making the box bigger. I just wouldn't use it myself either way.

User avatar
jan1i3
Inserter
Inserter
Posts: 48
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

Re: Wider error notice boxes?

Post by jan1i3 »

PFQNiet wrote:
Fri Dec 04, 2020 10:48 am
I'll just weigh in with my opinion: that box isn't there for us modders. It's there for players to copy the stack trace and send to us.

With debugadapter and VSCode you get immediate access to not only the line that broke, but a full stack trace, complete with variables (including up-values) and the global table. Everything you need to effectively debug.
I agree. It would only be for the cases where you do end up reading those errors and stack traces, where with the debugger that's very uncommon. But not everybody uses that either.
I don't really mind either way, it's more for other people.
Also known as JanSharp. jan1i3 was/is my old name ;)

User avatar
jan1i3
Inserter
Inserter
Posts: 48
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

Re: Wider error notice boxes?

Post by jan1i3 »

Alright, well it's a mod now: https://mods.factorio.com/mod/WiderNoticeTextBoxes
It being a mod doesn't really achive what i was hoping for, but hey if people like it they can have it now.
If it changes in the game itself i'll just deprecate the mod.
Also known as JanSharp. jan1i3 was/is my old name ;)

Post Reply

Return to “Modding discussion”