ff7tk 0.80.25
Work with Final Fantasy 7 game data
OptionsWidget.h
Go to the documentation of this file.
1/****************************************************************************/
2// copyright 2013 - 2020 Chris Rizzitello <sithlord48@gmail.com> //
3// //
4// This file is part of FF7tk. //
5// //
6// FF7tk is free software: you can redistribute it and/or modify //
7// it under the terms of the GNU General Public License as published by //
8// the Free Software Foundation, either version 3 of the License, or //
9// (at your option) any later version. //
10// //
11// FF7tk is distributed in the hope that it will be useful, //
12// but WITHOUT ANY WARRANTY; without even the implied warranty of //
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14// GNU General Public License for more details. //
15/****************************************************************************/
16#pragma once
17
18#include <QScrollArea>
19
20#ifndef ff7tkwidgets_export_h
21 #include <ff7tkwidgets_export.h>
22#endif
23
24class QComboBox;
25class QCheckBox;
26class QGridLayout;
27class QGroupBox;
28class QLabel;
29class QResizeEvent;
30class QSlider;
31class DialogPreview;
32
37class FF7TKWIDGETS_EXPORT OptionsWidget : public QScrollArea
38{
39 Q_OBJECT
40protected:
41 void resizeEvent(QResizeEvent *);
42 void changeEvent(QEvent *e);
43public:
44 explicit OptionsWidget(QWidget *parent = nullptr);
45 void setInput(int controlAction, int newButton);
46public slots:
47 void setSliderStyle(const QString &styleSheet);
48 void setScrollAreaStyleSheet(const QString &styleSheet);
49 void setDialogColors(QColor ul, QColor ur, QColor ll, QColor lr);
50 void setAtbMode(int mode);
51 void setSoundMode(int mode);
52 void setMagicOrder(int order);
53 void setCursor(int mode);
54 void setCamera(int mode);
55 void setControllerMode(int mode);
56 void setBattleTargets(bool shown);
57 void setBattleHelp(bool shown);
58 void setFieldHelp(bool shown);
59 void setBattleSpeed(int speed);
60 void setBattleMessageSpeed(int speed);
61 void setFieldMessageSpeed(int speed);
62 void setControllerMappingVisible(bool visible);
63signals:
64 void dialogColorULChanged(QColor color);
65 void dialogColorURChanged(QColor color);
66 void dialogColorLLChanged(QColor color);
67 void dialogColorLRChanged(QColor color);
68 void atbChanged(int mode);
69 void soundChanged(int mode);
70 void magicOrderChanged(int order);
71 void cursorChanged(int mode);
72 void cameraChanged(int mode);
73 void controllerModeChanged(int mode);
74 void battleTargetsChanged(bool shown);
75 void battleHelpChanged(bool shown);
76 void fieldHelpChanged(bool shown);
77 void battleSpeedChanged(int speed);
78 void battleMessageSpeedChanged(int speed);
79 void fieldMessageSpeedChanged(int speed);
80 void inputChanged(int controlAction, int newButton);
82private:
83 void updateText();
84 QGridLayout *makeControllerLayout();
85 DialogPreview *dialogPreview = nullptr;
86 QGroupBox *dialogBox = nullptr;
87 QWidget *centerWidget = nullptr;
88 QComboBox *comboAtb = nullptr;
89 QComboBox *comboSound = nullptr;
90 QComboBox *comboMagicOrder = nullptr;
91 QComboBox *comboCursor = nullptr;
92 QComboBox *comboCamera = nullptr;
93 QComboBox *comboControllerMode = nullptr;
94 QCheckBox *cbBattleTargets = nullptr;
95 QCheckBox *cbBattleHelp = nullptr;
96 QCheckBox *cbFieldHelp = nullptr;
97 QSlider *slideBattleSpeed = nullptr;
98 QSlider *slideBattleMessageSpeed = nullptr;
99 QSlider *slideFieldMessageSpeed = nullptr;
100 QGroupBox *controllerMappingBox = nullptr;
101 QLabel *labelAtb = nullptr;
102 QLabel *labelSound = nullptr;
103 QLabel *labelMagic = nullptr;
104 QLabel *labelCursor = nullptr;
105 QLabel *labelCamera = nullptr;
106 QLabel *labelControllerMode = nullptr;
107 QLabel *lblBattleSpeedMax = nullptr;
108 QLabel *lblBattleSpeedMin = nullptr;
109 QLabel *lblBattleMessageSpeedMax = nullptr;
110 QLabel *lblBattleMessageSpeedMin = nullptr;
111 QLabel *lblFieldMessageSpeedMax = nullptr;
112 QLabel *lblFieldMessageSpeedMin = nullptr;
113 QLabel *lblBattleSpeed = nullptr;
114 QLabel *lblBattleMessageSpeed = nullptr;
115 QLabel *lblFieldMessageSpeed = nullptr;
116 QList<QLabel *> lblInputs;
117
118 inline static const QStringList _inputNames {
119 QT_TR_NOOP("Up")
120 , QT_TR_NOOP("Right")
121 , QT_TR_NOOP("Down")
122 , QT_TR_NOOP("Left")
123 , QT_TR_NOOP("Menu")
124 , QT_TR_NOOP("Ok")
125 , QT_TR_NOOP("Cancel")
126 , QT_TR_NOOP("Switch")
127 , QT_TR_NOOP("Camera")
128 , QT_TR_NOOP("Target")
129 , QT_TR_NOOP("PgUp")
130 , QT_TR_NOOP("PgDn")
131 , QT_TR_NOOP("Help")
132 , QT_TR_NOOP("Pause")
133 , QT_TR_NOOP("9")
134 , QT_TR_NOOP("10")
135 };
136
137 inline static const QStringList _actionNames {
138 QT_TR_NOOP("Camera")
139 , QT_TR_NOOP("Target")
140 , QT_TR_NOOP("PgUp")
141 , QT_TR_NOOP("PgDn")
142 , QT_TR_NOOP("Menu")
143 , QT_TR_NOOP("Ok")
144 , QT_TR_NOOP("Cancel")
145 , QT_TR_NOOP("Switch")
146 , QT_TR_NOOP("Help")
147 , QT_TR_NOOP("9")
148 , QT_TR_NOOP("10")
149 , QT_TR_NOOP("Pause")
150 , QT_TR_NOOP("Up")
151 , QT_TR_NOOP("Right")
152 , QT_TR_NOOP("Down")
153 , QT_TR_NOOP("Left")
154 };
155
156 inline static const QStringList _atbList {
157 QT_TR_NOOP("Active")
158 , QT_TR_NOOP("Recommended")
159 , QT_TR_NOOP("Wait")
160 };
161
162 inline static const QStringList _soundList {
163 QT_TR_NOOP("Mono")
164 , QT_TR_NOOP("Stereo")
165 };
166
167 inline static const QStringList _magicOrderList {
168 QT_TR_NOOP("Restore,Attack,Indirect")
169 , QT_TR_NOOP("Restore,Indirect,Attack")
170 , QT_TR_NOOP("Attack,Indirect,Restore")
171 , QT_TR_NOOP("Attack,Restore,Indirect")
172 , QT_TR_NOOP("Indirect,Restore,Attack")
173 , QT_TR_NOOP("Indirect,Attack,Restore")
174 };
175
176 inline static const QStringList _cursorList {
177 QT_TR_NOOP("Initial")
178 , QT_TR_NOOP("Memory")
179 };
180
181 inline static const QStringList _cameraList {
182 QT_TR_NOOP("Auto")
183 , QT_TR_NOOP("Fixed")
184 };
185
186
187 inline static const QStringList _controllerModeList {
188 QT_TR_NOOP("Normal")
189 , QT_TR_NOOP("Custom")
190 };
191
192 const QString _fast = QT_TR_NOOP("Fast");
193 const QString _slow = QT_TR_NOOP("Slow");
194
195};
Definition: DialogPreview.h:27
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:38
void cursorChanged(int mode)
Emit Signal: Cursor Mode Changed.
void soundChanged(int mode)
Emit Signal: Sound Mode Changed.
void controllerModeChanged(int mode)
Emit Signal: Controller Mode Changed.
void dialogColorURChanged(QColor color)
Emit Signal: Upper Right Color Has Changed.
void atbChanged(int mode)
Emit Signal: ATB Mode Changed.
void battleTargetsChanged(bool shown)
Emit Signal: Battle Target Mode Changed.
void battleMessageSpeedChanged(int speed)
Emit Signal: Battle Message Speed Changed.
void battleSpeedChanged(int speed)
Emit Signal: Battle Speed Changed.
void battleHelpChanged(bool shown)
Emit Signal: Battle Help Mode Changed.
void cameraChanged(int mode)
Emit Signal: Camera Mode Changed.
void dialogColorLRChanged(QColor color)
Emit Signal: Lower Right Color Has Changed.
void inputChanged(int controlAction, int newButton)
Emit Signal: Mapping for FF7Save::CONTROLACTION has Changed to new FF7Save::PSXBUTTON.
void dialogColorLLChanged(QColor color)
Emit Signal: Lower Left Color Has Changed.
void fieldMessageSpeedChanged(int speed)
Emit Signal: Field Message Speed Changed.
void dialogColorULChanged(QColor color)
Emit Signal: Upper Left Color Has Changed.
void fieldHelpChanged(bool shown)
Emit Signal: Field Help Mode Changed.
void magicOrderChanged(int order)
Emit Signal: Magic Order Changed.