예제 #1
0
        /// <summary>
        /// Show Error dialog
        /// </summary>
        /// <param name="sender">Use this</param>
        /// <param name="title">Dialog title</param>
        /// <param name="text"></param>
        public static void onError(object sender, string title, string text)
        {
            //MessageBox.Show(text + "\nFrom : " + sender.GetType().Name, title, MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            LamaDialog dialog = new LamaDialog(title, text + "\nFrom : " + sender.GetType().Name, FlatAlertBox._Kind.Error, MessageBoxButtons.OK);

            dialog.ShowDialog();
        }
예제 #2
0
        /// <summary>
        /// Load scripts list
        /// </summary>
        void loadScript()
        {
            Lama.log("NOTICE", "Load script list");
            cb_gameMode.Items.Clear();
            string scriptLocation = this.serverPath + @"GameData\Scripts\Modes\";

            if (tb_title.Text.Length > 3)
            {
                if (tb_title.Text.Contains("SM"))
                {
                    scriptLocation += @"ShootMania\";
                }
                else if (tb_title.Text.Contains("TM"))
                {
                    scriptLocation += @"TrackMania\";
                }
                else
                {
                    LamaDialog   d = new LamaDialog("Select game", "Unknow title : " + tb_title.Text + "\n Please select game :", FlatUITheme.FlatAlertBox._Kind.Info, LamaSpecialButtons.GameSlect);
                    DialogResult r = d.ShowDialog();
                    if (r == DialogResult.OK)
                    {
                        scriptLocation += @"TrackMania\";
                    }
                    else
                    {
                        scriptLocation += @"ShootMania\";
                    }
                }
            }
            IEnumerable <string> lst = Directory.EnumerateFiles(scriptLocation);

            foreach (string file in lst)
            {
                cb_gameMode.Items.Add(subsep(file, scriptLocation, ".Script"));
            }
        }