P08-03: 配置の通常操作受入

This commit is contained in:
Agent Control Runner
2026-10-14 03:22:38 +09:00
parent 12430ba899
commit 7dd450c64c
22 changed files with 7543 additions and 2 deletions
+13 -1
View File
@@ -51,6 +51,7 @@ var selected_entity_id: StringName = &"":
var build_definition: Variant = null
var build_rotation := 0
var excavation_mode := false
var demolition_mode := false
var visual_theme: VisualThemeProfile = null
var zoom_level := 1.0
@@ -134,6 +135,8 @@ func set_visual_theme(profile: VisualThemeProfile) -> void:
func set_build_definition(definition: Variant, rotation := 0) -> void:
if definition != null:
demolition_mode = false
if definition != null and excavation_mode:
set_excavation_mode(false)
build_definition = definition
@@ -157,6 +160,8 @@ func set_build_rotation(value: int) -> void:
func set_excavation_mode(enabled: bool) -> void:
if enabled:
demolition_mode = false
if excavation_mode == enabled:
_update_excavation_preview()
return
@@ -461,7 +466,7 @@ func _gui_input(event: InputEvent) -> void:
var cell: Variant = canvas_to_cell(event.position)
if not cell is Vector3i:
return
if build_definition != null or excavation_mode:
if build_definition != null or excavation_mode or demolition_mode:
cell_clicked.emit(cell)
accept_event()
return
@@ -1685,3 +1690,10 @@ func _draw_build_connection(report: Dictionary) -> void:
var message := "入口への経路接続済" if status == &"CONNECTED" else "入口への経路未接続" if status == &"DISCONNECTED" else "入口・経路を確認できません"
draw_string(ThemeDB.fallback_font, target+Vector2(8,-12), message,
HORIZONTAL_ALIGNMENT_LEFT, -1, 13, color)
func set_demolition_mode(enabled: bool) -> void:
demolition_mode = enabled
if enabled:
clear_build_definition()
set_excavation_mode(false)
queue_redraw()