Godot update, camera nav widget, closes #35
This commit is contained in:
@@ -14,6 +14,19 @@ onready var vmode = {
|
||||
# var item = $"%building_type".get_item_text(index)
|
||||
# $WorldEditor.editor_command("change_building_type", [selected_building, item])
|
||||
|
||||
#var nav_active = false
|
||||
#func nav_gui_input(event: InputEvent):
|
||||
# if Input.is_action_just_pressed("mouse1"):
|
||||
# Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
# nav_active = true
|
||||
# elif Input.is_action_just_released("mouse1"):
|
||||
# Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
# nav_active = false
|
||||
# if nav_active && Input.is_action_pressed("mouse1"):
|
||||
# if event is InputEventMouseMotion:
|
||||
# get_viewport().get_camera().global_transform.origin.x += event.relative.x
|
||||
# get_viewport().get_camera().global_transform.origin.z -= event.relative.y
|
||||
|
||||
func _ready():
|
||||
for b in [
|
||||
$"%select_buildings",
|
||||
@@ -30,7 +43,7 @@ func _ready():
|
||||
$"%building_cursor".hide()
|
||||
$"%line_cursor".hide()
|
||||
# $"%building_type".connect("item_selected", self, "change_building_type")
|
||||
|
||||
# $"%NavPanel".connect("gui_input", self, "nav_gui_input")
|
||||
var ignore_events = [
|
||||
"result:get_closest_building",
|
||||
"mouse_drag",
|
||||
|
||||
Reference in New Issue
Block a user