mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
add keybinds to mill cards (#3439)
* add keybinds to mill cards Add functions to move single card from top of deck to the graveyard and exile. Add keybinds to move single or multiple cards from top of deck to exile or graveyard. Add new keybinds to settings menu. Move settings menu items around for a better fit. Rename a few of the items in the settings menu. Add default keybinds: ctrl alt d/e for single/multiple cards from top of deck to the graveyard. No defaults are set for moving to exile. * fix shortcut menu * fix missing tag * rename mismatched functions * fixed your typos * refactor shortcutsettings correct a lot of typos optimize a lot of functions this could merit a pr on its own * set mill keybinds * refactor add related card actions I found a function that was completely unintelligible so I made it remotely legible and removed the duplication. * shorten line by 17 characters replace a lot of function calls with just a single reference * add brackets add brackets to all single line if statements etc. readability improvements
This commit is contained in:
parent
843b9df939
commit
06081bd940
13 changed files with 1154 additions and 933 deletions
|
|
@ -1,19 +1,18 @@
|
|||
#ifndef SECUENCEEDIT_H
|
||||
#define SECUENCEEDIT_H
|
||||
#ifndef SEQUENCEEDIT_H
|
||||
#define SEQUENCEEDIT_H
|
||||
|
||||
#include <QEvent>
|
||||
#include <QKeySequence>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QWidget>
|
||||
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QEvent;
|
||||
|
||||
class SequenceEdit : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SequenceEdit(QString _shorcutName, QWidget *parent = nullptr);
|
||||
QString getSecuence();
|
||||
SequenceEdit(const QString &_shortcutName, QWidget *parent = nullptr);
|
||||
QString getSequence();
|
||||
void refreshShortcut();
|
||||
void clear();
|
||||
|
||||
|
|
@ -25,13 +24,13 @@ protected:
|
|||
bool eventFilter(QObject *, QEvent *event);
|
||||
|
||||
private:
|
||||
QString shorcutName;
|
||||
QString shortcutName;
|
||||
QLineEdit *lineEdit;
|
||||
QPushButton *clearButton;
|
||||
QPushButton *defaultButton;
|
||||
int keys;
|
||||
int currentKey;
|
||||
bool valid;
|
||||
int keys = 0;
|
||||
int currentKey = 0;
|
||||
bool valid = false;
|
||||
|
||||
void processKey(QKeyEvent *e);
|
||||
int translateModifiers(Qt::KeyboardModifiers state, const QString &text);
|
||||
|
|
@ -39,4 +38,4 @@ private:
|
|||
void updateSettings();
|
||||
};
|
||||
|
||||
#endif // SECUENCEEDIT_H
|
||||
#endif // SEQUENCEEDIT_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue