-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New and improved gui/mechanisms #1016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of being able to unlink mechanisms, but I'd rather see this as an overlay than a GUI tool. Specifically, it could draw action buttons to the left or right of the list of linked buildings on this panel:
The overlay could be added to https://github.com/DFHack/dfhack/blob/develop/plugins/lua/buildingplan/mechanisms.lua where we already have mechanism-related code
example of overlay that adds widgets to a vanilla list: PreferenceOverlay
in https://github.com/DFHack/dfhack/blob/develop/plugins/lua/sort/diplomacy.lua
How do we indicate that the unlink buttons are a DFHack feature? The auto-freeing settings would go on that panel. Manual freeing buttons would probably go on the "Show items" panel, along with a "Free all unlinked" option there somewhere. Converting the script is probably more effort than I want to do at the moment, however. |
that looks like a reasonable spot. A TextButton like The player shouldn't have to press anything else to make the button appear -- the overlay will just render it when in the correct context. I notice that right now this context is represented as Edit: done |
Ran into a DF bug: https://dwarffortressbugtracker.com/view.php?id=12721 The linked buildings page doesn't scroll. |
Is there a way to specify any matching |
if there are too many to list, you can specify the longest common prefix as your function NotifyOverlay:render(dc)
if not CONFLICTING_TOOLTIPS[mi.current_hover] then
NotifyOverlay.super.render(self, dc)
end
end you can get the current focus strings from |
How does one embed buttons in a scrolling list? The scroll position is defined by |
implement |
Is there any way to detect the overlay activating? I've got state data when returning to |
would that work if a building was selected, deselected, and selected again after the state had changed? unless the performance is a significant blocker, drawing the UI state directly from DF state and keeping the overlay as stateless as you can is a good idea. Example: https://github.com/DFHack/dfhack/blob/develop/plugins/lua/orders.lua#L391-L415 |
No, that's the same problem where I'd need to detect the overlay activating. It only catches swapping buildings without closing the view sheet.
It's O(n^2), iterating What's the difference between |
for the purpose of "have a side effect on every rendered frame", there's no difference. |
Gui script for unlinking and freeing mechanisms from buildings
Also fixed typos of "seize" in confirm, and
focus_string
forgui/teleport
being "autodump".Requires DFHack/dfhack#4319 to move freed mechanisms to ground properly. (Buildings may deconstruct if dwarves are allowed pull out the mechanisms themselves. Don't know what causes this, as it only happens sometimes.)