relative_gui_type for pumps?

Place to get help with not working mods / modding interface.
Post Reply
PFQNiet
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

relative_gui_type for pumps?

Post by PFQNiet »

What is the relative_gui_type for pump GUI? I can't seem to find it in the list in the docs.

robot256
Fast Inserter
Fast Inserter
Posts: 165
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: relative_gui_type for pumps?

Post by robot256 »

Might be missing. But have you gotten any other of the relative GUIs to work? I'm trying to add a button to the Artillery Wagon GUI. It runs without error, and clearly thinks it's creating a LuaGuiElement, but I can't see it anywhere on the screen. If I change "relative" to "left" then it works.

Code: Select all

player.gui.relative.add{type="button", name="saw-upgrade-button", caption="Enable Autofire", 
      anchor={gui=defines.relative_gui_type.train_gui, position=defines.relative_gui_position.right}}
This is inside the on_gui_opened event when the entity gui opened is type "artillery-wagon".

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: relative_gui_type for pumps?

Post by Choumiko »

train_gui is for the locomotive/schedule gui
looking at the defines it looks like pumps, wagons (all 3) and turrets are missing

Don't add it in on_gui_opened. You can just create it when the player is created. It only shows up when the correct gui is open and doesn't get destroyed when that gui is closed (unless another mod does it)

Edit: Rseding says its defines.relative_gui_type.container_gui for the artillery

Post Reply

Return to “Modding help”