P08-03: 配置の通常操作受入
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user