scripted_gui = {    	
  bottom_gui = {
    window_name = "bottom_window"
    context_type = player_context

    visible = {
 
always = yes
   
}


    effects = {
 
bottom_fff_click = {
    if = {
        limit = {
            has_country_flag = fff
        }
        clr_country_flag = fff
    }
    else = {
        set_country_flag = fff
set_variable = { var = failwar_page_number value = 1 }
    }
}
bottom_pat1_click = {
    if = {
        limit = {
            has_country_flag = pat_war
        }
        clr_country_flag = pat_war
    }
    else = {
        set_country_flag = pat_war
    }
}
bottom_unrest_click = {
    if = {
        limit = {
            has_country_flag = unrest
        }
        clr_country_flag = unrest
    }
    else = {
        set_country_flag = unrest
    }
}

bottom_crane_click = {
    if = {
        limit = {
            has_country_flag = menu
        }
        clr_country_flag = menu
    }
    else = {
        set_country_flag = menu
    }
}
bottom_hunt_click = {
    if = {
        limit = {
            has_country_flag = hunt
        }
        clr_country_flag = hunt
    }
    else = {
        set_country_flag = hunt
    }
}
bottom_typepad_click = {
    if = {
        limit = {
            has_country_flag = typepad
        }
        clr_country_flag = typepad
    }
    else = {
        set_country_flag = typepad
		set_country_flag = analysis
clr_country_flag = analysis_arm
clr_country_flag = analysis_arm1
clr_country_flag = analysis_arm2
 clr_country_flag = analysis_leg
clr_country_flag = analysis_leg1
clr_country_flag = analysis_leg2
 clr_country_flag = analysis_head
clr_country_flag = analysis_head1
clr_country_flag = analysis_head2
    }
}
bottom_rule_click = {
    if = {
        limit = {
            has_country_flag = peacetime_stats
        }
        clr_country_flag = peacetime_stats
    }
    else = {
        set_country_flag = peacetime_stats
		
    }
}
bottom_firstwar_click = {
    if = {
        limit = {
            has_country_flag = FirstWar_Open
        }
        clr_country_flag = FirstWar_Open
    }
    else = {
        set_country_flag = FirstWar_Open
    }
}

bottom_phase3_click = {
    if = {
        limit = {
            has_country_flag = finalbattle
        }
        clr_country_flag = finalbattle
    }
    else = {
        set_country_flag = finalbattle
    }
}
  
 }	 	
	 
	    triggers = {
	bottom_button2_visible = {
	OR = {
has_country_flag = finalbattle_bottom	
has_country_flag = menu_bottom	
has_global_flag = peacetime	

  }   } 

	bottom_button3_visible = {
	OR = {
has_global_flag = hunt	

  }  
  
			  }  	
	bottom_button4_visible = {
	OR = {
has_global_flag = peacetime	

  }  
  
			  } 

		
		
	bottom_phase3_visible = {
has_country_flag = finalbattle_bottom	
  }  	
	  	bottom_typepad_visible = {
has_global_flag = typepad	
  }
   
	bottom_unrest_visible = {
has_country_flag = unrest_bottom	
  } 
	bottom_crane_visible = {
has_country_flag = menu_bottom	
  } 
	bottom_hunt_visible = {
has_global_flag = hunt	
  } 
 	bottom_peacetime_visible = {
has_global_flag = peacetime	
  }
  	bottom_rule_visible = {
has_global_flag = peacetime	
  }
 	bottom_firstwar_visible = {
has_global_flag = first_war	
  }   
 	bottom_fff_visible = {
has_global_flag = fff	
  }  
 	bottom_pat1_visible = {
has_global_flag = pat1	
  }    
	}

    dynamic_lists = {
	}

properties = {
 
}

    ai_enabled = {
		always = no
    }

    ai_test_interval = 290  # The higher, the long it takes the ai to do actions
	ai_test_variance = 0.5

    ai_check = {
    }

    ai_check_scope = {
    }

    ai_weights = {
    }
  }
 

