scripted_gui = {
	cw_embargo_diplomacy_buttons_ui = {
		window_name = "cw_embargo_diplomacy_buttons"
		context_type = selected_country_context
		parent_window_token = selected_country_view

		triggers = {
			close_button_visible = {
				ROOT = {
					OR = {
						has_country_flag = show_who_embargoes_them
						has_country_flag = show_who_they_embargo
					}
				}
			}
		}
		effects = {
			close_button_click = {
				ROOT = {
					clr_country_flag = show_who_they_embargo
					clr_country_flag = show_who_embargoes_them
				}
			}
			who_embargos_them_button_click = {
				ROOT = {
					set_country_flag = show_who_embargoes_them
					clr_country_flag = show_who_they_embargo
					clear_array = ROOT.view_embargoes_list
				}
				every_country = {
					limit = {
						exists = yes
						PREV = {
							is_in_array = {
								array = PREV.embargoed_countries
								value = THIS.id
							}
						}
					}
					add_to_array = {
				    array = ROOT.view_embargoes_list
				    value = THIS.id
					}
				}
			}
			show_who_they_embargo_button_click = {
				ROOT = {
					clr_country_flag = show_who_embargoes_them
					set_country_flag = show_who_they_embargo
				}

			}
		}
		visible = {
			NOT = { has_dlc = "By Blood Alone" }
		}
	}
	cw_their_embargo_diplomacy_ui = {
		window_name = "cw_embargo_info_diplomacy"
		context_type = selected_country_context
		parent_window_token = selected_country_view

		visible = {
			NOT = { has_dlc = "By Blood Alone" }
			ROOT = { has_country_flag = show_who_they_embargo }
		}
		triggers = {
		}
		effects = {
		}
		dynamic_lists = {
			coutnries_we_embargo_list_gridbox = {
				array = THIS.embargoed_countries
				entry_container = countries_we_embargo_list_entry
				change_scope = yes
			}
		}
		properties = {
			country_flag = {
				image = "[THIS.GetFlag]"
			}
		}
		ai_enabled = {
			always = no
		}
	}
	cw_countries_that_embargo_them_diplomacy_ui = {
		window_name = "cw_embargo_info_diplomacy"
		context_type = selected_country_context
		parent_window_token = selected_country_view

		visible = {
			NOT = { has_dlc = "By Blood Alone" }
			ROOT = { has_country_flag = show_who_embargoes_them }
		}
		triggers = {
		}
		effects = {
		}
		dynamic_lists = {
			coutnries_we_embargo_list_gridbox = {
				array = ROOT.view_embargoes_list
				entry_container = countries_we_embargo_list_entry
				change_scope = yes
			}
		}
		properties = {
			country_flag = {
				image = "[THIS.GetFlag]"
			}
		}
		ai_enabled = {
      always = no
    }
	}
}
