godot-psd-training/UI/screenDoorOperate/screen_door_operate.gd
2024-05-11 14:10:07 +08:00

51 lines
1.7 KiB
GDScript

extends Window
var currenScreenDoor:ScreenDoor=null
@onready var isolation_strip: Button = $PanelContainer/MarginContainer/VBoxContainer/IsolationStrip/IsolationStrip
func _on_screen_door_click_signal(screenDoor:ScreenDoor,mousePosition) -> void:
position = Vector2(mousePosition.x-100,mousePosition.y)
currenScreenDoor = screenDoor
show()
if screenDoor.isSetIsolationStrip :
isolation_strip.text = '撤下隔离带'
else :
isolation_strip.text = '放置隔离带'
$"..".allClickPlatformSignal.emit(screenDoor.name+'RightClick',screenDoor)
func _on_close_requested() -> void:
hide()
##粘胶带
func _on_adhesive_tape_button_down() -> void:
currenScreenDoor.adhesiveTape()
hide()
allClickScreenDoorSignal.emit('clickAdhesiveTapeOf'+currenScreenDoor.name)
func _on_adhesive_tape_mouse_entered() -> void:
$PanelContainer/MarginContainer/VBoxContainer/MarginContainer/AdhesiveTape/AdhesiveTape.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_adhesive_tape_mouse_exited() -> void:
$PanelContainer/MarginContainer/VBoxContainer/MarginContainer/AdhesiveTape/AdhesiveTape.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
##隔离带
func _on_isolation_strip_button_down() -> void:
currenScreenDoor.isSetIsolationStrip = !currenScreenDoor.isSetIsolationStrip
hide()
allClickScreenDoorSignal.emit('clickIsolationStripOf'+currenScreenDoor.name)
func _on_isolation_strip_mouse_entered() -> void:
isolation_strip.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_isolation_strip_mouse_exited() -> void:
isolation_strip.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
##所有ScreenDoorOperate点击操作汇总
signal allClickScreenDoorSignal(equipmentName:String,equipmentInfo)