npo6ka / FNEI

Factorio NEI
https://mods.factorio.com/mods/npo6ka/FNEI
36 stars 21 forks source link

Show technology mistakenly unlocking research #39

Closed cmears closed 5 years ago

cmears commented 5 years ago

When I click on the technology in a recipe, the technology window isn't shown and instead the clicked-on technology becomes unlocked. The game gives this output:

  40.414 Script @__FNEI__/core/Debug.lua:98: [FNEI][ERROR] <FNCustomEvents>  FNEI: event  recipe sprite-button tech  return error!
  40.420 Script @__FNEI__/core/Debug.lua:98: [FNEI][ERROR] <FNCustomEvents>  LuaForce::current_research is read only.
stack traceback:
        __FNEI__/utils/open_tech_hook.lua:68: in function 'show_tech'
        __FNEI__/scripts/recipe/controller.lua:305: in function 'cur_event'
        __FNEI__/scripts/custom_events.lua:65: in function <__FNEI__/scripts/custom_events.lua:64>
        [C]: in function 'pcall'
        __FNEI__/scripts/custom_events.lua:64: in function 'invoke'
        __FNEI__/scripts/events.lua:75: in function <__FNEI__/scripts/events.lua:72>

So I guess manipulating current_research in this way is no longer possible?

cmears commented 5 years ago

(with Factorio 0.17.29 by the way)

MageKing17 commented 5 years ago

The hackish solution is no longer needed anyway, now that LuaControl::open_technology_gui() exists.

npo6ka commented 5 years ago

Fixed in 0.2.4.