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

This commit is contained in:
Agent Control Runner
2026-10-14 16:08:32 +09:00
parent 7e2368f5c4
commit 47750010b8
9 changed files with 498 additions and 56 deletions
+20 -10
View File
@@ -2781,17 +2781,17 @@ func _phase_name(phase: GameClock.Phase) -> String:
return "夜"
const RESOURCE_TITLES := {&"gold": "所持金", &"mana": "マナ", &"materials": "資材", &"faith": "信仰"}
func _resource_title(resource_name: StringName) -> String:
return String(RESOURCE_TITLES.get(resource_name, String(resource_name)))
func _on_resource_changed(resource_name: StringName, value: int) -> void:
if not resource_labels.has(resource_name):
return
var titles := {
&"gold": "所持金",
&"mana": "マナ",
&"materials": "資材",
&"faith": "信仰",
}
var label := resource_labels[resource_name] as Label
label.text = "%s %d" % [titles[resource_name], value]
label.text = "%s %d" % [_resource_title(resource_name), value]
if resource_name == &"mana":
label.mouse_filter = Control.MOUSE_FILTER_STOP
label.tooltip_text = "残量0で全館停止。接客・調理・搬入・エレベーターと新規入館が停止します。\n残量と配電が回復すると再開します。破壊・摘発による休止は解除されません。"
@@ -3169,12 +3169,22 @@ func _confirm_demolition() -> void:
# Paused play returns execution synchronously; running play returns acceptance.
if result.is_success() and _runtime.command_queue.get_processed_result(result.command_id) == null:
_pending_demolition_commands[result.command_id] = target
_set_status("撤去を受け付けました", true)
return
_show_demolition_result(result)
func _show_demolition_result(result: CommandResult) -> void:
var code := String(CommandResult.Code.keys()[result.code])
var reason := String(result.details.get(&"reason", ""))
_set_status("%s | %s | %s" % [code, reason, result.message], result.is_success())
if result.is_success():
var refund: Dictionary = result.details.get(&"refund", {})
var keys: Array = refund.keys()
keys.sort()
var amounts: PackedStringArray = []
for key: Variant in keys:
if int(refund[key]) != 0:
amounts.append("%s %d" % [_resource_title(StringName(key)), int(refund[key])])
_set_status("撤去しました(返金: %s)" % "、".join(amounts) if not amounts.is_empty() else "撤去しました(返金なし)", true)
else:
_set_status("撤去できません: " + result.message, false)
_refresh_selected_entity()
world_preview.queue_redraw()