summaryrefslogtreecommitdiff
path: root/src/worldeditor.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/worldeditor.py')
-rw-r--r--src/worldeditor.py53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/worldeditor.py b/src/worldeditor.py
index 35e42a6..0993f35 100644
--- a/src/worldeditor.py
+++ b/src/worldeditor.py
@@ -16,7 +16,7 @@ def colourFromNiceStr(thing):
return None
class KPWorldTableModel(QtCore.QAbstractTableModel):
- FIELDS = ('Name', 'Track ID',
+ FIELDS = ('Name', 'World ID', 'Track ID',
'FS Text 1', 'FS Text 2',
'FS Hint 1', 'FS Hint 2',
'HUD Text 1', 'HUD Text 2',
@@ -55,23 +55,25 @@ class KPWorldTableModel(QtCore.QAbstractTableModel):
if col == 0:
return entry.name
elif col == 1:
+ return entry.worldID
+ elif col == 2:
return entry.musicTrackID
- elif col == 2 or col == 3:
- return editableColourStr(entry.fsTextColours[col - 2])
- elif col == 4 or col == 5:
- return editableColourStr(entry.fsHintColours[col - 4])
- elif col == 6 or col == 7:
- return editableColourStr(entry.hudTextColours[col - 6])
- elif col >= 8 and col <= 10:
- return entry.hudHintTransform[col - 8]
+ elif col == 3 or col == 4:
+ return editableColourStr(entry.fsTextColours[col - 3])
+ elif col == 5 or col == 6:
+ return editableColourStr(entry.fsHintColours[col - 5])
+ elif col == 7 or col == 8:
+ return editableColourStr(entry.hudTextColours[col - 7])
+ elif col >= 9 and col <= 11:
+ return entry.hudHintTransform[col - 9]
if role == Qt.DecorationRole:
- if col == 2 or col == 3:
- return QtGui.QColor(*entry.fsTextColours[col - 2])
- elif col == 4 or col == 5:
- return QtGui.QColor(*entry.fsHintColours[col - 4])
- elif col == 6 or col == 7:
- return QtGui.QColor(*entry.hudTextColours[col - 6])
+ if col == 3 or col == 4:
+ return QtGui.QColor(*entry.fsTextColours[col - 3])
+ elif col == 5 or col == 6:
+ return QtGui.QColor(*entry.fsHintColours[col - 5])
+ elif col == 7 or col == 8:
+ return QtGui.QColor(*entry.hudTextColours[col - 7])
return QtCore.QVariant()
@@ -90,31 +92,34 @@ class KPWorldTableModel(QtCore.QAbstractTableModel):
entry.name = str(value.toString())
success = True
elif col == 1:
+ entry.worldID = str(value.toString())
+ success = True
+ elif col == 2:
v,ok = value.toInt()
if ok:
entry.musicTrackID = v
success = True
- elif col >= 2 and col <= 7:
+ elif col >= 3 and col <= 8:
newCol = colourFromNiceStr(str(value.toString()))
if newCol:
success = True
- if col == 2:
+ if col == 3:
entry.fsTextColours = (newCol, entry.fsTextColours[1])
- elif col == 3:
- entry.fsTextColours = (entry.fsTextColours[0], newCol)
elif col == 4:
- entry.fsHintColours = (newCol, entry.fsHintColours[1])
+ entry.fsTextColours = (entry.fsTextColours[0], newCol)
elif col == 5:
- entry.fsHintColours = (entry.fsHintColours[0], newCol)
+ entry.fsHintColours = (newCol, entry.fsHintColours[1])
elif col == 6:
- entry.hudTextColours = (newCol, entry.hudTextColours[1])
+ entry.fsHintColours = (entry.fsHintColours[0], newCol)
elif col == 7:
+ entry.hudTextColours = (newCol, entry.hudTextColours[1])
+ elif col == 8:
entry.hudTextColours = (entry.hudTextColours[0], newCol)
- elif col >= 8 and col <= 10:
+ elif col >= 9 and col <= 11:
v,ok = value.toInt()
if ok:
new = list(entry.hudHintTransform)
- new[col - 8] = v
+ new[col - 9] = v
entry.hudHintTransform = new
success = True