scripted_gui = {
	ASG_military_line_graph_SAMPLE_scripted_gui = {
		window_name = "ASG_military_line_graph_SAMPLE_gui"
		context_type = player_context
		visible = {
			has_global_flag = open_military_line_graph_gui
		}
		effects = {
			close_button_click = {
				clr_global_flag = open_military_line_graph_gui
			}
			substract_button_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				ASG_military_rescale_down = yes
			}
			add_button_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				ASG_military_rescale_up = yes
			}
			change_button_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 8
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_grey_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 1
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_blue_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 2
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_red_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 3
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_light_blue_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 4
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_green_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 5
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_light_red_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 6
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_light_white_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 7
					}
					set_global_flag = ASG_open_selection
				}
			}
			button_light_yellow_update_click = {
				# Invoke scripted effect to add a random point to the line
				# See scripted effect file
				# set_variable = {
				# 	GLOBAL.ASG_light_yellow_curve_tag = THIS.CONTROLLER
				# }
				# ASG_graphs_replot = yes
				if = {
					limit = {
						has_global_flag = ASG_open_selection
					}
					clr_global_flag = ASG_open_selection
				} else = {
					set_variable = {
						GLOBAL.ASG_selected_channel = 8
					}
					set_global_flag = ASG_open_selection
				}
			}
		}
		# Set up dynamic list to generate one line segment per point
		dynamic_lists = {
			ASG_military_line_segments_red = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_red
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_red
				index = ASG_segment_idx
			}
			ASG_military_line_segments_green = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_green
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_green
				index = ASG_segment_idx
			}
			ASG_military_line_segments_light_red = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_red
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_light_red
				index = ASG_segment_idx
			}
			ASG_military_line_segments_light_blue = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_blue
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_light_blue
				index = ASG_segment_idx
			}
			ASG_military_line_segments_blue = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_blue
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_blue
				index = ASG_segment_idx
			}
			ASG_military_line_segments_grey = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_grey
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_grey
				index = ASG_segment_idx
			}
			ASG_military_line_segments_light_yellow = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_yellow
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_light_yellow
				index = ASG_segment_idx
			}
			ASG_military_line_segments_light_white = {
				array = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_white
				change_scope = no
				entry_container = ASG_military_line_graph_line_segment_light_white
				index = ASG_segment_idx
			}
		}
		properties = {
			segment_red = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_red^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_red^ASG_segment_idx
			}
			segment_green = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_green^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_green^ASG_segment_idx
			}
			segment_light_red = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_red^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_light_red^ASG_segment_idx
			}
			segment_blue = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_blue^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_blue^ASG_segment_idx
			}
			segment_light_blue = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_blue^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_light_blue^ASG_segment_idx
			}
			segment_light_yellow = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_yellow^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_light_yellow^ASG_segment_idx
			}
			segment_light_white = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_light_white^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_light_white^ASG_segment_idx
			}
			segment_grey = {
				# Sets they position of the line segment to the graph offset
				# Equal to -y1
				y = GLOBAL.ASG_SAMPLE_military_graph_offsets_grey^ASG_segment_idx
				# Tells the shader how steep to draw the line
				# Must be equal to (y2 - y1) / 2 + 50
				frame = GLOBAL.ASG_military_graph_slopes_grey^ASG_segment_idx
			}
		}
		triggers = {
			# Optional. This hides every other x label, to give them some breathing room
			label_visible = {
				set_temp_variable = {
					si = ASG_segment_idx
				}
				modulo_temp_variable = {
					si = 2
				}
				check_variable = {
					si = 0
				}
			}
		}
	}
}
