# Comprehensive Sandbox Control - consent events for co-op multiplayer
add_namespace = csc_consent

# csc_consent.1 - Consent Request Popup (shown to target country)
country_event = {
	id = csc_consent.1
	title = csc_consent.1.t
	picture = GFX_report_event_generic_sign_treaty

	is_triggered_only = yes

	# Conditional description based on requested action
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_annex }
		}
		text = csc_consent.1.desc_annex
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_puppet }
		}
		text = csc_consent.1.desc_puppet
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_release_subject }
		}
		text = csc_consent.1.desc_release_subject
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_grant_independence }
		}
		text = csc_consent.1.desc_grant_independence
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_set_autonomy }
		}
		text = csc_consent.1.desc_set_autonomy
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_white_peace }
		}
		text = csc_consent.1.desc_white_peace
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_faction_invite }
		}
		text = csc_consent.1.desc_faction_invite
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_faction_remove }
		}
		text = csc_consent.1.desc_faction_remove
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_leave_faction }
		}
		text = csc_consent.1.desc_leave_faction
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_create_faction }
		}
		text = csc_consent.1.desc_create_faction
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_dismantle_faction }
		}
		text = csc_consent.1.desc_dismantle_faction
	}
	desc = {
		trigger = {
			event_target:csc_pending_actor_country = { has_country_flag = csc_pending_action_set_faction_leader }
		}
		text = csc_consent.1.desc_set_faction_leader
	}

	# Option A: Accept
	option = {
		name = csc_consent_accept
		event_target:csc_pending_actor_country = {
			csc_consent_execute_action = yes
			country_event = { id = csc_consent.2 }
			csc_consent_clear_flags = yes
		}
	}

	# Option B: Reject
	option = {
		name = csc_consent_reject
		event_target:csc_pending_actor_country = {
			country_event = { id = csc_consent.3 }
			csc_consent_clear_flags = yes
		}
	}
}

# csc_consent.2 - Accept Notification (shown to actor country)
country_event = {
	id = csc_consent.2
	title = csc_consent.2.t
	desc = csc_consent.2.d
	picture = GFX_report_event_generic_sign_treaty

	is_triggered_only = yes

	option = {
		name = csc_consent_ok
	}
}

# csc_consent.3 - Reject Notification (shown to actor country)
country_event = {
	id = csc_consent.3
	title = csc_consent.3.t
	desc = csc_consent.3.d
	picture = GFX_report_event_generic_sign_treaty

	is_triggered_only = yes

	option = {
		name = csc_consent_ok
	}
}
