37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
class ToolManager:
|
|
"""工具管理器 - 管理编辑器工具状态"""
|
|
|
|
def __init__(self, world):
|
|
"""初始化工具管理器"""
|
|
self.world = world
|
|
self.currentTool = "选择" # 默认工具为选择工具
|
|
|
|
def setCurrentTool(self, tool):
|
|
"""设置当前工具"""
|
|
self.currentTool = tool
|
|
|
|
print(f"\n=== 工具切换 ===")
|
|
print(f"当前工具: {tool}")
|
|
print(f"选中节点: {self.world.selection.selectedNode.getName() if self.world.selection.selectedNode else '无'}")
|
|
|
|
# 坐标轴现在始终跟随选中状态,不再依赖工具类型
|
|
|
|
def getCurrentTool(self):
|
|
"""获取当前工具"""
|
|
return self.currentTool
|
|
|
|
def isSelectionTool(self):
|
|
"""检查当前是否是选择工具"""
|
|
return self.currentTool == "选择"
|
|
|
|
def isMoveTool(self):
|
|
"""检查当前是否是移动工具"""
|
|
return self.currentTool == "移动"
|
|
|
|
def isRotateTool(self):
|
|
"""检查当前是否是旋转工具"""
|
|
return self.currentTool == "旋转"
|
|
|
|
def isScaleTool(self):
|
|
"""检查当前是否是缩放工具"""
|
|
return self.currentTool == "缩放" |