49 lines
1.2 KiB
GDScript
49 lines
1.2 KiB
GDScript
## VERTICAL SLICE - NOT FOR PRODUCTION
|
|
## 结算明细回看模态:完整流水逐行只读呈现。
|
|
## 流水 BB 文本经 open() 整段喂入——本类零格式化,格式化规则归 BattleLogView。
|
|
class_name SettlementReviewOverlay
|
|
extends Control
|
|
|
|
signal closed
|
|
|
|
var _log: RichTextLabel
|
|
|
|
|
|
func _init() -> void:
|
|
var shell := UiKit.modal_shell(self, Color(UiKit.DIM, 0.62), Vector2(760, 560), 6, UiKit.PANEL_DEFAULT)
|
|
(shell.dim as ColorRect).gui_input.connect(_on_dim_gui_input)
|
|
var box: VBoxContainer = shell.box
|
|
box.add_child(UiKit.label("结算明细回看(完整流水 · 逐行归因)",UiKit.FS_SUB, true))
|
|
_log = RichTextLabel.new()
|
|
_log.bbcode_enabled = true
|
|
_log.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
|
_log.clip_contents = true
|
|
_log.scroll_active = true
|
|
box.add_child(_log)
|
|
var close_btn := UiKit.button("关闭")
|
|
close_btn.pressed.connect(close)
|
|
box.add_child(close_btn)
|
|
visible = false
|
|
|
|
|
|
func is_open() -> bool:
|
|
return visible
|
|
|
|
|
|
func open(full_bb_text: String) -> void:
|
|
_log.clear()
|
|
_log.append_text(full_bb_text)
|
|
visible = true
|
|
|
|
|
|
func close() -> void:
|
|
if not visible:
|
|
return
|
|
visible = false
|
|
closed.emit()
|
|
|
|
|
|
func _on_dim_gui_input(ev: InputEvent) -> void:
|
|
if ev is InputEventMouseButton and ev.pressed:
|
|
close()
|