############################################################################################################
#	Expert AI mod - scripted localisation
############################################################################################################

############ difficulty settings ############

defined_text = {
	name = EAI_GetDifficultyHelpPage

	text = {
		trigger = { NOT = { has_variable = EAI_config_DIFFICULTY_help_page } }
		localization_key = EAI_config_DIFFUCULTY_help_1_tt
	}
	text = {
		trigger = { check_variable = { EAI_config_DIFFICULTY_help_page = 2 } }
		localization_key = EAI_config_DIFFUCULTY_help_2_tt
	}
	text = {
		trigger = { check_variable = { EAI_config_DIFFICULTY_help_page = 3 } }
		localization_key = EAI_config_DIFFUCULTY_help_3_tt
	}
}

### dynamic bonus

defined_text = {
	name = EAI_GetDifficulty1aSetting

	text = {
		trigger = { NOT = { has_variable = global.EAI_dynamic_difficulty_bonus } }
		localization_key = "GFX_EAI_button_0_on"
	}
	text = {
		localization_key = "GFX_EAI_button_0"
	}
}
defined_text = {
	name = EAI_GetDifficulty1bSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_difficulty_bonus = 1 } }
		localization_key = "GFX_EAI_button_2_on"
	}
	text = {
		localization_key = "GFX_EAI_button_2"
	}
}
defined_text = {
	name = EAI_GetDifficulty1cSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_difficulty_bonus = 2 } }
		localization_key = "GFX_EAI_button_3_on"
	}
	text = {
		localization_key = "GFX_EAI_button_3"
	}
}
defined_text = {
	name = EAI_GetDifficulty1dSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_difficulty_bonus = 3 } }
		localization_key = "GFX_EAI_button_4_on"
	}
	text = {
		localization_key = "GFX_EAI_button_4"
	}
}

### dynamic desperate defense

defined_text = {
	name = EAI_GetDifficulty2aSetting

	text = {
		trigger = { NOT = { has_variable = global.EAI_dynamic_desperate_defense } }
		localization_key = "GFX_EAI_button_0_on"
	}
	text = {
		localization_key = "GFX_EAI_button_0"
	}
}
defined_text = {
	name = EAI_GetDifficulty2bSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_desperate_defense = 1 } }
		localization_key = "GFX_EAI_button_2_on"
	}
	text = {
		localization_key = "GFX_EAI_button_2"
	}
}
defined_text = {
	name = EAI_GetDifficulty2cSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_desperate_defense = 2 } }
		localization_key = "GFX_EAI_button_3_on"
	}
	text = {
		localization_key = "GFX_EAI_button_3"
	}
}
defined_text = {
	name = EAI_GetDifficulty2dSetting

	text = {
		trigger = { check_variable = { global.EAI_dynamic_desperate_defense = 3 } }
		localization_key = "GFX_EAI_button_4_on"
	}
	text = {
		localization_key = "GFX_EAI_button_4"
	}
}

### attrition

defined_text = {
	name = EAI_GetDifficulty4aSetting

	text = {
		trigger = { NOT = { has_global_flag = EAI_attrition_3 has_global_flag = EAI_attrition_2 has_global_flag = EAI_attrition_1 } }
		localization_key = "GFX_EAI_button_0_on"
	}
	text = {
		trigger = { OR = { has_global_flag = EAI_attrition_3 has_global_flag = EAI_attrition_2 has_global_flag = EAI_attrition_1 } }
		localization_key = "GFX_EAI_button_0"
	}
}
defined_text = {
	name = EAI_GetDifficulty4bSetting

	text = {
		trigger = { has_global_flag = EAI_attrition_1 }
		localization_key = "GFX_EAI_button_2_on"
	}
	text = {
		trigger = { NOT = { has_global_flag = EAI_attrition_1 } }
		localization_key = "GFX_EAI_button_2"
	}
}
defined_text = {
	name = EAI_GetDifficulty4cSetting

	text = {
		trigger = { has_global_flag = EAI_attrition_2 }
		localization_key = "GFX_EAI_button_3_on"
	}
	text = {
		trigger = { NOT = { has_global_flag = EAI_attrition_2 } }
		localization_key = "GFX_EAI_button_3"
	}
}
defined_text = {
	name = EAI_GetDifficulty4dSetting

	text = {
		trigger = { has_global_flag = EAI_attrition_3 }
		localization_key = "GFX_EAI_button_4_on"
	}
	text = {
		trigger = { NOT = { has_global_flag = EAI_attrition_3 } }
		localization_key = "GFX_EAI_button_4"
	}
}

### reinforcement

defined_text = {
	name = EAI_GetDynamicReinforcementsSetting

	text = {
		trigger = { has_global_flag = EAI_dynamic_reinforcements_mode }
		localization_key = "GFX_EAI_checkbox_on"
	}
	text = {
		trigger = { NOT = { has_global_flag = EAI_dynamic_reinforcements_mode } }
		localization_key = "GFX_EAI_checkbox_off"
	}
}
defined_text = {
	name = EAI_GetReinforcementsGlobal

	text = {
		trigger = { check_variable = { global.EAI_global_dd_unit_count > 0 } }
		localization_key = EAI_divisions_received_global
	}
	text = {
		trigger = { NOT = { check_variable = { global.EAI_global_dd_unit_count > 0 } } }
		localization_key = ""
	}
}

### free convoys

defined_text = {
	name = EAI_GetFreeAIConvoysSetting

	text = {
		trigger = { has_global_flag = EAI_free_convoys }
		localization_key = "GFX_EAI_checkbox_on"
	}
	text = {
		trigger = { NOT = { has_global_flag = EAI_free_convoys } }
		localization_key = "GFX_EAI_checkbox_off"
	}
}