Firstly, apologies if this already in the won't-add section, I've had a quick search but didn't find it.
I'd like to make a request for better support for custom control rendering. The existing controls are nice but sometimes they don't quite cut it. I am looking at making a mod where the fundamental data structure the user is manipulating is a graph- obviously there is no builtin control for a graph, which is fine. However rendering custom controls is a bit awkward.
LuaStyle doesn't seem to offer anything similar to CSS's position:absolute, so it's kinda hard to make something that looks like a single control which is composed of many controls that implement different parts of it with positioning handled by the modder. So far I've used a hidden surface with camera element on it and LuaRendering, which can render "custom controls" surprisingly well if presumably a bit wasteful on performance.
Adding interactivity though is another matter as the click events don't report their location on the element that was clicked.
I assume that it would be a fairly large task to add support for proper CSS-style composite controls with absolute positioning/stacking, z-indexes and such. However what would definitely be "good enough for now especially for a kinda niche case" is if one control can receive slightly more detailed events. Specifically, add a position property to on_gui_click which says where on the element the user clicked. I can project that on to the hidden surface and figure out if they clicked on anything I actually care about on the other end; it's not like the user will expect great performance with a huge graph anyway.
Additionally, a little extra flexibility for on_gui_location_changed would be nice as well; this event can't currently understand the idea of dragging within a UI element itself. I would suggest adding a property, supports_internal_drag or something, which allows on_gui_location_changed to be fired when the user performs click-and-drag actions, with start/end points in element location space.
Obviously I would also be fine with the idea of better support for custom positioning of GUI elements, as strictly, there is nothing I want to do which is outside the bounds of what GUI elements can already do- clicking, dragging, etc. I just can't arrange them on the screen in a way that will actually look like what it needs to look like. I think that adding a little more location data/flexibility to the existing events should hopefully be a pretty low-effort good-enough solution which allows the modder to be creative if they really need to be.
Support for custom rendered controls
Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Return to “Modding interface requests”
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Implemented in 2.0
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Documentation Improvement Requests
- ↳ Resolved Requests
- ↳ Development tools
- ↳ Tools
- ↳ Mod and installation managers
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development tools
- ↳ Special interest mods and libraries
- ↳ Modding Development
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions