scripted_gui = { ledger_open_button_sg = { window_name = "ledger_open_container" parent_window_name = "MapmodesInterface_Ingame" dirty = global.ledger_ui_dirty_var visible = { is_ai = no NOT = { has_game_rule = { rule = allow_enable_ledger option = no } } } effects = { ledger_open_btn_click = { open_ledger = yes update_ledger_dirty_var = yes } } } ledger_sg = { window_name = "ledger_container" dirty = global.ledger_ui_dirty_var visible = { is_ai = no check_variable = { ledger_open > 0 } } # we have two dynamic lists for this scripted gui dynamic_lists = { # this is the main grid that contains added countries country_list = { array = country_array change_scope = yes entry_container = "ledger_country_entry_[?Root.ledger_open]" } } properties = { #change flag textures to actual flag texture flag = { image = "[This.GetFlag]" } next_page = { image = "[NextButton]" } previous_page = { image = "[PreviousButton]" } } effects = { close_click = { clear_variable = ledger_open update_ledger_dirty_var = yes } next_page_click = { if = { limit = { check_variable = { ledger_open = 7 } } update_ledger_country_array = yes } add_to_variable = { ledger_open = 1 } if = { limit = { check_variable = { ledger_open > 7 } } set_variable = { ledger_open = 1 } } if = { limit = { check_variable = { ledger_open = 7 } } update_ledger_faction_array = yes } update_ledger_dirty_var = yes } previous_page_click = { if = { limit = { check_variable = { ledger_open = 7 } } update_ledger_country_array = yes } subtract_from_variable = { ledger_open = 1 } if = { limit = { check_variable = { ledger_open < 1 } } set_variable = { ledger_open = 7 } } if = { limit = { check_variable = { ledger_open = 7 } } update_ledger_faction_array = yes } update_ledger_dirty_var = yes } country_header_click = { update_ledger_country_array = yes } ideology_header_click = { set_temp_variable = { sort_var = 46 } create_sorted_array = yes } stability_header_click = { set_temp_variable = { sort_var = 1 } create_sorted_array = yes } war_support_header_click = { set_temp_variable = { sort_var = 2 } create_sorted_array = yes } political_power_header_click = { set_temp_variable = { sort_var = 3 } create_sorted_array = yes } industry_header_2_click = { set_temp_variable = { sort_var = 4 } create_sorted_array = yes } population_header_click = { set_temp_variable = { sort_var = 5 } create_sorted_array = yes } research_slots_header_click = { set_temp_variable = { sort_var = 6 } create_sorted_array = yes } num_battalions_header_click = { set_temp_variable = { sort_var = 7 } create_sorted_array = yes } num_divisions_header_click = { set_temp_variable = { sort_var = 8 } create_sorted_array = yes } manpower_header_click = { set_temp_variable = { sort_var = 9 } create_sorted_array = yes } army_xp_header_click = { set_temp_variable = { sort_var = 10 } create_sorted_array = yes } command_power_header_click = { set_temp_variable = { sort_var = 11 } create_sorted_array = yes } casualties_header_click = { set_temp_variable = { sort_var = 12 } create_sorted_array = yes } land_doctrine_level_header_click = { set_temp_variable = { sort_var = 13 } create_sorted_array = yes } navy_header_4_click = { set_temp_variable = { sort_var = 14 } create_sorted_array = yes } air_header_4_click = { set_temp_variable = { sort_var = 15 } create_sorted_array = yes } navy_xp_header_click = { set_temp_variable = { sort_var = 16 } create_sorted_array = yes } air_xp_header_click = { set_temp_variable = { sort_var = 17 } create_sorted_array = yes } num_of_nukes_header_click = { set_temp_variable = { sort_var = 18 } create_sorted_array = yes } nuclear_reactors_header_click = { set_temp_variable = { sort_var = 19 } create_sorted_array = yes } rocket_sites_header_click = { set_temp_variable = { sort_var = 20 } create_sorted_array = yes } faction_header_5_click = { set_temp_variable = { sort_var = 21 } create_sorted_array = yes } num_civilian_factories_header_click = { set_temp_variable = { sort_var = 22 } create_sorted_array = yes } consumer_goods_header_click = { set_temp_variable = { sort_var = 23 } create_sorted_array = yes } military_factories_header_click = { set_temp_variable = { sort_var = 24 } create_sorted_array = yes } naval_factories_header_click = { set_temp_variable = { sort_var = 25 } create_sorted_array = yes } industry_header_5_click = { set_temp_variable = { sort_var = 4 } create_sorted_array = yes } fuel_header_click = { set_temp_variable = { sort_var = 26 } create_sorted_array = yes } faction_header_6_click = { set_temp_variable = { sort_var = 21 } create_sorted_array = yes } owned_states_header_click = { set_temp_variable = { sort_var = 27 } create_sorted_array = yes } controlled_states_header_click = { set_temp_variable = { sort_var = 28 } create_sorted_array = yes } owned_controlled_states_header_click = { set_temp_variable = { sort_var = 29 } create_sorted_array = yes } occupied_states_header_click = { set_temp_variable = { sort_var = 30 } create_sorted_array = yes } core_states_header_click = { set_temp_variable = { sort_var = 31 } create_sorted_array = yes } controlled_states_including_subjects_header_click = { set_temp_variable = { sort_var = 32 } create_sorted_array = yes } # Economy gdp_header_click = { set_temp_variable = { sort_var = 33 } create_sorted_array = yes } gdp_capita_header_click = { set_temp_variable = { sort_var = 34 } create_sorted_array = yes } total_productivity_header_click = { set_temp_variable = { sort_var = 47 } create_sorted_array = yes } debt_header_click = { set_temp_variable = { sort_var = 35 } create_sorted_array = yes } treasury_header_click = { set_temp_variable = { sort_var = 36 } create_sorted_array = yes } gross_income_header_click = { set_temp_variable = { sort_var = 37 } create_sorted_array = yes } expense_header_click = { set_temp_variable = { sort_var = 38 } create_sorted_array = yes } offices_header_click = { set_temp_variable = { sort_var = 39 } create_sorted_array = yes } # Faction faction_header_7_click = { update_ledger_faction_array = yes } faction_members_header_click = { set_temp_variable = { sort_var = 40 } create_sorted_array = yes } faction_battalions_header_click = { set_temp_variable = { sort_var = 41 } create_sorted_array = yes } faction_ships_header_click = { set_temp_variable = { sort_var = 42 } create_sorted_array = yes } faction_airforce_header_click = { set_temp_variable = { sort_var = 43 } create_sorted_array = yes } faction_industry_header_click = { set_temp_variable = { sort_var = 44 } create_sorted_array = yes } faction_states_header_click = { set_temp_variable = { sort_var = 45 } create_sorted_array = yes } } triggers = { major_overlay_visible = { is_major = yes } country_header_txt_visible = { check_variable = { ledger_open < 7 } } country_header_visible = { check_variable = { ledger_open < 7 } } ideology_header_txt_visible = { check_variable = { ledger_open = 1 } } ideology_header_visible = { check_variable = { ledger_open = 1 } } stability_header_txt_visible = { check_variable = { ledger_open = 1 } } stability_header_visible = { check_variable = { ledger_open = 1 } } war_support_header_txt_visible = { check_variable = { ledger_open = 1 } } war_support_header_visible = { check_variable = { ledger_open = 1 } } political_power_header_txt_visible = { check_variable = { ledger_open = 1 } } political_power_header_visible = { check_variable = { ledger_open = 1 } } industry_header_2_txt_visible = { check_variable = { ledger_open = 1 } } industry_header_2_visible = { check_variable = { ledger_open = 1 } } population_header_txt_visible = { check_variable = { ledger_open = 1 } } population_header_visible = { check_variable = { ledger_open = 1 } } research_slots_header_txt_visible = { check_variable = { ledger_open = 1 } } research_slots_header_visible = { check_variable = { ledger_open = 1 } } num_battalions_header_txt_visible = { check_variable = { ledger_open = 2 } } num_battalions_header_visible = { check_variable = { ledger_open = 2 } } num_divisions_header_txt_visible = { check_variable = { ledger_open = 2 } } num_divisions_header_visible = { check_variable = { ledger_open = 2 } } manpower_header_txt_visible = { check_variable = { ledger_open = 2 } } manpower_header_visible = { check_variable = { ledger_open = 2 } } army_xp_header_txt_visible = { check_variable = { ledger_open = 2 } } army_xp_header_visible = { check_variable = { ledger_open = 2 } } command_power_header_txt_visible = { check_variable = { ledger_open = 2 } } command_power_header_visible = { check_variable = { ledger_open = 2 } } casualties_header_txt_visible = { check_variable = { ledger_open = 2 } } casualties_header_visible = { check_variable = { ledger_open = 2 } } land_doctrine_level_header_txt_visible = { check_variable = { ledger_open = 2 } } land_doctrine_level_header_visible = { check_variable = { ledger_open = 2 } } navy_header_4_txt_visible = { check_variable = { ledger_open = 3 } } navy_header_4_visible = { check_variable = { ledger_open = 3 } } air_header_4_txt_visible = { check_variable = { ledger_open = 3 } } air_header_4_visible = { check_variable = { ledger_open = 3 } } navy_xp_header_txt_visible = { check_variable = { ledger_open = 3 } } navy_xp_header_visible = { check_variable = { ledger_open = 3 } } air_xp_header_txt_visible = { check_variable = { ledger_open = 3 } } air_xp_header_visible = { check_variable = { ledger_open = 3 } } num_of_nukes_header_txt_visible = { check_variable = { ledger_open = 3 } } num_of_nukes_header_visible = { check_variable = { ledger_open = 3 } } nuclear_reactors_header_txt_visible = { check_variable = { ledger_open = 3 } } nuclear_reactors_header_visible = { check_variable = { ledger_open = 3 } } rocket_sites_header_txt_visible = { check_variable = { ledger_open = 3 } } rocket_sites_header_visible = { check_variable = { ledger_open = 3 } } faction_header_5_txt_visible = { check_variable = { ledger_open = 4 } } faction_header_5_visible = { check_variable = { ledger_open = 4 } } num_civilian_factories_header_txt_visible = { check_variable = { ledger_open = 4 } } num_civilian_factories_header_visible = { check_variable = { ledger_open = 4 } } consumer_goods_header_txt_visible = { check_variable = { ledger_open = 4 } } consumer_goods_header_visible = { check_variable = { ledger_open = 4 } } military_factories_header_txt_visible = { check_variable = { ledger_open = 4 } } military_factories_header_visible = { check_variable = { ledger_open = 4 } } naval_factories_header_txt_visible = { check_variable = { ledger_open = 4 } } naval_factories_header_visible = { check_variable = { ledger_open = 4 } } industry_header_5_txt_visible = { check_variable = { ledger_open = 4 } } industry_header_5_visible = { check_variable = { ledger_open = 4 } } fuel_header_txt_visible = { check_variable = { ledger_open = 4 } } fuel_header_visible = { check_variable = { ledger_open = 4 } } faction_header_6_txt_visible = { check_variable = { ledger_open = 5 } } faction_header_6_visible = { check_variable = { ledger_open = 5 } } owned_states_header_txt_visible = { check_variable = { ledger_open = 5 } } owned_states_header_visible = { check_variable = { ledger_open = 5 } } controlled_states_header_txt_visible = { check_variable = { ledger_open = 5 } } controlled_states_header_visible = { check_variable = { ledger_open = 5 } } owned_controlled_states_header_txt_visible = { check_variable = { ledger_open = 5 } } owned_controlled_states_header_visible = { check_variable = { ledger_open = 5 } } occupied_states_header_txt_visible = { check_variable = { ledger_open = 5 } } occupied_states_header_visible = { check_variable = { ledger_open = 5 } } core_states_header_txt_visible = { check_variable = { ledger_open = 5 } } core_states_header_visible = { check_variable = { ledger_open = 5 } } controlled_states_including_subjects_header_txt_visible = { check_variable = { ledger_open = 5 } } controlled_states_including_subjects_header_visible = { check_variable = { ledger_open = 5 } } gdp_header_txt_visible = { check_variable = { ledger_open = 6 } } gdp_header_visible = { check_variable = { ledger_open = 6 } } gdp_capita_header_txt_visible = { check_variable = { ledger_open = 6 } } gdp_capita_header_visible = { check_variable = { ledger_open = 6 } } total_productivity_header_txt_visible = { check_variable = { ledger_open = 6 } } total_productivity_header_visible = { check_variable = { ledger_open = 6 } } debt_header_txt_visible = { check_variable = { ledger_open = 6 } } debt_header_visible = { check_variable = { ledger_open = 6 } } treasury_header_txt_visible = { check_variable = { ledger_open = 6 } } treasury_header_visible = { check_variable = { ledger_open = 6 } } gross_income_header_txt_visible = { check_variable = { ledger_open = 6 } } gross_income_header_visible = { check_variable = { ledger_open = 6 } } expense_header_txt_visible = { check_variable = { ledger_open = 6 } } expense_header_visible = { check_variable = { ledger_open = 6 } } offices_header_txt_visible = { check_variable = { ledger_open = 6 } } offices_header_visible = { check_variable = { ledger_open = 6 } } faction_header_7_txt_visible = { check_variable = { ledger_open = 7 } } faction_header_7_visible = { check_variable = { ledger_open = 7 } } faction_leader_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_leader_header_visible = { check_variable = { ledger_open = 7 } } faction_leader_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_members_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_members_header_visible = { check_variable = { ledger_open = 7 } } faction_battalions_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_battalions_header_visible = { check_variable = { ledger_open = 7 } } faction_ships_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_ships_header_visible = { check_variable = { ledger_open = 7 } } faction_airforce_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_airforce_header_visible = { check_variable = { ledger_open = 7 } } faction_industry_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_industry_header_visible = { check_variable = { ledger_open = 7 } } faction_states_header_txt_visible = { check_variable = { ledger_open = 7 } } faction_states_header_visible = { check_variable = { ledger_open = 7 } } } } }