# GUIs:
defined_text = {
	name = GetMoreMapModesShowMapIconsButtonTooltip

	text = {
		trigger = {
			has_country_flag = disable_more_mapmodes_map_mode_mapicons
		}
		localization_key = more_mapmodes_show_mapicons_button_tt_enable
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_show_mapicons_button_tt_disable
	}
}

defined_text = {
	name = GetMoreMapModesCountryMapModeCountryListEntryContainer

	text = {
		trigger = {
			exists = yes
			ROOT = {
				NOT = { check_variable = { more_mapmodes_country_map_mode_target = PREV.id } }
			}
			OR = {
				NOT = { tag = ROOT }
				ROOT = { has_variable = more_mapmodes_country_map_mode_target }
			}
		}
		localization_key = more_mapmodes_country_map_mode_country_list_entry
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_country_map_mode_country_list_entry_empty
	}
}

# Map Modes:
defined_text = {
	name = GetMoreMapModesCoreMapModeTooltip

	text = {
		trigger = {
			is_core_of = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_core
	}
	text = {
		trigger = {
			is_claimed_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_claimed
	}
	text = {
		trigger = {
			is_owned_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_owned
	}
	text = {
		trigger = {
			is_controlled_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_occupied
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesCoreMapModeTooltipDelayed

	text = {
		trigger = {
			OR = {
				is_core_of = ROOT
				is_claimed_by = ROOT
				is_owned_by = ROOT
				is_controlled_by = ROOT
			}
			is_owned_and_controlled_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_owner_green_controller_green
	}
	text = {
		trigger = {
			OR = {
				is_core_of = ROOT
				is_claimed_by = ROOT
				is_owned_by = ROOT
				is_controlled_by = ROOT
			}
			is_owned_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_owner_green_controller_red
	}
	text = {
		trigger = {
			OR = {
				is_core_of = ROOT
				is_claimed_by = ROOT
				is_owned_by = ROOT
				is_controlled_by = ROOT
			}
			is_controlled_by = ROOT
		}
		localization_key = more_mapmodes_core_map_mode_tt_owner_red_controller_green
	}
	text = {
		trigger = {
			OR = {
				is_core_of = ROOT
				is_claimed_by = ROOT
				is_owned_by = ROOT
				is_controlled_by = ROOT
			}
		}
		localization_key = more_mapmodes_core_map_mode_tt_owner_red_controller_red
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesStabilityMapModeTooltipDelayed

	text = {
		trigger = {
			set_temp_variable = { temp = modifier@stability_weekly }
			set_temp_variable = { temp_mult = modifier@stability_weekly_factor }
			add_to_temp_variable = { temp_mult = 1 }
			multiply_temp_variable = { temp = temp_mult }
			NOT = { check_variable = { temp = 0 } }
		}
		localization_key = more_mapmodes_stability_map_mode_tt
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesWarSupportMapModeTooltipDelayed

	text = {
		trigger = {
			set_temp_variable = { temp = modifier@war_support_weekly }
			set_temp_variable = { temp_mult = modifier@war_support_weekly_factor }
			add_to_temp_variable = { temp_mult = 1 }
			multiply_temp_variable = { temp = temp_mult }
			NOT = { check_variable = { temp = 0 } }
		}
		localization_key = more_mapmodes_war_support_map_mode_tt
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesCausedWorldTensionMapModeTooltip

	text = {
		trigger = {
			set_temp_variable = { threat_temp = has_added_tension_amount }
			check_variable = { threat_temp > 0 }
		}
		localization_key = more_mapmodes_caused_world_tension_map_mode_tt
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_caused_world_tension_map_mode_tt_none
	}
}

defined_text = {
	name = GetMoreMapModesWarGoalsMapModeTooltip

	text = {
		trigger = {
			tag = ROOT
		}
		localization_key = more_mapmodes_war_goals_map_mode_tt_us
	}
	text = {
		trigger = {
			has_wargoal_against = ROOT
		}
		localization_key = more_mapmodes_war_goals_map_mode_tt_enemy
	}
	text = {
		trigger = {
			is_justifying_wargoal_against = ROOT
		}
		localization_key = more_mapmodes_war_goals_map_mode_tt_justifying
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesAntiAirMapModeTooltip

	text = {
		trigger = {
			OR = {
				tag = ROOT
				is_ally_with = ROOT
				has_war_with = ROOT
			}
		}
		localization_key = more_mapmodes_anti_air_map_mode_tt
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesAntiAirMapModeTooltipDelayed

	text = {
		trigger = {
			tag = ROOT
		}
		localization_key = more_mapmodes_anti_air_map_mode_tt_our_state
	}
	text = {
		trigger = {
			is_ally_with = ROOT
		}
		localization_key = more_mapmodes_anti_air_map_mode_tt_allied_state
	}
	text = {
		trigger = {
			has_war_with = ROOT
		}
		localization_key = more_mapmodes_anti_air_map_mode_tt_enemy_state
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesAirBaseMapModeTooltip

	text = {
		trigger = {
			OR = {
				tag = ROOT
				is_ally_with = ROOT
				has_war_with = ROOT
			}
		}
		localization_key = more_mapmodes_air_base_map_mode_tt
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesAirBaseMapModeTooltipDelayed

	text = {
		trigger = {
			tag = ROOT
		}
		localization_key = more_mapmodes_air_base_map_mode_tt_our_state
	}
	text = {
		trigger = {
			is_ally_with = ROOT
		}
		localization_key = more_mapmodes_air_base_map_mode_tt_allied_state
	}
	text = {
		trigger = {
			has_war_with = ROOT
		}
		localization_key = more_mapmodes_air_base_map_mode_tt_enemy_state
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesInterventionMapModeTooltip

	text = {
		trigger = {
			tag = ROOT
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_us
	}
	text = {
		trigger = {
			received_expeditionary_forces = {
				sender = ROOT
				value > 0
			}
			ROOT = {
				received_expeditionary_forces = {
					sender = PREV
					value > 0
				}
			}
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_both_received_expeditionaries
	}
	text = {
		trigger = {
			received_expeditionary_forces = {
				sender = ROOT
				value > 0
			}
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_they_received_expeditionaries
	}
	text = {
		trigger = {
			ROOT = {
				received_expeditionary_forces = {
					sender = PREV
					value > 0
				}
			}
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_we_received_expeditionaries
	}
	text = {
		trigger = {
			has_volunteers_amount_from = {
				tag = ROOT
				count > 0
			}
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_they_received_volunteers
	}
	text = {
		trigger = {
			ROOT = {
				has_volunteers_amount_from = {
					tag = PREV
					count > 0
				}
			}
		}
		localization_key = more_mapmodes_intervention_map_mode_tt_we_received_volunteers
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesMajorsMapModeTooltip

	text = {
		trigger = {
			is_major = yes
		}
		localization_key = more_mapmodes_majors_map_mode_tt_major
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_majors_map_mode_tt
	}
}

defined_text = {
	name = GetMoreMapModesWorldWarMapModeTooltip

	text = {
		trigger = {
			has_war = yes
		}
		localization_key = more_mapmodes_world_war_map_mode_tt_war
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_world_war_map_mode_tt
	}
}

defined_text = {
	name = GetMoreMapModesSpyMastersMapModeTooltip

	text = {
		trigger = {
			is_spymaster = yes
		}
		localization_key = more_mapmodes_spymasters_map_mode_tt
	}
	text = {
		trigger = {
			is_in_faction = yes
		}
		localization_key = more_mapmodes_spymasters_map_mode_tt_faction
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = more_mapmodes_spymasters_map_mode_tt_no_faction
	}
}

defined_text = {
	name = GetMoreMapModesSpyMastersMapModeTooltipDelayed

	text = {
		trigger = {
			is_spymaster = yes
			is_in_faction = yes
		}
		localization_key = more_mapmodes_spymasters_map_mode_tt_faction
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesGuaranteesMapModeTooltip

	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				tag = PREV
			}
		}
		localization_key = more_mapmodes_guarantees_map_mode_tt_target
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				has_guaranteed = PREV
			}
		}
		localization_key = more_mapmodes_guarantees_map_mode_tt_has_guaranteed
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				is_guaranteed_by = PREV
			}
		}
		localization_key = more_mapmodes_guarantees_map_mode_tt_is_guaranteed
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesGuaranteesMapModeTooltipNumGivenGuarantees

	text = {
		trigger = {
			set_temp_variable = { given_guarantees_temp = 0 }
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				any_guaranteed_country = {
					is_guaranteed_by = PREV
				}
				all_guaranteed_country = {
					add_to_temp_variable = { given_guarantees_temp = 1 }
					always = yes
				}
			}
		}
		localization_key = more_mapmodes_guarantees_map_mode_tt_num_of_given_guarantees
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesGuaranteesMapModeTooltipNumReceivedGuarantees

	text = {
		trigger = {
			set_temp_variable = { received_guarantees_temp = 0 }
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				any_other_country = {
					has_guaranteed = PREV
				}
				all_other_country = {
					if = {
						limit = {
							has_guaranteed = PREV
						}
						add_to_temp_variable = { received_guarantees_temp = 1 }
					}
					else = {
						always = yes
					}
				}
			}
		}
		localization_key = more_mapmodes_guarantees_map_mode_tt_num_of_received_guarantees
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesSubjectsMapModeTooltip

	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				tag = PREV
			}
		}
		localization_key = more_mapmodes_subjects_map_mode_tt_target
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				PREV = { is_subject_of = PREV }
			}
		}
		localization_key = more_mapmodes_subjects_map_mode_tt_is_subject
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				is_subject_of = PREV
			}
		}
		localization_key = more_mapmodes_subjects_map_mode_tt_is_overlord
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				is_subject = yes
				OVERLORD = {
					set_temp_variable = { temp_target_overlord = THIS.id }
					FROM = {
						CONTROLLER = { is_subject_of = PREV.PREV }
					}
				}
			}
		}
		localization_key = more_mapmodes_subjects_map_mode_tt_is_other_subject_of_overlord
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesSubjectsMapModeTooltipNumSubjects

	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				num_subjects > 0
				set_temp_variable = { num_subjects_temp = num_subjects }
			}
		}
		localization_key = more_mapmodes_subjects_map_mode_tt_num_of_subjects
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesMarketAccessMapModeTooltip

	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				tag = PREV
			}
		}
		localization_key = more_mapmodes_market_access_map_mode_tt_target
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				has_market_access_with = PREV
			}
		}
		localization_key = more_mapmodes_market_access_map_mode_tt_access
	}
	text = {
		trigger = {
			var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id = {
				set_temp_variable = { temp_target = THIS.id }
				always = yes
			}
		}
		localization_key = more_mapmodes_market_access_map_mode_tt_no_access
	}
}

defined_text = {
	name = GetMoreMapModesMarketAccessMapModeTooltipDelayed

	text = {
		trigger = {
			NOT = { has_dlc = "Arms Against Tyranny"  }
		}
		localization_key = more_mapmodes_market_access_map_mode_tt_no_dlc
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesOccupationsMapModeTooltip

	text = {
		trigger = {
			is_owned_and_controlled_by = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_owned_and_controlled_target
	}
	text = {
		trigger = {
			OWNER = {
				has_war_together_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
			CONTROLLER = {
				has_war_together_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_owned_and_controlled
	}
	text = {
		trigger = {
			CONTROLLER = {
				OR = {
					tag = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
					has_war_together_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
				}
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_controlled
	}
	text = {
		trigger = {
			OWNER = {
				OR = {
					tag = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
					has_war_together_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
				}
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_owned
	}
	text = {
		trigger = {
			OWNER = {
				has_war_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
			CONTROLLER = {
				has_war_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_enemy
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}

defined_text = {
	name = GetMoreMapModesOccupationsMapModeTooltipDelayed

	text = {
		trigger = {
			is_controlled_by = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_controlled_by_us
	}
	text = {
		trigger = {
			CONTROLLER = {
				has_war_together_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_controlled_by_ally
	}
	text = {
		trigger = {
			CONTROLLER = {
				has_war_with = var:ROOT.more_mapmodes_country_map_mode_target?ROOT.id
			}
		}
		localization_key = more_mapmodes_occupations_map_mode_tt_controlled_by_enemy
	}
	text = {
		trigger = {
			always = yes
		}
		localization_key = ""
	}
}