The circuit connector side-panel drag handle can be used to drag the main window, I would like to mimic this for modded side-panels. According to one of the FFFs the gui is being worked on again for "the addon", so maybe this could be shoved in somewhere? I'm not in a hurry.
LuaGuiElement.drag_target for relative gui elements.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
LuaGuiElement.drag_target for relative gui elements.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: LuaGuiElement.drag_target for relative gui elements.
+1
Relative GUIs can't drag the frame they are attached to because "the element needs to be a child of the drag_target at some level" and "only top-level elements in LuaGui::screen can be drag_targets". Relative GUIs aren't a child of gui.screen at all so they can't drag themselves, and I guess technically they are not a child of their anchor either so they can't drag the GUI they are attached to. But if the sidebar has a substantial header and you are following GUI style, it's weird for the player to try and drag a dragbar and not have it drag.
Relative GUIs can't drag the frame they are attached to because "the element needs to be a child of the drag_target at some level" and "only top-level elements in LuaGui::screen can be drag_targets". Relative GUIs aren't a child of gui.screen at all so they can't drag themselves, and I guess technically they are not a child of their anchor either so they can't drag the GUI they are attached to. But if the sidebar has a substantial header and you are following GUI style, it's weird for the player to try and drag a dragbar and not have it drag.