本文整理汇总了Python中WorldEditor.popTool方法的典型用法代码示例。如果您正苦于以下问题:Python WorldEditor.popTool方法的具体用法?Python WorldEditor.popTool怎么用?Python WorldEditor.popTool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldEditor
的用法示例。
在下文中一共展示了WorldEditor.popTool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onPause
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import popTool [as 别名]
def onPause( self ):
self.cc.visible = 0
self.cc.delAsView()
if ( WorldEditor.tool() != None ):
WorldEditor.popTool()
pass
示例2: update
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import popTool [as 别名]
def update( self, dTime, tool ):
# must use update to check for this, key events aren't reliable
if not WorldEditor.isKeyDown( KEY_LEFTMOUSE ):
if (WorldEditor.isKeyDown( KEY_LCONTROL ) or WorldEditor.isKeyDown( KEY_RCONTROL )):
# add the set
set_union( self.chunkItemFunctor.selection, self.mouseRevealer )
elif WorldEditor.isKeyDown( KEY_LALT ) or WorldEditor.isKeyDown( KEY_RALT ):
# remove the set
self.chunkItemFunctor.selection.rem( self.mouseRevealer )
else:
# set the selection to our mouse revaler
set_assign( self.chunkItemFunctor.selection, self.mouseRevealer )
if not WorldEditor.isKeyDown( KEY_LALT ) and not WorldEditor.isKeyDown( KEY_RALT ):
# not removing, so also add whatever is under the cursor
set_union( self.chunkItemFunctor.selection, self.chunkItemFunctor.mouseRevealer )
self.chunkItemFunctor.selUpdate()
WorldEditor.popTool( )
示例3: enterMode
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import popTool [as 别名]
def enterMode( self, modeName, forceUpdate = 0 ):
#print "enterMode - current %s, new %s, terrainMode %s" % (self.modeName, modeName, self.terrainModeName )
if (self.modeName == modeName) and (not forceUpdate):
return
t = WorldEditor.tool()
oldTool = t
if t != None and modeName != "Object":
if self.itemTool.functor.script.selection.size:
self.itemTool.functor.script.selection.rem( self.itemTool.functor.script.selection )
self.itemTool.functor.script.selUpdate()
WorldEditor.popTool()
# Remove the project or height module if we're coming out of project or height mode
if self.modeName in ("Project", "Height"):
self.modeStack.pop()
self.modeName = self.modeStack[ len( self.modeStack ) - 1 ]
WorldEditor.pop()
if ( modeName == "TerrainTexture" ):
WorldEditor.pushTool( self.alphaTool )
self.terrainModeName = modeName
elif ( modeName == "TerrainHeight" ):
WorldEditor.pushTool( self.heightTool )
self.terrainModeName = modeName
elif ( modeName == "TerrainFilter" ):
WorldEditor.pushTool( self.filterTool )
self.terrainModeName = modeName
elif ( modeName == "TerrainHoleCut" ):
WorldEditor.pushTool( self.holeTool )
self.terrainModeName = modeName
elif ( modeName == "Terrain" ):
self.modeName = modeName
self.enterMode( self.terrainModeName )
self.modeStack.append( modeName )
return
elif ( modeName == "Object" ):
WorldEditor.pushTool( self.itemTool )
self.modeStack.append( modeName )
elif ( modeName == "Project" ):
WorldEditor.push( "ProjectModule" )
self.modeStack.append( modeName )
elif ( modeName == "Height" ):
WorldEditor.push( "HeightModule" )
self.modeStack.append( modeName )
else:
WorldEditor.addCommentaryMsg( "%s mode not yet implemented" % modeName, 1 )
self.enterChunkVizMode()
WorldEditor.addCommentaryMsg( "entered " + modeName + " mode" )
self.modeName = modeName
newTool = WorldEditor.tool()
if oldTool != None and oldTool != newTool:
oldTool.endUsing()
if newTool != None:
newTool.beginUsing()