scripted_gui = {

	EAI_stockpile = {

		context_type = player_context

		window_name = "EAI_stockpile_window"

		dirty = ROOT.EAI_refresh_gui

		visible = {
			has_country_flag = EAI_config_STOCKPILE
			has_variable = EAI_configuration_target
		}

		effects = {
			EAI_stockpile_close_button_click = {
				clr_country_flag = EAI_config_STOCKPILE
				if = { 
					limit = { NOT = { has_country_flag = EAI_config_ARMY } }

					clear_variable = EAI_configuration_target
				}
				EAI_clear_stockpile_variables = yes

				EAI_refresh_gui = yes
			}
		}

		triggers = {

		}
	}
}