diff options
author | Colin Noga <Tempus@chronometry.ca> | 2011-12-04 19:28:54 -0600 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2011-12-04 19:28:54 -0600 |
commit | 21cf889b5e45a5619a09e46db246abd4abbec3a4 (patch) | |
tree | 746370d0878358a948477ff92cc965f441fce5e9 /src/editorui | |
parent | 06ac2e91738f2dfc3043bbe23b807a45ea69596a (diff) | |
download | koopatlas-21cf889b5e45a5619a09e46db246abd4abbec3a4.tar.gz koopatlas-21cf889b5e45a5619a09e46db246abd4abbec3a4.zip |
Added animation preset saving/loading, and icons
Diffstat (limited to 'src/editorui')
-rw-r--r-- | src/editorui/doodads.py | 29 |
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): |