Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            var login = new ManyKey("Login", "Nick:", "", "Server:", "myserver.com");

            if (login.ShowDialog() != true)
            {
                Exit_Click(null, null);
                return;
            }

            mainWindow = this;

            nick   = login.Results[0];
            server = login.Results[1];

            nick = nick.Replace(" ", "_").Replace(",", "_").Replace("/", "_");

            if (nick.ToLower().StartsWith("gm"))
            {
                gm_mode = true;
            }

            CreateBackgroundWorker(HandleHost, OnHostEvent);
            CreateBackgroundWorker(HandleTimer, OnTimerElapsed);

            vs1.CustomInit();
            map1.CustomInit();
            map2.CustomInit();
            map2.SetGiveTarget(map1);

            partyInfo1.CustomInit("Wounds");
            partyInfo2.CustomInit("Consumables");
        }
Exemplo n.º 2
0
        void SearchSheet_Click(object sender, RoutedEventArgs e)
        {
            ManyKey dlg = new ManyKey("Search Sheets", "Search For:", "");

            if (dlg.ShowDialog() == true)
            {
                var pattern = dlg.Results[0];
                OpenAndIterateSheets((string file, StringBuilder errors) => (new SheetImporter()).SearchSheet(file, pattern, errors));
            }
        }
Exemplo n.º 3
0
        void ChangeNick_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new ManyKey("What do you want your new nickname to be?", "Nick:", nick);

            if (dlg.ShowDialog() == true)
            {
                nick = dlg.Results[0].Replace(" ", "_");

                SendIrc("nick " + nick);
                SendHost("nick " + nick);
            }
        }
Exemplo n.º 4
0
        internal void PromptNewMap()
        {
            var dlg = new ManyKey("New Map", "Name:", "");

            if (dlg.ShowDialog() == true)
            {
                string name = dlg.Results[0].Replace(" ", "_").Replace("/", "_");

                name = "_maps/" + name;

                MakeNewMap(name);
            }
        }
Exemplo n.º 5
0
        void DownloadSheet_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new ManyKey("Enter your download PIN/Password", "PIN:", "");

            if (dlg.ShowDialog() == true)
            {
                string k = dlg.Results[0];

                SendHost("dir _gameaid/_filenames");
                k = k.Replace("/", "_").Replace(" ", "_");
                SendHost(String.Format("download-dir {0}", k));

                lastPin = k;
            }
        }
Exemplo n.º 6
0
        void AddBotToChatroom_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new ManyKey("What chatroom do you want the bot to join?", "Chatroom:", mychannel);

            if (dlg.ShowDialog() == true)
            {
                string k = dlg.Results[0];

                if (!k.StartsWith("#"))
                {
                    k = "#" + k;
                }

                k.Replace(" ", "");
                SendHost(String.Format("join {0}", k));
            }
        }
Exemplo n.º 7
0
        void ChangeChatroom_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new ManyKey("What chatroom do you want room commands to go to?", "Chatroom:", botchannel);

            if (dlg.ShowDialog() == true)
            {
                string channel = dlg.Results[0].Replace(" ", "_");

                if (!channel.StartsWith("#"))
                {
                    channel = "#" + channel;
                }

                SendHost(String.Format("room {0}", channel));
                SendIrc(String.Format("join {0}", channel));
                miniIrc.SwitchToRoom(channel);
                botchannel = channel;
                SendHost("dir _party");
                SendHost("dir _gameaid/_remote");
            }
        }