summaryrefslogtreecommitdiff
path: root/src/editorui/doodads.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/editorui/doodads.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/editorui/doodads.py b/src/editorui/doodads.py
index d7f767f..7b9e222 100644
--- a/src/editorui/doodads.py
+++ b/src/editorui/doodads.py
@@ -129,15 +129,21 @@ class KPEditorDoodad(KPEditorItem):
# Add/Remove Animation Buttons
- addbutton = QtGui.QPushButton("Add Animation")
- rembutton = QtGui.QPushButton("Remove Animation")
- presetbutton = QtGui.QPushButton("Add Preset")
- newpbutton = QtGui.QPushButton("New Preset")
+ addbutton = QtGui.QPushButton(QtGui.QIcon("Resources/Plus.png"), "")
+ rembutton = QtGui.QPushButton(QtGui.QIcon("Resources/Minus.png"), "")
+ presetbutton = QtGui.QPushButton(QtGui.QIcon("Resources/AddPreset.png"), "Add Preset")
+ newpbutton = QtGui.QPushButton(QtGui.QIcon("Resources/NewPreset.png"), "New Preset")
+ # savebutton = QtGui.QPushButton(QtGui.QIcon("Resources/SavePreset.png"), "Save")
+ # loadbutton = QtGui.QPushButton(QtGui.QIcon("Resources/LoadPreset.png"), "Load")
+ # clearbutton = QtGui.QPushButton(QtGui.QIcon("Resources/ClearPreset.png"), "Clear")
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(savebutton, 1, 6, 1, 1)
+ # BottomLayout.addWidget(loadbutton, 1, 7, 1, 1)
+ # BottomLayout.addWidget(clearbutton, 1, 8, 1, 1)
# Annnnndddd we're spent.
@@ -148,13 +154,15 @@ class KPEditorDoodad(KPEditorItem):
presetbutton.released.connect(self.selectPreset)
newpbutton.released.connect(self.addToPreset)
+ # savebutton.released.connect(KP.mainWindow.saveAnimPresets)
+ # loadbutton.released.connect(KP.mainWindow.loadAnimPresets)
+ # clearbutton.released.connect(KP.mainWindow.clearAnimPresets)
def sizeHint(self):
return QtCore.QSize(591,300)
-
def addAnmItem(self):
itemA = QtGui.QStandardItem()
@@ -229,11 +237,12 @@ class KPEditorDoodad(KPEditorItem):
preset.append(listrow)
settings = KP.app.settings
-
+ import mapfile
+
if settings.contains('AnimationPresets'):
- presetList = settings.value('AnimationPresets').toPyObject()
- presets = settings.value('AnimationPresetData').toPyObject()
+ presetList = mapfile.load(str(settings.value('AnimationPresets').toPyObject()))
+ presets = mapfile.load(str(settings.value('AnimationPresetData').toPyObject()))
else:
@@ -243,8 +252,8 @@ class KPEditorDoodad(KPEditorItem):
presetList.append(name)
presets.append(preset)
- settings.setValue('AnimationPresets', presetList)
- settings.setValue('AnimationPresetData', presets)
+ settings.setValue('AnimationPresets', mapfile.dump(presetList))
+ settings.setValue('AnimationPresetData', mapfile.dump(presets))
def __init__(self, doodadRef):