Page 1 of 1

[2.0.76] Several inconsistent behaviours for QualityPrototype.draw_sprite_by_default

Posted: Sat Mar 21, 2026 7:58 am
by elliottcable
When enabling rendering of the default/null/"normal" qualityprototype's icon / disabling rendering of other, non-"normal" QualityPrototype instances, I've collated quite a few odd behaviours:

Code: Select all

data.raw.quality.normal.draw_sprite_by_default = true
data.raw.quality.customquality.draw_sprite_by_default = false
  • Enabling draw_sprite_by_default for "normal" will make the "quality-comparison-mode: any quality" option in filters/icon-selectors/comparators/etc, appear with a miniature 'normal quality' icon underneath it:
    03-21-2026, 02-16-28.png
    03-21-2026, 02-16-28.png (351.73 KiB) Viewed 388 times
  • If additional custom qualities are present, so that the widget switches from the 5-select row to a drop-down, this happens to every quality icon in the drop-down:
    03-21-2026, 02-20-47.png
    03-21-2026, 02-20-47.png (54.08 KiB) Viewed 388 times
  • While enabling draw_sprite_by_default for "normal" will make its tag appear on entities on the ground, and in alt-mode filter-icons, it still doesn't appear for items on belts, nor for items in chests, the filter-list in the chest GUI, nor the hover-listing on the right side of the screen in-world:
    03-21-2026, 02-25-09.png
    03-21-2026, 02-25-09.png (835.71 KiB) Viewed 388 times
    03-21-2026, 03-16-42.png
    03-21-2026, 03-16-42.png (1.77 MiB) Viewed 378 times
  • However, the inverse is true for non-"normal" qualities - creating a custom quality, then disabling draw_sprite_by_default, causes the quality-icon to disappear everywhere except belts:
    03-21-2026, 02-56-39.png
    03-21-2026, 02-56-39.png (1.52 MiB) Viewed 388 times
  • Indicators on buildings placed in the world, too, are unaffected by the setting: all non-null qualities are drawn in-world; and "normal" is never drawn in-world:
    03-21-2026, 05-16-23.png
    03-21-2026, 05-16-23.png (904.06 KiB) Viewed 340 times
Closest existing bug I could find via search was this: 121207

Here's a mod-file that reproduces, as minimal as I could make it; and a save-file using that mod, same as the screenshots:
TestEnableNormalQualityIcon_0.0.1.zip
(5.93 KiB) Downloaded 20 times
test-enable-normal-quality-icon.1.zip
(2.04 MiB) Downloaded 21 times
Apologies if this should have been multiple reports - each individual behaviour seemed tiny; they all seem interrelated; and creating separate reproduction-mods/savefiles would have been prohibitive. (Also for the huge images, I couldn't figure out how to resize [attachment] in BBcode. :cry: )

Re: [2.0.76] Several inconsistent behaviours for QualityPrototype.draw_sprite_by_default

Posted: Sat Mar 21, 2026 8:31 am
by elliottcable
For whatever it's worth - I'm doing something weird, and the behaviour of "turning on the sprite-drawing of the normal icon" being silly isn't too surprising. It probably precludes the whole mod I was trying to build, but also, the mod I'm trying to build is a horrible hack in the first place.

But, based on my investigation, it doesn't feel like there's currently any situation where draw_sprite_by_default is useful? Not only can you not use it to enable the drawing of vanilla normal-quality (okay, fine, that's a wild plan, lol); but it also isn't consistently useful to disable the drawing of a custom modded quality (i.e. the still-being-drawn-on-belts, etc in the above post.) Unless I'm missing something, it's basically a footgun of a flag right now, haha.

Re: [2.0.76] Several inconsistent behaviours for QualityPrototype.draw_sprite_by_default

Posted: Tue Apr 07, 2026 5:56 pm
by causa-sui
Edit:
0.000 2026-04-07 13:24:13; Factorio 2.0.76 (build 84451, linux64, steam, space-age)
0.000 Operating system: Linux
I think I've hit this problem from a different angle.

I'm setting draw_sprite_by_default = true and hidden = false on the normal quality prototype in data-final-fixes.lua. I've confirmed via log() that the values stick. When the setting (not shown) is enabled, the normal quality indicator icon shows up in item filters and logistic slot indicators as expected, but it's missing on items in the inventory (player, chest, assembler etc). Other quality tiers work as expected.

Is rendering the quality badge on inventory items hardcoded to skip level 0? Or is there a prototype field I'm missing?

Code: Select all

local transparent = "__quality-sprite-toggle__/graphics/transparent.png"

local quality_setting_map = {
  ["normal"]    = "qst-show-normal",
  ["uncommon"]  = "qst-show-uncommon",
  ["rare"]      = "qst-show-rare",
  ["epic"]      = "qst-show-epic",
  ["legendary"] = "qst-show-legendary",
}

for quality_name, setting_name in pairs(quality_setting_map) do
  local show = settings.startup[setting_name].value
  local quality_proto = data.raw["quality"][quality_name]
  if not quality_proto then goto continue end

  if show then
    quality_proto.draw_sprite_by_default = true
    quality_proto.hidden = false
  else
    quality_proto.icons = {
      {
        icon = transparent,
        icon_size = 1,
      }
    }
  end

  ::continue::
end
Screenshot attached: I can see in alt mode that this cryo plant is making normal quality explosives, but the explosives in the machine don't get the indicator icon 🧐