卡②T3a(呈现层结构收敛批): u18 ui_kit 公开面收敛——删frame_skinned/verb_button(全库零消费S8普查)+私有化四件(modal_dim/beams_rect/gradient_base/switch_toggle,消费方随动改址)+modal_shell六参→五参哨兵收拢(PANEL_DEFAULT常量三态:null=无面板/哨兵=默认样式盒/StyleBox=自定义,八消费点改址含settlement_review哨兵形)+bcard/BCard._init六参→五参opts束{price,footnote}(curio_pick/shop_overlay改址)+beams_rect像素循环拆_paint_beams(常量提类作用域)+BCard._init图标槽提_build_icon_slot;公开方法26→20键清偿,五键全清
This commit is contained in:
1 parent
2cb6dd13e7
commit
123d7c7832
15 files changed
+203
-179
No files matched your search
@@ -101,7 +101,7 @@ static func build_start_overlay(host: Control, db: ConfigDb = null) -> Dictionar
|
||||
var bd := UiKit.backdrop_tile()
|
||||
if bd != null:
|
||||
overlay.add_child(bd)
|
||||
overlay.add_child(UiKit.beams_rect())
|
||||
overlay.add_child(UiKit._beams_rect())
|
||||
overlay.add_child(UiKit.vignette_rect())
|
||||
# 双列骨架:左=操作列 56% / 右=舞台(立绘看台)
|
||||
var cols := HBoxContainer.new()
|
||||
|
||||
@@ -41,7 +41,7 @@ func _init() -> void:
|
||||
#(与营地/设置/图例同族)。半透明氛围 dim 保留(胜利暖纱/失败暮蓝——open_* 就地换色),信息与
|
||||
# 按钮全部上板;金蜡封 = 面板头部静态徽记(坠落演出落点被面板遮挡)。
|
||||
# 骨架经 UiKit.modal_shell;_dim 引用摘出供 open_* 换氛围色。
|
||||
var shell := UiKit.modal_shell(self, Color(COL_WARM, 0.0), Vector2(520, 0), 12, true,
|
||||
var shell := UiKit.modal_shell(self, Color(COL_WARM, 0.0), Vector2(520, 0), 12,
|
||||
UiKit.panel_skinned(Vector4(16, 14, 16, 14)))
|
||||
st._dim = shell.dim
|
||||
var box: VBoxContainer = shell.box
|
||||
|
||||
@@ -63,7 +63,7 @@ var _side := _SideState.new()
|
||||
func _init() -> void:
|
||||
# 底=不透明暖亮档(半透 dim 会透出底下棋盘/战斗提示条,故须实底;demo #v-camp=bg-bright 实底,
|
||||
# 遮蔽语义由组合根输入锁兜底)
|
||||
var dim := UiKit.modal_dim(self, UiKit.BG_BRIGHT)
|
||||
var dim := UiKit._modal_dim(self, UiKit.BG_BRIGHT)
|
||||
# 石纹弱质感+暗角(demo .tilebg 0.14/.vignette;缺位不挂即回退平色)
|
||||
var bd := UiKit.backdrop_tile()
|
||||
if bd != null:
|
||||
|
||||
@@ -14,7 +14,7 @@ var _cancel_btn: Button
|
||||
|
||||
func _init() -> void:
|
||||
var box: VBoxContainer = UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(460, 0), 12,
|
||||
true, UiKit.panel_skinned(Vector4(14, 12, 14, 12))).box
|
||||
UiKit.panel_skinned(Vector4(14, 12, 14, 12))).box
|
||||
_text = UiKit.label("",UiKit.FS_BODY, false, UiKit.INK_TITLE)
|
||||
_text.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
_text.custom_minimum_size = Vector2(430, 0)
|
||||
|
||||
@@ -96,7 +96,7 @@ func open_pick(header: String, cards: Array) -> void:
|
||||
var idl := cid.to_lower()
|
||||
var band := UiKit.tg_band(idl) # 类型色带单点(TG_* 五族同源判定;aoe/blast 归 TG_AOE)
|
||||
# 类型脚注(T7 判官 checkpoint:demo .bcard .src 底部类型行——实机缺=卡下半空底;词=demo 同款)
|
||||
var card := UiKit.bcard(title, desc, band, _icon_for_id(idl), "", _type_label(idl))
|
||||
var card := UiKit.bcard(title, desc, band, _icon_for_id(idl), {"footnote": _type_label(idl)})
|
||||
card.gui_input.connect(func(ev: InputEvent) -> void:
|
||||
if ev is InputEventMouseButton and ev.pressed and ev.button_index == MOUSE_BUTTON_LEFT:
|
||||
_select_card(cid))
|
||||
|
||||
@@ -10,30 +10,36 @@ signal debug_levels_requested # 两层调试对局入口
|
||||
signal diagnose_requested # 诊断转储入口(卡死取证编排归组合根)
|
||||
signal closed
|
||||
|
||||
var seed_edit: LineEdit # 组合根 _seed_value 唯一读取面
|
||||
## 内部状态件(u7 子域拆件——契约 9 职责语句「调试浮窗运行态」):单一变化原因=调试面板状态与
|
||||
## 当局数据投影。探针直读冻结成员(seed_edit/_sim_btn/_dbg_btn)住宿主;
|
||||
## st._run_data/st._run_labels 经 run_data_probe()/update_run_data() 方法出口(字段直访面零外部依赖)。
|
||||
class _DebugState extends RefCounted:
|
||||
var _db
|
||||
var _base_atk := 0
|
||||
var _base_hp := 0
|
||||
var _atk: HSlider
|
||||
var _hp: HSlider
|
||||
var _atk_val: Label
|
||||
var _hp_val: Label
|
||||
var _eff: Label
|
||||
var _sim_count: SpinBox
|
||||
var _sim_out: RichTextLabel
|
||||
var _sim_running := false # 批量模拟进行中(is_running 判据——与对局中禁用态分离防互扰)
|
||||
var _ctx_locked := false # 对局中上下文锁定(组合根 _sync_debug_overlay 喂入——批量模拟/两层调试入口禁用)
|
||||
var _run_labels := {} # 当局数据六项标签(只读投影,组合根 update_run_data 喂入)
|
||||
var _run_data := {} # 最近一次投喂快照(探针值对面 run_data_probe)
|
||||
|
||||
var _db
|
||||
var _base_atk := 0
|
||||
var _base_hp := 0
|
||||
var _atk: HSlider
|
||||
var _hp: HSlider
|
||||
var _atk_val: Label
|
||||
var _hp_val: Label
|
||||
var _eff: Label
|
||||
var _sim_count: SpinBox
|
||||
var _sim_btn: Button
|
||||
var _dbg_btn: Button # 两层调试入口钮(对局中禁用承载面)
|
||||
var _sim_out: RichTextLabel
|
||||
var _sim_running := false # 批量模拟进行中(is_running 判据——与对局中禁用态分离防互扰)
|
||||
var _ctx_locked := false # 对局中上下文锁定(组合根 _sync_debug_overlay 喂入——批量模拟/两层调试入口禁用)
|
||||
var _run_labels := {} # 当局数据六项标签(只读投影,组合根 update_run_data 喂入)
|
||||
var _run_data := {} # 最近一次投喂快照(探针值对面 run_data_probe)
|
||||
|
||||
var st := _DebugState.new()
|
||||
var seed_edit: LineEdit # 组合根 _seed_value 唯一读取面(探针直读冻结)
|
||||
var _sim_btn: Button # 两层调试批量模拟入口钮(探针直读冻结)
|
||||
var _dbg_btn: Button # 两层调试入口钮(对局中禁用承载面;探针直读冻结)
|
||||
|
||||
|
||||
func _init(db_ref, base_atk: int, base_hp: int) -> void:
|
||||
_db = db_ref
|
||||
_base_atk = base_atk
|
||||
_base_hp = base_hp
|
||||
st._db = db_ref
|
||||
st._base_atk = base_atk
|
||||
st._base_hp = base_hp
|
||||
_build()
|
||||
_sync_labels()
|
||||
visible = false # 显式初始化——不靠树序巧合(缺陷⑤家族纪律)
|
||||
@@ -42,78 +48,78 @@ func _init(db_ref, base_atk: int, base_hp: int) -> void:
|
||||
# ---- 对外语义面(组合根/探针)----
|
||||
|
||||
func atk_pct() -> int:
|
||||
return int(_atk.value)
|
||||
return int(st._atk.value)
|
||||
|
||||
|
||||
func hp_pct() -> int:
|
||||
return int(_hp.value)
|
||||
return int(st._hp.value)
|
||||
|
||||
|
||||
func set_sliders(atk: int, hp: int) -> void:
|
||||
_atk.value = atk
|
||||
_hp.value = hp
|
||||
st._atk.value = atk
|
||||
st._hp.value = hp
|
||||
|
||||
|
||||
func reset_sliders() -> void:
|
||||
_atk.value = 0
|
||||
_hp.value = 0
|
||||
st._atk.value = 0
|
||||
st._hp.value = 0
|
||||
_sync_labels()
|
||||
|
||||
|
||||
func effect_text() -> String:
|
||||
return _eff.text
|
||||
return st._eff.text
|
||||
|
||||
|
||||
func set_sim_count(n: int) -> void:
|
||||
_sim_count.value = n
|
||||
st._sim_count.value = n
|
||||
|
||||
|
||||
func is_running() -> bool:
|
||||
return _sim_running # 批量模拟进行中(与对局中禁用态分离,置灰 ≠ 在跑)
|
||||
return st._sim_running # 批量模拟进行中(与对局中禁用态分离,置灰 ≠ 在跑)
|
||||
|
||||
|
||||
func set_sim_running(running: bool) -> void:
|
||||
_sim_running = running
|
||||
st._sim_running = running
|
||||
_sync_sim_button()
|
||||
|
||||
|
||||
# 对局中上下文锁定(组合根 _sync_debug_overlay 喂入):批量模拟与两层调试入口
|
||||
# 在活跃对局并存态不开放(长程异步模拟/并发对局编排与活跃结算并存态破坏状态机)
|
||||
func set_context_locked(locked: bool) -> void:
|
||||
_ctx_locked = locked
|
||||
st._ctx_locked = locked
|
||||
_sync_sim_button()
|
||||
|
||||
|
||||
# 当局数据只读投影喂入(六项——组合根 _debug_run_data 构造;纯标签重查零动效)
|
||||
func update_run_data(data: Dictionary) -> void:
|
||||
_run_data = data.duplicate()
|
||||
for key in _run_labels:
|
||||
(_run_labels[key] as Label).text = str(data.get(key, "—"))
|
||||
st._run_data = data.duplicate()
|
||||
for key in st._run_labels:
|
||||
(st._run_labels[key] as Label).text = str(data.get(key, "—"))
|
||||
|
||||
|
||||
# 当局数据快照读面(探针值对面——ui_tune_probe 断言六项与只读访问器逐项一致)
|
||||
func run_data_probe() -> Dictionary:
|
||||
return _run_data.duplicate()
|
||||
return st._run_data.duplicate()
|
||||
|
||||
|
||||
# 两钮同判据(模拟运行 / 对局上下文锁定对「模拟」「两层调试」两入口等价)——
|
||||
# 判据单点:两 setter 都经此同步,禁在调用点各写一份
|
||||
func _sync_sim_button() -> void:
|
||||
_sim_btn.disabled = _sim_running or _ctx_locked
|
||||
_sim_btn.text = "模拟中…" if _sim_running else "运行模拟"
|
||||
_dbg_btn.disabled = _sim_running or _ctx_locked
|
||||
_sim_btn.disabled = st._sim_running or st._ctx_locked
|
||||
_sim_btn.text = "模拟中…" if st._sim_running else "运行模拟"
|
||||
_dbg_btn.disabled = st._sim_running or st._ctx_locked
|
||||
|
||||
|
||||
func set_sim_progress(text: String) -> void:
|
||||
_sim_out.text = text
|
||||
st._sim_out.text = text
|
||||
|
||||
|
||||
func set_sim_report(text: String) -> void:
|
||||
_sim_out.text = text
|
||||
st._sim_out.text = text
|
||||
|
||||
|
||||
func output_text() -> String:
|
||||
return _sim_out.get_parsed_text()
|
||||
return st._sim_out.get_parsed_text()
|
||||
|
||||
|
||||
# ---- 探针接缝(真实翻译出口——按钮 pressed 信号路径,非直调组合根)----
|
||||
@@ -141,11 +147,11 @@ func _reset_btn_pressed() -> void:
|
||||
|
||||
|
||||
func effective_atk() -> int:
|
||||
return UiKit.scaled(_base_atk, atk_pct())
|
||||
return UiKit.scaled(st._base_atk, atk_pct())
|
||||
|
||||
|
||||
func effective_max_hp() -> int:
|
||||
return UiKit.scaled(_base_hp, hp_pct())
|
||||
return UiKit.scaled(st._base_hp, hp_pct())
|
||||
|
||||
|
||||
# ---- 内部构建(标题/关闭固定于浮窗骨架,可扩展列表区居中滚动)----
|
||||
@@ -153,15 +159,7 @@ func effective_max_hp() -> int:
|
||||
func _build() -> void:
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, UiKit.BG_OVERLAY, Vector2(640, 0), 8)
|
||||
var box: VBoxContainer = shell.box
|
||||
|
||||
var title := UiKit.label("调试",UiKit.FS_TITLE, true, UiKit.WARM)
|
||||
box.add_child(title)
|
||||
var desc := UiKit.label(
|
||||
"开发调试专用(UI 最顶层「调试」浮层角标随时可开——任何界面不遮挡)。当局数据=本局只读投影,种子即本局种子唯一查看位。\n百分比叠加基础值:攻击 %d / 生命 %d。影响所有模式(手动与模拟),不落盘。" % [_base_atk, _base_hp],
|
||||
13, false, UiKit.WARM_SOFT)
|
||||
box.add_child(desc)
|
||||
box.add_child(HSeparator.new())
|
||||
|
||||
_build_intro(box)
|
||||
# 可扩展列表页(后续调试项按区块往下追加——超高滚动,滚轮下探)
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.custom_minimum_size = Vector2(0, 430)
|
||||
@@ -171,10 +169,32 @@ func _build() -> void:
|
||||
list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
list.add_theme_constant_override("separation", 8)
|
||||
scroll.add_child(list)
|
||||
_build_run_data(list)
|
||||
_build_fx_row(list)
|
||||
_build_seed_row(list)
|
||||
_build_slider_block(list)
|
||||
_build_sim_block(list)
|
||||
_build_debug_diag(list)
|
||||
var close_btn := UiKit.button("关闭")
|
||||
close_btn.pressed.connect(_emit_closed)
|
||||
box.add_child(close_btn)
|
||||
|
||||
# 区块·当局数据(六项只读投影:种子=本局种子唯一查看位〔adventure
|
||||
# .master_seed 现值,非 _seed_value() 重算〕/关卡/节点/HP/GP/钥石;数据由组合根开窗与模态开合
|
||||
# 时 update_run_data 喂入;纯标签零信号连接零动效)
|
||||
|
||||
## 头部域:标题+说明(百分比叠加基础值——影响所有模式,不落盘)
|
||||
func _build_intro(box: VBoxContainer) -> void:
|
||||
var title := UiKit.label("调试",UiKit.FS_TITLE, true, UiKit.WARM)
|
||||
box.add_child(title)
|
||||
var desc := UiKit.label(
|
||||
"开发调试专用(UI 最顶层「调试」浮层角标随时可开——任何界面不遮挡)。当局数据=本局只读投影,种子即本局种子唯一查看位。\n百分比叠加基础值:攻击 %d / 生命 %d。影响所有模式(手动与模拟),不落盘。" % [st._base_atk, st._base_hp],
|
||||
13, false, UiKit.WARM_SOFT)
|
||||
box.add_child(desc)
|
||||
box.add_child(HSeparator.new())
|
||||
|
||||
|
||||
## 区块·当局数据(六项只读投影:种子=本局种子唯一查看位〔adventure
|
||||
## .master_seed 现值,非 _seed_value() 重算〕/关卡/节点/HP/GP/钥石;数据由组合根开窗与模态开合
|
||||
## 时 update_run_data 喂入;纯标签零信号连接零动效)
|
||||
func _build_run_data(list: VBoxContainer) -> void:
|
||||
var run_head := UiKit.label("当局数据(只读)",UiKit.FS_HINT, true, UiKit.WARM)
|
||||
list.add_child(run_head)
|
||||
var run_grid := GridContainer.new()
|
||||
@@ -187,11 +207,13 @@ func _build() -> void:
|
||||
cap.custom_minimum_size = Vector2(52, 0)
|
||||
run_grid.add_child(cap)
|
||||
var val := UiKit.label("—",UiKit.FS_HINT, false, UiKit.WARM)
|
||||
_run_labels[item[0]] = val
|
||||
st._run_labels[item[0]] = val
|
||||
run_grid.add_child(val)
|
||||
list.add_child(HSeparator.new())
|
||||
|
||||
# 区块⓪胜利演出风格(两套并存——纹章拼合[默认]/尘金粒子;会话级不落盘)
|
||||
|
||||
## 区块⓪胜利演出风格(两套并存——纹章拼合[默认]/尘金粒子;会话级不落盘)
|
||||
func _build_fx_row(list: VBoxContainer) -> void:
|
||||
var fx_row := HBoxContainer.new()
|
||||
fx_row.add_theme_constant_override("separation", 10)
|
||||
list.add_child(fx_row)
|
||||
@@ -201,8 +223,10 @@ func _build() -> void:
|
||||
fx_btn.pressed.connect(_on_fx_toggle.bind(fx_btn)) # lambda 转命名方法(只读巡检白名单方法名精确可判)
|
||||
fx_row.add_child(fx_btn)
|
||||
|
||||
# 区块①随机种子(种子三分判定归组合根 _seed_value 单点):
|
||||
# 默认空框(空=随全局规则:首局恒 42/非首局随机;显式填入全场景优先)
|
||||
|
||||
## 区块①随机种子(种子三分判定归组合根 _seed_value 单点):
|
||||
## 默认空框(空=随全局规则:首局恒 42/非首局随机;显式填入全场景优先)
|
||||
func _build_seed_row(list: VBoxContainer) -> void:
|
||||
var seed_row := HBoxContainer.new()
|
||||
list.add_child(seed_row)
|
||||
seed_row.add_child(UiKit.label("随机种子",UiKit.FS_BODY, false))
|
||||
@@ -213,16 +237,17 @@ func _build() -> void:
|
||||
seed_row.add_child(seed_edit)
|
||||
list.add_child(HSeparator.new())
|
||||
|
||||
# 区块②角色数值调整板
|
||||
var atk_row := _slider_row(list, "攻击加成")
|
||||
_atk = atk_row.slider
|
||||
_atk_val = atk_row.value_label
|
||||
var hp_row := _slider_row(list, "生命加成")
|
||||
_hp = hp_row.slider
|
||||
_hp_val = hp_row.value_label
|
||||
_eff = UiKit.label("",UiKit.FS_HINT, false)
|
||||
list.add_child(_eff)
|
||||
|
||||
## 区块②角色数值调整板(攻击/生命两滑轨+生效值行+应用/重置钮)
|
||||
func _build_slider_block(list: VBoxContainer) -> void:
|
||||
var atk_row := _slider_row(list, "攻击加成")
|
||||
st._atk = atk_row.slider
|
||||
st._atk_val = atk_row.value_label
|
||||
var hp_row := _slider_row(list, "生命加成")
|
||||
st._hp = hp_row.slider
|
||||
st._hp_val = hp_row.value_label
|
||||
st._eff = UiKit.label("",UiKit.FS_HINT, false)
|
||||
list.add_child(st._eff)
|
||||
var btn_row := HBoxContainer.new()
|
||||
list.add_child(btn_row)
|
||||
var apply_btn := UiKit.button("应用并关闭")
|
||||
@@ -233,34 +258,36 @@ func _build() -> void:
|
||||
btn_row.add_child(reset_btn)
|
||||
list.add_child(HSeparator.new())
|
||||
|
||||
# 区块③批量模拟(与 headless 扫描同口径——编排归 tune_sim_controller)
|
||||
|
||||
## 区块③批量模拟(与 headless 扫描同口径——编排归 tune_sim_controller)
|
||||
func _build_sim_block(list: VBoxContainer) -> void:
|
||||
var sim_row := HBoxContainer.new()
|
||||
list.add_child(sim_row)
|
||||
sim_row.add_child(UiKit.label("批量模拟第一关",UiKit.FS_BODY, false))
|
||||
_sim_count = SpinBox.new()
|
||||
_sim_count.min_value = 10
|
||||
_sim_count.max_value = 200
|
||||
_sim_count.step = 10
|
||||
_sim_count.value = 30
|
||||
_sim_count.custom_minimum_size = Vector2(90, 0)
|
||||
sim_row.add_child(_sim_count)
|
||||
st._sim_count = SpinBox.new()
|
||||
st._sim_count.min_value = 10
|
||||
st._sim_count.max_value = 200
|
||||
st._sim_count.step = 10
|
||||
st._sim_count.value = 30
|
||||
st._sim_count.custom_minimum_size = Vector2(90, 0)
|
||||
sim_row.add_child(st._sim_count)
|
||||
sim_row.add_child(UiKit.label("次(理性玩家策略,含面板当前加成)",UiKit.FS_HINT, false))
|
||||
_sim_btn = UiKit.button("运行模拟")
|
||||
_sim_btn.pressed.connect(_emit_simulate_requested)
|
||||
sim_row.add_child(_sim_btn)
|
||||
_sim_out = RichTextLabel.new()
|
||||
_sim_out.bbcode_enabled = true
|
||||
_sim_out.custom_minimum_size = Vector2(0, 300)
|
||||
list.add_child(_sim_out)
|
||||
st._sim_out = RichTextLabel.new()
|
||||
st._sim_out.bbcode_enabled = true
|
||||
st._sim_out.custom_minimum_size = Vector2(0, 300)
|
||||
list.add_child(st._sim_out)
|
||||
list.add_child(HSeparator.new())
|
||||
|
||||
# 区块④两层调试对局入口(HP 关内延续;对局中禁用)
|
||||
|
||||
## 区块④⑤两层调试入口与诊断转储(对局中禁用;转储编排经信号外发归组合根——纯视图边界;
|
||||
## dump_diagnosis 卡死取证功能保留,不设门控隐藏——本浮窗本就可全局可开,双轨无意义)
|
||||
func _build_debug_diag(list: VBoxContainer) -> void:
|
||||
_dbg_btn = UiKit.button("调试 · 连续关卡两层(HP 关内延续)")
|
||||
_dbg_btn.pressed.connect(_emit_debug_levels)
|
||||
list.add_child(_dbg_btn)
|
||||
|
||||
# 区块⑤诊断转储:dump_diagnosis 卡死取证功能保留;不设门控隐藏——本浮窗本就可全局可开,双轨无意义。
|
||||
# 纯视图边界:转储编排经信号外发归组合根。
|
||||
var diag_row := HBoxContainer.new()
|
||||
diag_row.add_theme_constant_override("separation", 10)
|
||||
list.add_child(diag_row)
|
||||
@@ -270,10 +297,6 @@ func _build() -> void:
|
||||
diag_btn.pressed.connect(_emit_diagnose_requested)
|
||||
diag_row.add_child(diag_btn)
|
||||
|
||||
var close_btn := UiKit.button("关闭")
|
||||
close_btn.pressed.connect(_emit_closed)
|
||||
box.add_child(close_btn)
|
||||
|
||||
|
||||
func _slider_row(box: VBoxContainer, title: String) -> Dictionary:
|
||||
var row := HBoxContainer.new()
|
||||
@@ -293,14 +316,14 @@ func _slider_row(box: VBoxContainer, title: String) -> Dictionary:
|
||||
|
||||
|
||||
func _sync_labels() -> void:
|
||||
_atk_val.text = "+%d%%" % atk_pct()
|
||||
_hp_val.text = "+%d%%" % hp_pct()
|
||||
_eff.text = "生效值:攻击 %d → %d · 生命 %d → %d" % [
|
||||
_base_atk, effective_atk(), _base_hp, effective_max_hp()]
|
||||
st._atk_val.text = "+%d%%" % atk_pct()
|
||||
st._hp_val.text = "+%d%%" % hp_pct()
|
||||
st._eff.text = "生效值:攻击 %d → %d · 生命 %d → %d" % [
|
||||
st._base_atk, effective_atk(), st._base_hp, effective_max_hp()]
|
||||
|
||||
|
||||
func _emit_simulate_requested() -> void:
|
||||
simulate_requested.emit(int(_sim_count.value))
|
||||
simulate_requested.emit(int(st._sim_count.value))
|
||||
|
||||
|
||||
func _emit_diagnose_requested() -> void:
|
||||
|
||||
@@ -23,7 +23,7 @@ var _rap_cost := -1 # <0 = 不渲染 RAP 行(构造参数注表值,禁字
|
||||
|
||||
func _init(rap_cost: int = -1) -> void:
|
||||
_rap_cost = rap_cost
|
||||
var shell := UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(520, 0), 6, true,
|
||||
var shell := UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(520, 0), 6,
|
||||
UiKit.panel_skinned(Vector4(12, 10, 12, 10))) # 石板皮(T2;缺位回退 flat)
|
||||
_panel = shell.panel
|
||||
(shell.dim as ColorRect).gui_input.connect(_on_dim_gui_input)
|
||||
|
||||
@@ -66,7 +66,7 @@ func _init() -> void:
|
||||
_map._layer_decor.node_icons[t] = UiKit.load_tex(TEX_NODE_ICONS[t])
|
||||
# 独立屏底(spec Layout——demo #v-map 暖棕竖向
|
||||
# 渐变(#4A3B2A 0%→#3A2E22 40%)+石纹弱质感 0.14+暗角聚焦;底纹缺位回退纯色)
|
||||
var base := UiKit.gradient_base(UiKit.BG_MAP_TOP, UiKit.BG_ROOT)
|
||||
var base := UiKit._gradient_base(UiKit.BG_MAP_TOP, UiKit.BG_ROOT)
|
||||
add_child(base)
|
||||
var tex := UiKit.backdrop_tile()
|
||||
if tex != null:
|
||||
|
||||
@@ -11,7 +11,7 @@ var _btn: Button
|
||||
|
||||
func _init() -> void:
|
||||
# M5(UI 落码批):rest 兑付面板 plate9 石板化+暖金头带字(demo ④休息弹层;暗字上亮板 §7.2)
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, Color(0, 0, 0, 0.6), Vector2.ZERO, 14, true,
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, Color(0, 0, 0, 0.6), Vector2.ZERO, 14,
|
||||
UiKit.panel_skinned(Vector4(26, 18, 26, 18)))
|
||||
var box: VBoxContainer = shell.box
|
||||
_label = UiKit.label("",UiKit.FS_SUB, true, UiKit.INK_TITLE)
|
||||
|
||||
@@ -34,7 +34,7 @@ func _build() -> void:
|
||||
# 减动效与结算演出动画=同一设置,一行承载。
|
||||
# 两列对齐(label 列定宽 140——demo .setrow label/控制两列)+
|
||||
# 后果说明内联随行(demo .why 同排)+返回钮紧凑化(demo .btn9 紧凑)。
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, UiKit.BG_BRIGHT, Vector2(560, 0), 8, true,
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, UiKit.BG_BRIGHT, Vector2(560, 0), 8,
|
||||
UiKit.panel_skinned(Vector4(20, 16, 20, 16)))
|
||||
var box: VBoxContainer = shell.box
|
||||
|
||||
@@ -73,7 +73,7 @@ func _build() -> void:
|
||||
var fs_lab := UiKit.label("全屏",UiKit.FS_BODY, false, UiKit.INK_LABEL)
|
||||
fs_lab.custom_minimum_size = Vector2(140, 0) # 同上
|
||||
fs_row.add_child(fs_lab)
|
||||
_fs_btn = UiKit.switch_toggle(false)
|
||||
_fs_btn = UiKit._switch_toggle(false)
|
||||
_fs_btn.toggled.connect(_on_fullscreen_toggled)
|
||||
fs_row.add_child(_fs_btn)
|
||||
_fs_st = UiKit.label("关",UiKit.FS_HINT, true, UiKit.INK_LABEL)
|
||||
@@ -88,7 +88,7 @@ func _build() -> void:
|
||||
var motion_lab := UiKit.label("结算演出动画",UiKit.FS_BODY, false, UiKit.INK_LABEL)
|
||||
motion_lab.custom_minimum_size = Vector2(140, 0) # 同上
|
||||
motion_row.add_child(motion_lab)
|
||||
_motion_btn = UiKit.switch_toggle(true)
|
||||
_motion_btn = UiKit._switch_toggle(true)
|
||||
_motion_btn.toggled.connect(_on_motion_toggled)
|
||||
motion_row.add_child(_motion_btn)
|
||||
_motion_st = UiKit.label("完整",UiKit.FS_HINT, true, UiKit.INK_LABEL)
|
||||
|
||||
@@ -10,7 +10,7 @@ var _log: RichTextLabel
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
var shell := UiKit.modal_shell(self, Color(UiKit.DIM, 0.62), Vector2(760, 560), 6, true)
|
||||
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))
|
||||
|
||||
@@ -211,7 +211,7 @@ func _build_shelf_card(holder: Control, c: Dictionary) -> Dictionary:
|
||||
body = "%s %+d(本冒险)" % [String(KIND_LABELS.get(kind, kind)), int(c.get("value", 0))]
|
||||
var card := UiKit.bcard(String(c.get("display_name", kind)), body,
|
||||
UiKit.tg_band(kl), icon_key, # 类型色带单点(N4c/Q4 甲——货架与三选一同源判定,原固定默认带)
|
||||
"%d ◈" % int(c.get("price", 0)), String(KIND_LABELS.get(kind, kind)))
|
||||
{"price": "%d ◈" % int(c.get("price", 0)), "footnote": String(KIND_LABELS.get(kind, kind))})
|
||||
var btn := UiKit.button("购买")
|
||||
btn.pressed.connect(_emit_shelf_buy.bind(kind))
|
||||
card.add_footer(btn)
|
||||
|
||||
@@ -14,7 +14,7 @@ var _feats_label: Label
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(560, 0), 10, true,
|
||||
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(560, 0), 10,
|
||||
UiKit.panel_skinned(Vector4(20, 16, 20, 16))) # 石板皮(缺位回退数据板——同设置面先例)
|
||||
var box: VBoxContainer = shell.box
|
||||
|
||||
|
||||
@@ -330,23 +330,9 @@ static func vignette_rect() -> TextureRect:
|
||||
# 程序纹理循环带,确定性生成零随机。光柱采用连续 alpha:
|
||||
# 带内 alpha 0→0.05→0 横向过渡+纵向衰减上亮下暗;
|
||||
# 纹理 filter=显式 LINEAR 白名单(与暗角/地图渐变同血统)
|
||||
static func beams_rect() -> TextureRect:
|
||||
static func _beams_rect() -> TextureRect:
|
||||
var img := Image.create(560, 560, false, Image.FORMAT_RGBA8)
|
||||
var ca := cos(0.2094) # 12°(102deg 带轴的垂直倾角)
|
||||
var sa := sin(0.2094)
|
||||
var beam_col := Color(1.0, 236.0 / 255.0, 200.0 / 255.0)
|
||||
var band_lo := 240.0
|
||||
var band_hi := 340.0
|
||||
var band_mid := (band_lo + band_hi) * 0.5
|
||||
var band_peak := 0.05
|
||||
var band_half := (band_hi - band_lo) * 0.5
|
||||
for y in 560:
|
||||
var v_fall := 1.0 - float(y) / 560.0 # 纵向衰减:上亮下暗(连续 alpha)
|
||||
for x in 560:
|
||||
var d := fposmod(x * ca + y * sa, 560.0)
|
||||
if d >= band_lo and d < band_hi:
|
||||
var a: float = band_peak * (1.0 - absf(d - band_mid) / band_half) * v_fall
|
||||
img.set_pixel(x, y, Color(beam_col.r, beam_col.g, beam_col.b, a))
|
||||
_paint_beams(img)
|
||||
var tr := TextureRect.new()
|
||||
tr.texture = ImageTexture.create_from_image(img)
|
||||
tr.stretch_mode = TextureRect.STRETCH_TILE
|
||||
@@ -356,8 +342,32 @@ static func beams_rect() -> TextureRect:
|
||||
return tr
|
||||
|
||||
|
||||
# 光带几何常量(12° 斜向光带——带轴倾角/带域/峰值强度;_paint_beams 单消费)
|
||||
const BEAMS_TILT_CA := 0.9135 # cos(0.2094)——12°(102deg 带轴的垂直倾角)
|
||||
const BEAMS_TILT_SA := 0.4067 # sin(0.2094)
|
||||
const BEAMS_BAND_LO := 240.0
|
||||
const BEAMS_BAND_HI := 340.0
|
||||
const BEAMS_PEAK := 0.05
|
||||
|
||||
|
||||
## 光带像素域(循环体提函数——12° 斜向光带双三角衰减:带内峰值×纵向衰减逐像素着色)
|
||||
func _paint_beams(img: Image) -> void:
|
||||
var ca := BEAMS_TILT_CA
|
||||
var sa := BEAMS_TILT_SA
|
||||
var beam_col := Color(1.0, 236.0 / 255.0, 200.0 / 255.0)
|
||||
var band_mid := (BEAMS_BAND_LO + BEAMS_BAND_HI) * 0.5
|
||||
var band_half := (BEAMS_BAND_HI - BEAMS_BAND_LO) * 0.5
|
||||
for y in 560:
|
||||
var v_fall := 1.0 - float(y) / 560.0 # 纵向衰减:上亮下暗(连续 alpha)
|
||||
for x in 560:
|
||||
var d := fposmod(x * ca + y * sa, 560.0)
|
||||
if d >= BEAMS_BAND_LO and d < BEAMS_BAND_HI:
|
||||
var a: float = BEAMS_PEAK * (1.0 - absf(d - band_mid) / band_half) * v_fall
|
||||
img.set_pixel(x, y, Color(beam_col.r, beam_col.g, beam_col.b, a))
|
||||
|
||||
|
||||
# 竖向渐变底(demo #v-map linear-gradient(180deg, top 0%, low 40%)——stop 后恒 low)
|
||||
static func gradient_base(top: Color, low: Color, stop := 0.4) -> TextureRect:
|
||||
static func _gradient_base(top: Color, low: Color, stop := 0.4) -> TextureRect:
|
||||
var g := Gradient.new()
|
||||
g.offsets = PackedFloat32Array([0.0, stop])
|
||||
g.colors = PackedColorArray([top, low])
|
||||
@@ -442,7 +452,7 @@ static func label(text: String, size: int, bold: bool, color: Color = Color(-1,
|
||||
# PanelContainer(panel_sb 缺省 = 主题默认板——settlement_review 同款);box = 内容列
|
||||
#(min_size/separation 参数化,min_size ZERO = 不设)。返回 Dictionary{dim, center, panel, box}
|
||||
#——探针直读的私有件由调用方按名摘引,结构同名同层级不变。
|
||||
static func modal_dim(parent: Control, dim_color: Color) -> ColorRect:
|
||||
static func _modal_dim(parent: Control, dim_color: Color) -> ColorRect:
|
||||
var dim := ColorRect.new()
|
||||
dim.color = dim_color
|
||||
dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
@@ -450,18 +460,29 @@ static func modal_dim(parent: Control, dim_color: Color) -> ColorRect:
|
||||
return dim
|
||||
|
||||
|
||||
const PANEL_DEFAULT := true # modal_shell 面板哨兵(非 StyleBox 实例——null=无面板/本哨兵=默认样式盒面板/StyleBox=自定义)
|
||||
|
||||
|
||||
# 面板哨兵解析(六参收拢五参——三态:null=无面板〔原 with_panel=false〕/PANEL_DEFAULT=默认样式盒面板
|
||||
# 〔原 with_panel=true+panel_sb=null〕/StyleBox 实例=自定义样式盒面板〔原双参形态〕)
|
||||
static func _resolve_shell_panel(panel_sb) -> PanelContainer:
|
||||
if panel_sb == null:
|
||||
return null
|
||||
var panel := PanelContainer.new()
|
||||
if panel_sb != PANEL_DEFAULT:
|
||||
panel.add_theme_stylebox_override("panel", panel_sb)
|
||||
return panel
|
||||
|
||||
|
||||
static func modal_shell(parent: Control, dim_color: Color, min_size := Vector2.ZERO, separation := 12,
|
||||
with_panel := false, panel_sb: StyleBox = null) -> Dictionary:
|
||||
var dim := modal_dim(parent, dim_color)
|
||||
panel_sb = null) -> Dictionary:
|
||||
var dim := _modal_dim(parent, dim_color)
|
||||
var center := CenterContainer.new()
|
||||
center.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
dim.add_child(center)
|
||||
var panel: PanelContainer = null
|
||||
var panel := _resolve_shell_panel(panel_sb)
|
||||
var host: Control = center
|
||||
if with_panel:
|
||||
panel = PanelContainer.new()
|
||||
if panel_sb != null:
|
||||
panel.add_theme_stylebox_override("panel", panel_sb)
|
||||
if panel != null:
|
||||
center.add_child(panel)
|
||||
host = panel
|
||||
var box := VBoxContainer.new()
|
||||
@@ -563,19 +584,6 @@ static func panel_skinned(margin: Vector4 = Vector4.ZERO, tint := Color.WHITE) -
|
||||
|
||||
|
||||
# 仪式石框(空心角括框——营地容器框;缺位回退暗面板)
|
||||
static func frame_skinned(margin: Vector4 = Vector4.ZERO) -> StyleBox:
|
||||
var tex := load_tex(TEX_BORDER_STONE)
|
||||
if tex == null:
|
||||
return panel_flat(BG_OVERLAY, PANEL_BORDER,RADIUS_OBJECT, 1, margin)
|
||||
var sb := _tex_sb(tex, 12.0)
|
||||
sb.content_margin_left = margin.x
|
||||
sb.content_margin_top = margin.y
|
||||
sb.content_margin_right = margin.z
|
||||
sb.content_margin_bottom = margin.w
|
||||
return sb
|
||||
|
||||
|
||||
# 图标槽(营地钥石/柜台件——缺位返回 null,消费点不挂 TextureRect 即回退纯文本)
|
||||
static func icon_rect(tex_path: String, px: float) -> TextureRect:
|
||||
var t := load_tex(tex_path)
|
||||
if t == null:
|
||||
@@ -659,19 +667,6 @@ static func _apply_button_skin(b: Button) -> void:
|
||||
# 消费方 = 标题/营地/设置/商店/三选一屏。单点纪律同 §7.1:新件只加不改旧件)──
|
||||
|
||||
# 动词按钮(图标+动词+悬停说明三件套——标题屏按钮组/通用;icon 缺位=纯文字不炸)
|
||||
static func verb_button(text: String, icon_path: String, tip := "") -> Button:
|
||||
var b := button(text)
|
||||
var tex := load_tex(icon_path)
|
||||
if tex != null:
|
||||
b.icon = tex
|
||||
b.add_theme_constant_override("icon_max_width", 20)
|
||||
b.expand_icon = false
|
||||
if tip != "":
|
||||
b.tooltip_text = tip
|
||||
return b
|
||||
|
||||
|
||||
# 主操作钮(烛光黄平涂+木描边——非奖励金;配色总纲「主按钮禁亮金」;缺 panel_stone 依赖=纯色可靠)
|
||||
static func primary_button(text: String, tip := "") -> Button:
|
||||
var b := button(text)
|
||||
var sb := panel_flat(CANDLE, Color8(110, 69, 52),RADIUS_OBJECT, 2, Vector4(10, 2, 10, 2))
|
||||
@@ -749,7 +744,9 @@ class BCard:
|
||||
var _sb_normal: StyleBox
|
||||
var _sb_sel: StyleBox
|
||||
|
||||
func _init(title: String, desc: String, band: Color, icon_path: String, price := "", footnote := "") -> void:
|
||||
func _init(title: String, desc: String, band: Color, icon_path: String, opts := {}) -> void:
|
||||
var price: String = opts.get("price", "")
|
||||
var footnote: String = opts.get("footnote", "")
|
||||
var tex := UiKit.load_tex(UiKit.TEX_PANEL_STONE)
|
||||
_sb_normal = UiKit.panel_skinned(Vector4(12, 10, 12, 10)) if tex != null else UiKit.panel_flat(PANEL_DATA, PANEL_BORDER,RADIUS_OBJECT, 1, Vector4(12, 10, 12, 10)) # 回退=数据板单点
|
||||
_sb_sel = UiKit.panel_flat(PANEL_DATA, Color8(138, 90, 52), RADIUS_OBJECT, 2, Vector4(12, 10, 12, 10)) # 选中底=数据板单点
|
||||
@@ -766,21 +763,7 @@ class BCard:
|
||||
mark.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
mark.visible = false
|
||||
box.add_child(mark)
|
||||
# 图标槽(demo .ic 76×76 槽底+图标 60=20px 源 3 整数倍)
|
||||
var slot := PanelContainer.new()
|
||||
slot.add_theme_stylebox_override("panel", UiKit.panel_flat(SLOT_BACKDROP_SOFT, PANEL_BORDER, 0, 1)) # 明度差降档(柔和档;白图标 ≥3:1 硬约束在役)
|
||||
slot.custom_minimum_size = Vector2(76, 76)
|
||||
slot.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
box.add_child(slot)
|
||||
icon_tr = TextureRect.new()
|
||||
var itex := UiKit.load_tex(icon_path)
|
||||
if itex != null:
|
||||
icon_tr.texture = itex
|
||||
icon_tr.custom_minimum_size = Vector2(60, 60)
|
||||
icon_tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
icon_tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
icon_tr.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||||
slot.add_child(icon_tr)
|
||||
box.add_child(_build_icon_slot(icon_path))
|
||||
name_l = UiKit.label(title,FS_SUB, true, INK_TITLE)
|
||||
name_l.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
box.add_child(name_l)
|
||||
@@ -800,6 +783,23 @@ class BCard:
|
||||
foot_l.visible = footnote != ""
|
||||
box.add_child(foot_l)
|
||||
|
||||
# 图标槽(demo .ic 76×76 槽底+图标 60=20px 源 3 整数倍;明度差降档——柔和档;白图标 ≥3:1 硬约束在役)
|
||||
func _build_icon_slot(icon_path: String) -> PanelContainer:
|
||||
var slot := PanelContainer.new()
|
||||
slot.add_theme_stylebox_override("panel", UiKit.panel_flat(SLOT_BACKDROP_SOFT, PANEL_BORDER, 0, 1))
|
||||
slot.custom_minimum_size = Vector2(76, 76)
|
||||
slot.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
icon_tr = TextureRect.new()
|
||||
var itex := UiKit.load_tex(icon_path)
|
||||
if itex != null:
|
||||
icon_tr.texture = itex
|
||||
icon_tr.custom_minimum_size = Vector2(60, 60)
|
||||
icon_tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
icon_tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
icon_tr.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||||
slot.add_child(icon_tr)
|
||||
return slot
|
||||
|
||||
func set_selected(v: bool) -> void:
|
||||
add_theme_stylebox_override("panel", _sb_sel if v else _sb_normal)
|
||||
mark.visible = v
|
||||
@@ -809,8 +809,9 @@ class BCard:
|
||||
body.move_child(c, foot_l.get_index())
|
||||
|
||||
|
||||
static func bcard(title: String, desc: String, band: Color, icon_path: String, price := "", footnote := "") -> BCard:
|
||||
return BCard.new(title, desc, band, icon_path, price, footnote)
|
||||
## 竖卡工厂(BCard._init 同形收拢 6→5 参——opts 键 {price, footnote} 缺省逐字同值)
|
||||
static func bcard(title: String, desc: String, band: Color, icon_path: String, opts := {}) -> BCard:
|
||||
return BCard.new(title, desc, band, icon_path, opts)
|
||||
|
||||
|
||||
# 拨杆开关(设置屏——46×22 滑柄形;状态字随行由消费方摆;会话级/持久由消费方接 SettingsStore)
|
||||
@@ -838,7 +839,7 @@ class SwitchToggle:
|
||||
_knob.size = Vector2(18, 16)
|
||||
|
||||
|
||||
static func switch_toggle(initial: bool) -> SwitchToggle:
|
||||
static func _switch_toggle(initial: bool) -> SwitchToggle:
|
||||
return SwitchToggle.new(initial)
|
||||
|
||||
|
||||
|
||||
@@ -636,7 +636,7 @@ func _smoke_texture_filter() -> void:
|
||||
Kit.check("V3 白名单在位:暗角 vignette 显式 LINEAR",
|
||||
vg.texture_filter == CanvasItem.TEXTURE_FILTER_LINEAR)
|
||||
vg.free()
|
||||
var bm = uikit_s.beams_rect()
|
||||
var bm = uikit_s._beams_rect()
|
||||
Kit.check("V3 白名单在位:光柱 beams 显式 LINEAR",
|
||||
bm.texture_filter == CanvasItem.TEXTURE_FILTER_LINEAR)
|
||||
# T4 光柱连续 alpha 结构断言(观感归目检):带心峰值 0.05/带缘连续过渡/纵向衰减上亮下暗
|
||||
@@ -661,7 +661,7 @@ func _smoke_texture_filter() -> void:
|
||||
Kit.check("T4 光柱纵向衰减生效(上半亮度 %.0f > 下半 %.0f 的 2 倍——上亮下暗)" % [top_sum, bot_sum],
|
||||
top_sum > bot_sum * 2.0)
|
||||
bm.free()
|
||||
var gb = uikit_s.gradient_base(Color.BLACK, Color.WHITE)
|
||||
var gb = uikit_s._gradient_base(Color.BLACK, Color.WHITE)
|
||||
Kit.check("V3 白名单在位:地图渐变 gradient_base 显式 LINEAR",
|
||||
gb.texture_filter == CanvasItem.TEXTURE_FILTER_LINEAR)
|
||||
gb.free()
|
||||
|
||||
Reference in new issue
Block a user