raiguard / RecipeBook

Recipe Book for Factorio.
MIT License
19 stars 9 forks source link

Alt+LeftClick on liquids/gases does not work the same as with solids #130

Closed aqocyrale closed 1 year ago

aqocyrale commented 1 year ago

Describe the Bug

My standard method of using RecipeBook is to open a building, for example an assembling machine, and press Alt+LeftClick on an item shown in the recipe to open the relevant RecipeBook page. This works consistently with all solid items, but also consistently doesn't work with liquids/gases.

I'm specifically using RecipeBook with Sea Block, but I tried using it standalone with only base vanilla factorio otherwise for the sake of this bug report, and confirmed this issue exists with RecipeBook being the only active mod.

To Reproduce

Steps to reproduce the behavior: (tested on Factorio 1.1.80 Stable, RecipeBook 3.5.4)

  1. Disable all mods, and activate only RecipeBook mod, let factorio restart to take effect.
  2. Go to Map editor > New scenario > Freeplay > Play
  3. Press E to open item menu, grab an Assembling machine 2 or 3, put it down in the world
  4. Set the Assembling machine 2/3 recipe to Electric engine unit
  5. Try to Alt+LeftClick on each of the recipe items (both inputs and outputs) in the Assembling machine 2/3's configuration menu

Expected: Each Alt+LeftClick opens the corresponding RecipeBook page for the item. Actual: works with the solids (Electronic circuit, Engine unit, Electric engine unit), does not work with the liquid (Lubricant)

Save file & Username & Log file

I'm not providing a save file because this is easy to reproduce in the map editor and I've outlined the steps to do so. Please don't ignore this bug report, I think RecipeBook is great and I enjoy using it, but this one caveat is very frustrating.

aqocyrale commented 1 year ago

From looking at the source code and logging ingame, I found that at

control.lua

at

script.on_event({ "rb-search", "rb-open-selected" }

the if statement

if e.input_name == "rb-open-selected" then

is reached but then the next one isn't, that is,

if selected_prototype then

evaluates to false and does not enter the clause.

upon inspection, e does not have the selected_prototype field when it's a liquid, it only has cursor_position, input_name, name, player_index, tick, none of which are useful.

upon further inquiry, it seems like this might be a factorio bug which cannot be fixed on mod level?

https://forums.factorio.com/viewtopic.php?f=230&t=102420

I wonder if there's a possible workaround for now?

raiguard commented 1 year ago

Yep, this is a vanilla bug. Nope, I can't fix it on the mod's side. Nope, there is no workaround. I will look into fixing it on the game's side if possible, but no guarantees.