######################################################
#################### COAT OF ARMS ####################
######################################################

# Standard Realm Coa of Arms types

@overlay_alpha = 0.4

template coat_of_arms_icon_data
{
	gfxtype = coatofarmsgfx
	shaderfile = "gfx/FX/gui_coatofarms.shader"
	alwaystransparent = yes
	allow_outside = yes
}

types CoATypes
{
	type coat_of_arms_icon = icon {
		using = coat_of_arms_icon_data
	}

	type drag_drop_coat_of_arms_icon = drag_drop_icon {
		using = coat_of_arms_icon_data
		alwaystransparent = no
		drag_drop_base_type = "coat_of_arms_icon"
	}

	####################################
	########### REALM SHIELDS ##########
	####################################

	## Tiny Realm CoA
	type coa_realm_tiny_crown = coa_realm_tiny {
		blockoverride "crown" {
			visible = "[Not(Character.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}

	type coa_realm_tiny = button_group {
		using = CoA_Realm_Defaults

		block "government_datacontext"
		{
			datacontext = "[Character.GetGovernment]"
		}

		widget = {
			parentanchor = hcenter
			position = { 0 -24 }
			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_28.dds"
				block "adventurer" {
					visible = no
				}
			}
			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_28.dds"
				block "minority" {
					visible = no
				}
			}

			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_28.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_28.dds"
				block "mercenary" {
					visible = no
				}
			}
		}

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 2

			icon = {
				name = "crown"
				texture = "gfx/interface/coat_of_arms/crown_strip_28.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 32 22 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_28.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 32 22 }

				block "rep_crown" {
					visible = no
				}
			}

			widget = {
				visible = "[Character.HasLandedTitles]"
				size = { 32 32 }

				coa_realm_shadow = {
					texture = "[GovernmentType.GetRealmFrameShadow('(int32)28')]"
					size = { 32 32 }
					framesize = { 32 32 }

					using = CoA_Realm_Hover_Glow
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 32 32 }
					coat_of_arms = "[Character.GetPrimaryTitle.GetTitleCoA.GetTexture('(int32)56','(int32)56')]"
					coat_of_arms_slot = "[Character.GetPrimaryTitle.GetTitleCoA.GetSlot('(int32)56','(int32)56')]"
					coat_of_arms_mask = "[GovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[GovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[GovernmentType.GetRealmMaskScale]"

					block "coa_icon_additions" {}

					modify_texture = {
						texture = "[GovernmentType.GetRealmMask]"
						blend_mode = overlay
					}

					coa_realm_overlay = {
						texture = "[GovernmentType.GetRealmFrame('(int32)28')]"
						size = { 32 32 }
						framesize = { 32 32 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_28.dds"
						position = { 0 -6 }
						size = { 32 32 }
						framesize = { 32 32 }
						frame = "[Character.GetPrimaryTitle.GetTierFrame]"
					}
				}
			}
		}
	}


	## Small Realm CoA
	type coa_realm_small_crown = coa_realm_small {
		blockoverride "crown" {
			visible = "[Not(Character.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}

	type coa_realm_small = button_group {
		using = CoA_Realm_Defaults

		widget = {
			parentanchor = hcenter
			position = { 0 -34 }

			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_44.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_44.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_44.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_44.dds"
				block "holy_order" {
					visible = no
				}
			}
		}

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 3

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				framesize = { 52 32 }
				texture = "gfx/interface/coat_of_arms/crown_strip_44.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				framesize = { 52 32 }
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_44.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"

				block "rep_crown" {
					visible = no
				}
			}

			widget = {
				size = { 52 52 }

				coa_realm_shadow = {
					texture = "[GovernmentType.GetRealmFrameShadow('(int32)44')]"
					size = { 52 52 }
					framesize = { 52 52 }
					using = CoA_Realm_Hover_Glow
				}
				visible = "[Character.HasLandedTitles]"

				coat_of_arms_icon = {
					parentanchor = center
					size = { 52 52 }
					coat_of_arms = "[Character.GetPrimaryTitle.GetTitleCoA.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[Character.GetPrimaryTitle.GetTitleCoA.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "[GovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[GovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[GovernmentType.GetRealmMaskScale]"

					block "coa_icon_additions" {}

					modify_texture = {
						texture = "[GovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[GovernmentType.GetRealmFrame('(int32)44')]"
						size = { 52 52 }
						framesize = { 52 52 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_44.dds"
						position = { 0 -7 }
						size = { 52 52 }
						framesize = { 52 52 }
						frame = "[Character.GetPrimaryTitle.GetTierFrame]"
					}
				}
			}
		}
	}


	## Medium Realm CoA
	type coa_realm_medium_crown = coa_realm_medium {
		blockoverride "crown" {
			visible = "[Not(Character.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}

	type coa_realm_medium = button_group {
		using = CoA_Realm_Defaults

		block "government_datacontext"
		{
			datacontext = "[Character.GetGovernment]"
		}

		flowcontainer = {
			direction = vertical
			spacing = 3

			ignoreinvisible = yes

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_62.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 64 40 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_62.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 64 40 }

				block "rep_crown" {
					visible = no
				}
			}

			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_62.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_62.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_62.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_62.dds"
				block "holy_order" {
					visible = no
				}
			}

			widget = {
				size = { 64 64 }

				coa_realm_shadow = {
					texture = "[GovernmentType.GetRealmFrameShadow('(int32)62')]"
					size = { 64 64 }
					framesize = { 64 64 }

					using = CoA_Realm_Hover_Glow
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }

					block "coa_icon_additions" {}

					block "coat_of_arms"
					{
						coat_of_arms = "[Character.GetPrimaryTitle.GetTitleCoA.GetTexture('(int32)124','(int32)124')]"
						coat_of_arms_slot = "[Character.GetPrimaryTitle.GetTitleCoA.GetSlot('(int32)124','(int32)124')]"
					}

					coat_of_arms_offset = "[GovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[GovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[GovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[GovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						framesize = { 64 64 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						position = { 0 -9 }
						size = { 64 64 }
						framesize = { 64 64 }
					}
				}
			}
		}
	}


	## Big Realm CoA
	type coa_realm_big_crown = coa_realm_big {
		blockoverride "crown" {
			visible = "[Not(Character.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}
	type coa_realm_big = button_group {
		using = CoA_Realm_Defaults

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 4

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_86.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 96 60 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_86.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 96 60 }

				block "rep_crown" {
					visible = no
				}
			}

			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_86.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_86.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_86.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_86.dds"
				block "holy_order" {
					visible = no
				}
			}

			widget = {
				size = { 96 96 }

				coa_realm_shadow = {
					texture = "[GovernmentType.GetRealmFrameShadow('(int32)86')]"
					size = { 96 96 }
					framesize = { 96 96 }

					using = CoA_Realm_Hover_Glow
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 96 96 }

					block "coa_icon_additions" {}

					block "coat_of_arms"
					{
						coat_of_arms = "[Character.GetPrimaryTitle.GetTitleCoA.GetTexture('(int32)172','(int32)172')]"
						coat_of_arms_slot = "[Character.GetPrimaryTitle.GetTitleCoA.GetSlot('(int32)172','(int32)172')]"
					}

					coat_of_arms_mask = "[GovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[GovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[GovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[GovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[GovernmentType.GetRealmFrame('(int32)86')]"
						size = { 96 96 }
						framesize = { 96 96 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_86.dds"
						position = { 0 -14 }
						size = { 96 96 }
						framesize = { 96 94 }
					}
				}
			}
		}
	}

	## Huge Realm CoA
	type coa_realm_huge_crown = coa_realm_huge {
		blockoverride "crown" {
			visible = "[Not(Character.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Character.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}
	type coa_realm_huge = button_group {
		using = CoA_Realm_Defaults

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 2

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_115.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 128 80 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_115.dds"
				frame = "[Character.GetPrimaryTitle.GetTierFrame]"
				framesize = { 128 80 }

				block "rep_crown" {
					visible = no
				}
			}

			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_115.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_115.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_115.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_115.dds"
				block "holy_order" {
					visible = no
				}
			}

			widget = {
				parentanchor = hcenter
				size = { 128 128 }

				coa_realm_shadow = {
					texture = "[GovernmentType.GetRealmFrameShadow('(int32)115')]"
					size = { 128 128 }
					framesize = { 128 128 }

					using = CoA_Realm_Hover_Glow
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 128 128 }
					coat_of_arms = "[Character.GetPrimaryTitle.GetTitleCoA.GetTexture('(int32)230','(int32)230')]"
					coat_of_arms_slot = "[Character.GetPrimaryTitle.GetTitleCoA.GetSlot('(int32)230','(int32)230')]"
					coat_of_arms_mask = "[GovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[GovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[GovernmentType.GetRealmMaskScale]"

					block "coa_icon_additions" {}

					modify_texture = {
						texture = "[GovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[GovernmentType.GetRealmFrame('(int32)115')]"
						size = { 128 128 }
						framesize = { 128 128 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_115.dds"
						position = { 0 -14 }
						size = { 128 128 }
						framesize = { 128 128 }
					}
				}
			}
		}
	}

	# The frame around the Realm CoA texture
	type coa_realm_overlay = highlight_icon {
		name = "coa_overlay"
		parentanchor = center
		frame = "[Character.GetPrimaryTitle.GetTierFrame]"
		texture = "[Character.GetGovernment.GetRealmFrame('(int32)230')]"
		size = { 128 128 }
		framesize = { 128 128 }
	}

	type coa_realm_shadow = highlight_icon {
		name = "coa_shadow"
		parentanchor = center
		frame = "[Character.GetPrimaryTitle.GetTierFrame]"
		texture = "[Character.GetGovernment.GetRealmFrameShadow('(int32)230')]"
		size = { 128 128 }
		framesize = { 128 128 }
	}

	type coa_realm_topframe = highlight_icon {
		name = "coa_topframe"
		parentanchor = center
		frame = "[Character.GetPrimaryTitle.GetTierFrame]"
		texture ="gfx/interface/coat_of_arms/topframe_115.dds"
		size = { 128 128 }
		framesize = { 128 128 }
	}

	####################################
	############## TITLES ##############
	####################################

	# Standard Ttile Coa of Arms types

	## Tiny Title CoA
	type coa_title_tiny_crown = coa_title_tiny {
		blockoverride "crown" {
			visible = "[Not(Title.GetHolder.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}
	type coa_title_tiny = button_group {
		using = CoA_Title_Defaults

		flowcontainer = {
			direction = vertical

			block "position" {
			position = { 0 -10 }
			}
			
			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			spacing = -4
			ignoreinvisible = yes

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_28.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 32 22 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_28.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 32 22 }

				block "rep_crown" {
					visible = no
				}
			}

			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_28.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_28.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_28.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_28.dds"
				block "holy_order" {
					visible = no
				}
			}
			widget = {
				parentanchor = hcenter
				size = { 36 36 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 28 28 }
					coat_of_arms = "[Title.GetTitleCoA.GetTexture('(int32)56','(int32)56')]"
					coat_of_arms_slot = "[Title.GetTitleCoA.GetSlot('(int32)56','(int32)56')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					using = CoA_Title_Hover_Glow

					block "coa_icon" {}

					coa_title_frame = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_28.dds"
						size = { 36 36 }
					}

					coa_title_frame_no_holder = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_no_holder_28.dds"
						size = { 36 36 }
					}
				}
			}
		}
	}

	## Small Title CoA
	type coa_title_small_crown = coa_title_small {
		blockoverride "crown" {
			visible = "[Not(Title.GetHolder.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}
	type coa_title_small = button_group {
		using = CoA_Title_Defaults

		flowcontainer = {
			direction = vertical
			spacing = -3
			ignoreinvisible = yes

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_44.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 52 32 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_44.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 52 32 }

				block "rep_crown" {
					visible = no
				}
			}
			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_44.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_44.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_44.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_44.dds"
				block "holy_order" {
					visible = no
				}
			}
			widget = {
				parentanchor = hcenter
				size = { 52 52 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 44 44 }
					coat_of_arms = "[Title.GetTitleCoA.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[Title.GetTitleCoA.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					using = CoA_Title_Hover_Glow

					coa_title_frame = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_44.dds"
						size = { 52 52 }
					}

					coa_title_frame_no_holder = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_no_holder_44.dds"
						size = { 56 56 }
					}
				}
			}
		}
	}

	## Medium Title CoA
	type coa_title_medium_crown = coa_title_medium {
		blockoverride "crown" {
			visible = "[Not(Title.GetHolder.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}

	type coa_title_medium = button_group {
		using = CoA_Title_Defaults

		flowcontainer = {
			direction = vertical
			spacing = -3
			ignoreinvisible = yes

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_62.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 64 40 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_62.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 64 40 }

				block "rep_crown" {
					visible = no
				}
			}
			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_62.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_62.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_62.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_62.dds"
				block "holy_order" {
					visible = no
				}
			}

			widget = {
				parentanchor = hcenter
				size = { 72 72 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 62 62 }
					coat_of_arms = "[Title.GetTitleCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[Title.GetTitleCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					using = CoA_Title_Hover_Glow

					coa_title_frame = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_62.dds"
						size = { 72 72 }
					}

					coa_title_frame_no_holder = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_no_holder_62.dds"
						size = { 80 80 }
					}
				}
			}
		}
	}

	## Big Title CoA
	type coa_title_big_crown = coa_title_big {
		blockoverride "crown" {
			visible = "[Not(Title.GetHolder.GetGovernment.HasGovernmentFlag( 'gov_uses_non_crown_coa'))]"
		}
		blockoverride "rep_crown" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_locked_to_elective')]"
		}
		blockoverride "holy_order" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_holy_order')]"
		}
		blockoverride "mercenary" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_mercenary')]"
		}
		blockoverride "adventurer" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_adventurer')]"
		}
		blockoverride "minority" {
			visible = "[Title.GetHolder.GetGovernment.HasGovernmentFlag( 'government_is_landless_minority')]"
		}
	}

	type coa_title_big = button_group {
		using = CoA_Title_Defaults

		flowcontainer = {
			direction = vertical
			spacing = -3
			ignoreinvisible = yes

			block "government_datacontext"
			{
				datacontext = "[Character.GetGovernment]"
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_115.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 128 80 }

				block "crown" {
					visible = no
				}
			}
			icon = {
				name = "rep_crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/rep_crown_strip_115.dds"
				frame = "[Title.GetTierFrame]"
				framesize = { 128 80 }

				block "rep_crown" {
					visible = no
				}
			}
			icon = {
				name = "adventurer_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_115.dds"
				block "adventurer" {
					visible = no
				}
			}

			icon = {
				name = "minority_top_decor"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_115.dds"
				block "minority" {
					visible = no
				}
			}
			icon = {
				name = "mercenary"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_115.dds"
				block "mercenary" {
					visible = no
				}
			}

			icon = {
				name = "holy_order"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_115.dds"
				block "holy_order" {
					visible = no
				}
			}

			widget = {
				parentanchor = hcenter
				size = { 96 96 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 86 86 }
					coat_of_arms = "[Title.GetTitleCoA.GetTexture('(int32)172','(int32)172')]"
					coat_of_arms_slot = "[Title.GetTitleCoA.GetSlot('(int32)172','(int32)172')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					using = CoA_Title_Hover_Glow

					coa_title_frame = {
						texture = "gfx/interface/coat_of_arms/title_86.dds"
						size = { 96 96 }
					}

					coa_title_frame_no_holder = {
						texture = "gfx/interface/coat_of_arms/title_no_holder_86.dds"
						size = { 104 104 }
					}
				}
			}
		}
	}

	## The frames around the Title CoA texture
	type coa_title_frame = highlight_icon {
		name = "coa_title_frame"
		parentanchor = center
		texture = "gfx/interface/coat_of_arms/title_86.dds"
	}

	type coa_title_frame_no_holder = highlight_icon {
		name = "coa_title_frame_noholder"
		visible = "[Not(Title.HasHolder)]"
		parentanchor = center
		texture = "gfx/interface/coat_of_arms/title_no_holder_86.dds"
	}

	####################################
	############## DYNASTY #############
	####################################

	type coa_lowborn_icon = vbox
	{
		icon = {
			block "icon_size"
			{
				size = { 62 62 }
			}
			texture = "gfx/interface/coat_of_arms/lowborn.dds"
			tooltip = "[lowborn|E]"
		}
	}

	type coa_dynasty_widget = button_group
	{
		visible = "[Dynasty.IsValid]"
	}

	type coa_dynasty_lowborn_widget = widget
	{
		visible = "[Not( Dynasty.IsValid )]"
		coa_lowborn_icon = {}
	}

	type coa_dynasty_tiny = widget
	{
		size = { 48 48 }

		coa_dynasty_lowborn_widget = {
			parentanchor = center
			size = { 40 40 }

			blockoverride "icon_size"
			{
				size = { 28 28 }
			}
		}

		coa_dynasty_widget = {
			size = { 40 40 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coat_of_arms_icon = {
				parentanchor = center
				size = { 28 28 }
				coat_of_arms = "[Dynasty.GetDynastyCoA.GetTexture('(int32)56','(int32)56')]"
				coat_of_arms_slot = "[Dynasty.GetDynastyCoA.GetSlot('(int32)56','(int32)56')]"
				coat_of_arms_mask = "[Dynasty.GetCulture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Dynasty.GetCulture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Dynasty.GetCulture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				size = { 48 48 }
				texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
			}
		}
	}

	type coa_dynasty_small = widget
	{
		size = { 72 72 }

		coa_dynasty_lowborn_widget = {
			parentanchor = center
			size = { 56 56 }
			blockoverride "icon_size"
			{
				size = { 44 44 }
			}
		}

		coa_dynasty_widget = {
			size = { 56 56 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coat_of_arms_icon = {
				parentanchor = center
				size = { 44 44 }
				coat_of_arms = "[Dynasty.GetDynastyCoA.GetTexture('(int32)88','(int32)88')]"
				coat_of_arms_slot = "[Dynasty.GetDynastyCoA.GetSlot('(int32)88','(int32)88')]"
				coat_of_arms_mask = "[Dynasty.GetCulture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Dynasty.GetCulture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Dynasty.GetCulture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				size = { 64 64 }
				texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
			}
		}
	}

	type coa_dynasty_medium = widget
	{
		size = { 96 96 }

		coa_dynasty_lowborn_widget = {
			parentanchor = center
			size = { 80 80 }
			blockoverride "icon_size"
			{
				size = { 64 64 }
			}
		}

		coa_dynasty_widget = {
			size = { 80 80 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coat_of_arms_icon = {
				parentanchor = center
				size = { 72 72 }
				coat_of_arms = "[Dynasty.GetDynastyCoA.GetTexture('(int32)124','(int32)124')]"
				coat_of_arms_slot = "[Dynasty.GetDynastyCoA.GetSlot('(int32)124','(int32)124')]"
				coat_of_arms_mask = "[Dynasty.GetCulture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Dynasty.GetCulture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Dynasty.GetCulture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				size = { 96 96 }
				texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
			}
		}
	}

	type coa_dynasty_big = widget
	{
		size = { 128 128 }

		coa_dynasty_lowborn_widget = {
			parentanchor = center
			size = { 112 112 }
			blockoverride "icon_size"
			{
				size = { 88 88 }
			}
		}

		coa_dynasty_widget = {
			size = { 112 112 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coat_of_arms_icon = {
				parentanchor = center
				size = { 88 88 }
				coat_of_arms = "[Dynasty.GetDynastyCoA.GetTexture('(int32)172','(int32)172')]"
				coat_of_arms_slot = "[Dynasty.GetDynastyCoA.GetSlot('(int32)172','(int32)172')]"
				coat_of_arms_mask = "[Dynasty.GetCulture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Dynasty.GetCulture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Dynasty.GetCulture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				size = { 128 128 }
				texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
			}
		}
	}

	type coa_dynasty_huge = widget
	{
		size = { 172 172 }

		coa_dynasty_lowborn_widget = {
			parentanchor = center
			size = { 156 156 }
			blockoverride "icon_size"
			{
				size = { 112 112 }
			}
		}

		coa_dynasty_widget = {
			parentanchor = center
			size = { 152 152 }
			using = CoA_Dynasty_Defaults

			coat_of_arms_icon = {
				parentanchor = center
				size = { 120 120 }
				coat_of_arms = "[Dynasty.GetDynastyCoA.GetTexture('(int32)230','(int32)230')]"
				coat_of_arms_slot = "[Dynasty.GetDynastyCoA.GetSlot('(int32)230','(int32)230')]"
				coat_of_arms_mask = "[Dynasty.GetCulture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Dynasty.GetCulture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Dynasty.GetCulture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
				size = { 172 172 }
			}
		}
	}

	type coa_dynasty_frame = highlight_icon {
		name = "house_frame"
		parentanchor = center

		block "coa_dynasty_frame_size" {}

		block "frame_override"
		{
			frame = "[Dynasty.GetPrestigeFrame]"
		}
		texture = "[Dynasty.GetCulture.GetCultureDynastyCoAFrame]"
		framesize = { 160 160 }
		size = { 172 172 }
	}

	####################################
	############### HOUSE ##############
	####################################

	type coa_house_widget = button_group
	{
		layoutpolicy_horizontal = expanding
		visible = "[DynastyHouse.IsValid]"
	}


	## House relation icon
	#
	# Show the House Relation level between the players house,
	# and this house.
	#
	type icon_house_relation = icon {
		visible = "[DynastyHouse.HasHouseRelationWith( GetPlayer.GetHouse )]"
		size = { 16 16 }

		texture = "[DynastyHouse.GetHouseRelationWith( GetPlayer.GetHouse ).GetLevel.GetFlatIcon]"
	}


	type coa_house_lowborn_widget = widget
	{
		layoutpolicy_horizontal = shrinking
		visible = "[Not( DynastyHouse.IsValid )]"
		coa_lowborn_icon = {}
	}

	type coa_house_tiny = widget
	{
		size = { 48 48 }

		hbox = {
			margin = { 4 4 }

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 40 40 }

				blockoverride "icon_size"
				{
					size = { 28 28 }
				}
			}

			coa_house_widget = {
				size = { 40 40 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 28 28 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)56','(int32)56')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)56','(int32)56')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					size = { 40 40 }
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
				}
			}
		}
	}

	type coa_house_microscopic = widget
	{
		size = { 24 24 }

		hbox = {

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 18 18 }
				blockoverride "icon_size"
				{
					size = { 16 16 }
				}
			}

			coa_house_widget = {
				size = { 24 24 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 16 16 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)56','(int32)56')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)56','(int32)56')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					size = { 24 24 }
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
				}
			}
		}
	}
	type coa_house_small = widget
	{
		size = { 64 64 }

		hbox = {
			margin = { 4 4 }

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 56 56 }
				blockoverride "icon_size"
				{
					size = { 44 44 }
				}
			}

			coa_house_widget = {
				size = { 56 56 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 44 44 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					size = { 56 56 }
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
				}
			}
		}
	}

	type coa_house_medium = widget
	{
		size = { 88 88 }

		hbox = {
			margin = { 4 4 }

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 80 80 }
				blockoverride "icon_size"
				{
					size = { 64 64 }
				}
			}

			coa_house_widget = {
				size = { 80 80 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"


					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					size = { 80 80 }
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
				}
			}
		}
	}

	type coa_house_big = widget
	{
		size = { 120 120 }

		hbox = {
			margin = { 3 5 }

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 112 112 }
				blockoverride "icon_size"
				{
					size = { 86 86 }
				}
			}

			coa_house_widget = {
				size = { 112 112 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 86 86 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)172','(int32)172')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)172','(int32)172')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					size = { 112 112 }
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
				}
			}
		}
	}

	type coa_house_huge = widget
	{
		size = { 160 160 }

		hbox = {
			margin = { 3 5 }

			block "culture_template_data_datacontext"
			{
				datacontext = "[DynastyHouse.GetCulture.GetTemplateData]"
			}

			coa_house_lowborn_widget = {
				size = { 156 156 }
				blockoverride "icon_size"
				{
					size = { 120 120 }
				}
			}

			coa_house_widget = {
				size = { 156 156 }
				using = CoA_House_Defaults

				coat_of_arms_icon = {
					parentanchor = center
					size = { 120 120 }
					coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)230','(int32)230')]"
					coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)230','(int32)230')]"
					coat_of_arms_mask = "[CultureTemplateData.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[CultureTemplateData.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[CultureTemplateData.GetCultureHouseCoAScale]"


					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
					size = { 156 156 }
				}

				block "house_relation_icon"
				{
					icon_house_relation = {
						parentanchor = left|bottom
						position = { 16 -16 }
						size = { 32 32 }
					}
				}
			}
		}
	}

	# Frame used at the front of all House CoAs
	type coa_house_frame = highlight_icon {
		name = "house_frame"
		parentanchor = center

		block "frame_override"
		{
			frame = "[DynastyHouse.GetDynasty.GetPrestigeFrame]"
		}

		texture = "[CultureTemplateData.GetCultureHouseCoAFrame]"
		framesize = { 160 160 }
		size = { 156 156 }
	}

	####################################
	########## CONFEDERATION ###########
	####################################

	type coa_confederation_frame = icon {
		name = "coa_confederation_frame"
		parentanchor = center
		texture = "gfx/interface/coat_of_arms/title_86.dds"
	}

	type coa_confederation_tiny = button_group {
		visible = "[Confederation.IsValid]"
		using = CoA_Confederation_Defaults

		widget = {
			parentanchor = hcenter
			size = { 36 36 }

			coat_of_arms_icon = {
				parentanchor = center
				size = { 28 28 }
				coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)56','(int32)56')]"
				coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)56','(int32)56')]"
				coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
				coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
				coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

				block "glow" {
					using = CoA_Confederation_Hover_Glow
				}

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}

				coa_confederation_frame = {
					parentanchor = center
					texture = "gfx/interface/coat_of_arms/title_44.dds"
					size = { 36 36 }
				}
			}
		}
	}

	type coa_confederation_microscopic = button_group {
		visible = "[Confederation.IsValid]"
		size = { 24 24 }

		using = CoA_Confederation_Defaults

		coat_of_arms_icon = {
			parentanchor = center
			size = { 18 18 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)56','(int32)56')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)56','(int32)56')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
			coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
			coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

			block "glow" {
				using = CoA_Confederation_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}

			coa_confederation_frame = {
				size = { 18 18 }
			}
		}
	}

	type coa_confederation_small = button_group {
		visible = "[Confederation.IsValid]"
		size = { 52 52 }

		using = CoA_Confederation_Defaults

		coat_of_arms_icon = {
			parentanchor = center
			size = { 44 44 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)88','(int32)88')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)88','(int32)88')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
			coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
			coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

			block "glow" {
				using = CoA_Confederation_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}

			coa_confederation_frame = {
				parentanchor = center
				texture = "gfx/interface/coat_of_arms/title_44.dds"
				size = { 52 52 }
			}
		}
	}

	type coa_confederation_medium = button_group {
		visible = "[Confederation.IsValid]"
		size = { 72 72 }

		using = CoA_Confederation_Defaults

		coat_of_arms_icon = {
			parentanchor = center
			size = { 62 62 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)124','(int32)124')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)124','(int32)124')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
			coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
			coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

			block "glow" {
				using = CoA_Confederation_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}

			coa_confederation_frame = {
				parentanchor = center
				texture = "gfx/interface/coat_of_arms/title_62.dds"
				size = { 72 72 }
			}
		}
	}

	type coa_confederation_big = button_group {
		visible = "[Confederation.IsValid]"
		size = { 96 96 }

		using = CoA_Confederation_Defaults

		coat_of_arms_icon = {
			parentanchor = center
			size = { 86 86 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)172','(int32)172')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)172','(int32)172')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
			coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
			coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

			block "glow" {
				using = CoA_Confederation_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}

			coa_confederation_frame = {
				parentanchor = center
				texture = "gfx/interface/coat_of_arms/title_86.dds"
				size = { 96 96 }
			}
		}
	}

	type coa_confederation_huge = button_group {
		visible = "[Confederation.IsValid]"
		size = { 115 115 }

		using = CoA_Confederation_Defaults

		coat_of_arms_icon = {
			parentanchor = center
			size = { 115 115 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)230','(int32)230')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)230','(int32)230')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
			coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
			coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

			block "glow" {
				using = CoA_Confederation_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}

			coa_confederation_frame = {
				parentanchor = center
				size = { 115 115 }
			}
		}
	}

	type coa_bloc_microscopic = button_group {
		visible = "[Confederation.IsValid]"
		size = { 24 24 }

		using = CoA_Confederation_Defaults

		coa_confederation_frame = {
			parentanchor = center
			texture = "gfx/interface/coat_of_arms/frames/bloc_frame.dds"
			size = { 24 24 }
			position = { 2 0 }
		}

		coat_of_arms_icon = {
			parentanchor = center
			size = { 24 24 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)56','(int32)56')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)56','(int32)56')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/frames/bloc_frame_mask.dds"
			coat_of_arms_offset = { -0.02 -0.01 }
			coat_of_arms_scale = { 0.8 0.8 }

			block "glow" {
				using = CoA_Bloc_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}
		}
	}

	type coa_bloc_tiny = button_group {
		visible = "[Confederation.IsValid]"
		size = { 36 36 }

		using = CoA_Confederation_Defaults

		coa_confederation_frame = {
			parentanchor = center
			texture = "gfx/interface/coat_of_arms/frames/bloc_frame.dds"
			size = { 36 36 }
			position = { 2 0 }
		}

		coat_of_arms_icon = {
			parentanchor = center
			size = { 36 36 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)88','(int32)88')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)88','(int32)88')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/frames/bloc_frame_mask.dds"
			coat_of_arms_offset = { -0.02 -0.01 }
			coat_of_arms_scale = { 0.8 0.8 }

			block "glow" {
				using = CoA_Bloc_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}
		}
	}

	type coa_bloc_small = button_group {
		visible = "[Confederation.IsValid]"
		size = { 52 52 }

		using = CoA_Confederation_Defaults

		coa_confederation_frame = {
			parentanchor = center
			texture = "gfx/interface/coat_of_arms/frames/bloc_frame.dds"
			size = { 52 52 }
			position = { 2 0 }
		}

		coat_of_arms_icon = {
			parentanchor = center
			size = { 52 52 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)88','(int32)88')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)88','(int32)88')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/frames/bloc_frame_mask.dds"
			coat_of_arms_offset = { -0.02 -0.01 }
			coat_of_arms_scale = { 0.8 0.8 }

			block "glow" {
				using = CoA_Bloc_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}
		}
	}

	type coa_bloc_medium = button_group {
		visible = "[Confederation.IsValid]"
		size = { 72 72 }

		using = CoA_Confederation_Defaults

		coa_confederation_frame = {
			parentanchor = center
			texture = "gfx/interface/coat_of_arms/frames/bloc_frame.dds"
			size = { 72 72 }
			position = { 2 0 }
		}

		coat_of_arms_icon = {
			parentanchor = center
			size = { 72 72 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)124','(int32)124')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)124','(int32)124')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/frames/bloc_frame_mask.dds"
			coat_of_arms_offset = { -0.02 -0.01 }
			coat_of_arms_scale = { 0.8 0.8 }

			block "glow" {
				using = CoA_Bloc_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}
		}
	}

	type coa_bloc_big = button_group {
		visible = "[Confederation.IsValid]"
		size = { 96 96 }

		using = CoA_Confederation_Defaults

		coa_confederation_frame = {
			parentanchor = center
			texture = "gfx/interface/coat_of_arms/frames/bloc_frame.dds"
			size = { 86 86 }
			position = { 2 0 }
		}

		coat_of_arms_icon = {
			parentanchor = center
			size = { 86 86 }
			coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)124','(int32)124')]"
			coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)124','(int32)124')]"
			coat_of_arms_mask = "gfx/interface/coat_of_arms/frames/bloc_frame_mask.dds"
			coat_of_arms_offset = { -0.02 -0.01 }
			coat_of_arms_scale = { 0.8 0.8 }

			block "glow" {
				using = CoA_Bloc_Hover_Glow
			}

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = @overlay_alpha
			}
		}
	}

	####################################
	############# SAVEGAME #############
	####################################

	type coa_savegame = button_group {
		alwaystransparent = yes

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_44.dds"
				frame = "[SaveGameItem.GetPlayerTier]"
				framesize = { 52 32 }
			}

			widget = {
				size = { 52 52 }

				coa_realm_shadow = {
					texture = "[SaveGameItem.GetPlayerGovernment.GetRealmFrameShadow('(int32)44')]"
					size = { 52 52 }
					framesize = { 52 52 }
					frame = 1
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 52 52 }
					coat_of_arms = "[SaveGameItem.GetCoatOfArms.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[SaveGameItem.GetCoatOfArms.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "[SaveGameItem.GetPlayerGovernment.GetRealmMask]"
					coat_of_arms_offset = "[SaveGameItem.GetPlayerGovernment.GetRealmMaskOffset]"
					coat_of_arms_scale = "[SaveGameItem.GetPlayerGovernment.GetRealmMaskScale]"

					modify_texture = {
						texture = "[SaveGameItem.GetPlayerGovernment.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[SaveGameItem.GetPlayerGovernment.GetRealmFrame('(int32)44')]"
						frame = "[SaveGameItem.GetPlayerTier]"
						framesize = { 52 52 }
						size = { 52 52 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_44.dds"
						frame = "[SaveGameItem.GetPlayerTier]"
						framesize = { 52 52 }
						position = { 0 -7 }
						size = { 52 52 }
					}
				}
			}
		}
	}

	type coa_savegame_house = container {

		coat_of_arms_icon = {
			size = { 44 44 }
			parentanchor = center
			coat_of_arms = "[SaveGameItem.GetHouseCoatOfArms.GetTexture('(int32)88','(int32)88')]"
			coat_of_arms_slot = "[SaveGameItem.GetHouseCoatOfArms.GetSlot('(int32)88','(int32)88')]"
			coat_of_arms_mask = "[SaveGameItem.GetSaveGameItemHouseCoAMask]"
			coat_of_arms_offset = "[SaveGameItem.GetSaveGameItemHouseCoAOffset]"
			coat_of_arms_scale = "[SaveGameItem.GetSaveGameItemHouseCoAScale]"

			modify_texture = {
				texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
				blend_mode = overlay
				alpha = 0.4
			}
		}

		coa_house_frame = {
			size = { 56 56 }
			parentanchor = center
			frame = "[SaveGameItem.GetDynastyFrame]"
			texture = "[SaveGameItem.GetSaveGameItemHouseCoAFrame]"
		}
	}

	####################################
	############# BOOKMARK #############
	####################################

	type coa_dynasty_bookmark = button_group {

		block "character" {
			onclick = "[GameSetup.SetSelectedCharacter( BookmarkCharacter.Self )]"
		}

		tooltip = "BOOKMARK_DYNASTY_OR_HOUSE_TOOLTIP"

		flowcontainer = {
			margin = { 3 0 }
			margin_top = 5

			widget = {
				size = { 56 56 }

				# Dynasty CoA and frame
				coat_of_arms_icon = {
					visible = "[Not( BookmarkCharacter.HasDynastyHouse )]"
					parentanchor = center
					size = { 44 44 }
					coat_of_arms = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateDynastyCoAMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateDynastyCoAOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateDynastyCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
					}
				}

				coa_house_frame = {
					visible = "[Not( BookmarkCharacter.HasDynastyHouse )]"
					blockoverride "frame_override"
					{
						frame = "[BookmarkCharacter.GetDynastySplendorFrame]"
					}
					size = { 56 56 }
					texture = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateDynastyCoAFrame]"
				}

				# House CoA and frame
				coat_of_arms_icon = {
					visible = "[BookmarkCharacter.HasDynastyHouse]"
					parentanchor = center
					size = { 48 52 }
					coat_of_arms = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetTexture('(int32)88','(int32)88')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetSlot('(int32)88','(int32)88')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCultureTemplate.GetCultureTemplateHouseCoAMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateHouseCoAOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateHouseCoAScale]"

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
					}
				}

				coa_house_frame = {
					visible = "[BookmarkCharacter.HasDynastyHouse]"
					blockoverride "frame_override"
					{
						frame = "[BookmarkCharacter.GetDynastySplendorFrame]"
					}
					size = { 56 56 }
					texture = "[BookmarkCharacter.GetDynastyTemplate.GetCultureTemplate.GetCultureTemplateHouseCoAFrame]"
				}
			}
		}
	}

	type coa_realm_bookmark = container {
		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 3

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_62.dds"
				frame = "[BookmarkCharacter.GetTier]"
				framesize = { 64 40 }
			}

			widget = {
				size = { 64 64 }

				coa_realm_shadow = {
					parentanchor = center
					texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrameShadow('(int32)62')]"
					size = { 64 64 }
					framesize = { 64 64 }
					frame = 1
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes

					coat_of_arms = "[BookmarkCharacter.GetLandedTitleTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetLandedTitleTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						frame = 1
						framesize = { 64 64 }
						inherit_visual_state = no
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						position = { 0 -8 }
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
					}
				}
			}
		}
	}

	type coa_clan_bookmark = container {
		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 3

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_62.dds"
				frame = "[BookmarkCharacter.GetTier]"
				framesize = { 64 40 }
			}

			widget = {
				size = { 64 64 }

				coa_realm_shadow = {
					parentanchor = center
					texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrameShadow('(int32)62')]"
					size = { 64 64 }
					framesize = { 64 64 }
					frame = 1
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes
					visible = "[Not(BookmarkCharacter.HasDynastyHouse)]"

					coat_of_arms = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						framesize = { 64 64 }
						frame = 1
						inherit_visual_state = no
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
						position = { 0 -8 }
					}
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes
					visible = "[BookmarkCharacter.HasDynastyHouse]"

					coat_of_arms = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						inherit_visual_state = no
						frame = 1
						framesize = { 64 64 }
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
						position = { 0 -8 }
					}
				}
			}
		}
	}

	type coa_admin_nodlc_bookmark = container {
		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 3

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_62.dds"
				frame = "[BookmarkCharacter.GetTier]"
				framesize = { 64 40 }
			}

			widget = {
				size = { 64 64 }

				coa_realm_shadow = {
					parentanchor = center
					texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrameShadow('(int32)62')]"
					size = { 64 64 }
					framesize = { 64 64 }
					frame = 1
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes

					coat_of_arms = "[BookmarkCharacter.GetLandedTitleTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetLandedTitleTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[GetGovernment('feudal_government').GetRealmMask]"
					coat_of_arms_offset = "[GetGovernment('feudal_government').GetRealmMaskOffset]"
					coat_of_arms_scale = "[GetGovernment('feudal_government').GetRealmMaskScale]"

					modify_texture = {
						texture = "[GetGovernment('feudal_government').GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[GetGovernment('feudal_government').GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						inherit_visual_state = no
						frame = 1
						framesize = { 64 64 }
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						position = { 0 -2 }
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
					}
				}
			}
		}
	}

	type coa_adventurer_bookmark = container {
		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = 4

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_adventurer_topframe_62.dds"
				size = { 62 30 }
			}

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/landless_minority_government_topframe_62.dds"
				size = { 62 30 }
			}
			widget = {
				size = { 64 64 }

				coa_realm_shadow = {
					parentanchor = center
					texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrameShadow('(int32)62')]"
					size = { 64 64 }
					framesize = { 64 64 }
					frame = 1
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes
					visible = "[Not(BookmarkCharacter.HasDynastyHouse)]"

					coat_of_arms = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						inherit_visual_state = no
						frame = 1
						framesize = { 64 64 }
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
						position = { 0 -8 }
					}
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 64 64 }
					alwaystransparent = yes
					visible = "[BookmarkCharacter.HasDynastyHouse]"

					coat_of_arms = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetTexture('(int32)124','(int32)124')]"
					coat_of_arms_slot = "[BookmarkCharacter.GetDynastyHouseTemplate.GetCoA.GetSlot('(int32)124','(int32)124')]"
					coat_of_arms_mask = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
					coat_of_arms_offset = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskOffset]"
					coat_of_arms_scale = "[BookmarkCharacter.GetGovernmentType.GetRealmMaskScale]"

					modify_texture = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmMask]"
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						texture = "[BookmarkCharacter.GetGovernmentType.GetRealmFrame('(int32)62')]"
						size = { 64 64 }
						inherit_visual_state = no
						frame = 1
						framesize = { 64 64 }
					}

					coa_realm_topframe = {
						inherit_visual_state = no
						texture ="gfx/interface/coat_of_arms/topframe_62.dds"
						framesize = { 64 64 }
						size = { 64 64 }
						frame = "[BookmarkCharacter.GetTier]"
						position = { 0 -8 }
					}
				}
			}
		}
	}

	#########################################
	######### COAT OF ARMS DESIGNER #########
	#########################################
	# These widgets require a "CoatOfArms" datacontext (CCoatOfArmsSprite in code)

	# modelled after coa_realm_huge_crown
	type coa_preview_realm_huge_crown = button_group {
		alwaystransparent = yes

		flowcontainer = {
			direction = vertical
			ignoreinvisible = yes
			spacing = -2

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_115.dds"

				block "frame_override"
				{
					frame = 2
				}
				framesize = { 128 80 }

				block "crown"
				{
					visible = yes
				}
			}

			icon = {
				name = "mercenary"

				block "mercenary_visible"
				{
					visible = no
				}

				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/mercenary_topframe_115.dds"
			}

			icon = {
				name = "holy_order"

				block "holy_order_visible"
				{
					visible = no
				}

				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/holyorder_topframe_115.dds"
			}

			widget = {
				parentanchor = hcenter
				size = { 128 128 }

				coa_realm_shadow = {
					parentanchor = center
					texture = "gfx/interface/icons/realm_frames/_default_115_shadow.dds"
					size = { 128 128 }
				}

				coat_of_arms_icon = {
					parentanchor = center
					size = { 128 128 }
					coat_of_arms = "[CoatOfArms.GetTexture('(int32)230','(int32)230')]"
					coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)230','(int32)230')]"

					block "coa_icon_additions" {}

					block "coat_of_arms_mask"
					{
						coat_of_arms_mask = "gfx/interface/icons/realm_frames/_default_mask.dds"
						coat_of_arms_offset = { 0.0 0.07 }
						coat_of_arms_scale = { 0.9 0.9 }
					}

					modify_texture = {
						block "realm_mask_texture"
						{
							texture = "gfx/interface/icons/realm_frames/_default_mask.dds"
						}
						blend_mode = overlay
						alpha = @overlay_alpha
					}

					coa_realm_overlay = {
						block "realm_frame_texture"
						{
							texture = "gfx/interface/icons/realm_frames/_default_115_frame.dds"
						}
						size = { 128 128 }
					}

					coa_realm_topframe = {
						texture ="gfx/interface/coat_of_arms/topframe_115.dds"
						block "frame_override"
						{
							frame = 2
						}
						size = { 128 128 }
						framesize = { 128 128 }
						position = { 0 -12}
					}
				}
			}
		}
	}

	# modelled after coa_title_big_crown
	type coa_preview_title_big_crown = button_group {
		alwaystransparent = yes

		flowcontainer = {
			margin = { 3 7 }
			direction = vertical
			spacing = -3
			ignoreinvisible = yes

			icon = {
				name = "crown"
				parentanchor = hcenter
				texture = "gfx/interface/coat_of_arms/crown_strip_115.dds"
				block "frame_override"
				{
					frame = 2
				}
				framesize = { 128 80 }

				block "crown"
				{
					visible = yes
				}
			}

			widget = {
				parentanchor = hcenter
				size = { 96 96 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 86 86 }
					coat_of_arms = "[CoatOfArms.GetTexture('(int32)172','(int32)172')]"
					coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)172','(int32)172')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					coa_title_frame = {
						texture = "gfx/interface/coat_of_arms/title_86.dds"
						size = { 96 96 }
						alwaystransparent = yes
					}
				}
			}
		}
	}

	# modelled after coa_title_tiny
	type coa_preview_title_tiny = button_group {
		alwaystransparent = yes

		flowcontainer = {
			margin = { 3 7 }
			direction = vertical
			spacing = -4
			ignoreinvisible = yes

			spacer = {
				name = "crown"
				size = { 18 12 }
				visible = no
			}

			widget = {
				parentanchor = hcenter
				size = { 36 35 }

				coat_of_arms_icon = {
					parentanchor = center
					size = { 28 28 }
					coat_of_arms = "[CoatOfArms.GetTexture('(int32)56','(int32)56')]"
					coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)56','(int32)56')]"
					coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds"
					coat_of_arms_offset = "[DefaultCoATitleMaskOffset]"
					coat_of_arms_scale = "[DefaultCoATitleMaskScale]"

					coa_title_frame = {
						parentanchor = center
						texture = "gfx/interface/coat_of_arms/title_28.dds"
						size = { 34 34 }
					}
				}
			}
		}
	}

	# modelled after coa_dynasty_huge
	type coa_preview_dynasty_huge = widget
	{
		size = { 172 172 }

		#block "coa_widget_size"

		button_group = {
			parentanchor = center
			size = { 156 156 }
			alwaystransparent = yes

			coat_of_arms_icon = {
				parentanchor = center
				size = { 128 128 }
				coat_of_arms = "[CoatOfArms.GetTexture('(int32)230','(int32)230')]"
				coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)230','(int32)230')]"
				coat_of_arms_mask = "[Culture.GetCultureDynastyCoAMask]"
				coat_of_arms_offset = "[Culture.GetCultureDynastyCoAOffset]"
				coat_of_arms_scale = "[Culture.GetCultureDynastyCoAScale]"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}

			coa_dynasty_frame = {
				texture = "[Culture.GetCultureDynastyCoAFrame]"
				size = { 172 172 }
				alwaystransparent = yes

				#block "coa_frame_size" {}

				blockoverride "frame_override"
				{
					frame = 2
				}
			}
		}
	}

	# modelled after coa_house_huge
	type coa_preview_house_huge = widget
	{
		size = { 160 160 }

		hbox = {
			margin = { 4 4 }

			coa_house_widget = {
				visible = yes
				size = { 156 156 }
				alwaystransparent = yes

				coat_of_arms_icon = {
					parentanchor = center
					size = { 120 120 }
					coat_of_arms = "[CoatOfArms.GetTexture('(int32)230','(int32)230')]"
					coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)230','(int32)230')]"
					coat_of_arms_mask = "[Culture.GetCultureHouseCoAMask]"
					coat_of_arms_offset = "[Culture.GetCultureHouseCoAOffset]"
					coat_of_arms_scale = "[Culture.GetCultureHouseCoAScale]"
					alwaystransparent = yes

					modify_texture = {
						texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
						blend_mode = overlay
						alpha = @overlay_alpha
					}
				}

				coa_house_frame = {
					texture = "[Culture.GetCultureHouseCoAFrame]"
					size = { 156 156 }
					alwaystransparent = yes

					blockoverride "frame_override"
					{
						frame = 2
					}
				}
			}
		}
	}

	####################################
	######### CULTURE PREVIEW ##########
	####################################

	type coa_hybridize_window = widget
	{
		size = { 128 128 }

		button_group = {
			size = { 84 84 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coat_of_arms_icon = {
				parentanchor = center
				using = Mask_Rough_Edges

				size = { 84 84 }
				coat_of_arms = "[DesignerCoA.GetCoA.GetTexture('(int32)124','(int32)124')]"
				coat_of_arms_slot = "[DesignerCoA.GetCoA.GetSlot('(int32)124','(int32)124')]"
				block "mask"
				{
					coat_of_arms_mask = "[Culture.GetCultureDynastyCoAMask]"
					coat_of_arms_offset = "[Culture.GetCultureDynastyCoAOffset]"
					coat_of_arms_scale = "[Culture.GetCultureDynastyCoAScale]"
				}

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}

			}

			block "frame"
			{
				coa_dynasty_frame = {
					size = { 128 128 }
					texture = "[Culture.GetCultureDynastyCoAFrame]"
				}
			}
		}
	}

	type coa_hybridize_frame_preview = widget
	{
		size = { 128 128 }

		button_group = {
			size = { 84 84 }
			using = CoA_Dynasty_Defaults
			parentanchor = center

			coa_dynasty_frame = {
				size = { 128 128 }
				texture = "[Culture.GetCultureDynastyCoAFrame]"
			}
		}
	}

	##### Sigil Coat of Arms
	type coa_character_sigil = widget
	{
		block "size"
		{
			size = { 45 30 }
		}

		widget = {
			parentanchor = center

			icon = {
				name = "sigil_bg"
				texture = "gfx/interface/skinned/window_letter/sigil_bg.dds"
				alwaystransparent = yes
				parentanchor = center

				block "size"
				{
					size = { 50 50 }
				}
			}

			icon = {
				name = "sigil"
				visible = "[Character.HasSealCoA]"
				gfxtype = coatofarmsgfx
				shaderfile = "gfx/FX/gui_coatofarms.shader"
				effectname = PdxGuiSeal
				alwaystransparent = yes
				datacontext = "[Character.GetSealCoA]"
				coat_of_arms_slot = "[CoatOfArms.GetSlot('(int32)88','(int32)88')]"
				coat_of_arms = "[CoatOfArms.GetTexture('(int32)88','(int32)88')]"
				coat_of_arms_mask = "gfx/interface/skinned/window_letter/sigil_center.dds"
				parentanchor = center

				block "sigil_size"
				{
					size = { 34 34 }
				}
			}

			icon = {
				name = "sigil_lowborn"
				visible = "[Not( Character.HasSealCoA )]"
				texture = "gfx/interface/skinned/window_letter/sigil_center_lowborn.dds"
				alwaystransparent = yes
				parentanchor = center

				block "sigil_size"
				{
					size = { 34 34 }
				}
			}
		}

		coa_house_widget = {
			using = CoA_House_Defaults
			visible = "[Character.HasSealCoA]"
			datacontext = "[Character.GetHouse]"
			parentanchor = center

			block "sigil_size"
			{
				size = { 34 34 }
			}

			coat_of_arms_icon = {
				parentanchor = center
				block "sigil_size"
				{
					size = { 34 34 }
				}
				coat_of_arms = "[DynastyHouse.GetHouseCoA.GetTexture('(int32)124','(int32)124')]"
				coat_of_arms_slot = "[DynastyHouse.GetHouseCoA.GetSlot('(int32)124','(int32)124')]"
				coat_of_arms_mask = "gfx/interface/skinned/window_letter/asia_house_mask.dds"

				modify_texture = {
					texture = "gfx/interface/coat_of_arms/coa_overlay.dds"
					blend_mode = overlay
					alpha = @overlay_alpha
				}
			}
		}
	}
}

