float the build buttons as a horizontal bar over the game world and show key bindings inside build buttons

This commit is contained in:
2026-08-06 08:28:40 +02:00
parent f39fe9a118
commit c1af58d80c
14 changed files with 575 additions and 477 deletions

View File

@@ -1,5 +1,8 @@
#pragma once
#include <QString>
#include "BuildingType.h"
#include "WorldCamera.h"
class QKeyEvent;
@@ -24,6 +27,12 @@ class QKeyEvent;
class InputMapper
{
public:
// The build hotkey that selects the given building type, spelled for display on
// its build button's badge (REQ-UI-BUILD-COST): "1" for a plain digit, "⇧1" for
// a Shift+digit, and an empty string for a building type with no build hotkey.
// Lives here so the badge and the key handling read the same binding table.
static QString getBuildHotkeyLabel(BuildingType type);
// Both return true when the key was consumed; the caller passes anything else
// on to its base class so unrelated shortcuts keep working.
bool handleKeyPress(QKeyEvent* event);