scripted_gui = {
	rename_faction_sg_opener = {
		context_type = player_context
		parent_window_token = politics_tab
		window_name = "rename_faction_opener_container"
		visible = {
			is_ai = no
			is_faction_leader = yes
		}
		effects = {
			rename_faction_open_click = {
				if = {
					limit = { NOT = { has_variable = rename_faction_open } }
					clear_array = chars
					clear_variable = current_char
					set_variable = { rename_faction_open = 1 }
					if = {
						limit = { NOT = { has_variable = ROOT.rename_language} }
						set_variable = { ROOT.rename_language = 1 }
					}
				}
			}
		}
	}
	rename_faction_sg = {
	
		context_type = player_context
		parent_window_token = politics_tab
		window_name = "rename_faction_container"
		
		visible = {
			is_ai = no
			is_faction_leader = yes
			check_variable = { rename_faction_open = 1 }
		}
		
		properties = {
			lang = {
				frame = ROOT.rename_language
			}
		}

		effects = {
			close_click = {
				clear_array = chars
				clear_variable = current_char
				clear_variable = rename_faction_open
			}
			
			lang_click = {
				add_to_variable = { ROOT.rename_language = 1 }
				if = {
					limit = { check_variable = { ROOT.rename_language > 4 } }
					set_variable = { ROOT.rename_language = 1 }
				}
			}

			rename_faction_button_click = {
				rename_faction_effect = yes
				clear_array = chars
				clear_variable = current_char
				clear_variable = rename_faction_open
			}

			# COMMON
			keypress_backspace_click = {
				get_keypress_backspace = yes
			}

			keypress_space_click = { get_keypress_space = yes }
			keypress_exclamation_mark_click = { get_keypress_exclamation_mark = yes }
			keypress_lbracket_click = { get_keypress_lbracket = yes }
			keypress_rbracket_click = { get_keypress_rbracket = yes }
			keypress_asterix_click = { get_keypress_asterix = yes }
			keypress_plus_click = { get_keypress_plus = yes }
			keypress_comma_click = { get_keypress_comma = yes }
			keypress_hyphen_click = { get_keypress_hyphen = yes }
			keypress_dot_click = { get_keypress_dot = yes }
			keypress_slash_click = { get_keypress_slash = yes }
			keypress_colon_click = { get_keypress_colon = yes }
			keypress_semicolon_click = { get_keypress_semicolon = yes }
			keypress_lesser_than_click = { get_keypress_lesser_than = yes }
			keypress_equal_to_click = { get_keypress_equal_to = yes }
			keypress_greater_than_click = { get_keypress_greater_than = yes }
			keypress_question_mark_click = { get_keypress_question_mark = yes }
			keypress_at_click = { get_keypress_at = yes }
			keypress_0_click = { get_keypress_0 = yes }
			keypress_1_click = { get_keypress_1 = yes }
			keypress_2_click = { get_keypress_2 = yes }
			keypress_3_click = { get_keypress_3 = yes }
			keypress_4_click = { get_keypress_4 = yes }
			keypress_5_click = { get_keypress_5 = yes }
			keypress_6_click = { get_keypress_6 = yes }
			keypress_7_click = { get_keypress_7 = yes }
			keypress_8_click = { get_keypress_8 = yes }
			keypress_9_click = { get_keypress_9 = yes }

			# ENG
			keypress_shift_A_click = { get_keypress_shift_A = yes }
			keypress_shift_B_click = { get_keypress_shift_B = yes }
			keypress_shift_C_click = { get_keypress_shift_C = yes }
			keypress_shift_D_click = { get_keypress_shift_D = yes }
			keypress_shift_E_click = { get_keypress_shift_E = yes }
			keypress_shift_F_click = { get_keypress_shift_F = yes }
			keypress_shift_G_click = { get_keypress_shift_G = yes }
			keypress_shift_H_click = { get_keypress_shift_H = yes }
			keypress_shift_I_click = { get_keypress_shift_I = yes }
			keypress_shift_J_click = { get_keypress_shift_J = yes }
			keypress_shift_K_click = { get_keypress_shift_K = yes }
			keypress_shift_L_click = { get_keypress_shift_L = yes }
			keypress_shift_M_click = { get_keypress_shift_M = yes }
			keypress_shift_N_click = { get_keypress_shift_N = yes }
			keypress_shift_O_click = { get_keypress_shift_O = yes }
			keypress_shift_P_click = { get_keypress_shift_P = yes }
			keypress_shift_Q_click = { get_keypress_shift_Q = yes }
			keypress_shift_R_click = { get_keypress_shift_R = yes }
			keypress_shift_S_click = { get_keypress_shift_S = yes }
			keypress_shift_T_click = { get_keypress_shift_T = yes }
			keypress_shift_U_click = { get_keypress_shift_U = yes }
			keypress_shift_V_click = { get_keypress_shift_V = yes }
			keypress_shift_W_click = { get_keypress_shift_W = yes }
			keypress_shift_X_click = { get_keypress_shift_X = yes }
			keypress_shift_Y_click = { get_keypress_shift_Y = yes }
			keypress_shift_Z_click = { get_keypress_shift_Z = yes }
			keypress_a_click = { get_keypress_a = yes }
			keypress_b_click = { get_keypress_b = yes }
			keypress_c_click = { get_keypress_c = yes }
			keypress_d_click = { get_keypress_d = yes }
			keypress_e_click = { get_keypress_e = yes }
			keypress_f_click = { get_keypress_f = yes }
			keypress_g_click = { get_keypress_g = yes }
			keypress_h_click = { get_keypress_h = yes }
			keypress_i_click = { get_keypress_i = yes }
			keypress_j_click = { get_keypress_j = yes }
			keypress_k_click = { get_keypress_k = yes }
			keypress_l_click = { get_keypress_l = yes }
			keypress_m_click = { get_keypress_m = yes }
			keypress_n_click = { get_keypress_n = yes }
			keypress_o_click = { get_keypress_o = yes }
			keypress_p_click = { get_keypress_p = yes }
			keypress_q_click = { get_keypress_q = yes }
			keypress_r_click = { get_keypress_r = yes }
			keypress_s_click = { get_keypress_s = yes }
			keypress_t_click = { get_keypress_t = yes }
			keypress_u_click = { get_keypress_u = yes }
			keypress_v_click = { get_keypress_v = yes }
			keypress_w_click = { get_keypress_w = yes }
			keypress_x_click = { get_keypress_x = yes }
			keypress_y_click = { get_keypress_y = yes }
			keypress_z_click = { get_keypress_z = yes }

			# PL special chars
			pl_keypress_shift_an_click = { get_pl_keypress_shift_an = yes }
			pl_keypress_shift_ci_click = { get_pl_keypress_shift_ci = yes }
			pl_keypress_shift_ly_click = { get_pl_keypress_shift_ly = yes }
			pl_keypress_shift_ni_click = { get_pl_keypress_shift_ni = yes }
			pl_keypress_shift_ou_click = { get_pl_keypress_shift_ou = yes }
			pl_keypress_shift_si_click = { get_pl_keypress_shift_si = yes }
			pl_keypress_shift_zi_click = { get_pl_keypress_shift_zi = yes }
			pl_keypress_shift_zz_click = { get_pl_keypress_shift_zz = yes }
			pl_keypress_shift_en_click = { get_pl_keypress_shift_en = yes }
			pl_keypress_an_click = { get_pl_keypress_an = yes }
			pl_keypress_ci_click = { get_pl_keypress_ci = yes }
			pl_keypress_ly_click = { get_pl_keypress_ly = yes }
			pl_keypress_ni_click = { get_pl_keypress_ni = yes }
			pl_keypress_ou_click = { get_pl_keypress_ou = yes }
			pl_keypress_si_click = { get_pl_keypress_si = yes }
			pl_keypress_zi_click = { get_pl_keypress_zi = yes }
			pl_keypress_zz_click = { get_pl_keypress_zz = yes }
			pl_keypress_en_click = { get_pl_keypress_en = yes }

			# RU special chars by DRAFT
			ru_keypress_shift_ru_X_click = { get_ru_keypress_shift_ru_X = yes }
			ru_keypress_shift_TV_ZNAK_click = { get_ru_keypress_shift_TV_ZNAK = yes }
			ru_keypress_shift_JJ_click = { get_ru_keypress_shift_JJ = yes }
			ru_keypress_shift_IE_click = { get_ru_keypress_shift_IE = yes }
			ru_keypress_shift_ru_B_click = { get_ru_keypress_shift_ru_B = yes }
			ru_keypress_shift_YU_click = { get_ru_keypress_shift_YU = yes }
			ru_keypress_ru_x_click = { get_ru_keypress_ru_x = yes }
			ru_keypress_tv_znak_click = { get_ru_keypress_tv_znak = yes }
			ru_keypress_jj_click = { get_ru_keypress_jj = yes }
			ru_keypress_ie_click = { get_ru_keypress_ie = yes }
			ru_keypress_ru_b_click = { get_ru_keypress_ru_b = yes }
			ru_keypress_yu_click = { get_ru_keypress_yu = yes }
		
			#GER special chars
			de_keypress_shift_ae_click = { get_de_keypress_shift_ae = yes }
			de_keypress_shift_oe_click = { get_de_keypress_shift_oe = yes }
			de_keypress_shift_ue_click = { get_de_keypress_shift_ue = yes }
			de_keypress_shift_ss_click = { get_de_keypress_shift_ss = yes }
			de_keypress_ae_click = { get_de_keypress_ae = yes }
			de_keypress_oe_click = { get_de_keypress_oe = yes }
			de_keypress_ue_click = { get_de_keypress_ue = yes }
			de_keypress_ss_click = { get_de_keypress_ss = yes }
		}

		triggers = {
			#PL special chars
			pl_keypress_shift_an_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_ci_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_ly_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_ni_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_ou_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_si_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_zi_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_zz_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_shift_en_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_an_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_ci_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_ly_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_ni_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_ou_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_si_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_zi_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_zz_click_enabled = { check_variable = { ROOT.rename_language = 3 } }
			pl_keypress_en_click_enabled = { check_variable = { ROOT.rename_language = 3 } }

			#RU special chars by DRAFT
			ru_keypress_shift_ru_X_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_shift_TV_ZNAK_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_shift_JJ_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_shift_IE_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_shift_ru_B_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_shift_YU_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_ru_x_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_tv_znak_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_jj_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_ie_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_ru_b_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
			ru_keypress_yu_click_enabled = { check_variable = { ROOT.rename_language = 2 } }
		
			#GER special chars
			de_keypress_shift_ae_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_shift_oe_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_shift_ue_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_shift_ss_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_ae_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_oe_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_ue_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
			de_keypress_ss_click_enabled = { check_variable = { ROOT.rename_language = 4 } }
		}
	}
}

