scripted_gui = {

	sp_event_window = {
		window_name = "sp_event_window"
		context_type = player_context

		visible = {
			has_global_flag = Super_Event_Visible
		}
		
		triggers = {
			Super_Event_Image_Second_World_War_visible = {
				has_global_flag = GER_WW2
			}
		}
		
		triggers = {
			Super_Event_Image_Sino_Japanese_visible = {
				has_global_flag = JAP_Sino_Japanese
			}
		}
		
		triggers = {
			Super_Event_Image_Spanish_Civil_War_visible = {
				has_global_flag = SPA_Civil_War
			}
		}
		
		triggers = {
			Super_Event_Image_Pacific_War_visible = {
				has_global_flag = USA_Pacific_War
			}
		}
		
		triggers = {
			Super_Event_Image_Barbarossa_visible = {
				has_global_flag = GER_Barbarossa
			}
		}
		
		triggers = {
			Super_Event_Image_Nationalist_visible = {
				has_global_flag = SPA_Nationalist
			}
		}
		
		triggers = {
			Super_Event_Image_Republican_visible = {
				has_global_flag = SPA_Republican
			}
		}
		
		triggers = {
			Super_Event_Image_Anarchist_visible = {
				has_global_flag = SPA_Anarchist
			}
		}
		
		triggers = {
			Super_Event_Image_Communist_visible = {
				has_global_flag = SPA_Communist
			}
		}
		
		triggers = {
			Super_Event_Image_Falangist_visible = {
				has_global_flag = SPA_Falangist
			}
		}
		
		triggers = {
			Super_Event_Image_Stalinist_visible = {
				has_global_flag = SPA_Stalinist
			}
		}
		
		triggers = {
			Super_Event_Image_Carlist_visible = {
				has_global_flag = SPA_Carlist
			}
		}
		
		triggers = {
			Super_Event_Image_British_Collapse_visible = {
				has_global_flag = ENG_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Germany_visible = {
				has_global_flag = GER_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Soviet_End_visible = {
				has_global_flag = SOV_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Japanese_Surrender_visible = {
				has_global_flag = JAP_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_America_visible = {
				has_global_flag = USA_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_First_Nuke_visible = {
				has_global_flag = SP_Nuke
			}
		}
		
		#############
		###BRITISH###
		#############
		
		triggers = {
			Super_Event_Image_Imperial_Federation_visible = {
				has_global_flag = UK_ImpFed
			}
		}
		
		triggers = {
			Super_Event_Image_Decolonization_visible = {
				has_global_flag = UK_Decolonization
			}
		}
			
		triggers = {
			Super_Event_Image_King_Party_visible = {
				has_global_flag = UK_King
			}
		}
			
		triggers = {
			Super_Event_Image_Mosley_visible = {
				has_global_flag = UK_Mosley
			}
		}
		
		triggers = {
			Super_Event_Image_Brit_Communist_visible = {
				has_global_flag = UK_Communist
			}
		}
		
		#############
		###GERMANY###
		#############
		
		triggers = {
			Super_Event_Image_Kaiser_WW2_visible = {
				has_global_flag = GER_KaiserWW2
			}
		}
		
		triggers = {
			Super_Event_Image_German_Civil_War_visible = {
				has_global_flag = GER_GCW
			}
		}
		
		triggers = {
			Super_Event_Image_Kaiser_Returns_visible = {
				has_global_flag = GER_Kaiser
			}
		}
		
		triggers = {
			Super_Event_Image_Democratic_Germany_visible = {
				has_global_flag = GER_Democracy
			}
		}
		
		triggers = {
			Super_Event_Image_Endsieg_visible = {
				has_global_flag = GER_Endsieg
			}
		}
		
		triggers = {
			Super_Event_Image_Endsieg_visible = {
				has_global_flag = GER_Endsieg
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_France_visible = {
				has_global_flag = FRA_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Poland_visible = {
				has_global_flag = POL_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Unholy_Alliance_visible = {
				has_global_flag = GER_Unholy
			}
		}
		
		triggers = {
			Super_Event_Image_Austria_Hungary_visible = {
				has_global_flag = AUS_HUN
			}
		}
		
		triggers = {
			Super_Event_Image_Eastern_Front_visible = {
				has_global_flag = GER_KaiserEast
			}
		}
		
		triggers = {
			Super_Event_Image_Victoria_visible = {
				has_global_flag = GER_Victoria
			}
		}
		
		##########
		###ASIA###
		##########
		
		triggers = {
			Super_Event_Image_Fall_China_visible = {
				has_global_flag = CHI_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Chinese_Civil_War_visible = {
				has_global_flag = CHI_CW
			}
		}
		
		triggers = {
			Super_Event_Image_China_Communist_visible = {
				has_global_flag = CHI_CommieUnify
			}
		}
		
		triggers = {
			Super_Event_Image_China_Nationalist_visible = {
				has_global_flag = CHI_NationalistUnify
			}
		}
		
		triggers = {
			Super_Event_Image_Russo_Japanese_visible = {
				has_global_flag = JAP_Russo
			}
		}
		
		triggers = {
			Super_Event_Image_Qing_visible = {
				has_global_flag = MAN_Qing
			}
		}
		
		triggers = {
			Super_Event_Image_GEACPS_visible = {
				has_global_flag = JAP_GEACPS
			}
		}
		
		triggers = {
			Super_Event_Image_JCW_visible = {
				has_global_flag = JAP_CW
			}
		}
		
		triggers = {
			Super_Event_Image_Chinese_Victory_visible = {
				has_global_flag = CHI_Victory
			}
		}
		
		###################
		####No Step Back###
		###################
		
		triggers = {
			Super_Event_Image_SCWC_visible = {
				has_global_flag = SOV_Civil_War_Communist
			}
		}
		
		triggers = {
			Super_Event_Image_SCWW_visible = {
				has_global_flag = SOV_Civil_War_White
			}
		}
		
		triggers = {
			Super_Event_Image_Romanov_visible = {
				has_global_flag = SOV_Romanov
			}
		}
		
		triggers = {
			Super_Event_Image_PLC_visible = {
				has_global_flag = POL_LIT
			}
		}
		
		triggers = {
			Super_Event_Image_Winter_War_visible = {
				has_global_flag = FIN_Winter_War
			}
		}
		
		###############
		###BOSPHORUS###
		###############
		
		triggers = {
			Super_Event_Image_Macedon_visible = {
				has_global_flag = GRE_Macedon
			}
		}
		
		triggers = {
			Super_Event_Image_Byzantine_visible = {
				has_global_flag = GRE_Byzantine
			}
		}
		
		triggers = {
			Super_Event_Image_Ottoman_visible = {
				has_global_flag = TUR_Ottoman
			}
		}
		
		triggers = {
			Super_Event_Image_Turan_visible = {
				has_global_flag = TUR_Turan
			}
		}
		
		triggers = {
			Super_Event_Image_Balkan_visible = {
				has_global_flag = BUL_Balkan
			}
		}
		
		############
		###BUTTON###
		############
		
		effects = {
			sp_event_close_button_click = {
				clr_global_flag = Super_Event_Visible
				
				if = {
					limit = {
						has_global_flag = GER_WW2
					}
					clr_global_flag = GER_WW2
				}
					
				if = {
					limit = {
						has_global_flag = JAP_Sino_Japanese
					}
					clr_global_flag = JAP_Sino_Japanese
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Civil_War
					}
					clr_global_flag = SPA_Civil_War
				}
				
				if = {
					limit = {
						has_global_flag = USA_Pacific_War
					}
					clr_global_flag = USA_Pacific_War
				}
				
				if = {
					limit = {
						has_global_flag = GER_Barbarossa
					}
					clr_global_flag = GER_Barbarossa
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Nationalist
					}
					clr_global_flag = SPA_Nationalist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Republican
					}
					clr_global_flag = SPA_Republican
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Anarchist
					}
					clr_global_flag = SPA_Anarchist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Communist
					}
					clr_global_flag = SPA_Communist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Falangist
					}
					clr_global_flag = SPA_Falangist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Stalinist
					}
					clr_global_flag = SPA_Stalinist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Carlist
					}
					clr_global_flag = SPA_Carlist
				}
				
				if = {
					limit = {
						has_global_flag = ENG_Fall
					}
					clr_global_flag = ENG_Fall
				}
				
				if = {
					limit = {
						has_global_flag = GER_Fall
					}
					clr_global_flag = GER_Fall
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Fall
					}
					clr_global_flag = SOV_Fall
				}
				
				if = {
					limit = {
						has_global_flag = JAP_Fall
					}
					clr_global_flag = JAP_Fall
				}
				
				if = {
					limit = {
						has_global_flag = USA_Fall
					}
					clr_global_flag = USA_Fall
				}
				
				if = {
					limit = {
						has_global_flag = SP_Nuke
					}
					clr_global_flag = SP_Nuke
				}
				
				#############
				###BRITISH###
				#############
				
				if = {
					limit = {
						has_global_flag = UK_ImpFed
					}
					clr_global_flag = UK_ImpFed
				}
				
				if = {
					limit = {
						has_global_flag = UK_Decolonization
					}
					clr_global_flag = UK_Decolonization
				}
				
				if = {
					limit = {
						has_global_flag = UK_King
					}
					clr_global_flag = UK_King
				}
				
				if = {
					limit = {
						has_global_flag = UK_Mosley
					}
					clr_global_flag = UK_Mosley
				}
				
				if = {
					limit = {
						has_global_flag = UK_Communist
					}
					clr_global_flag = UK_Communist
				}
				
				#############
				###GERMANY###
				#############
				
				if = {
					limit = {
						has_global_flag = GER_KaiserWW2
					}
					clr_global_flag = GER_KaiserWW2
				}
				
				if = {
					limit = {
						has_global_flag = GER_KaiserWW2
					}
					clr_global_flag = GER_KaiserWW2
				}
				
				if = {
					limit = {
						has_global_flag = GER_GCW
					}
					clr_global_flag = GER_GCW
				}
				
				if = {
					limit = {
						has_global_flag = GER_Kaiser
					}
					clr_global_flag = GER_Kaiser
				}
				
				if = {
					limit = {
						has_global_flag = GER_Democracy
					}
					clr_global_flag = GER_Democracy
				}
				
				if = {
					limit = {
						has_global_flag = GER_Endsieg
					}
					clr_global_flag = GER_Endsieg
				}
				
				if = {
					limit = {
						has_global_flag = FRA_Fall
					}
					clr_global_flag = FRA_Fall
				}
				
				if = {
					limit = {
						has_global_flag = POL_Fall
					}
					clr_global_flag = POL_Fall
				}
				
				if = {
					limit = {
						has_global_flag = GER_Unholy
					}
					clr_global_flag = GER_Unholy
				}
				
				if = {
					limit = {
						has_global_flag = AUS_HUN
					}
					clr_global_flag = AUS_HUN
				}
				
				if = {
					limit = {
						has_global_flag = GER_KaiserEast
					}
					clr_global_flag = GER_kaiserEast
				}
				
				if = {
					limit = {
						has_global_flag = GER_Victoria
					}
					clr_global_flag = GER_Victoria
				}
				
				##########
				###ASIA###
				##########
				
				if = {
					limit = {
						has_global_flag = CHI_Fall
					}
					clr_global_flag = CHI_Fall
				}
				
				if = {
					limit = {
						has_global_flag = CHI_CW
					}
					clr_global_flag = CHI_CW
				}
				
				if = {
					limit = {
						has_global_flag = CHI_CommieUnify
					}
					clr_global_flag = CHI_CommieUnify
				}
				
				if = {
					limit = {
						has_global_flag = CHI_NationalistUnify
					}
					clr_global_flag = CHI_NationalistUnify
				}
				
				if = {
					limit = {
						has_global_flag = JAP_Russo
					}
					clr_global_flag = JAP_Russo
				}
				
				if = {
					limit = {
						has_global_flag = MAN_Qing
					}
					clr_global_flag = MAN_Qing
				}
				
				if = {
					limit = {
						has_global_flag = JAP_GEACPS
					}
					clr_global_flag = JAP_GEACPS
				}
				
				if = {
					limit = {
						has_global_flag = JAP_CW
					}
					clr_global_flag = JAP_CW
				}
				
				if = {
					limit = {
						has_global_flag = CHI_Victory
					}
					clr_global_flag = CHI_Victory
				}
				
				###################
				####No Step Back###
				###################
				
				if = {
					limit = {
						has_global_flag = SOV_Civil_War_Communist
					}
					clr_global_flag = SOV_Civil_War_Communist
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Civil_War_White
					}
					clr_global_flag = SOV_Civil_War_White
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Romanov
					}
					clr_global_flag = SOV_Romanov
				}
				
				if = {
					limit = {
						has_global_flag = POL_LIT
					}
					clr_global_flag = POL_LIT
				}
				
				if = {
					limit = {
						has_global_flag = FIN_Winter_War
					}
					clr_global_flag = FIN_Winter_War
				}
				
				###############
				###BOSPHORUS###
				###############
				
				if = {
					limit = {
						has_global_flag = GRE_Macedon
					}
					clr_global_flag = GRE_Macedon
				}
				
				if = {
					limit = {
						has_global_flag = GRE_Byzantine
					}
					clr_global_flag = GRE_Byzantine
				}
				
				if = {
					limit = {
						has_global_flag = TUR_Ottoman
					}
					clr_global_flag = TUR_Ottoman
				}
				
				if = {
					limit = {
						has_global_flag = TUR_Turan
					}
					clr_global_flag = TUR_Turan
				}
				
				if = {
					limit = {
						has_global_flag = BUL_Balkan
					}
					clr_global_flag = BUL_Balkan
				}
			}
		}
	}
}