﻿################################################################
# Ruler Reign Marker - customizable_localization
################################################################

# Routes the "Reign Began" line through a custom-loc block so the
# inner expression sees the title via the lowercase `Title` scope
# (provided by type = landed_title). The outer loc-scope variable
# `TITLE` used in COA_TOOLTIP_HOLDER does not propagate through
# nested function calls like Subtract_CFixedPoint(...) - the title
# resolves to a null scope in arg position. Going via Title.Custom
# fixes that by switching the scope handoff to the customizable_loc
# system, which provides Title as a real scope object.
#
# Two text blocks (first matching wins):
#   1. Exact date if var:rrm_holder_gain_date stamped
#   2. Approximate year (current_year - title_held_years) otherwise
rrm_reign_began_block = {
	type = landed_title

	text = {
		trigger = {
			exists = var:rrm_holder_gain_date
		}
		localization_key = RRM_REIGN_BEGAN_EXACT_INNER
	}

	text = {
		trigger = { always = yes }
		localization_key = RRM_REIGN_BEGAN_APPROX_INNER
	}
}
