jap_imperial_influence_inlay_window = {

    window_name = jap_imperial_influence_ui_window

    internal = yes

    visible = {
       # IS ALWAYS VISIBLE 
    }

    scripted_images = {

        # IMPERIAL/NATIONAL RULER
        emperor_portrait = {
            GFX_imperial_influence_ruler_yasuhito = {
            	OR = {
            		has_country_leader = {
            		    ruling_only = yes
            		    character = JAP_emperor_yasuhito
            		}
            		has_country_flag = JAP_yasuhito_is_the_current_regent_or_emperor_flag
            	}
            	NOT = {
            		has_country_leader = {
            		    ruling_only = yes
            		    character = JAP_empress_nagako
            		}
            	}
            }
            GFX_imperial_influence_ruler_nobuhito = {
            	OR = {
            		has_country_leader = {
            		    ruling_only = yes
            		    character = JAP_emperor_nobuhito
            		}
            		has_country_flag = JAP_nobuhito_is_the_current_regent_or_emperor_flag
            	}
            }
            GFX_imperial_influence_ruler_nagako = {
                has_country_leader = {
                    ruling_only = yes
                    character = JAP_empress_nagako
                }
            }
            GFX_imperial_influence_ruler_kanson_arahata = {
                has_government = communism
                has_completed_focus = JAP_the_labor_farmer_faction_ascendant
            }
            GFX_imperial_influence_ruler_kyuichi_tokuda = {
                has_government = communism
                NOT = {
                	has_completed_focus = JAP_the_labor_farmer_faction_ascendant
                }
            }
            GFX_imperial_influence_ruler_hirohito = yes #Default
        }

        ### FACTIONS ###

        # ARMY
        army_faction_frame = {
            GFX_imperial_influence_faction_frame_subdued = {
                JAP_army_faction_is_tier_1 = yes
            }
            GFX_imperial_influence_faction_frame_meddling = {
       			JAP_army_faction_is_tier_2 = yes
		    }
            GFX_imperial_influence_faction_frame_influential = {
                JAP_army_faction_is_tier_3 = yes
            }
            GFX_imperial_influence_faction_frame_dominating = {
                JAP_army_faction_is_tier_4 = yes
            }
        }

        # NAVY
        naval_faction_frame = {
            GFX_imperial_influence_faction_frame_subdued = {
                JAP_naval_faction_is_tier_1 = yes
            }
            GFX_imperial_influence_faction_frame_meddling = {
                JAP_naval_faction_is_tier_2 = yes
            }
            GFX_imperial_influence_faction_frame_influential = {
                JAP_naval_faction_is_tier_3 = yes
            }
            GFX_imperial_influence_faction_frame_dominating = {
                JAP_naval_faction_is_tier_4 = yes
            }
        }

        # ZAIBATSU
        zaibatsu_faction_frame = {
            GFX_imperial_influence_faction_frame_subdued = {
                has_idea = JAP_zaibatsu_faction_tier_1
            }
            GFX_imperial_influence_faction_frame_meddling = {
               has_idea = JAP_zaibatsu_faction_tier_2
            }
            GFX_imperial_influence_faction_frame_influential = {
                has_idea = JAP_zaibatsu_faction_tier_3
            }
            GFX_imperial_influence_faction_frame_dominating = {
                has_idea = JAP_zaibatsu_faction_tier_4
            }
        }

        # CIVILIAN GOVERNMENT 
        government_faction_frame = {
            GFX_imperial_influence_faction_frame_subdued = {
                has_idea = JAP_government_faction_tier_1
            }
            GFX_imperial_influence_faction_frame_meddling = {
               has_idea = JAP_government_faction_tier_2
            }
            GFX_imperial_influence_faction_frame_influential = {
                has_idea = JAP_government_faction_tier_3
            }
            GFX_imperial_influence_faction_frame_dominating = {
                has_idea = JAP_government_faction_tier_4
            }
        }

        # APPROVAL AND DISSAPPROVAL BUTTONS 
        army_faction_stamp_of_approval = {
            GFX_imperial_influence_stamp_of_approval_selected = yes
        }
        army_faction_stamp_of_disapproval = {
            GFX_imperial_influence_stamp_of_discredit_selected = yes
        }
        naval_faction_stamp_of_approval = {
            GFX_imperial_influence_stamp_of_approval_selected = yes
        }
        naval_faction_stamp_of_disapproval = {
            GFX_imperial_influence_stamp_of_discredit_selected = yes
        }
        zaibatsu_faction_stamp_of_approval = {
            GFX_imperial_influence_stamp_of_approval_selected = yes
        }
        zaibatsu_faction_stamp_of_disapproval = {
            GFX_imperial_influence_stamp_of_discredit_selected = yes
        }
        government_faction_stamp_of_approval = {
            GFX_imperial_influence_stamp_of_approval_selected = yes
        }
        government_faction_stamp_of_disapproval = {
            GFX_imperial_influence_stamp_of_discredit_selected = yes
        }
    }

    # BUTTONS 
 	scripted_buttons = {
 		army_faction_stamp_of_approval = { 
	 		available = {
	 			has_political_power > 25
	 			JAP_army_faction_is_not_dominant = yes
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}
	 			NOT = {
	 				has_country_flag = JAP_blocked_from_favoring_the_army_flag 
	 			}
	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					JAP_army_faction_is_tier_1 = yes
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_army_faction_gain = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		army_faction_stamp_of_disapproval = { 
	 		available = {
	 			has_political_power > 25
	 			JAP_army_faction_is_not_subdued = yes
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}

	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					JAP_army_faction_is_tier_1 = yes
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -24	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_army_faction_loss = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		naval_faction_stamp_of_approval = { 
	 		available = {
	 			has_political_power > 25
	 			JAP_naval_faction_is_not_dominant = yes
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}
	 			NOT = {
	 				has_country_flag = JAP_blocked_from_favoring_the_navy_flag 
	 			}
	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					JAP_naval_faction_is_tier_1 = yes
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_naval_faction_gain = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		naval_faction_stamp_of_disapproval = { 
	 		available = {
	 			has_political_power > 74
	 			JAP_naval_faction_is_not_subdued = yes
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}

	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					JAP_naval_faction_is_tier_1 = yes
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_naval_faction_loss = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		zaibatsu_faction_stamp_of_approval = { 
	 		available = {
	 			has_political_power > 24
	 			NOT = {
	 				has_idea = JAP_zaibatsu_faction_tier_4
	 			}
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}
	 			NOT = {
	 				has_country_flag = JAP_blocked_from_favoring_the_zaibatsus_flag 
	 			}
	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					has_idea = JAP_zaibatsu_faction_tier_1
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_zaibatsu_faction_gain = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		zaibatsu_faction_stamp_of_disapproval = { 
	 		available = {
	 			has_political_power > 24
	 			NOT = {
	 				has_idea = JAP_zaibatsu_faction_tier_1
	 			}
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}

	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					has_idea = JAP_zaibatsu_faction_tier_1
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_zaibatsu_faction_loss = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		government_faction_stamp_of_approval = { 
	 		available = {
	 			has_political_power > 24
	 			NOT = {
	 				has_idea = JAP_government_faction_tier_4
	 			}
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}
	 			NOT = {
	 				has_country_flag = JAP_blocked_from_favoring_the_government_flag 
	 			}
	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					has_idea = JAP_government_faction_tier_1
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_government_faction_gain = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 		government_faction_stamp_of_disapproval = { 
	 		available = {
	 			has_political_power > 24
	 			NOT = {
	 				has_idea = JAP_government_faction_tier_1
	 			}
	 			IF = {
	 				limit = {
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 				NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 			}
	 			ELSE_IF = {
	 				limit = {
	 					has_country_flag = JAP_interfered_in_imperial_influence_flag
	 				}
	 				custom_trigger_tooltip = {
	 					tooltip = JAP_imperial_influence_interference_reset_days_tt
	 					NOT = {	has_country_flag = JAP_interfered_in_imperial_influence_flag }
	 				}
	 			}

	 		}
	 		click_effect = {
	 			IF = {
	 				limit = {
	 					has_idea = JAP_government_faction_tier_1
	 				}
	 				add_political_power = -50
	 			}
	 			ELSE = {
	 				add_political_power = -25	 			
	 			}

	 			custom_effect_tooltip = generic_skip_one_line_tt

	 			JAP_big_government_faction_loss = yes
	 			set_country_flag = {
	 				flag = JAP_interfered_in_imperial_influence_flag
	 				value = 1
	 				days = 2
	 			}
	 		}
 		}
 	}
}