﻿# Great Schism progress shown in every Christian Church phase until the schism happens or is prevented
pam_great_schism_progress_gui = {
	is_shown = {
		pam_great_schism_progress_can_change_trigger = yes
	}
}

# the crisis chapter shows the schism icon when it can be started by it
pam_great_schism_can_start_gui = {
	is_shown = {
		pam_great_schism_progress_can_change_trigger = yes
		situation:the_christian_church ?= {
			has_variable = pam_great_schism_status
			var:pam_great_schism_status = flag:threshold_reached
		}
	}
}

# schism is active, so we show a tab for it
pam_great_schism_ongoing_gui = {
	is_shown = {
		pam_great_schism_progress_can_change_trigger = yes
		situation:the_christian_church ?= {
			has_variable = pam_great_schism_status
			var:pam_great_schism_status = flag:ongoing
		}
	}
}

pam_investiture_crisis_chapter_unavailable_gui = {
	scope = character

	is_shown = {
		pam_main_power_faith_conditional_appointment_trigger = no
		situation:the_christian_church ?= {
			OR = {
				situation_current_phase = fragile_unity
				situation_current_phase = reform_phase
			}
		}
	}
}

pam_has_schism_stance = {
	scope = character

	is_shown = {
		has_variable = pam_schism_stance
		NOT = { var:pam_schism_stance = flag:no_schism }
		pam_great_schism_progress_can_change_trigger = yes
	}
}


using_tenet_popularity_gui = {
	scope = faith

	is_valid = {
		has_tenet_popularity_trigger = yes
	}
}

tenet_popularity_gui_very_popular = {
	scope = tenet

	is_valid = {
		"scope:faith.tenet_popularity(root)" >= tenet_popularity_very_popular_threshold
	}
}
tenet_popularity_gui_popular = {
	scope = tenet

	is_valid = {
		"scope:faith.tenet_popularity(root)" < tenet_popularity_very_popular_threshold
		"scope:faith.tenet_popularity(root)" >= tenet_popularity_popular_threshold
	}
}
tenet_popularity_gui_neutral = {
	scope = tenet

	is_valid = {
		"scope:faith.tenet_popularity(root)" < tenet_popularity_popular_threshold
		"scope:faith.tenet_popularity(root)" >= tenet_popularity_neutral_threshold
	}
}
tenet_popularity_gui_unpopular = {
	scope = tenet

	is_valid = {
		"scope:faith.tenet_popularity(root)" < tenet_popularity_neutral_threshold
	}
}

pam_is_papabile = {
	scope = character

	is_shown = {
		is_papabile = yes
	}
}

pam_is_papabile_pious = {
	scope = character

	is_shown = {
		pam_is_college_election_candidate_trigger = { SOURCE = theocratic_elective_pious }
	}
}

pam_is_papabile_populist = {
	scope = character

	is_shown = {
		pam_is_college_election_candidate_trigger = { SOURCE = theocratic_elective_populist }
	}
}

pam_is_papabile_powerful = {
	scope = character

	is_shown = {
		pam_is_college_election_candidate_trigger = { SOURCE = theocratic_elective_powerful }
	}
}

pam_know_doctrine = {
	scope = character
	saved_scopes = { doctrine }

	is_valid = {
		OR = {
			knows_doctrine = scope:doctrine
			has_perk = prophet_perk
		}
	}
}

# Shows the Create Holy Site button to anyone who can create holy sites, with or without By God Alone
pam_can_create_holy_site_gui = {
	scope = character

	is_shown = {
		OR = {
			has_dlc_feature = by_god_alone
			can_create_faith_holy_site_authority_trigger = yes
		}
	}
}
