Esempio n. 1
0
def doFullSave(item):
    """This function forces a full save and process all operation."""
    Personality.preFullSave()
    WorldEditor.save()
Esempio n. 2
0
def actSaveProjectExecute():
    """This function forces a full save and process all operation."""
    Personality.preFullSave()
    WorldEditor.save()
Esempio n. 3
0
def doFullSave( item ):
	"""This function forces a full save and process all operation."""
	Personality.preFullSave()
	WorldEditor.save()
def actSaveProjectExecute():
	"""This function forces a full save and process all operation."""
	Personality.preFullSave()
	WorldEditor.save()
Esempio n. 5
0
	def ownKeyEvent( self, key, modifiers ):
		t = WorldEditor.tool()

		handled = 1

		if key == KEY_RBRACKET:
			if modifiers & MODIFIER_SHIFT:
				t.strength = t.strength * 1.25
				WorldEditor.addCommentaryMsg( "Tool strength %0.1f" % t.strength, 0 )
			else:
				t.size = t.size * 1.25
				WorldEditor.addCommentaryMsg( "Tool size %0.1f" % t.size, 0 )
		elif key == KEY_LBRACKET:
			if modifiers & MODIFIER_SHIFT:
				t.strength = t.strength * 0.8
				WorldEditor.addCommentaryMsg( "Tool strength %0.1f" % t.strength, 0 )
			else:
				t.size = t.size * 0.8
				WorldEditor.addCommentaryMsg( "Tool size %0.1f" % t.size, 0 )

		elif key == KEY_F6:
			scv = WorldEditor.getOptionString( "tools/showChunkVisualisation" )
			if scv == "true":
				self.alphatool.delView( self.chunkvis )
				WorldEditor.setOptionString( "tools/showChunkVisualisation", "false" )
			else:
				self.alphatool.addView( self.chunkvis )
				WorldEditor.setOptionString( "tools/showChunkVisualisation", "true" )

		elif key == KEY_F8:
			WorldEditor.save()

		elif key == KEY_F9:
			if not t.applying:
				if t == self.alphatool:
					if t.functor == self.alphafunc:
						t.functor = self.heightfunc
						self.guiview.visible = 0
						WorldEditor.addCommentaryMsg(
							"Entering height filter mode.  Press LMB to apply", 0 )
					else:
						t.functor = self.alphafunc
						WorldEditor.pushTool( self.ecotool )
						WorldEditor.addCommentaryMsg(
							"Entering ecotype mode.  Press Enter to apply", 0 )
				elif t == self.ecotool:
					WorldEditor.popTool()
					WorldEditor.pushTool( self.objtool )
					WorldEditor.addCommentaryMsg(
						"Entering objt manipln mode. Use LMB to select", 0 )
				else:
					WorldEditor.popTool()
					self.guiview.visible = 1
					WorldEditor.addCommentaryMsg(
						"Entering alpha mode.  Press LMB to apply", 0 )
					

		elif key == KEY_Z:
			if not t.applying and (modifiers & MODIFIER_CONTROL):
				if not (modifiers & MODIFIER_SHIFT):
					what = WorldEditor.undo(0)
					if what:
						WorldEditor.addCommentaryMsg( "Undoing: " + what, 1 )
					WorldEditor.undo()
				else:
					what = WorldEditor.redo(0)
					if what:
						WorldEditor.addCommentaryMsg( "Redoing: " + what, 1 )
					WorldEditor.redo()

		elif key == KEY_I and (modifiers & MODIFIER_CONTROL):
			self.objInfo.browseUp()
			self.objInfo.showBrowse()
		elif key == KEY_K and (modifiers & MODIFIER_CONTROL):
			self.objInfo.browseDown()
			self.objInfo.showBrowse()
		elif key == KEY_J and (modifiers & MODIFIER_CONTROL):
			self.objInfo.browseLeft()
			self.objInfo.showBrowse()
		elif key == KEY_L and (modifiers & MODIFIER_CONTROL):
			self.objInfo.browseRight()
			self.objInfo.showBrowse()

		else:
			handled = 0
		
		return handled