コード例 #1
0
ファイル: Form1.cs プロジェクト: TNTUP/D3GUI
 private void button1_Click(object sender, EventArgs e)
 {
     timedMessages tm = new timedMessages();
     tm.file = "Data\\Answer.txt";
     tm.Show();
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: TNTUP/D3GUI
        private void btnAddLua_Click(object sender, EventArgs e)
        {
            string fileName = "";
            string buttonName = "";
            DialogResult p = MessageBox.Show("Would you like to create a new script, or run an existing one? Yes for new.", "New LUA", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (p == DialogResult.Cancel)
                return;

            if (p == DialogResult.Yes) {
                SaveFileDialog newFile = new SaveFileDialog();
                newFile.InitialDirectory = serverProc.StartInfo.WorkingDirectory + "\\Lua\\";
                newFile.Filter = "Lua Scripts | *.lua";
                newFile.ShowDialog();
                fileName = newFile.FileName;

                StreamWriter sNewFile = new StreamWriter(newFile.FileName);
                sNewFile.Write(" ");
                sNewFile.Close();

                if (fileName == "")
                    return;
            }
            if (p == DialogResult.No) {
                OpenFileDialog newFile = new OpenFileDialog();
                newFile.InitialDirectory = serverProc.StartInfo.WorkingDirectory + "\\Lua\\";
                newFile.Filter = "Lua Scripts | *.lua";
                newFile.ShowDialog();
                fileName = newFile.FileName;

                if (fileName == "")
                    return;
            }
            buttonName = Microsoft.VisualBasic.Interaction.InputBox("Please give a name for the custom button", "Adding LUA");

            if (buttonName == "")
                return;

            DialogResult thisresult = MessageBox.Show("Would you like to edit the file now?", "Lua Add", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (thisresult == DialogResult.Yes) {
                timedMessages tm = new timedMessages();
                tm.file = fileName;
                tm.Show();
            }

            settingsReader rc;

            if (!File.Exists("GUI.ini"))
                rc = new settingsReader("GUI.ini", true);
            else {
                rc = new settingsReader("GUI.ini");
                rc.readSettings();
            }

            string oldButtons = "";

            if (rc.settings.ContainsKey("luas"))
                oldButtons = rc.settings["luas"];

            oldButtons += buttonName + "," + fileName + "|";
            rc.settings["luas"] = oldButtons;

            rc.saveSettings();

            addButton(buttonName, fileName);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: TNTUP/D3GUI
 private void btnUndo_Click(object sender, EventArgs e)
 {
     timedMessages tm = new timedMessages();
     tm.file = "Data\\Undo.txt";
     tm.Show();
 }