effect · mark_focus_tree_layout_dirty
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Forces the refresh of the tree layout for the scoped country
mark_focus_tree_layout_dirty = yes
mark_focus_tree_layout_dirtyCOUNTRYanyForces the refresh of the tree layout for the scoped country
mark_focus_tree_layout_dirty = yes
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
当 mod 通过脚本动态修改国策树布局(例如用 complete_national_focus 批量完成国策、或通过 add_ideas 间接影响国策可用性)后,界面上的国策树位置可能不会立即刷新,此时在同一执行块末尾加上此命令可强制重新计算布局。常见于"动态国策树"类 mod,在事件触发后确保玩家看到正确的树形结构。
country_event = {
id = my_mod.1
title = my_mod.1.t
desc = my_mod.1.d
option = {
name = my_mod.1.a
complete_national_focus = my_special_focus
mark_focus_tree_layout_dirty = yes
}
}
[complete_national_focus](/wiki/effect/complete_national_focus) — 脚本强制完成国策后布局可能错位,需要紧跟此命令刷新树的渲染位置。[activate_shine_on_focus](/wiki/effect/activate_shine_on_focus) / [deactivate_shine_on_focus](/wiki/effect/deactivate_shine_on_focus) — 动态高亮或取消高亮某个国策节点时,配合刷新确保视觉状态与逻辑状态一致。[has_completed_focus](/wiki/trigger/has_completed_focus) — 作为条件检查某国策是否已完成,从而决定是否需要触发布局刷新(用于 if 块内按需调用)。mark_focus_tree_layout_dirty = yes 即可解决。every_owned_state 等状态 scope 内,游戏会报错或静默跳过,应确保始终在国家 scope(如 ROOT、FROM、具体国家标签)下执行。