Ejemplo n.º 1
0
        public Main()
        {
            InitializeComponent();
            config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
            bool dontupdate = false;
            if (config != null)
            {
                // it's stored as string, what is fasted yescompare?
                if (config.AppSettings.Settings.AllKeys.Contains("useEquipped") && config.AppSettings.Settings["useEquipped"].Value == true.ToString())
                {
                    useRunesCheck.Checked = true;
                    useEquipped = true;
                }
                // this?
                if (Main.config.AppSettings.Settings.AllKeys.Contains("noupdate"))
                    bool.TryParse(Main.config.AppSettings.Settings["noupdate"].Value, out dontupdate);

            }

            runes = new RuneControl[] { runeControl1, runeControl2, runeControl3, runeControl4, runeControl5, runeControl6 };
            var sorter = new ListViewSort();
            sorter.OnColumnClick(MonPriority.Index);
            listView1.ListViewItemSorter = sorter;
            listView2.ListViewItemSorter = new ListViewSort();

            sorter = new ListViewSort();
            sorter.OnColumnClick(0);
            listView5.ListViewItemSorter = sorter;

            if (!dontupdate)
            {
                Task.Factory.StartNew(() =>
                {
                    using (WebClient client = new WebClient())
                    {
                        client.DownloadStringCompleted += client_DownloadStringCompleted;
                        client.DownloadStringAsync(new Uri("https://raw.github.com/Skibisky/RuneManager/master/version.txt"));
                    }
                });
            }
            else
            {
                updateBox.Show();
                updateComplain.Text = "Updates Disabled";
                var ver = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
                string oldvernum = ver.ProductVersion;
                updateCurrent.Text = "Current: " + oldvernum;
                updateNew.Text = "";
            }

            for (int i = 0; i < 11; i++)
            {
                ToolStripItem it = new ToolStripMenuItem(i.ToString() + (i > 0 ? " (" + Math.Ceiling(i * 1.5).ToString() + "%)" : ""));
                it.Tag = (int)Math.Floor(i * 1.5);
                it.Click += ShrineClickSpeed;
                speedToolStripMenuItem.DropDownItems.Add(it);
            }
        }
Ejemplo n.º 2
0
        private void rune_Click(object sender, EventArgs e)
        {
            ResetRuneClicked();

            RuneControl tc = ((RuneControl)sender);

            tc.Gamma = 1.4f;
            tc.Refresh();

            var ind = runes.ToList().IndexOf(tc) + 1;

            RuneSelected = ind;
            if (alwaysShowBases || (ind > 0 && tc.Tag != null))
            {
                RuneClick?.Invoke(sender, new RuneClickEventArgs(ind, (Rune)tc.Tag));
            }
        }
Ejemplo n.º 3
0
        public Main()
        {
            InitializeComponent();
            config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
            if (config != null)
            {
                // it's stored as string, what is fasted yescompare?
                if (config.AppSettings.Settings.AllKeys.Contains("useEquipped") && config.AppSettings.Settings["useEquipped"].Value == true.ToString())
                {
                    useRunesCheck.Checked = true;
                    useEquipped           = true;
                }
            }

            runes = new RuneControl[] { runeControl1, runeControl2, runeControl3, runeControl4, runeControl5, runeControl6 };
            var sorter = new ListViewSort();

            sorter.OnColumnClick(MonPriority.Index);
            listView1.ListViewItemSorter = sorter;
            listView2.ListViewItemSorter = new ListViewSort();

            sorter = new ListViewSort();
            sorter.OnColumnClick(0);
            listView5.ListViewItemSorter = sorter;

            Task.Factory.StartNew(() =>
            {
                using (WebClient client = new WebClient())
                {
                    client.DownloadStringCompleted += client_DownloadStringCompleted;
                    client.DownloadStringAsync(new Uri("https://raw.github.com/Skibisky/RuneManager/master/version.txt"));
                }
            });

            for (int i = 0; i < 11; i++)
            {
                ToolStripItem it = new ToolStripMenuItem(i.ToString() + (i > 0 ? " (" + Math.Ceiling(i * 1.5).ToString() + "%)" : ""));
                it.Tag    = (int)Math.Floor(i * 1.5);
                it.Click += ShrineClickSpeed;
                speedToolStripMenuItem.DropDownItems.Add(it);
            }
        }
Ejemplo n.º 4
0
        private void rune_Click(object sender, EventArgs e)
        {
            foreach (RuneControl t in runes)
            {
                t.Gamma = 1;
                t.Refresh();
            }

            RuneControl tc = ((RuneControl)sender);

            if (tc.Tag != null)
            {
                tc.Gamma = 1.4f;
                tc.Refresh();
                rune_Stats((Rune)tc.Tag);
                runeBox.Show();
                runeShown.SetRune((Rune)tc.Tag);
            }
            else
            {
                tc.Hide();
                runeBox.Hide();
            }
        }