scripted_gui = {

	wrw_sp_event_window = {
		window_name = "wrw_sp_event_window"
		context_type = player_context

		visible = {
			has_global_flag = wrw_Super_Event_Visible
		}
		
		triggers = {
			Super_Event_Image_West_Russian_War_Zhukov_visible = {
				has_global_flag = WRS_Zhukov_War
			}
		}
		
		triggers = {
			Super_Event_Image_West_Russian_War_Tukhach_visible = {
				has_global_flag = WRS_Tukhach_War
			}
		}
		
		triggers = {
			Super_Event_Image_Siberian_War_visible = {
				has_global_flag = Siberian_War
			}
		}
		
		triggers = {
			Super_Event_Image_WRS_over_wrw_visible = {
				has_global_flag = WRW_wrs_won
			}
		}
		
		triggers = {
			Super_Event_Image_Germany_over_wrw_visible = {
				has_global_flag = WRW_ger_won
			}
		}	
		
		triggers = {
			Super_Event_Image_Harms_good_end_visible = {
				has_global_flag = Harms_good_end
			}
		}	
		
		triggers = {
			Super_Event_Image_Harms_war_visible = {
				has_global_flag = Harms_war
			}
		}	
		
		triggers = {
			Super_Event_Image_Paster_good_end_visible = {
				has_global_flag = Paster_good_end
			}
		}	
		
		triggers = {
			Super_Event_Image_Paster_war_visible = {
				has_global_flag = Paster_war
			}
		}	
		
		triggers = {
			Super_Event_Image_Pokr_bad_end_visible = {
				has_global_flag = Pokr_bad_end
			}
		}	
		
		triggers = {
			Super_Event_Image_Pokr_good_end_visible = {
				has_global_flag = Pokr_good_end
			}
		}	
		
		triggers = {
			Super_Event_Image_Pokr_war_visible = {
				has_global_flag = Pokr_war
			}
		}	
		
		triggers = {
			Super_Event_Image_SBI_devastate_visible = {
				has_global_flag = SBI_devastate
			}
		}
		
		triggers = {
			Super_Event_Image_Kanaris_war_visible = {
				has_global_flag = SBI_KANARIS_WAR
			}
		}
		
		triggers = {
			Super_Event_Image_Kanaris_win_visible = {
				has_global_flag = SBI_KANARIS_WIN
			}
		}
		
		triggers = {
			Super_Event_Image_Kanaris_good_end_visible = {
				has_global_flag = SBI_KANARIS_GOOD
			}
		}
		
		
		############
		###BUTTON###
		############
		
		effects = {
			wrw_sp_event_close_button_click = {
				clr_global_flag = wrw_Super_Event_Visible
				
				if = {
					limit = {
						has_global_flag = WRS_Zhukov_War
					}
					clr_global_flag = WRS_Zhukov_War
				}
				
				if = {
					limit = {
						has_global_flag = WRS_Tukhach_War
					}
					clr_global_flag = WRS_Tukhach_War
				}
				
				if = {
					limit = {
						has_global_flag = Siberian_War
					}
					clr_global_flag = Siberian_War
				}
				
				if = {
					limit = {
						has_global_flag = WRW_wrs_won
					}
					clr_global_flag = WRW_wrs_won
				}
				
				if = {
					limit = {
						has_global_flag = WRW_ger_won
					}
					clr_global_flag = WRW_ger_won
				}
				
				if = {
					limit = {
						has_global_flag = Harms_good_end
					}
					clr_global_flag = Harms_good_end
				}
				
				if = {
					limit = {
						has_global_flag = Harms_war
					}
					clr_global_flag = Harms_war
				}
				
				if = {
					limit = {
						has_global_flag = Paster_good_end
					}
					clr_global_flag = Paster_good_end
				}
				
				if = {
					limit = {
						has_global_flag = Paster_war
					}
					clr_global_flag = Paster_war
				}
				
				if = {
					limit = {
						has_global_flag = Pokr_bad_end
					}
					clr_global_flag = Pokr_bad_end
				}
				
				if = {
					limit = {
						has_global_flag = Pokr_good_end
					}
					clr_global_flag = Pokr_good_end
				}
				
				if = {
					limit = {
						has_global_flag = Pokr_war
					}
					clr_global_flag = Pokr_war
				}
				
				if = {
					limit = {
						has_global_flag = SBI_devastate
					}
					clr_global_flag = SBI_devastate
				}
				
				if = {
					limit = {
						has_global_flag = SBI_KANARIS_WAR
					}
					clr_global_flag = SBI_KANARIS_WAR
				}
				
				if = {
					limit = {
						has_global_flag = SBI_KANARIS_WIN
					}
					clr_global_flag = SBI_KANARIS_WIN
				}
				
				if = {
					limit = {
						has_global_flag = SBI_KANARIS_GOOD
					}
					clr_global_flag = SBI_KANARIS_GOOD
				}
				
			}
		}
	}
}