﻿
AuGu_setting_interaction = {
	common_interaction = yes
	category = interaction_category_friendly
	greeting = positive
	icon = child
	desc = AuGu_setting_interaction_desc
	
	send_name = AuGu_send_text

	popup_on_receive = yes
	pause_on_receive = yes

	interface_priority = 60
	send_options_exclusive = yes

	is_shown = {
		scope:actor = {
			is_ai = no
		}
		scope:recipient = {
			this = scope:actor
		}
		always = yes
	}
	is_valid_showing_failures_only = {
		always = yes
	}
	
	send_option = {
		flag = all
		localization = AuGu_setting_all
	}
	send_option = {
		flag = only_children
		localization = AuGu_setting_only_children
	}
	send_option = {
		flag = only_close_familly
		localization = AuGu_setting_only_close_familly
	}
	send_option = {
		is_valid = {
			custom_tooltip = {
				scope:actor = {
					OR = {
						has_variable = AuGu_setting_all_var
						has_variable = AuGu_setting_only_children_var
						has_variable = AuGu_setting_only_close_familly_var
					}
				}
				text = AuGu_setting_remove_familly_valid
			}
		}
		flag = remove
		localization = AuGu_setting_remove_familly
	}		
	
	on_accept = {
		switch = {
			trigger = yes
			scope:all = { 
				scope:actor = {
					set_variable = {
						name = AuGu_setting_all_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_all_tt
					custom_tooltip = AuGu_setting_all_ttt
					
					remove_variable = AuGu_setting_no_close_familly_var
					remove_variable = AuGu_setting_no_children_var
					remove_variable = AuGu_setting_no_heir_var
					remove_variable = AuGu_setting_tutor_var
					remove_variable = AuGu_setting_only_close_familly_var
					remove_variable = AuGu_setting_only_children_var
					
					open_interaction_window = {
						interaction = AuGu_setting_second_interaction
						actor = scope:actor
						recipient = scope:actor
					}
					
				}
			}
			scope:only_children = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_only_children_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_only_children_tt
					custom_tooltip = AuGu_setting_only_children_ttt
					
					remove_variable = AuGu_setting_no_close_familly_var
					remove_variable = AuGu_setting_no_children_var
					remove_variable = AuGu_setting_no_heir_var
					remove_variable = AuGu_setting_tutor_var
					remove_variable = AuGu_setting_only_close_familly_var
					remove_variable = AuGu_setting_all_var
					
					open_interaction_window = {
						interaction = AuGu_setting_second_interaction
						actor = scope:actor
						recipient = scope:actor
					}
					
				}
			}
			scope:only_close_familly = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_only_close_familly_var
						value = flag:yes
					}
					
					custom_tooltip = AuGu_setting_only_close_familly_tt
					custom_tooltip = AuGu_setting_only_close_familly_ttt
					
					remove_variable = AuGu_setting_no_close_familly_var
					remove_variable = AuGu_setting_no_children_var
					remove_variable = AuGu_setting_no_heir_var
					remove_variable = AuGu_setting_tutor_var
					remove_variable = AuGu_setting_only_children_var
					remove_variable = AuGu_setting_all_var
					
					open_interaction_window = {
						interaction = AuGu_setting_second_interaction
						actor = scope:actor
						recipient = scope:actor
					}									
				}
			}
			scope:remove = {
				scope:actor = {
					custom_tooltip = AuGu_setting_remove_tt
					custom_tooltip = AuGu_setting_remove_ttt
					
					remove_variable = AuGu_setting_all_var
					remove_variable = AuGu_setting_no_close_familly_var
					remove_variable = AuGu_setting_no_children_var
					remove_variable = AuGu_setting_no_heir_var
					remove_variable = AuGu_setting_tutor_var
					remove_variable = AuGu_setting_only_close_familly_var
					remove_variable = AuGu_setting_only_children_var
				}
			}
		}
	}
}			


AuGu_setting_second_interaction = {
	common_interaction = yes
	category = interaction_category_friendly
	greeting = positive
	icon = child
	
	
	send_name = AuGu_send_text

	popup_on_receive = yes
	pause_on_receive = yes

	interface_priority = 60
	send_options_exclusive = yes
         hidden = yes 
	is_shown = {
		scope:actor = {
			is_ai = no
		}
		scope:recipient = {
			this = scope:actor
		}
		always = yes
	}
	is_valid_showing_failures_only = {
		always = yes
	}
	send_option = {
		flag = remove_second
		localization = AuGu_setting_remove_second_familly
	}
	send_option = {
		flag = no_heir
		localization = AuGu_setting_no_heir
	}
	send_option = {
		is_shown = {
			scope:actor = {
				NOT = { has_variable = AuGu_setting_only_children_var }
			}
		}
		flag = no_children
		localization = AuGu_setting_no_children
	}
	send_option = {
		is_shown = {
			scope:actor = {
				NOR = { 
					has_variable = AuGu_setting_only_children_var
					has_variable = AuGu_setting_only_close_familly_var
				}
			}
		}
		flag = no_close_familly
		localization = AuGu_setting_no_close_familly
	}
	
	
	on_accept = {
		switch = {
			trigger = yes
			scope:no_close_familly = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_no_close_familly_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_no_close_familly_tt
					custom_tooltip = AuGu_setting_no_close_familly_ttt
					
					open_interaction_window = {
						interaction = AuGu_setting_third_interaction
						actor = scope:actor
						recipient = scope:actor
					}	
					
				}
			}
			scope:no_children = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_no_children_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_no_children_tt
					custom_tooltip = AuGu_setting_no_children_ttt
					
					open_interaction_window = {
						interaction = AuGu_setting_third_interaction
						actor = scope:actor
						recipient = scope:actor
					}
					
				}
			}
			scope:no_heir = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_no_heir_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_no_heir_tt
					custom_tooltip = AuGu_setting_no_heir_ttt
					
					open_interaction_window = {
						interaction = AuGu_setting_third_interaction
						actor = scope:actor
						recipient = scope:actor
					}
					
				}
			}
			scope:remove_second = {
				scope:actor = {
					custom_tooltip = AuGu_setting_remove_second_tt
					custom_tooltip = AuGu_setting_remove_second_ttt
					open_interaction_window = {
						interaction = AuGu_setting_third_interaction
						actor = scope:actor
						recipient = scope:actor
					}
					
				}
			}
		}
	}
}			


AuGu_setting_third_interaction = {
	common_interaction = yes
	category = interaction_category_friendly
	greeting = positive
	icon = child
	
	
	send_name = AuGu_send_text

	popup_on_receive = yes
	pause_on_receive = yes

	interface_priority = 60
	send_options_exclusive = yes
         hidden = yes 
	is_shown = {
		scope:actor = {
			is_ai = no
		}
		scope:recipient = {
			this = scope:actor
		}
		always = yes
	}
	is_valid_showing_failures_only = {
		always = yes
	}
	send_option = {
		flag = tutor
		localization  = AuGu_setting_tutor
	}
	send_option = {
		flag = no_tutor
		localization  = AuGu_setting_no_tutor
	}
	
	
	on_accept = {
		switch = {
			trigger = yes
			scope:tutor = {
				scope:actor = {
					set_variable = {
						name = AuGu_setting_tutor_var
						value = flag:yes
					}
					custom_tooltip = AuGu_setting_tutor_tt
					
				}
			}
			scope:no_tutor = {
				scope:actor = {
					custom_tooltip = AuGu_setting_no_tutor_tt
					
				}
			}
		}
	}
}