ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
OptionsWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2013 - 2020 Chris Rizzitello <sithlord48@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QScrollArea>
7 #include <ff7tkwidgets_export.h>
8 
9 class QComboBox;
10 class QCheckBox;
11 class QGridLayout;
12 class QGroupBox;
13 class QLabel;
14 class QResizeEvent;
15 class QSlider;
16 class DialogPreview;
17 
22 class FF7TKWIDGETS_EXPORT OptionsWidget : public QScrollArea
23 {
24  Q_OBJECT
25 protected:
26  void resizeEvent(QResizeEvent *);
27  void changeEvent(QEvent *e);
28 public:
29  explicit OptionsWidget(QWidget *parent = nullptr);
30  void setInput(int controlAction, int newButton);
31 public slots:
32  void setSliderStyle(const QString &styleSheet);
33  void setScrollAreaStyleSheet(const QString &styleSheet);
34  void setDialogColors(QColor ul, QColor ur, QColor ll, QColor lr);
35  void setAtbMode(int mode);
36  void setSoundMode(int mode);
37  void setMagicOrder(int order);
38  void setCursor(int mode);
39  void setCamera(int mode);
40  void setControllerMode(int mode);
41  void setBattleTargets(bool shown);
42  void setBattleHelp(bool shown);
43  void setFieldHelp(bool shown);
44  void setBattleSpeed(int speed);
45  void setBattleMessageSpeed(int speed);
46  void setFieldMessageSpeed(int speed);
47  void setControllerMappingVisible(bool visible);
48 signals:
49  void dialogColorULChanged(QColor color);
50  void dialogColorURChanged(QColor color);
51  void dialogColorLLChanged(QColor color);
52  void dialogColorLRChanged(QColor color);
53  void atbChanged(int mode);
54  void soundChanged(int mode);
55  void magicOrderChanged(int order);
56  void cursorChanged(int mode);
57  void cameraChanged(int mode);
58  void controllerModeChanged(int mode);
59  void battleTargetsChanged(bool shown);
60  void battleHelpChanged(bool shown);
61  void fieldHelpChanged(bool shown);
62  void battleSpeedChanged(int speed);
63  void battleMessageSpeedChanged(int speed);
64  void fieldMessageSpeedChanged(int speed);
65  void inputChanged(int controlAction, int newButton);
67 private:
68  void updateText();
69  void updateIcons();
70  QGridLayout *makeControllerLayout();
71  DialogPreview *dialogPreview = nullptr;
72  QGroupBox *dialogBox = nullptr;
73  QWidget *centerWidget = nullptr;
74  QComboBox *comboAtb = nullptr;
75  QComboBox *comboSound = nullptr;
76  QComboBox *comboMagicOrder = nullptr;
77  QComboBox *comboCursor = nullptr;
78  QComboBox *comboCamera = nullptr;
79  QComboBox *comboControllerMode = nullptr;
80  QCheckBox *cbBattleTargets = nullptr;
81  QCheckBox *cbBattleHelp = nullptr;
82  QCheckBox *cbFieldHelp = nullptr;
83  QSlider *slideBattleSpeed = nullptr;
84  QSlider *slideBattleMessageSpeed = nullptr;
85  QSlider *slideFieldMessageSpeed = nullptr;
86  QGroupBox *controllerMappingBox = nullptr;
87  QLabel *labelAtb = nullptr;
88  QLabel *labelSound = nullptr;
89  QLabel *labelMagic = nullptr;
90  QLabel *labelCursor = nullptr;
91  QLabel *labelCamera = nullptr;
92  QLabel *labelControllerMode = nullptr;
93  QLabel *lblBattleSpeedMax = nullptr;
94  QLabel *lblBattleSpeedMin = nullptr;
95  QLabel *lblBattleMessageSpeedMax = nullptr;
96  QLabel *lblBattleMessageSpeedMin = nullptr;
97  QLabel *lblFieldMessageSpeedMax = nullptr;
98  QLabel *lblFieldMessageSpeedMin = nullptr;
99  QLabel *lblBattleSpeed = nullptr;
100  QLabel *lblBattleMessageSpeed = nullptr;
101  QLabel *lblFieldMessageSpeed = nullptr;
102  QList<QLabel *> lblInputs;
103 
104  inline static const QStringList _inputNames {
105  QT_TR_NOOP("Up")
106  , QT_TR_NOOP("Right")
107  , QT_TR_NOOP("Down")
108  , QT_TR_NOOP("Left")
109  , QT_TR_NOOP("Menu")
110  , QT_TR_NOOP("Ok")
111  , QT_TR_NOOP("Cancel")
112  , QT_TR_NOOP("Switch")
113  , QT_TR_NOOP("Camera")
114  , QT_TR_NOOP("Target")
115  , QT_TR_NOOP("PgUp")
116  , QT_TR_NOOP("PgDn")
117  , QT_TR_NOOP("Help")
118  , QT_TR_NOOP("Pause")
119  , QT_TR_NOOP("9")
120  , QT_TR_NOOP("10")
121  };
122 
123  inline static const QStringList _actionNames {
124  QT_TR_NOOP("Camera")
125  , QT_TR_NOOP("Target")
126  , QT_TR_NOOP("PgUp")
127  , QT_TR_NOOP("PgDn")
128  , QT_TR_NOOP("Menu")
129  , QT_TR_NOOP("Ok")
130  , QT_TR_NOOP("Cancel")
131  , QT_TR_NOOP("Switch")
132  , QT_TR_NOOP("Help")
133  , QT_TR_NOOP("9")
134  , QT_TR_NOOP("10")
135  , QT_TR_NOOP("Pause")
136  , QT_TR_NOOP("Up")
137  , QT_TR_NOOP("Right")
138  , QT_TR_NOOP("Down")
139  , QT_TR_NOOP("Left")
140  };
141 
142  inline static const QStringList _atbList {
143  QT_TR_NOOP("Active")
144  , QT_TR_NOOP("Recommended")
145  , QT_TR_NOOP("Wait")
146  };
147 
148  inline static const QStringList _soundList {
149  QT_TR_NOOP("Mono")
150  , QT_TR_NOOP("Stereo")
151  };
152 
153  inline static const QStringList _magicOrderList {
154  QT_TR_NOOP("Restore,Attack,Indirect")
155  , QT_TR_NOOP("Restore,Indirect,Attack")
156  , QT_TR_NOOP("Attack,Indirect,Restore")
157  , QT_TR_NOOP("Attack,Restore,Indirect")
158  , QT_TR_NOOP("Indirect,Restore,Attack")
159  , QT_TR_NOOP("Indirect,Attack,Restore")
160  };
161 
162  inline static const QStringList _cursorList {
163  QT_TR_NOOP("Initial")
164  , QT_TR_NOOP("Memory")
165  };
166 
167  inline static const QStringList _cameraList {
168  QT_TR_NOOP("Auto")
169  , QT_TR_NOOP("Fixed")
170  };
171 
172 
173  inline static const QStringList _controllerModeList {
174  QT_TR_NOOP("Normal")
175  , QT_TR_NOOP("Custom")
176  };
177 
178  const QString _fast = QT_TR_NOOP("Fast");
179  const QString _slow = QT_TR_NOOP("Slow");
180 
181 };
OptionsWidget
A Single widget to allow you to set all the options for the game will save emit a signal when any opt...
Definition: OptionsWidget.h:22
DialogPreview
Definition: DialogPreview.h:9