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
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).