Page 1 of 1

relative_gui_type for pumps?

Posted: Sat Nov 28, 2020 1:17 am
by PFQNiet
What is the relative_gui_type for pump GUI? I can't seem to find it in the list in the docs.

Re: relative_gui_type for pumps?

Posted: Thu Dec 03, 2020 10:03 pm
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".

Re: relative_gui_type for pumps?

Posted: Thu Dec 03, 2020 10:08 pm
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