Skip to content

Convert "Request dock" button to a menu#2837

Open
oznogon wants to merge 2 commits intodaid:masterfrom
oznogon:docking-request-menu
Open

Convert "Request dock" button to a menu#2837
oznogon wants to merge 2 commits intodaid:masterfrom
oznogon:docking-request-menu

Conversation

@oznogon
Copy link
Copy Markdown
Contributor

@oznogon oznogon commented Apr 6, 2026

When multiple compatible DockingBay entities are within range, list them on the "Request dock" button and let the player select which entity to dock with instead of automatically choosing the nearest entity.

This converts DockingBay to subclass GuiPanel instead of GuiButton, and uses separate GuiButton and GuiListbox components in order to handle different docking states and dynamically update list contents.

This does NOT CHANGE keyboard shortcut behavior, which continues to dock with the nearest eligible target. It also does NOT CHANGE any existing interactions when only one eligible target is within range.

Recording.2026-04-06.100116.mp4

@dkapell
Copy link
Copy Markdown
Contributor

dkapell commented Apr 30, 2026

Testing this out, I realized that the new GuiPanel is being drawn at the same spot/size as the docking button, so on the default theme it looks like a single button, but on my custom theme (for example) it ends up with a second border around the docking button. To work around this i added:

  • bool visible = true as a public member of GuiPanel (gui/gui2_panel.h)
  • if (visible) { ... } around the renderer.drawStretchedHV (gui/gui2_panel.cpp)
  • this->visible = false at the start of GuiDockingButton::GuiDockingButton (screenComponents/dockingButton.cpp)

This allows for the docking button to be drawn the same as before, regardless of theme, while keeping the new functionality.

oznogon added 2 commits April 30, 2026 09:13
When multiple compatible DockingBay entities are within range, list
them and let the player select which entity to dock with instead of
automatically choosing the nearest entity.
@oznogon oznogon force-pushed the docking-request-menu branch from 374bcf5 to b7376f5 Compare April 30, 2026 16:13
@oznogon
Copy link
Copy Markdown
Contributor Author

oznogon commented Apr 30, 2026

Testing this out, I realized that the new GuiPanel is being drawn at the same spot/size as the docking button, so on the default theme it looks like a single button, but on my custom theme (for example) it ends up with a second border around the docking button. To work around this i added:

* `bool visible = true` as a public member of GuiPanel (gui/gui2_panel.h)

* `if (visible) { ... } ` around the `renderer.drawStretchedHV` (gui/gui2_panel.cpp)

* `this->visible = false` at the start of `GuiDockingButton::GuiDockingButton` (screenComponents/dockingButton.cpp)

This allows for the docking button to be drawn the same as before, regardless of theme, while keeping the new functionality.

Refactored it to no longer be a GuiPanelGuiButton-based element, and to conditionally render the new background_panel only when expanded.

@dkapell
Copy link
Copy Markdown
Contributor

dkapell commented Apr 30, 2026

Refactored it to no longer be a GuiPanel-based element, and to conditionally render the new background_panel only when expanded.

Thanks! I've confirmed on my end that that looks right with my (probably slightly incorrect) theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants