hi im just starting to mod an idea i had but i didn't want to re create the train station gui,
im just trying to add a extra checkbox option in the mode of operation box in the train station gui that would ideally pop up another box the same way enable/disable does.
i don't need to read any information in the gui except my custom content.
im guessing through all my googling this isn't possible but i have no idea what my other options would be :/.
is it possible to extend a base entity's gui??
Re: is it possible to extend a base entity's gui??
No this is not possible. However you can define a custom hotkey which, when pressed while hovering over a train station, opens up your custom gui. The custom gui can contain anything you want. This is probably the easiest solution to this.
Another possible workaround for this is detecting if the player has opened a train station gui and then attaching a custom gui window to the side of the main window by offsetting the position. This however has the issue that there is no way to detect the game resolution and gui scale, which means the attached window might be a bit off on different screens. I wouldn't recommend this.
Another possible workaround for this is detecting if the player has opened a train station gui and then attaching a custom gui window to the side of the main window by offsetting the position. This however has the issue that there is no way to detect the game resolution and gui scale, which means the attached window might be a bit off on different screens. I wouldn't recommend this.
My mods:
Re: is it possible to extend a base entity's gui??
thanks for that, is their any button already used in the modding community for such a hover button so i can stay consistent with the community and end user expectation? (also just learned using q while hovering items lets u place items of that type if you have them. QOL improved! xD)
Re: is it possible to extend a base entity's gui??
Most mods use LuaPlayer.gui.top for permanently visible buttons and LuaPlayer.gui.left for extended guis/toggable stuff (http://lua-api.factorio.com/latest/LuaP ... Player.gui)zanven wrote:thanks for that, is their any button already used in the modding community for such a hover button so i can stay consistent with the community and end user expectation? (also just learned using q while hovering items lets u place items of that type if you have them. QOL improved! xD)
Re: is it possible to extend a base entity's gui??
I think he ment the hotkey itself. And as far as I know there is no convention to hotkeys just pick the one that suits you best. These hotkeys can be changed by the user in the control settings. Upon hotkey press you can choose to add the gui panel either to LuaPlayer.gui.left (as Choumiko said) which is just below the top left corner of the screen, or to LuaPlayer.gui.center if you want to have something more like a popup.
My mods: