summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-05-13 10:37:33 -0500
committerColin Noga <Tempus@chronometry.ca>2012-05-13 10:37:33 -0500
commit06c6ea9b11837d32b47dfe2807e3fc83eb80c9a4 (patch)
tree6c165950434f3c688b26aef2d53f31df1a115985 /src/ui.py
parente037c2d4256e2975e50d00517526794dff444f0d (diff)
downloadkoopatlas-06c6ea9b11837d32b47dfe2807e3fc83eb80c9a4.tar.gz
koopatlas-06c6ea9b11837d32b47dfe2807e3fc83eb80c9a4.zip
Added Delay offset, made Y scale begin from bottom coords rather than top, some fixes
Diffstat (limited to 'src/ui.py')
-rw-r--r--src/ui.py37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/ui.py b/src/ui.py
index a7d2524..74e1fdc 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -731,14 +731,14 @@ class KPAnmOptions(QtGui.QWidget):
# Time for the Table View, model and Delegate
- self.model = QtGui.QStandardItemModel(0, 7)
+ self.model = QtGui.QStandardItemModel(0, 8)
self.anmTable = QtGui.QTableView()
self.anmTable.setModel(self.model)
delegate = self.AnmDelegate()
self.anmTable.setItemDelegate(delegate)
- self.model.setHorizontalHeaderLabels(["Looping", "Interpolation", "Frame Len", "Type", "Start Value", "End Value", "Delay"])
+ self.model.setHorizontalHeaderLabels(["Looping", "Interpolation", "Frame Len", "Type", "Start Value", "End Value", "Delay", "Delay Offset"])
self.anmTable.setColumnWidth(0, 150)
self.anmTable.setColumnWidth(1, 100)
self.anmTable.setColumnWidth(2, 65)
@@ -746,11 +746,12 @@ class KPAnmOptions(QtGui.QWidget):
self.anmTable.setColumnWidth(4, 65)
self.anmTable.setColumnWidth(5, 65)
self.anmTable.setColumnWidth(6, 65)
+ self.anmTable.setColumnWidth(7, 80)
self.anmTable.horizontalHeader().setVisible(True)
self.anmTable.verticalHeader().setVisible(False)
- BottomLayout.addWidget(self.anmTable, 0, 0, 1, 6)
+ BottomLayout.addWidget(self.anmTable, 0, 0, 1, 8)
# Add/Remove Animation Buttons
@@ -764,8 +765,8 @@ class KPAnmOptions(QtGui.QWidget):
BottomLayout.addWidget(addbutton, 1, 0, 1, 1)
BottomLayout.addWidget(rembutton, 1, 1, 1, 1)
BottomLayout.addWidget(QtGui.QLabel(""), 1, 2, 1, 2)
- BottomLayout.addWidget(presetbutton, 1, 4, 1, 1)
- BottomLayout.addWidget(newpbutton, 1, 5, 1, 1)
+ BottomLayout.addWidget(presetbutton, 1, 6, 1, 1)
+ BottomLayout.addWidget(newpbutton, 1, 7, 1, 1)
# BottomLayout.addWidget(savebutton, 1, 6, 1, 1)
# BottomLayout.addWidget(loadbutton, 1, 7, 1, 1)
# BottomLayout.addWidget(clearbutton, 1, 8, 1, 1)
@@ -792,20 +793,25 @@ class KPAnmOptions(QtGui.QWidget):
# Fix for backwards compatibility
if len(row) == 6:
- row.append(0.0)
+ row.append(0)
+
+ if len(row) == 7:
+ row.append(0)
itemA = QtGui.QStandardItem()
itemB = QtGui.QStandardItem()
itemC = QtGui.QStandardItem()
itemD = QtGui.QStandardItem()
+ itemE = QtGui.QStandardItem()
itemA.setData(row[2], QtCore.Qt.EditRole)
itemB.setData(row[4], QtCore.Qt.EditRole)
itemC.setData(row[5], QtCore.Qt.EditRole)
itemD.setData(row[6], QtCore.Qt.EditRole)
+ itemE.setData(row[7], QtCore.Qt.EditRole)
self.model.appendRow([QtGui.QStandardItem(row[0]), QtGui.QStandardItem(row[1]),
- itemA, QtGui.QStandardItem(row[3]), itemB, itemC, itemD])
+ itemA, QtGui.QStandardItem(row[3]), itemB, itemC, itemD, itemE])
self.update()
@@ -818,15 +824,17 @@ class KPAnmOptions(QtGui.QWidget):
itemB = QtGui.QStandardItem()
itemC = QtGui.QStandardItem()
itemD = QtGui.QStandardItem()
+ itemE = QtGui.QStandardItem()
itemA.setData(1, QtCore.Qt.EditRole)
itemB.setData(0.0, QtCore.Qt.EditRole)
itemC.setData(0.0, QtCore.Qt.EditRole)
- itemD.setData(0.0, QtCore.Qt.EditRole)
+ itemD.setData(0, QtCore.Qt.EditRole)
+ itemE.setData(0, QtCore.Qt.EditRole)
self.model.appendRow([QtGui.QStandardItem("Contiguous"), QtGui.QStandardItem("Linear"),
itemA, QtGui.QStandardItem("X Position"),
- itemB, itemC, itemD])
+ itemB, itemC, itemD, itemE])
def remAnmItem(self):
@@ -860,8 +868,10 @@ class KPAnmOptions(QtGui.QWidget):
f.setData(row[5], Qt.EditRole)
g = q()
g.setData(row[6], Qt.EditRole)
+ h = q()
+ h.setData(row[6], Qt.EditRole)
- self.model.appendRow([a,b,c,d,e,f,g])
+ self.model.appendRow([a,b,c,d,e,f,g,h])
self.resolveAnmList()
@@ -877,7 +887,7 @@ class KPAnmOptions(QtGui.QWidget):
preset = []
for row in xrange(self.model.rowCount()):
listrow = []
- for column in xrange(7):
+ for column in xrange(8):
item = self.model.item(row, column)
if (column == 0) or (column == 1) or (column == 2):
data = str(item.data(Qt.EditRole).toString())
@@ -918,7 +928,7 @@ class KPAnmOptions(QtGui.QWidget):
for x in xrange(rows):
rowList = []
- for item in xrange(7):
+ for item in xrange(8):
index = model.index(x, item)
data = model.data(index, Qt.EditRole).toString()
if data.toFloat()[1]:
@@ -937,7 +947,7 @@ class KPAnmOptions(QtGui.QWidget):
d.setupAnimations()
model.clear()
- self.model.setHorizontalHeaderLabels(["Looping", "Interpolation", "Frame Len", "Type", "Start Value", "End Value", "Delay"])
+ self.model.setHorizontalHeaderLabels(["Looping", "Interpolation", "Frame Len", "Type", "Start Value", "End Value", "Delay", "Delay Offset"])
self._doodadRef = None
self.doodadList = None
@@ -1204,6 +1214,7 @@ class KPMainWindow(QtGui.QMainWindow):
self.anmOptsDock.setWindowTitle("Editing {0} Doodad{1}".format(len(doodadList), suffix))
self.anmOpts.setupAnms(doodadList)
+
########################
# Slots for Menu Items #
########################