######################################################
##################### TEMPLATES ######################
######################################################

## Default values for Title CoA buttons
template CoA_Title_Defaults
{
	block "coa_button"
	{
		block "coa_tooltip"
		{
			tooltipwidget = {
				using = LandedTitleTooltip
			}
		}
		block "coa_onclick"
		{
			onclick = "[DefaultOnCoatOfArmsClick(Title.GetID)]"
			onrightclick = "[DefaultOnCoatOfArmsRightClick(Title.GetID)]"
			button_ignore = none
		}
	}
	using = State_Title_MouseEntry
}

template CoA_Title_Hover_Glow
{
	glow = {
		block "coa_hover_glow_visible"
		{
			visible = "[Title.IsHovered]"
		}
		using = Color_Bright_Yellow
		glow_radius = 8

		glow_generation_rules = {
			glow_alpha_mask = 0
			glow_blur_passes = 10
			glow_texture_downscale = 2.5f
			glow_ignore_inside_pixels = yes
		}
	}

	using = Animation_Glow_Pulse
}

template CoA_Realm_Hover_Glow
{
	glow = {
		block "coa_hover_glow_visible"
		{
			visible = "[Character.IsHovered]"
		}
		using = Color_Bright_Yellow
		glow_radius = 4

		glow_generation_rules = {
			glow_alpha_mask = 0
			glow_blur_passes = 5
			glow_texture_downscale = 2.5f
			glow_ignore_inside_pixels = yes
		}
	}

	using = Animation_Glow_Pulse
}

