示例#1
0
        public void RefreshFunctions(Config config)
        {
            int prevIndex = -1;

            if (comboBox_Function.Items.Count != 0)
            {
                prevIndex = comboBox_Function.SelectedIndex;
            }

            comboBox_Function.Items.Clear();

            comboBox_Function.Items.Add("-");
            for (int i = 0; i < MenuFuncs.FUNCS.Length; i++)
            {
                comboBox_Function.Items.Add(MenuFuncs.WithSpaces(MenuFuncs.FUNCS[i]));
            }
            if (config != null)
            {
                for (int i = 0; i < config.CustomActions.Count; i++)
                {
                    comboBox_Function.Items.Add((config.CustomActions[i] as dynamic).name);
                }
            }
            comboBox_Function.SelectedIndex = 0;

            if (prevIndex != -1 && prevIndex < comboBox_Function.Items.Count)
            {
                comboBox_Function.SelectedIndex = prevIndex;
            }
        }
示例#2
0
        public ContextMenuItem(string name, string func, Config config)
        {
            InitializeComponent();

            // func drop down list
            RefreshFunctions(config);

            // name
            textBox_Name.Text = name;

            // func
            func = MenuFuncs.WithSpaces(func);
            int fundIndex = comboBox_Function.Items.IndexOf(func);

            if (fundIndex != -1)
            {
                comboBox_Function.SelectedIndex = fundIndex;
            }
        }
示例#3
0
        public ContextMenuItem(string name, string func)
        {
            InitializeComponent();

            // func drop down list
            comboBox_Function.Items.Add("-");
            for (int i = 0; i < MenuFuncs.FUNCS.Length; i++)
            {
                comboBox_Function.Items.Add(MenuFuncs.WithSpaces(MenuFuncs.FUNCS[i]));
            }
            comboBox_Function.SelectedIndex = 0;

            // name
            textBox_Name.Text = name;

            // func
            func = MenuFuncs.WithSpaces(func);
            int fundIndex = comboBox_Function.Items.IndexOf(func);

            if (fundIndex != -1)
            {
                comboBox_Function.SelectedIndex = fundIndex;
            }
        }
 // Start is called before the first frame update
 void Start()
 {
     displayedGameTime = InGameStartTime;
     SceneLoader       = this.GetComponent <MenuFuncs>();
 }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     menuScript = GetComponent <MenuFuncs>();
 }