Page 1 of 1

gui/cursor pos, player.opened, pl. zoom , bonus_progress

Posted: Sat Jul 28, 2018 5:17 pm
by ownlyme
1. set gui position:
i want to make a tooltip when you hover entities, but i couldn't find the position parameters in luagui

2. reading player.cursor_position:
i assume there is also no api for cursor coordinates or something like that? well i can still put it at the right border of the screen if #1 works

3. reading player.zoom
an alternative would be to use floating text, but those don't scale with player zoom level so i couldn't just make an entity for the background etc.

4. editing player.opened gui, set bonus_progress on any entity
i want to make an bonus production bar for a nuclear reactor (it outputs additional used fuel cells), but player.opened is only an entity and there seems to be no way to access this gui. (also it doesn't have the bonus_progress property)

i could make an entity for every digit, but that would result in at least 15 entities per tooltip... + 2 progress bars... so... over 30

Re: gui/cursor pos, player.opened, pl. zoom , bonus_progress

Posted: Sat Jul 28, 2018 5:58 pm
by Bilka
ownlyme wrote:1. set gui position:
i want to make a tooltip when you hover entities, but i couldn't find the position parameters in luagui
Not even the normal GUI can properly do this, so this cannot be implemented for the mod gui.
ownlyme wrote:2. reading player.cursor_position:
i assume there is also no api for cursor coordinates or something like that? well i can still put it at the right border of the screen if #1 works
The cursor position is currently not synced between players, and will probably never be synced because it would generate a lot of data. So, it is not deterministic, and as such not readable.
ownlyme wrote:3. reading player.zoom
an alternative would be to use floating text, but those don't scale with player zoom level so i couldn't just make an entity for the background etc.
Same as above.
ownlyme wrote:4. editing player.opened gui, set bonus_progress on any entity
i want to make an bonus production bar for a nuclear reactor (it outputs additional used fuel cells), but player.opened is only an entity and there seems to be no way to access this gui. (also it doesn't have the bonus_progress property)
You cannot access the vanilla GUI because it is not deterministic. Reactors don't and won't support bonus_progress because this would have to be saved in the save file, meaning that there would be overhead for a property that would only be used by mods.