﻿# Inspect only: no policy, history, pact or character-variable changes.
nmt_power_preview_gui = {
	scope = character
	# The 'Alliance Power Button' game rule can hide the button.
	is_shown = {
		NOT = { has_game_rule = nmt_power_preview_hidden }
	}
	effect = {
		save_scope_as = nmt_player
		scope:nmt_preview_candidate = {
			# Save the GUI-supplied character explicitly for the preview event.
			save_scope_as = nmt_preview_candidate
			nmt_pick_ruler_effect = { ACTION = nmt_capture_preview_ruler_effect }
		}
		trigger_event = { id = nmt_marriage.0103 }
	}
}

# Shown = put the troop number on the button itself (the default). Otherwise the button
# shows a plain label, which keeps a large matchmaker list fast.
nmt_power_inline_gui = {
	scope = character
	is_shown = {
		has_game_rule = nmt_power_preview_inline
	}
}

# Arrange Marriage: which ruler the marriage diplomacy choice will be with.
# root = the ruler the proposal is sent to (the Recipient), scope:nmt_player = the player.
# A new ruler: a choice will be asked after the proposal is accepted.
nmt_deal_ruler_new_gui = {
	scope = character
	is_shown = {
		nmt_valid_truce_pair_trigger = { PLAYER = scope:nmt_player }
		scope:nmt_player = {
			NOT = { is_target_in_variable_list = { name = nmt_partners_v2 target = root } }
			NOT = { is_target_in_variable_list = { name = nmt_pending_partners_v2 target = root } }
		}
	}
}

# A ruler the player already chose for (or is about to): that choice covers this couple too.
nmt_deal_ruler_known_gui = {
	scope = character
	is_shown = {
		nmt_valid_truce_pair_trigger = { PLAYER = scope:nmt_player }
		scope:nmt_player = {
			OR = {
				is_target_in_variable_list = { name = nmt_partners_v2 target = root }
				is_target_in_variable_list = { name = nmt_pending_partners_v2 target = root }
			}
		}
	}
}
