forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_spell_window.h
66 lines (52 loc) · 1.55 KB
/
fake_spell_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef CATA_OBJECT_CREATOR_FAKE_SPELL_WINDOW_H
#define CATA_OBJECT_CREATOR_FAKE_SPELL_WINDOW_H
#include "magic.h"
#include <QtWidgets/qcombobox.h>
#include <QtWidgets/qlabel.h>
#include <QtWidgets/qlineedit.h>
#include <QtWidgets/qlistwidget.h>
#include <QtWidgets/qmainwindow.h>
#include <QtWidgets/qspinbox.h>
namespace creator
{
class fake_spell_window : public QMainWindow
{
Q_OBJECT
public:
fake_spell_window( QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
void show() {
QWidget::show();
}
void hide() {
QWidget::hide();
}
const fake_spell &get_fake_spell() const {
return editable_spell;
};
void set_fake_spell( const fake_spell &sp ) {
editable_spell = sp;
}
void set_update_func( const std::function<void( void )> &func ) {
update_func = func;
}
// the index of this window in the windows vector in fake_spell_listbox
int index = 0;
Q_SIGNALS:
// emits a signal if any attached data is modified
void modified();
private:
std::function<void( void )> update_func = []() {};
fake_spell editable_spell;
QLineEdit error_window;
QLabel id_label;
QLabel max_level_label;
QLabel min_level_label;
QLabel once_in_label;
QLineEdit id_box;
QSpinBox max_level_box;
QSpinBox min_level_box;
QSpinBox once_in_duration_box;
QComboBox once_in_units_box;
};
}
#endif