Document LuaSimulation.get_widget_position

i142857
Inserter
Inserter
Posts: 24
Joined: Mon Nov 04, 2024 9:56 am
Contact:

Document LuaSimulation.get_widget_position

Post by i142857 »

The docs for get_widget_position don't really give you much. The arguments are called data and data2, and there's no explanation on what they mean (for each type). Only source of information I can find are files like tips-and-tricks-simulations.lua but only certain kinds of examples are in there. For instance, I can't find any example using data2, so I can't figure out what, if anything, it does. Experimenting with these APIs is relatively difficult and time-consuming, too.

Here's what I'd like to know:
  • Does this API work for custom UIs too, or only built-in UIs? So far I haven't been able to get it to work for my custom UIs, but perhaps I'm holding it wrong.
  • If custom UIs are supported, how do I find things? Can it locate controls by name? I have tried, for example, finding a custom label by content (like the base game does) and it doesn't seem to work.
  • What kind of data/data2 arguments are expected by each type?
Thank you!
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 355
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: Document LuaSimulation.get_widget_position

Post by Osmo »

I agree, it is hard to figure out what is supported and what isn't
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4886
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Document LuaSimulation.get_widget_position

Post by boskid »

LuaSimulation::get_widget_position() was reworked for 2.1.15 (breaking change) and all relevant parameters will be properly documented accepting all usual formats lua api accepts. "data" and "data2" parameters will be completly removed.
Post Reply

Return to “Resolved Requests”