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、具体国家标签)下执行。Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.
When a mod dynamically modifies the focus tree layout through scripting (for example, by mass-completing focuses via complete_national_focus or indirectly affecting focus availability through add_ideas), the focus tree positions on the UI may not refresh immediately. Adding this command at the end of the same execution block forces a recalculation of the layout. This is common in "dynamic focus tree" mods to ensure players see the correct tree structure after an event is triggered.
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) — After scripting forcefully completes a focus, the layout may shift. This command must immediately follow to refresh the tree's rendering positions.[activate_shine_on_focus](/wiki/effect/activate_shine_on_focus) / [deactivate_shine_on_focus](/wiki/effect/deactivate_shine_on_focus) — When dynamically highlighting or unhighlighting a focus node, use this alongside to ensure visual state matches logical state.[has_completed_focus](/wiki/trigger/has_completed_focus) — Serves as a conditional check to determine whether a focus has been completed, allowing you to decide whether a layout refresh is needed (call conditionally within if blocks as required).mark_focus_tree_layout_dirty = yes resolves the issue.every_owned_state, the game will error or silently skip it. Always ensure execution within country scope (such as ROOT, FROM, or a specific country tag).