template CoA_Confederation_Hover_Glow
{
	glow = {
		block "coa_hover_glow_visible"
		{
			visible = "[Confederation.IsHovered]"
		}
		using = Color_Bright_Yellow
		glow_radius = 8

		glow_generation_rules = {
			glow_alpha_mask = 0
			glow_blur_passes = 10
			glow_texture_downscale = 2.5f
			glow_ignore_inside_pixels = yes
		}
	}

	using = Animation_Glow_Pulse
}

template CoA_Bloc_Hover_Glow
{
	glow = {
		block "coa_hover_glow_visible"
		{
			visible = "[Confederation.IsHovered]"
		}
		using = Color_Bright_Yellow
		glow_radius = 4

		glow_generation_rules = {
			glow_alpha_mask = 0
			glow_blur_passes = 10
			glow_texture_downscale = 2.5f
			glow_ignore_inside_pixels = yes
		}
	}

	using = Animation_Glow_Pulse
}


## Default values for Realm CoA buttons
template CoA_Realm_Defaults
{
	block "coa_button"
	{
		tooltip = "[Character.GetDefaultRealmFlagTooltip]"
		onclick = "[DefaultOnRealmFlagClick(Character.GetID)]"
		onrightclick = "[DefaultOnCharacterRightClick(Character.GetID)]"
		button_ignore = none
		tooltip_visible = "[Not(IsInteractionMenuOpenForCharacter(Character.GetID))]"
	}

	block "coa_realm_mouse_entry"
	{
		using = State_Realm_MouseEntry
	}
}

## Default values for Dynasty CoA buttons
template CoA_Dynasty_Defaults
{
	block "coa_button"
	{
		block "coa_tooltip"
		{
			tooltipwidget = {
				using = DynastyTooltip
			}
		}
		block "OnClickDefault"
		{
			onclick = "[DefaultOnDynastyCoatOfArmsClick(Dynasty.GetID)]"
		}
	}
}

## Default values for House CoA buttons
template CoA_House_Defaults
{
	block "coa_button"
	{
		block "coa_tooltip"
		{
			tooltipwidget = {
				using = dynasty_house_tooltip
			}
		}
		onclick = "[DefaultOnHouseCoatOfArmsClick(DynastyHouse.GetID)]"
	}
}

## Default values for Confederation CoA buttons
template CoA_Confederation_Defaults
{
	block "coa_button"
	{
		block "coa_tooltip"
		{
		}
	}
	using = Confederation_Mouse_Entry
}
