mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 01:53:25 -08:00
[Refactor] Move AnnotationDialog and action data types into game/ (#7411)
Folds in the closed #7410 (Move AnnotationDialog from game/ logic to game_graphics/) now that layers 1-2 are closed and this stack bottoms on master directly: - Add game_graphics/dialogs/dlg_annotation.{h,cpp} and move the QInputDialog subclass there; game/ no longer declares any widget type. - Add game/player/token_info.h and game/player/move_top_cards_until_options.h. - Move CardMenuActionType to game/player/card_menu_action_type.h. - Graphics dialog headers include the new game/ headers instead of defining the structs themselves. No behavior change. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
bbc7e462ff
commit
d30d275296
14 changed files with 89 additions and 50 deletions
13
cockatrice/src/game_graphics/dialogs/dlg_annotation.cpp
Normal file
13
cockatrice/src/game_graphics/dialogs/dlg_annotation.cpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "dlg_annotation.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
void AnnotationDialog::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Return && event->modifiers() & Qt::ControlModifier) {
|
||||
event->accept();
|
||||
accept();
|
||||
return;
|
||||
}
|
||||
QInputDialog::keyPressEvent(event);
|
||||
}
|
||||
22
cockatrice/src/game_graphics/dialogs/dlg_annotation.h
Normal file
22
cockatrice/src/game_graphics/dialogs/dlg_annotation.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* @file dlg_annotation.h
|
||||
* @ingroup GameDialogs
|
||||
*/
|
||||
|
||||
#ifndef COCKATRICE_DLG_ANNOTATION_H
|
||||
#define COCKATRICE_DLG_ANNOTATION_H
|
||||
|
||||
#include <QInputDialog>
|
||||
|
||||
class AnnotationDialog : public QInputDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
void keyPressEvent(QKeyEvent *e) override;
|
||||
|
||||
public:
|
||||
explicit AnnotationDialog(QWidget *parent = nullptr) : QInputDialog(parent)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_DLG_ANNOTATION_H
|
||||
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef DLG_CREATETOKEN_H
|
||||
#define DLG_CREATETOKEN_H
|
||||
|
||||
#include "../../game/player/token_info.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
|
@ -25,17 +27,6 @@ class CardInfoPictureWidget;
|
|||
class QModelIndex;
|
||||
class QWidget;
|
||||
|
||||
struct TokenInfo
|
||||
{
|
||||
QString name;
|
||||
QString color;
|
||||
QString pt;
|
||||
QString annotation;
|
||||
bool destroy = true;
|
||||
bool faceDown = false;
|
||||
QString providerId;
|
||||
};
|
||||
|
||||
class DlgCreateToken : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef DLG_MOVE_TOP_CARDS_UNTIL_H
|
||||
#define DLG_MOVE_TOP_CARDS_UNTIL_H
|
||||
|
||||
#include "../../game/player/move_top_cards_until_options.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
|
@ -21,13 +23,6 @@ class QLabel;
|
|||
class QSpinBox;
|
||||
class QWidget;
|
||||
|
||||
struct MoveTopCardsUntilOptions
|
||||
{
|
||||
QStringList exprs = {};
|
||||
int numberOfHits = 1;
|
||||
bool autoPlay = false;
|
||||
};
|
||||
|
||||
class DlgMoveTopCardsUntil : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue