ff7tk  1.2.0.24
Work with Final Fantasy 7 game data
ChocoboManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2013 - 2023 Chris Rizzitello <sithlord48@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QWidget>
7 #include <ff7tkwidgets_export.h>
8 #include <ChocoboEditor>
9 #include <ChocoboLabel>
10 
11 class QComboBox;
12 class QGroupBox;
13 class QLCDNumber;
14 
15 class FF7TKWIDGETS_EXPORT ChocoboManager : public QWidget
16 {
17  Q_OBJECT
18 public:
19  explicit ChocoboManager(QWidget *parent = nullptr);
20 signals:
21  void ownedChanged(qint8);
22  void occupiedChanged(qint8);
23  void stableMaskChanged(qint8);
24  void setMode(bool advanced);
25  void nameChanged(int, QString);
26  void sexChanged(int, quint8);
27  void typeChanged(int, quint8);
28  void sprintChanged(int, quint16);
29  void mSprintChanged(int, quint16);
30  void speedChanged(int, quint16);
31  void mSpeedChanged(int, quint16);
32  void staminaChanged(int, quint16);
33  void accelChanged(int, quint8);
34  void coopChanged(int, quint8);
35  void intelligenceChanged(int, quint8);
36  void personalityChanged(int, quint8);
37  void pCountChanged(int, quint8);
38  void winsChanged(int, quint8);
39  void ratingChanged(int, quint8);
40  void cantMateChanged(int, bool);
41  void penChanged(int, int);
42 public slots:
43  inline void setAdvancedMode(bool advanced)
44  {
45  chocoboEditor->setAdvancedMode(advanced);
46  }
47  void setData(FF7CHOCOBO choco[6], QString name[6], quint16 stamina[6], bool cMate[6], qint8 owned, qint8 occupied, qint8 mask, qint8 chocoPens[4], quint8 chocoRatings[6]);
48  void setData(QList<FF7CHOCOBO> chocos, QList<QString> names, QList<quint16> staminas, QList<bool> cMate, qint8 owned, qint8 occupied, qint8 mask, QList<qint8> chocoPens, QList<quint8> chocoRatings);
49  void setChocobo(int s, const FF7CHOCOBO &chocoData, const QString &chocoName, quint16 chocoStamina, bool chocoCmate, quint8 rating);
50  void setChocoboPen(int pen, int value);
51  void setOwned(int owned);
52  void setOccupied(int occupied, int mask);
53 protected:
54  void changeEvent(QEvent *);
55 private slots:
56  void ChocoboChanged(int s);
57  void setStablesOwned(int value);
58 private:
59  void updateCombos();
60  bool isEmpty(FF7CHOCOBO choco);
61  void clearSelection();
62  void disableChocoLabels();
63  void enableChocoboLabels(int count);
64  void rmChocobo(int s);
65  void labelUpdate(int label);
66  void connectEditor();
67  QGridLayout *createChocoboPenGrid();
68  QGridLayout *createChocoboLabelGrid();
69  QSpinBox *sbStablesOwned = nullptr;
70  QLCDNumber *lcdStablesOccupied = nullptr;
71  ChocoboLabel *chocoboLabel[6] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
72  ChocoboEditor *chocoboEditor = nullptr;
73  QGroupBox *penBox = nullptr;
74  qint8 stablesOwned = 0;
75  qint8 stablesOccupied = 0;
76  qint8 stableMask;
77  QLabel *lblStablesOwned = nullptr;
78  QLabel *lblStablesOccupied = nullptr;
79  int selectedStable = -1;
80  //one extra of each for a buffer.
81  FF7CHOCOBO chocoboData[7];
82  QString chocoboName[7];
83  bool cantMate[7];
84  quint16 chocoboStamina[7];
85  quint8 chocoboRatings[7];
86  QComboBox *comboChocoPen[4];
87 };
Definition: ChocoboEditor.h:20
A Label to display a single chocobo's brief data.
Definition: ChocoboLabel.h:19
Definition: ChocoboManager.h:16
void sexChanged(int, quint8)
void speedChanged(int, quint16)
void staminaChanged(int, quint16)
void penChanged(int, int)
void accelChanged(int, quint8)
void setMode(bool advanced)
void occupiedChanged(qint8)
void winsChanged(int, quint8)
void nameChanged(int, QString)
void personalityChanged(int, quint8)
void mSpeedChanged(int, quint16)
void typeChanged(int, quint8)
void cantMateChanged(int, bool)
void stableMaskChanged(qint8)
void ownedChanged(qint8)
void intelligenceChanged(int, quint8)
void pCountChanged(int, quint8)
void setAdvancedMode(bool advanced)
Definition: ChocoboManager.h:43
void sprintChanged(int, quint16)
void coopChanged(int, quint8)
void mSprintChanged(int, quint16)
void ratingChanged(int, quint8)
a chocobo in save game