[Game] Add an invite button to non-started and not full games (#7143)

* [Client] Send game invites from the user context menu via a private message

The user context menu gains an "Invite to Game" submenu listing the
inviteable games in the room (the inviter's own games, honoring the
buddy-only setting). Picking one opens a private message to the target
user with a cockatrice://joingame link naming the game, so the target
gets a clickable invite instead of a raw URL. Multi-game rooms offer a
picker; a single inviteable game sends directly. Sending a message to
an offline user no longer swallows the draft — it reports that the
user is offline and keeps the typed text.

Took 1 minute

* [Client] Add invite-to-game dialog to the game window

Took 15 seconds

* [Client] Open the invite dialog taller by default without enforcing a minimum size

* Move button to bottom

Took 3 minutes

* Address comments.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-08-17 21:37:15 +02:00 • committed by GitHub
parent 08d6b51db9
commit 7c550ee505
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 449 additions and 76 deletions

View file

@ -37,6 +37,7 @@ class CardInfoFrameWidget;
class QTimer;
class QSplitter;
class QLabel;
class QPushButton;
class QToolButton;
class QMenu;
class ZoneViewLayout;
@ -69,6 +70,7 @@ private:
CardInfoFrameWidget *cardInfoFrameWidget;
PlayerListWidget *playerListWidget;
QPushButton *inviteButton = nullptr;
QLabel *timeElapsedLabel;
MessageLogWidget *messageLog;
QLabel *sayLabel;
@ -86,6 +88,7 @@ private:
QAction *aGameInfo, *aConcede, *aCopyGameLink, *aLeaveGame, *aNextPhase, *aNextPhaseAction, *aNextTurn,
*aReverseTurn, *aRemoveLocalArrows, *aRotateViewCW, *aRotateViewCCW, *aResetLayout, *aResetReplayLayout;
QAction *aFocusChat;
QAction *aInviteToGame = nullptr;
QList<QAction *> phaseActions;
QAction *aCardMenu;
@ -128,6 +131,7 @@ private:
void createPlayAreaWidget(bool bReplay = false);
void createDeckViewContainerWidget(bool bReplay = false);
void createReplayDock(GameReplay *replay);
void updateInviteButtonState();
signals:
void gameClosing(TabGame *tab);
void containerProcessingStarted(const GameEventContext &context);
@ -147,6 +151,7 @@ private slots:
void setCardMenu(CardMenu *menu);
void actGameInfo();
void actInviteToGame();
void actConcede();
void actCopyGameLink();
void actRemoveLocalArrows();