﻿RUI_Ch_build_trait_list = {
	scope = character

	effect = {
		if = {
			limit = {
				is_alive = yes
			}
			clear_variable_list = traits
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = education
				}
				prev = {
					add_to_variable_list = {
						name = traits
						target = prev
					}
				}
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = commander
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = winter_commander
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = lifestyle
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = court_type
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = fame
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOT = {	has_trait_flag = hidden_trait }
					has_trait_category = health
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
			every_character_trait = {
				limit = {
					NOR = {
						has_trait_flag = hidden_trait
						has_trait_category = childhood
						has_trait_category = personality
						has_trait_category = education
						has_trait_category = commander
						has_trait_category = winter_commander
						has_trait_category = lifestyle
						has_trait_category = court_type
						has_trait_category = fame
						has_trait_category = health
					}
				}
				prev = { add_to_variable_list = { name = traits target = prev } }
			}
		}
	}
}

RUI_Ch_clear_trait_list = {
	scope = character

	effect = {
		clear_variable_list = traits
	}
}

RUI_Ch_clear_trait_list_all = {
	scope = none
	effect = {
		every_living_character = {
			limit = {
				has_variable_list = traits
			}
			clear_variable_list = traits
		}
	}
}
