scripted_gui = {
  no_gui = {
    window_name = "menu_window"
    context_type = player_context

    visible = {
      has_country_flag = menu
    }

    effects = {
      add_economy_click = {
        if = {
          limit = {
            check_variable = { total_investment < max_investment }
          }
          add_to_variable = { prosperity_investment = 1 }
          add_to_variable = { prosperity_research = 0.1 }
          add_to_variable = { total_investment = 1 }
          subtract_from_variable = { investment_pp_cost = 1 }
         }
      }
      remove_economy_click = {
        if = {
          limit = {
            check_variable = { prosperity_investment > 0 }
          }
          subtract_from_variable = { prosperity_investment = 1 }
          subtract_from_variable = { prosperity_research = 0.1 }
          subtract_from_variable = { total_investment = 1 }
          add_to_variable = { investment_pp_cost = 1 }
        }
      }
      add_military_click = {
        if = {
          limit = {
            check_variable = { total_investment < max_investment }
          }
          add_to_variable = { military_investment = 1 }
          add_to_variable = { military_research = 0.1 }
          add_to_variable = { total_investment = 1 }
          subtract_from_variable = { investment_pp_cost = 1 }
        }
      }
      remove_military_click = {
        if = {
          limit = {
            check_variable = { military_investment > 0 }
          }
          subtract_from_variable = { military_investment = 1 }
          subtract_from_variable = { military_research = 0.1 }
          subtract_from_variable = { total_investment = 1 }
          add_to_variable = { investment_pp_cost = 1 }
        }
      }
      add_stability_click = {
        if = {
          limit = {
            check_variable = { total_investment < max_investment }
          }
          add_to_variable = { stability_investment = 1 }
          add_to_variable = { stability_research = 0.1 }
          add_to_variable = { total_investment = 1 }
          subtract_from_variable = { investment_pp_cost = 1 }
        }
      }
      remove_stability_click = {
        if = {
          limit = {
            check_variable = { stability_investment > 0 }
          }
          subtract_from_variable = { stability_investment = 1 }
          subtract_from_variable = { stability_research = 0.1 }
          subtract_from_variable = { total_investment = 1 }
          add_to_variable = { investment_pp_cost = 1 }
        }
      }
      add_technology_click = {
        if = {
          limit = {
            check_variable = { total_investment < max_investment }
          }
          add_to_variable = { technology_investment = 1 }
          add_to_variable = { technology_research = 0.1 }
          add_to_variable = { total_investment = 1 }
          subtract_from_variable = { investment_pp_cost = 1 }
        }
      }
      remove_technology_click = {
        if = {
          limit = {
            check_variable = { technology_investment > 0 }
          }
          subtract_from_variable = { technology_investment = 1 }
          subtract_from_variable = { total_investment = 1 }
          subtract_from_variable = { technology_research = 0.1 }
     		add_to_variable = { investment_pp_cost = 1 }
        }
      }
      add_control_click = {
        if = {
          limit = {
            check_variable = { total_investment < max_investment }
          }
          add_to_variable = { control_investment = 1 }
          add_to_variable = { control_research = 0.1 }
 
 add_to_variable = { total_investment = 1 }
          subtract_from_variable = { investment_pp_cost = 1 }
        }
      }
      remove_control_click = {
        if = {
          limit = {
            check_variable = { control_investment > 0 }
          }
          subtract_from_variable = { control_investment = 1 }
          subtract_from_variable = { control_research = 0.1}
          subtract_from_variable = { total_investment = 1 }
          add_to_variable = { investment_pp_cost = 1 }
        }
      }
    }

    triggers = {}
  }

  dynamic_lists = {}

  properties = {
 
  }

  ai_enabled = {
    always = no
  }

  ai_test_interval = 290
  ai_test_variance = 0.5

  ai_check = {}

  ai_check_scope = {}

  ai_weights = {}
}