show the available controls in a panel over the world

This commit is contained in:
2026-08-07 18:48:01 +02:00
parent 68a43a7d98
commit 980fad272f
9 changed files with 466 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#include <QString>
#include "ControlAction.h"
// What the player is shown for the actions and bindings declared in ControlAction.h
// (REQ-UI-CONTROLS-CONTENT). Kept out of lib/core deliberately: that file decides what
// is available and what triggers it, this one decides what it is called, and only this
// half is presentation.
//
// A badge is rendered from the binding it belongs to rather than written beside it, so
// what the panel shows on a chip is what the resolver actually matches. When bindings
// become player-configurable, this is the only place that has to learn to spell a
// rebound key.
// The chip text for one binding: "Ctrl+V", "LMB drag", "RMB".
QString getControlBindingBadge(const ControlBinding& binding);
// What the action is called in this context. A few actions are named for their
// situation rather than their implementation -- one exit action reads "Exit placement"
// in a placement mode and "Exit deconstruct mode" in deconstruct mode.
QString getControlActionLabel(ControlAction action, const ControlContext& context);
// The heading, in the upper case the card shows it in (REQ-UI-CONTROLS-CARD).
QString getControlContextName(ControlContextKind kind);