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
67
68
69
70
71
72
73
74
75
76
77
78
|
#include "lsmaterialeditor.h"
#include "lsmaterialeditors.h"
#include <QGroupBox>
LSMaterialEditor::LSMaterialEditor(QWidget *parent) :
QWidget(parent) {
QGridLayout *grid = new QGridLayout(this);
int gridRow = 0;
m_nameEntry = new QLineEdit(this);
grid->addWidget(new QLabel("Name:", this), gridRow, 0, 1, 1);
grid->addWidget(m_nameEntry, gridRow, 1, 1, 1);
gridRow++;
// TEV colour box
QGroupBox *tevCBox = new QGroupBox("TEV Colours", this);
QGridLayout *tevCLayout = new QGridLayout(tevCBox);
tevCLayout->addWidget(new QLabel("Initial Registers:", tevCBox), 0, 0, 1, 4);
tevCLayout->addWidget(new QLabel("Constant:", tevCBox), 2, 0, 1, 4);
for (int i = 0; i < 7; i++) {
m_colourPickers[i] = new LSColorPicker(tevCBox);
bool isKonst = (i >= 3);
tevCLayout->addWidget(m_colourPickers[i], isKonst?3:1, isKonst?(i-3):i, 1, 1);
}
grid->addWidget(tevCBox, gridRow, 0, 1, 2);
gridRow++;
// TEV stages
QGroupBox *stageBox = new QGroupBox("TEV Stages", this);
QVBoxLayout *stageLayout = new QVBoxLayout(stageBox);
m_tevStageSetEditor = new LSSetEditor<LYTTevStage, LSTevStageEditor>(16, stageBox);
stageLayout->addWidget(m_tevStageSetEditor);
grid->addWidget(stageBox, gridRow, 0, 1, 2);
gridRow++;
// finish it all up
grid->setRowStretch(gridRow, 1);
m_currentlyLoadingMaterial = false;
m_material = 0;
}
void LSMaterialEditor::setMaterial(LYTMaterial *mat) {
m_currentlyLoadingMaterial = true;
m_material = mat;
m_nameEntry->setText(mat->name);
for (int i = 0; i < 3; i++)
m_colourPickers[i]->setColor(mat->colours[i]);
for (int i = 0; i < 4; i++)
m_colourPickers[i+3]->setColor(mat->tevKColour[i]);
m_tevStageSetEditor->setData(&mat->tevStages);
m_currentlyLoadingMaterial = false;
}
void LSMaterialEditor::handleNameChanged(QString value) {
}
void LSMaterialEditor::handleSaveChangedName() {
}
void LSMaterialEditor::handleColourPicked(QColor value) {
}
|