Page 1 of 1

[1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Posted: Sun May 15, 2022 7:52 pm
by curiosity
To reproduce:
1. Register the following custom input:

Code: Select all

  {
    type = "custom-input",
    name = "rb-open-selected",
    key_sequence = "ALT + mouse-button-1",
    include_selected_prototype = true,
  }
2. In-game execute the following command:

Code: Select all

/c script.on_event('rb-open-selected', function(e)
    local p = e.selected_prototype
    if p then
        game.print{'', e.tick, ' ', p.base_type, '.', p.derived_type, '.', p.name}
    else
        game.print{'', e.tick, ' nothing'}
    end
end)
3. Open an assembler with a recipe that has fluid ingredients or products and Alt-click on the fluid slot.

Observed:
The "nothing" message.

Expected:
A message with fluid type and name.

This works correctly for item slots, the discrepancy is quite unexpected.

Honktown has also confirmed that the bug exists for the mining fluid.

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Posted: Sun May 15, 2022 7:57 pm
by Honktown
Related: viewtopic.php?p=539988#p539988

Open prototypes explorer GUI doesn't work with input/output fluids on assemblers, nor the input fluid on miners, but does work on the output fluid (e.g. yes: crude-oil from a pumpjack, no: sulfuric acid for uranium-ore)

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Posted: Mon May 16, 2022 2:04 am
by robot256
The assembler fluidbox API is a hot mess, so I'm not surprised it's not doing what you want. Assembler fluidboxes are assigned at runtime based on what recipe is selected. Each recipe can ignore, use, or merge the N different prototype fluidboxes to make M = (between 0 and N) dynamic fluidboxes. The fluidbox prototypes theoretically contain all the information you need, but requesting the prototypes for the dynamic fluidboxes doesn't give you the corresponding prototype fluidboxes. The indexes and index limits in the API are messed up.

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Posted: Mon May 16, 2022 2:20 am
by Honktown
robot256 wrote:
Mon May 16, 2022 2:04 am
The assembler fluidbox API is a hot mess, so I'm not surprised it's not doing what you want. Assembler fluidboxes are assigned at runtime based on what recipe is selected. Each recipe can ignore, use, or merge the N different prototype fluidboxes to make M = (between 0 and N) dynamic fluidboxes. The fluidbox prototypes theoretically contain all the information you need, but requesting the prototypes for the dynamic fluidboxes doesn't give you the corresponding prototype fluidboxes. The indexes and index limits in the API are messed up.
This isn't about the fluidbox prototypes. This is about the fluids themselves. Edit: I didn't mean to sound rude. I can see why someone might be interested in the fluidboxes themselves, and think the subject was referring to them.

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Posted: Sun May 29, 2022 3:44 pm
by Rseding91
Thanks for the report. This is due to the way these specific icons are created and handled in 1.1.x and older. This entire section of the GUI logic was re-written for the expansion so once it's released it will also be fixed in base game.