[0.14.22] Problems with virtual signals and subgroups

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

[0.14.22] Problems with virtual signals and subgroups

Post by theRustyKnife »

If you add some signals into different subgroups, the signal selection window freaks out a bit. The signals are spread randomly, sometimes not shown at all. The subgroups get cut in multiple parts sometimes.

Throwing the bellow code into a data.lua file should reproduce it:

Code: Select all

data:extend{{
	type = "item-group",
	name = "test-group",
	icon = "__core__/graphics/clear.png",
	order = "zzz",
}}

local group_number = 4 -- if there's just one group everything seems to be fine
local signal_number = 20

-- make sure the signals can be divided into the subgroups
while signal_number % group_number ~= 0 or signal_number <= 0 do signal_number = signal_number - 1; end

-- for naming the items
local global_index = 1

-- subgroup loop
for group_i = 1, group_number do
	local subgroup = "test-subgroup-" .. group_i
	
	data:extend{{
		type = "item-subgroup",
		name = subgroup,
		group = "test-group",
		order = "a[" .. group_i .. "]",
	}}
	
	-- signal loop
	for signal_i = 1, signal_number / group_number do
		data:extend{{
			type = "virtual-signal", -- type = "item", is fine
			name = "test-virtual-signal-" .. global_index,
			localised_name = "Item " .. global_index .. " in " .. group_i,
			icon = "__base__/graphics/icons/signal/signal_" .. (group_i % 10) .. ".png",
			subgroup = subgroup,
			stack_size = 100,
			flags = {},
			order = "aaa-" .. signal_i, -- if order is varying per item, some signals are not displayed at all (but sometimes they will reappear after re-opening the dialog)
		}}
		
		global_index = global_index + 1
	end
end
I'm running no mods aside from the one containing only the above code.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13344
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.14.22] Problems with virtual signals and subgroups

Post by Rseding91 »

Fixed for 0.15. The signals were not getting sorted by the subgroups properly so they would appear in what ever order they where defined in the lua files after accounting for the sort order string and entity name sorting.

Fluids had the same problem.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”