Page 1 of 1

[wheybags] [17.68] Rich Text virtual-signal

Posted: Fri Sep 13, 2019 8:20 pm
by LuziferSenpai
Hey,

I dont know if this is intended or not, but when using a Signal which is also a Entity/Item orso, it shows the Rich Text, not the Icon.

Greetz,

Luzifer

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Tue Sep 17, 2019 2:46 pm
by wheybags
Not a bug, it's not a virtual signal, it's an item.

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Tue Sep 17, 2019 3:45 pm
by LuziferSenpai
So I need to check for it?

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Tue Sep 17, 2019 7:11 pm
by Optera
I read the report as rich text for virtual signal "iron-ore" not showing the associated icon.

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Tue Sep 17, 2019 7:14 pm
by Bilka
Optera wrote: Tue Sep 17, 2019 7:11 pm I read the report as rich text for virtual signal "iron-ore" not showing the associated icon.
There is no "iron-ore" virtual signal, so that would be working correctly. Virtual signals are only the colors + letters + numbers, not the items and fluids.

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Wed Sep 18, 2019 5:26 am
by Optera
Bilka wrote: Tue Sep 17, 2019 7:14 pm
Optera wrote: Tue Sep 17, 2019 7:11 pm I read the report as rich text for virtual signal "iron-ore" not showing the associated icon.
There is no "iron-ore" virtual signal, so that would be working correctly. Virtual signals are only the colors + letters + numbers, not the items and fluids.
[sarcasm]Factorio also ensures there's never any mod doing something like adding virtual with the same name as item.[/sarcasm]

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Wed Sep 18, 2019 6:08 am
by posila
Optera wrote: Wed Sep 18, 2019 5:26 am [sarcasm]Factorio also ensures there's never any mod doing something like adding virtual with the same name as item.[/sarcasm]
If your mod does add virtual signal prototype called iron-ore, there will be virtual signal called iron-ore in the game and

Code: Select all

[img=virtual-signal/iron-ore]
will show icon of your iron-ore virtual signal, that your mod defined.

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Wed Sep 18, 2019 6:19 am
by Optera
Correct.
I just made a mod to test it for fluid, item and entity.

Code: Select all

local icon_background = { icon = "__base__/graphics/icons/signal/signal_white.png", icon_size = 32 }

data:extend{
  {
    type = "item-subgroup",
    name = "virtual-signal-test",
    group = "signals",
    order = "zzz"
  },
}

local function make_signal(base)
  local vs_icons
  if base.icons then
    vs_icons = table.deepcopy(base.icons)
    table.insert(vs_icons, 1, icon_background)
  elseif base.icon then
    vs_icons = { icon_background, { icon = base.icon, icon_size = base.icon_size } }
  else
    vs_icons = { icon_background }
  end
  local signal = {
    type = "virtual-signal",
    name = base.name,
    icons = vs_icons,
    subgroup = "virtual-signal-test",
    order = "z",
  }
  data:extend{signal}
end

make_signal(data.raw.fluid["water"])
make_signal(data.raw.item["iron-plate"])
make_signal(data.raw.item["stone-furnace"])
In game result:
2019-09-18-08-18-23-9259121.png
2019-09-18-08-18-23-9259121.png (44.36 KiB) Viewed 2079 times

Re: [wheybags] [17.68] Rich Text virtual-signal

Posted: Wed Sep 18, 2019 8:24 am
by LuziferSenpai
I just need to to put the type as Rich Text Filter, in that way it should work.