LuaGuiElement.drag_target for relative gui elements.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

LuaGuiElement.drag_target for relative gui elements.

Post by eradicator »

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.

WIP
WIP
draghandle.png (233.24 KiB) Viewed 729 times
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.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: LuaGuiElement.drag_target for relative gui elements.

Post by Deadlock989 »

+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.
Image

Post Reply

Return to “Modding interface requests”