scripted_gui = {

	russia_reworked_achievement_button = {
		context_type = player_context
		window_name = "russia_reworked_achievements_button"
		parent_window_token = top_bar

		#Game rule in case people don't want achievements
		visible = {
			has_global_flag = russia_reworked_achievements_enabled
		}

		ai_enabled = {
			always = no
		}

		effects = {
			russia_reworked_achievements_button_icon_click = {
				set_country_flag = russia_reworked_show_achievements
			}

			russia_reworked_achievements_notification_button_icon_click = {
				set_country_flag = russia_reworked_show_achievements
				clr_country_flag = russia_reworked_new_achievement
			}
		}

		triggers = {
			russia_reworked_achievements_button_icon_visible = {
				NOT = {
					has_country_flag = russia_reworked_new_achievement
				}
			}

			russia_reworked_achievements_notification_button_icon_visible = {
				has_country_flag = russia_reworked_new_achievement
			}
		}
	}

	russia_reworked_achievements_gui = {
		context_type = player_context
		window_name = "russia_reworked_achievements_window"

		visible = {
			has_global_flag = russia_reworked_achievements_enabled
			has_country_flag = russia_reworked_show_achievements
		}

		ai_enabled = {
			always = no
		}

		dynamic_lists = {
			russia_reworked_cleaning_red_carpet_achievement_grid = {
				array = global.cleaning_red_carpet_achievement
				change_scope = yes
				entry_container = russia_reworked_cleaning_red_carpet_entry
			}

            russia_reworked_revolution_completed_achievement_grid = {
				array = global.revolution_completed_achievement
				change_scope = yes
				entry_container = russia_reworked_revolution_completed_entry
			}

            russia_reworked_speedrun_urals_achievement_grid = {
				array = global.speedrun_urals_achievement
				change_scope = yes
				entry_container = russia_reworked_speedrun_urals_entry
			}

            russia_reworked_not_sus_achievement_grid = {
				array = global.not_sus_achievement
				change_scope = yes
				entry_container = russia_reworked_not_sus_entry
			}

            russia_reworked_new_world_order_achievement_grid = {
				array = global.new_world_order_achievement
				change_scope = yes
				entry_container = russia_reworked_new_world_order_entry
			}

            russia_reworked_red_army_achievement_grid = {
				array = global.red_army_achievement
				change_scope = yes
				entry_container = russia_reworked_red_army_entry
			}

            russia_reworked_world_without_borders_achievement_grid = {
				array = global.world_without_borders_achievement
				change_scope = yes
				entry_container = russia_reworked_world_without_borders_entry
			}

            russia_reworked_rush_b_achievement_grid = {
				array = global.rush_b_achievement
				change_scope = yes
				entry_container = russia_reworked_rush_b_entry
			}

            russia_reworked_fourth_rome_achievement_grid = {
				array = global.fourth_rome_achievement
				change_scope = yes
				entry_container = russia_reworked_fourth_rome_entry
			}

            russia_reworked_gotcha_achievement_grid = {
				array = global.gotcha_achievement
				change_scope = yes
				entry_container = russia_reworked_gotcha_entry
			}

            russia_reworked_drunkard_wheel_achievement_grid = {
				array = global.drunkard_wheel_achievement
				change_scope = yes
				entry_container = russia_reworked_drunkard_wheel_entry
			}

            russia_reworked_copyright_achievement_grid = {
				array = global.copyright_achievement
				change_scope = yes
				entry_container = russia_reworked_copyright_entry
			}

            russia_reworked_running_90_achievement_grid = {
				array = global.running_90_achievement
				change_scope = yes
				entry_container = russia_reworked_running_90_entry
			}

            russia_reworked_quick_revolution_achievement_grid = {
				array = global.quick_revolution_achievement
				change_scope = yes
				entry_container = russia_reworked_quick_revolution_entry
			}

            russia_reworked_great_deeds_achievement_grid = {
				array = global.great_deeds_achievement
				change_scope = yes
				entry_container = russia_reworked_great_deeds_entry
			}

            russia_reworked_rome_tsarigrad_moscow_achievement_grid = {
				array = global.rome_tsarigrad_moscow_achievement
				change_scope = yes
				entry_container = russia_reworked_rome_tsarigrad_moscow_entry
			}

            russia_reworked_1905_avenged_achievement_grid = {
				array = global.1905_avenged_achievement
				change_scope = yes
				entry_container = russia_reworked_1905_avenged_entry
			}

            russia_reworked_lacplesis_achievement_grid = {
				array = global.lacplesis_achievement
				change_scope = yes
				entry_container = russia_reworked_lacplesis_entry
			}

            russia_reworked_third_friend_achievement_grid = {
				array = global.third_friend_achievement
				change_scope = yes
				entry_container = russia_reworked_third_friend_entry
			}

            russia_reworked_national_priority_achievement_grid = {
				array = global.national_priority_achievement
				change_scope = yes
				entry_container = russia_reworked_national_priority_entry
			}

			russia_reworked_revenge_best_served_cold_achievement_grid = {
				array = global.revenge_best_served_cold_achievement
				change_scope = yes
				entry_container = russia_reworked_revenge_best_served_cold_entry
			}

			russia_reworked_just_like_old_times_achievement_grid = {
				array = global.just_like_old_times_achievement
				change_scope = yes
				entry_container = russia_reworked_just_like_old_times_entry
			}

			russia_reworked_tour_de_france_achievement_grid = {
				array = global.tour_de_france_achievement
				change_scope = yes
				entry_container = russia_reworked_tour_de_france_entry
			}

            russia_reworked_making_fun_of_me_uh_achievement_grid = {
				array = global.making_fun_of_me_uh_achievement
				change_scope = yes
				entry_container = russia_reworked_making_fun_of_me_uh_entry
			}

            russia_reworked_click_me_achievement_grid = {
				array = global.click_me_achievement
				change_scope = yes
				entry_container = russia_reworked_click_me_entry
			}

            russia_reworked_big_tower_achievement_grid = {
				array = global.big_tower_achievement
				change_scope = yes
				entry_container = russia_reworked_big_tower_entry
			}
		}

        effects = {
            close_button_click = {
                clr_country_flag = russia_reworked_show_achievements
            }
        }

		triggers = {
			russia_reworked_cleaning_red_carpet_achievement_icon_unlocked_visible = {
				is_in_array = { global.cleaning_red_carpet_achievement = THIS }
			}

			russia_reworked_cleaning_red_carpet_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.cleaning_red_carpet_achievement = THIS }
				}
			}

			russia_reworked_cleaning_red_carpet_achievement_status_yes_visible = {
				is_in_array = { global.cleaning_red_carpet_achievement = THIS }
			}

			russia_reworked_cleaning_red_carpet_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.cleaning_red_carpet_achievement = THIS }
				}
			}

            russia_reworked_revolution_completed_achievement_icon_unlocked_visible = {
				is_in_array = { global.revolution_completed_achievement = THIS }
			}

			russia_reworked_revolution_completed_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.revolution_completed_achievement = THIS }
				}
			}

			russia_reworked_revolution_completed_achievement_status_yes_visible = {
				is_in_array = { global.revolution_completed_achievement = THIS }
			}

			russia_reworked_revolution_completed_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.revolution_completed_achievement = THIS }
				}
			}

            russia_reworked_speedrun_urals_achievement_icon_unlocked_visible = {
				is_in_array = { global.speedrun_urals_achievement = THIS }
			}

			russia_reworked_speedrun_urals_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.speedrun_urals_achievement = THIS }
				}
			}

			russia_reworked_speedrun_urals_achievement_status_yes_visible = {
				is_in_array = { global.speedrun_urals_achievement = THIS }
			}

			russia_reworked_speedrun_urals_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.speedrun_urals_achievement = THIS }
				}
			}

            russia_reworked_not_sus_achievement_icon_unlocked_visible = {
				is_in_array = { global.not_sus_achievement = THIS }
			}

			russia_reworked_not_sus_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.not_sus_achievement = THIS }
				}
			}

			russia_reworked_not_sus_achievement_status_yes_visible = {
				is_in_array = { global.not_sus_achievement = THIS }
			}

			russia_reworked_not_sus_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.not_sus_achievement = THIS }
				}
			}

            russia_reworked_new_world_order_achievement_icon_unlocked_visible = {
				is_in_array = { global.new_world_order_achievement = THIS }
			}

			russia_reworked_new_world_order_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.new_world_order_achievement = THIS }
				}
			}

			russia_reworked_new_world_order_achievement_status_yes_visible = {
				is_in_array = { global.new_world_order_achievement = THIS }
			}

			russia_reworked_new_world_order_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.new_world_order_achievement = THIS }
				}
			}

            russia_reworked_red_army_achievement_icon_unlocked_visible = {
				is_in_array = { global.red_army_achievement = THIS }
			}

			russia_reworked_red_army_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.red_army_achievement = THIS }
				}
			}

			russia_reworked_red_army_achievement_status_yes_visible = {
				is_in_array = { global.red_army_achievement = THIS }
			}

			russia_reworked_red_army_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.red_army_achievement = THIS }
				}
			}

            russia_reworked_world_without_borders_achievement_icon_unlocked_visible = {
				is_in_array = { global.world_without_borders_achievement = THIS }
			}

			russia_reworked_world_without_borders_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.world_without_borders_achievement = THIS }
				}
			}

			russia_reworked_world_without_borders_achievement_status_yes_visible = {
				is_in_array = { global.world_without_borders_achievement = THIS }
			}

			russia_reworked_world_without_borders_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.world_without_borders_achievement = THIS }
				}
			}

            russia_reworked_rush_b_achievement_icon_unlocked_visible = {
				is_in_array = { global.rush_b_achievement = THIS }
			}

			russia_reworked_rush_b_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.rush_b_achievement = THIS }
				}
			}

			russia_reworked_rush_b_achievement_status_yes_visible = {
				is_in_array = { global.rush_b_achievement = THIS }
			}

			russia_reworked_rush_b_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.rush_b_achievement = THIS }
				}
			}

            russia_reworked_fourth_rome_achievement_icon_unlocked_visible = {
				is_in_array = { global.fourth_rome_achievement = THIS }
			}

			russia_reworked_fourth_rome_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.fourth_rome_achievement = THIS }
				}
			}

			russia_reworked_fourth_rome_achievement_status_yes_visible = {
				is_in_array = { global.fourth_rome_achievement = THIS }
			}

			russia_reworked_fourth_rome_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.fourth_rome_achievement = THIS }
				}
			}

            russia_reworked_gotcha_achievement_icon_unlocked_visible = {
				is_in_array = { global.gotcha_achievement = THIS }
			}

			russia_reworked_gotcha_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.gotcha_achievement = THIS }
				}
			}

			russia_reworked_gotcha_achievement_status_yes_visible = {
				is_in_array = { global.gotcha_achievement = THIS }
			}

			russia_reworked_gotcha_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.gotcha_achievement = THIS }
				}
			}

            russia_reworked_drunkard_wheel_achievement_icon_unlocked_visible = {
				is_in_array = { global.drunkard_wheel_achievement = THIS }
			}

			russia_reworked_drunkard_wheel_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.drunkard_wheel_achievement = THIS }
				}
			}

			russia_reworked_drunkard_wheel_achievement_status_yes_visible = {
				is_in_array = { global.drunkard_wheel_achievement = THIS }
			}

			russia_reworked_drunkard_wheel_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.drunkard_wheel_achievement = THIS }
				}
			}

            russia_reworked_copyright_achievement_icon_unlocked_visible = {
				is_in_array = { global.copyright_achievement = THIS }
			}

			russia_reworked_copyright_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.copyright_achievement = THIS }
				}
			}

			russia_reworked_copyright_achievement_status_yes_visible = {
				is_in_array = { global.copyright_achievement = THIS }
			}

			russia_reworked_copyright_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.copyright_achievement = THIS }
				}
			}

            russia_reworked_running_90_achievement_icon_unlocked_visible = {
				is_in_array = { global.running_90_achievement = THIS }
			}

			russia_reworked_running_90_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.running_90_achievement = THIS }
				}
			}

			russia_reworked_running_90_achievement_status_yes_visible = {
				is_in_array = { global.running_90_achievement = THIS }
			}

			russia_reworked_running_90_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.running_90_achievement = THIS }
				}
			}

            russia_reworked_quick_revolution_achievement_icon_unlocked_visible = {
				is_in_array = { global.quick_revolution_achievement = THIS }
			}

			russia_reworked_quick_revolution_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.quick_revolution_achievement = THIS }
				}
			}

			russia_reworked_quick_revolution_achievement_status_yes_visible = {
				is_in_array = { global.quick_revolution_achievement = THIS }
			}

			russia_reworked_quick_revolution_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.quick_revolution_achievement = THIS }
				}
			}

            russia_reworked_great_deeds_achievement_icon_unlocked_visible = {
				is_in_array = { global.great_deeds_achievement = THIS }
			}

			russia_reworked_great_deeds_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.great_deeds_achievement = THIS }
				}
			}

			russia_reworked_great_deeds_achievement_status_yes_visible = {
				is_in_array = { global.great_deeds_achievement = THIS }
			}

			russia_reworked_great_deeds_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.great_deeds_achievement = THIS }
				}
			}

            russia_reworked_rome_tsarigrad_moscow_achievement_icon_unlocked_visible = {
				is_in_array = { global.rome_tsarigrad_moscow_achievement = THIS }
			}

			russia_reworked_rome_tsarigrad_moscow_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.rome_tsarigrad_moscow_achievement = THIS }
				}
			}

			russia_reworked_rome_tsarigrad_moscow_achievement_status_yes_visible = {
				is_in_array = { global.rome_tsarigrad_moscow_achievement = THIS }
			}

			russia_reworked_rome_tsarigrad_moscow_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.rome_tsarigrad_moscow_achievement = THIS }
				}
			}

            russia_reworked_1905_avenged_achievement_icon_unlocked_visible = {
				is_in_array = { global.1905_avenged_achievement = THIS }
			}

			russia_reworked_1905_avenged_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.1905_avenged_achievement = THIS }
				}
			}

			russia_reworked_1905_avenged_achievement_status_yes_visible = {
				is_in_array = { global.1905_avenged_achievement = THIS }
			}

			russia_reworked_1905_avenged_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.1905_avenged_achievement = THIS }
				}
			}

            russia_reworked_lacplesis_achievement_icon_unlocked_visible = {
				is_in_array = { global.lacplesis_achievement = THIS }
			}

			russia_reworked_lacplesis_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.lacplesis_achievement = THIS }
				}
			}

			russia_reworked_lacplesis_achievement_status_yes_visible = {
				is_in_array = { global.lacplesis_achievement = THIS }
			}

			russia_reworked_lacplesis_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.lacplesis_achievement = THIS }
				}
			}

            russia_reworked_third_friend_achievement_icon_unlocked_visible = {
				is_in_array = { global.third_friend_achievement = THIS }
			}

			russia_reworked_third_friend_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.third_friend_achievement = THIS }
				}
			}

			russia_reworked_third_friend_achievement_status_yes_visible = {
				is_in_array = { global.third_friend_achievement = THIS }
			}

			russia_reworked_third_friend_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.third_friend_achievement = THIS }
				}
			}

            russia_reworked_national_priority_achievement_icon_unlocked_visible = {
				is_in_array = { global.national_priority_achievement = THIS }
			}

			russia_reworked_national_priority_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.national_priority_achievement = THIS }
				}
			}

			russia_reworked_national_priority_achievement_status_yes_visible = {
				is_in_array = { global.national_priority_achievement = THIS }
			}

			russia_reworked_national_priority_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.national_priority_achievement = THIS }
				}
			}

			russia_reworked_revenge_best_served_cold_achievement_icon_unlocked_visible = {
				is_in_array = { global.revenge_best_served_cold_achievement = THIS }
			}

			russia_reworked_revenge_best_served_cold_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.revenge_best_served_cold_achievement = THIS }
				}
			}

			russia_reworked_revenge_best_served_cold_achievement_status_yes_visible = {
				is_in_array = { global.revenge_best_served_cold_achievement = THIS }
			}

			russia_reworked_revenge_best_served_cold_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.revenge_best_served_cold_achievement = THIS }
				}
			}

			russia_reworked_just_like_old_times_achievement_icon_unlocked_visible = {
				is_in_array = { global.just_like_old_times_achievement = THIS }
			}

			russia_reworked_just_like_old_times_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.just_like_old_times_achievement = THIS }
				}
			}

			russia_reworked_just_like_old_times_achievement_status_yes_visible = {
				is_in_array = { global.just_like_old_times_achievement = THIS }
			}

			russia_reworked_just_like_old_times_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.just_like_old_times_achievement = THIS }
				}
			}

			russia_reworked_tour_de_france_achievement_icon_unlocked_visible = {
				is_in_array = { global.tour_de_france_achievement = THIS }
			}

			russia_reworked_tour_de_france_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.tour_de_france_achievement = THIS }
				}
			}

			russia_reworked_tour_de_france_achievement_status_yes_visible = {
				is_in_array = { global.tour_de_france_achievement = THIS }
			}

			russia_reworked_tour_de_france_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.tour_de_france_achievement = THIS }
				}
			}

            russia_reworked_making_fun_of_me_uh_achievement_icon_unlocked_visible = {
				is_in_array = { global.making_fun_of_me_uh_achievement = THIS }
			}

			russia_reworked_making_fun_of_me_uh_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.making_fun_of_me_uh_achievement = THIS }
				}
			}

			russia_reworked_making_fun_of_me_uh_achievement_status_yes_visible = {
				is_in_array = { global.making_fun_of_me_uh_achievement = THIS }
			}

			russia_reworked_making_fun_of_me_uh_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.making_fun_of_me_uh_achievement = THIS }
				}
			}

            russia_reworked_click_me_achievement_icon_unlocked_visible = {
				is_in_array = { global.click_me_achievement = THIS }
			}

			russia_reworked_click_me_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.click_me_achievement = THIS }
				}
			}

			russia_reworked_click_me_achievement_status_yes_visible = {
				is_in_array = { global.click_me_achievement = THIS }
			}

			russia_reworked_click_me_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.click_me_achievement = THIS }
				}
			}

            russia_reworked_big_tower_achievement_icon_unlocked_visible = {
				is_in_array = { global.big_tower_achievement = THIS }
			}

			russia_reworked_big_tower_achievement_icon_locked_visible = {
				NOT = {
					is_in_array = { global.big_tower_achievement = THIS }
				}
			}

			russia_reworked_big_tower_achievement_status_yes_visible = {
				is_in_array = { global.big_tower_achievement = THIS }
			}

			russia_reworked_big_tower_achievement_status_no_visible = {
				NOT = {
					is_in_array = { global.big_tower_achievement = THIS }
				}
			}
		}

		properties = {
			flag = {
                image = "[This.GetFlag]"
            }
		}
	}
}