scripted_gui = {

	SBI_WEST_RUSSIAN_WAR_decision_ui = {
		context_type = decision_category
		window_name = "SBI_WEST_RUSSIAN_WAR_decision_ui_window"

		triggers = {
			SBI_war_ostland_red_visible = {
				SBI = {
					has_country_flag = wrw_ostland_captured
				}
			}
			SBI_war_ostland_gray_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_ostland_captured }
				}
			}
			
			SBI_war_moskowien_red_visible = {
				SBI = {
					has_country_flag = wrw_moskowien_captured
				}
			}
			SBI_war_moskowien_gray_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_moskowien_captured }
				}
			}
			
			SBI_war_ukraine_red_visible = {
				SBI = {
					has_country_flag = wrw_ukraine_captured
				}
			}
			SBI_war_ukraine_gray_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_ukraine_captured }
				}
			}
			
			SBI_war_kaukasien_red_visible = {
				SBI = {
					has_country_flag = wrw_kaukasien_captured
				}
			}
			SBI_war_kaukasien_gray_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_kaukasien_captured }
				}
			}
			
			SBI_war_kazakhstan_gray_visible = {
				SBI = {
					has_country_flag = wrw_kazakhstan_captured
				}
			}
			SBI_war_kazakhstan_red_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_kazakhstan_captured }
				}
			}
			
			SBI_war_west_russia_gray_visible = {
				SBI = {
					has_country_flag = wrw_west_russia_captured
				}
			}
			SBI_war_west_russia_red_visible = {
				SBI = {
					NOT = { has_country_flag = wrw_west_russia_captured }
				}
			}
		}
		
		effects = {
			SBI_war_ukraine_red_click = {
				set_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
			SBI_war_ostland_red_click = {
				set_country_flag = war_ostland_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
			SBI_war_moskowien_red_click = {
				set_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
			SBI_war_kaukasien_red_click = {
				set_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
			SBI_war_ukraine_gray_click = {
				set_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_ostland_gray_click = {
				set_country_flag = war_ostland_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_moskowien_gray_click = {
				set_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_kaukasien_gray_click = {
				set_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_kazakhstan_gray_click = {
				set_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_west_russia_gray_click = {
				set_country_flag = war_west_russia_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_kaukasien_open_flag
				if = {
					limit = { original_tag = GER }
					set_country_flag = GER_OUR_open_flag
					clr_country_flag = GER_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_NOT_OUR_open_flag
					clr_country_flag = WRS_OUR_open_flag
				}
			}
			SBI_war_kazakhstan_red_click = {
				set_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kaukasien_open_flag
				clr_country_flag = war_west_russia_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
			SBI_war_west_russia_red_click = {
				set_country_flag = war_west_russia_open_flag
				clr_country_flag = war_ukraine_open_flag
				clr_country_flag = war_moskowien_open_flag
				clr_country_flag = war_ostland_open_flag
				clr_country_flag = war_kazakhstan_open_flag
				clr_country_flag = war_kaukasien_open_flag
				if = {
					limit = { original_tag = SBI }
					set_country_flag = WRS_OUR_open_flag
					clr_country_flag = WRS_NOT_OUR_open_flag
				}
				else_if = {
					limit = { original_tag = GER }
					set_country_flag = GER_NOT_OUR_open_flag
					clr_country_flag = GER_OUR_open_flag
				}
			}
		}

		properties = {

			WAR_exhaustion_bar_GER = {
				frame = GER.WAR_exhaustion_bar_GER
			}

			WAR_exhaustion_bar_SBI = {
				frame = SBI.WAR_exhaustion_bar_SBI
			}
			
			WAR_get_control_moskow = {
				image = "[SBI_WAR_get_control_moskow]"
			}
			WAR_get_control_kiev = {
				image = "[SBI_WAR_get_control_kiev]"
			}
			WAR_get_control_riga = {
				image = "[SBI_WAR_get_control_riga]"
			}
			WAR_get_control_tbilisi = {
				image = "[SBI_WAR_get_control_tbilisi]"
			}
			WAR_get_control_syktyvkar = {
				image = "[SBI_WAR_get_control_syktyvkar]"
			}
			
			WAR_get_control_leningrad = {
				image = "[SBI_WAR_get_control_leningrad]"
			}
			WAR_get_control_kargopol = {
				image = "[SBI_WAR_get_control_kargopol]"
			}
			WAR_get_control_vologda = {
				image = "[SBI_WAR_get_control_vologda]"
			}
			WAR_get_control_gorky = {
				image = "[SBI_WAR_get_control_gorky]"
			}
			WAR_get_control_samara = {
				image = "[SBI_WAR_get_control_samara]"
			}
			WAR_get_control_paulusburg = {
				image = "[SBI_WAR_get_control_paulusburg]"
			}
			WAR_get_control_lipezk = {
				image = "[SBI_WAR_get_control_lipezk]"
			}
			WAR_get_control_smolensk = {
				image = "[SBI_WAR_get_control_smolensk]"
			}
			WAR_get_control_minsk = {
				image = "[SBI_WAR_get_control_minsk]"
			}
			WAR_get_control_kazan = {
				image = "[SBI_WAR_get_control_kazan]"
			}
			WAR_get_control_orenburg = {
				image = "[SBI_WAR_get_control_orenburg]"
			}
			WAR_get_control_uralsk = {
				image = "[SBI_WAR_get_control_uralsk]"
			}
			WAR_get_control_ahtubinsk = {
				image = "[SBI_WAR_get_control_ahtubinsk]"
			}
		}
		
		visible = {
			always = yes
		}
	}
	
}