Hey Kryzeth, could you please make it so that when cycling through machines, the ghost retains the selected quality?
I made the changes locally and it worked as intended, but I did not test with the quality mod disabled. It should still work though given that the underlying types define the quality fields whether the quality mod is installed or not.
I updated get_cursor_name() to this:
-- get item name and quality name from real item stack or ghost cursor
local function get_cursor(player)
local stack = player.cursor_stack and player.cursor_stack.valid_for_read and player.cursor_stack
if stack then
local stack_quality_name = stack.quality and stack.quality.name
return stack.name, stack_quality_name
end
local ghost = player.cursor_ghost
if ghost then
local ghost_quality_name = ghost.quality and ghost.quality.name
-- this will probably never trigger, since ghost.name seems to always return a prototype
if type(ghost.name) == "string" then
return ghost.name, ghost_quality_name
end
-- ghost.name usually returns a prototype, which itself has a .name field
if ghost.name and ghost.name.name then
return ghost.name.name, ghost_quality_name
end
end
end
Then in cycle_size() when it is called, I capture the quality name:
local current_name, quality_name = get_cursor(player)
In cycle_size()'s return statement, I include the quality field in the table that is parsed as an ItemIDAndQaulityIDPair:
return { name = entry.name, quality = quality_name }
Thanks! I love your mini/micro mods <3