Page 1 of 1

Misleading error source reported for styles

Posted: Tue May 26, 2020 6:13 pm
by moon69
"StyleTestA" mod correctly implements a style, and allows the game to load...

Code: Select all

local style = data.raw["gui-style"].default
style.StyleTestA =
{
  type = "button_style",
  parent = "frame_action_button",
  width = 66
}
"StyleTestB" mod has a style error, and Factorio doesn't load ...

Code: Select all

local style = data.raw["gui-style"].default
style.StyleTestB =
{
  type = "button_style",
  parent = "close_button",
  width = 66
}
The load error though makes it look like StyleTestA is at least partially to blame.
StyleTestB.png
StyleTestB.png (1.13 MiB) Viewed 989 times

Prototype/GuiStyle says we have to use ["gui-style"].default.

Is there a better/recommended way of defining a style?

Re: Misleading error source reported for styles

Posted: Tue May 26, 2020 9:40 pm
by darkfrei
moon69 wrote:
Tue May 26, 2020 6:13 pm
Is there a better/recommended way of defining a style?
There is definition of the style frame_action_button
2020-05-26T23_39_19-Window.png
2020-05-26T23_39_19-Window.png (7.98 KiB) Viewed 972 times
but no style close_button

Re: Misleading error source reported for styles

Posted: Wed May 27, 2020 5:06 am
by moon69
Thanks Darkfrei, but I am actually wondering how to avoid mod A being disabled when the error is actually in unrelated mod B?
StyleTestB2.png
StyleTestB2.png (60.29 KiB) Viewed 955 times

Re: Misleading error source reported for styles

Posted: Wed May 27, 2020 5:28 am
by posila
I improved mod tracking for "Parent style not found" error for next release (0.18.28)

Re: Misleading error source reported for styles

Posted: Wed May 27, 2020 7:15 pm
by moon69
Cool thanks.