mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
*** empty log message ***
This commit is contained in:
parent
cffa99aba5
commit
d3f8d9364b
@ -394,6 +394,7 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.ignore('handleMouse3Up')
|
self.ignore('handleMouse3Up')
|
||||||
|
|
||||||
def editToontownCentral(self):
|
def editToontownCentral(self):
|
||||||
|
self.editMode = 'toontownCentral'
|
||||||
self.levelMap.setPos(0.0,0.0,0.0)
|
self.levelMap.setPos(0.0,0.0,0.0)
|
||||||
self.showMap('toontownCentral')
|
self.showMap('toontownCentral')
|
||||||
self.useToontownCentralColors()
|
self.useToontownCentralColors()
|
||||||
@ -408,6 +409,7 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.panel.editMenu.selectitem('Toontown Central')
|
self.panel.editMenu.selectitem('Toontown Central')
|
||||||
|
|
||||||
def editDonaldsDock(self):
|
def editDonaldsDock(self):
|
||||||
|
self.editMode = 'donaldsDock'
|
||||||
self.levelMap.setPos(0.0,0.0,0.0)
|
self.levelMap.setPos(0.0,0.0,0.0)
|
||||||
self.showMap('donaldsDock')
|
self.showMap('donaldsDock')
|
||||||
self.useDonaldsDockColors()
|
self.useDonaldsDockColors()
|
||||||
@ -423,6 +425,7 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.panel.editMenu.selectitem('Donalds Dock')
|
self.panel.editMenu.selectitem('Donalds Dock')
|
||||||
|
|
||||||
def editMinniesMelodyLand(self):
|
def editMinniesMelodyLand(self):
|
||||||
|
self.editMode = 'minniesMelodyLand'
|
||||||
self.levelMap.setPos(0.0,0.0,0.0)
|
self.levelMap.setPos(0.0,0.0,0.0)
|
||||||
self.showMap('minniesMelodyLand')
|
self.showMap('minniesMelodyLand')
|
||||||
self.useMinniesMelodyLandColors()
|
self.useMinniesMelodyLandColors()
|
||||||
@ -438,6 +441,7 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.panel.editMenu.selectitem('Minnies Melody Land')
|
self.panel.editMenu.selectitem('Minnies Melody Land')
|
||||||
|
|
||||||
def editTheBurrrgh(self):
|
def editTheBurrrgh(self):
|
||||||
|
self.editMode = 'theBurrrgh'
|
||||||
self.levelMap.setPos(0.0,0.0,0.0)
|
self.levelMap.setPos(0.0,0.0,0.0)
|
||||||
self.showMap('theBurrrgh')
|
self.showMap('theBurrrgh')
|
||||||
self.useTheBurrrghColors()
|
self.useTheBurrrghColors()
|
||||||
@ -468,9 +472,8 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.accept('createNewLevelGroup', self.createNewLevelGroup)
|
self.accept('createNewLevelGroup', self.createNewLevelGroup)
|
||||||
self.accept('setNodePathName', self.setNodePathName)
|
self.accept('setNodePathName', self.setNodePathName)
|
||||||
self.accept('manipulateObjectCleanup', self.updateSelectedPose)
|
self.accept('manipulateObjectCleanup', self.updateSelectedPose)
|
||||||
self.accept('SGESelectNodePath', self.selectNodePath)
|
|
||||||
#self.accept('SGESelectNodePath', self.flashNodePath)
|
|
||||||
self.accept('SGEFlashNodePath', self.flashNodePath)
|
self.accept('SGEFlashNodePath', self.flashNodePath)
|
||||||
|
self.accept('SGESelectNodePath', self.selectNodePath)
|
||||||
self.accept('SGEIsolateNodePath', self.isolateNodePath)
|
self.accept('SGEIsolateNodePath', self.isolateNodePath)
|
||||||
self.accept('SGEToggle VizNodePath', self.toggleNodePathViz)
|
self.accept('SGEToggle VizNodePath', self.toggleNodePathViz)
|
||||||
self.accept('SGESet ParentNodePath', self.setGroupParent)
|
self.accept('SGESet ParentNodePath', self.setGroupParent)
|
||||||
@ -1048,6 +1051,35 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
dict['corniceColors'] = corniceColors
|
dict['corniceColors'] = corniceColors
|
||||||
return dict
|
return dict
|
||||||
|
|
||||||
|
def saveColor(self):
|
||||||
|
self.appendColorToColorPaletteFile(self.panel.colorEntry.get())
|
||||||
|
|
||||||
|
def appendColorToColorPaletteFile(self, color):
|
||||||
|
obj = self.targetDNAObject
|
||||||
|
if obj:
|
||||||
|
classType = obj.__class__.getClassType()
|
||||||
|
if classType.eq(DNAWall.getClassType()):
|
||||||
|
tag = 'wallColor:'
|
||||||
|
elif classType.eq(DNAWindows.getClassType()):
|
||||||
|
tag = 'windowColor:'
|
||||||
|
elif classType.eq(DNADoor.getClassType()):
|
||||||
|
tag = 'doorColor:'
|
||||||
|
elif classType.eq(DNACornice.getClassType()):
|
||||||
|
tag = 'corniceColor:'
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
# Valid type, add color to file
|
||||||
|
filename = 'level_editor/' + self.editMode + 'Colors.txtnew'
|
||||||
|
f = Filename(filename)
|
||||||
|
f.resolveFilename(getModelPath())
|
||||||
|
f = open(f.toOsSpecific(), 'a')
|
||||||
|
f.write('%s Vec4(%.2f, %.2f, %.2f, 1.0)\n' %
|
||||||
|
(tag,
|
||||||
|
color[0]/255.0,
|
||||||
|
color[1]/255.0,
|
||||||
|
color[2]/255.0))
|
||||||
|
f.close()
|
||||||
|
|
||||||
def printColorDictionary(self, dict):
|
def printColorDictionary(self, dict):
|
||||||
for color in dict['wallColors']:
|
for color in dict['wallColors']:
|
||||||
print ('wallColor: Vec4(%.2f, %.2f, %.2f, 1.0)' %
|
print ('wallColor: Vec4(%.2f, %.2f, %.2f, 1.0)' %
|
||||||
@ -3128,6 +3160,8 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
self.colorEntry = VectorWidgets.ColorEntry(
|
self.colorEntry = VectorWidgets.ColorEntry(
|
||||||
hull, text = 'Select Color',
|
hull, text = 'Select Color',
|
||||||
command = self.updateSelectedObjColor)
|
command = self.updateSelectedObjColor)
|
||||||
|
self.colorEntry.menu.add_command(
|
||||||
|
label = 'Save Color', command = self.levelEditor.saveColor)
|
||||||
self.colorEntry.pack(fill = 'x')
|
self.colorEntry.pack(fill = 'x')
|
||||||
|
|
||||||
buttonFrame = Frame(hull)
|
buttonFrame = Frame(hull)
|
||||||
|
@ -112,7 +112,7 @@ class SceneGraphExplorerItem(TreeItem):
|
|||||||
return sublist
|
return sublist
|
||||||
|
|
||||||
def OnSelect(self):
|
def OnSelect(self):
|
||||||
messenger.send('SGESelectNodePath', [self.nodePath])
|
messenger.send('SGEFlashNodePath', [self.nodePath])
|
||||||
|
|
||||||
def MenuCommand(self, command):
|
def MenuCommand(self, command):
|
||||||
messenger.send('SGE' + command + 'NodePath', [self.nodePath])
|
messenger.send('SGE' + command + 'NodePath', [self.nodePath])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user