Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Threading;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using HtmlAgilityPack;
- using System.Net;
- using System.Timers;
- namespace Daily_Organizer
- {
- public partial class MainWindow : Window
- {
- public bool N, Y, B;
- public Thickness NoBoard = new Thickness(0), YesBoard = new Thickness(1);
- public int BaseHeight = 15, BaseWidth = 150;
- public DateTime PSTZone;
- public List<DateTimeOffset> DragonTimes = null;
- public MainWindow()
- {
- InitializeComponent();
- DispatcherTimer Timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
- {
- LocalTime.Text = "Local " + DateTime.Now.ToShortTimeString();
- }, Dispatcher);
- DispatcherTimer PSTTimer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
- {
- PSTZone = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, "Pacific Standard Time");
- PSTTime.Text = "PST " + PSTZone.ToShortTimeString();
- }, Dispatcher);
- DispatcherTimer MabiTimer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
- {
- MabiTime.Text = string.Format("Mabi {0}", ErinnTime.Now.ToString("h:mm tt"));
- }, Dispatcher);
- N_TotalEXP.Text = Convert.ToString(UserSettings.Default.S_N_TotalEXP);
- PopulateDragonTimes();
- UpdateNele(null, EventArgs.Empty);
- Timer DragonRefresh = new Timer();
- DragonRefresh.Elapsed += UpdateDragonCount;
- DragonRefresh.Interval = 5000;
- DragonRefresh.Enabled = true;
- }
- public void PopulateDragonTimes()
- {
- DragonTimes = new List<DateTimeOffset>();
- DateTime DD_1 = new DateTime(2018, 01, 01, 10, 30, 00);
- DateTimeOffset DD_1_O = new DateTimeOffset(DD_1, new TimeSpan(-8, 0, 0));
- R_DD_1stLocal.Text = Convert.ToString(DD_1_O.ToLocalTime().ToString("h:mm tt"));
- DateTime DD_2 = new DateTime(2018, 01, 01, 17, 00, 00);
- DateTimeOffset DD_2_O = new DateTimeOffset(DD_2, new TimeSpan(-8, 0, 0));
- R_DD_2ndLocal.Text = Convert.ToString(DD_2_O.ToLocalTime().ToString("h:mm tt"));
- DateTime PD_1 = new DateTime(2018, 01, 01, 15, 00, 00);
- DateTimeOffset PD_1_O = new DateTimeOffset(PD_1, new TimeSpan(-8, 0, 0));
- R_PD_1stLocal.Text = Convert.ToString(PD_1_O.ToLocalTime().ToString("h:mm tt"));
- DateTime PD_2 = new DateTime(2018, 01, 01, 19, 00, 00);
- DateTimeOffset PD_2_O = new DateTimeOffset(PD_2, new TimeSpan(-8, 0, 0));
- R_PD_2ndLocal.Text = Convert.ToString(PD_2_O.ToLocalTime().ToString("h:mm tt"));
- DateTime RD_1 = new DateTime(2018, 01, 01, 16, 00, 00);
- DateTimeOffset RD_1_O = new DateTimeOffset(RD_1, new TimeSpan(-8, 0, 0));
- R_RD_1stLocal.Text = Convert.ToString(RD_1_O.ToLocalTime().ToString("h:mm tt"));
- DateTime RD_2 = new DateTime(2018, 01, 01, 21, 00, 00);
- DateTimeOffset RD_2_O = new DateTimeOffset(RD_2, new TimeSpan(-8, 0, 0));
- R_RD_2ndLocal.Text = Convert.ToString(RD_2_O.ToLocalTime().ToString("h:mm tt"));
- DateTime BD_1 = new DateTime(2018, 01, 01, 11, 00, 00);
- DateTimeOffset BD_1_O = new DateTimeOffset(BD_1, new TimeSpan(-8, 0, 0));
- R_BD_1stLocal.Text = Convert.ToString(BD_1_O.ToLocalTime().ToString("h:mm tt"));
- DateTime BD_2 = new DateTime(2018, 01, 01, 19, 00, 00);
- DateTimeOffset BD_2_O = new DateTimeOffset(BD_2, new TimeSpan(-8, 0, 0));
- R_BD_2ndLocal.Text = Convert.ToString(BD_2_O.ToLocalTime().ToString("h:mm tt"));
- DateTime WD_1 = new DateTime(2018, 01, 01, 11, 30, 00);
- DateTimeOffset WD_1_O = new DateTimeOffset(WD_1, new TimeSpan(-8, 0, 0));
- R_WD_1stLocal.Text = Convert.ToString(WD_1_O.ToLocalTime().ToString("h:mm tt"));
- DateTime WD_2 = new DateTime(2018, 01, 01, 19, 30, 00);
- DateTimeOffset WD_2_O = new DateTimeOffset(WD_2, new TimeSpan(-8, 0, 0));
- R_WD_2ndLocal.Text = Convert.ToString(WD_2_O.ToLocalTime().ToString("h:mm tt"));
- DragonTimes.Add(DD_1_O);
- DragonTimes.Add(DD_2_O);
- DragonTimes.Add(PD_1_O);
- DragonTimes.Add(PD_2_O);
- DragonTimes.Add(RD_1_O);
- DragonTimes.Add(RD_2_O);
- DragonTimes.Add(BD_1_O);
- DragonTimes.Add(BD_2_O);
- DragonTimes.Add(WD_1_O);
- DragonTimes.Add(WD_2_O);
- }
- public List<DateTime> SortAscending(List<DateTime> list)
- {
- list.Sort((a, b) => a.CompareTo(b));
- return list;
- }
- public void UpdateDragonCount(object sender, EventArgs e)
- {
- DateTime DD1 = Convert.ToDateTime(DragonTimes[0].LocalDateTime);
- DateTime DD2 = Convert.ToDateTime(DragonTimes[1].LocalDateTime);
- DateTime PD1 = Convert.ToDateTime(DragonTimes[2].LocalDateTime);
- DateTime PD2 = Convert.ToDateTime(DragonTimes[3].LocalDateTime);
- DateTime RD1 = Convert.ToDateTime(DragonTimes[4].LocalDateTime);
- DateTime RD2 = Convert.ToDateTime(DragonTimes[5].LocalDateTime);
- DateTime BD1 = Convert.ToDateTime(DragonTimes[6].LocalDateTime);
- DateTime BD2 = Convert.ToDateTime(DragonTimes[7].LocalDateTime);
- DateTime WD1 = Convert.ToDateTime(DragonTimes[8].LocalDateTime);
- DateTime WD2 = Convert.ToDateTime(DragonTimes[9].LocalDateTime);
- List<DateTime> DTimes = new List<DateTime>();
- List<string> DragonTimeNames = new List<string>();
- Application.Current.Dispatcher.Invoke(() =>
- {
- if (R_DesertDragon.IsChecked == true)
- {
- DTimes.Add(DD1);
- DTimes.Add(DD2);
- DragonTimeNames.Add("Desert Dragon");
- DragonTimeNames.Add("Desert Dragon");
- }
- if (R_PrairieDragon.IsChecked == true)
- {
- DTimes.Add(PD1);
- DTimes.Add(PD2);
- DragonTimeNames.Add("Prairie Dragon");
- DragonTimeNames.Add("Prairie Dragon");
- }
- if (R_RedDragon.IsChecked == true)
- {
- DTimes.Add(RD1);
- DTimes.Add(RD2);
- DragonTimeNames.Add("Red Dragon");
- DragonTimeNames.Add("Red Dragon");
- }
- if (R_BlackDragon.IsChecked == true)
- {
- DTimes.Add(BD1);
- DTimes.Add(BD2);
- DragonTimeNames.Add("Black Dragon");
- DragonTimeNames.Add("Black Dragon");
- }
- if (R_WhiteDragon.IsChecked == true)
- {
- DTimes.Add(WD1);
- DTimes.Add(WD2);
- DragonTimeNames.Add("White Dragon");
- DragonTimeNames.Add("White Dragon");
- }
- SortAscending(DTimes);
- if (DTimes.Count == 10)
- {
- ShowDDBoxes();
- ShowPDBoxes();
- ShowRDBoxes();
- ShowBDBoxes();
- ShowWDBoxes();
- }
- if (DTimes.Count == 9)
- {
- R_C_10.Text = null;
- }
- if (DTimes.Count == 8)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- ShowDDBoxes();
- ShowPDBoxes();
- ShowRDBoxes();
- ShowBDBoxes();
- R_C_10.Text = null;
- R_C_9.Text = null;
- }
- if (DTimes.Count == 7)
- {
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- }
- if (DTimes.Count == 6)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- ShowDDBoxes();
- ShowPDBoxes();
- ShowRDBoxes();
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- }
- if (DTimes.Count == 5)
- {
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- }
- if (DTimes.Count == 4)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- ShowDDBoxes();
- ShowPDBoxes();
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- R_C_5.Text = null;
- }
- if (DTimes.Count == 3)
- {
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- R_C_5.Text = null;
- R_C_4.Text = null;
- }
- if (DTimes.Count == 2)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- R_C_3.Width = 0;
- R_C_3.Height = 0;
- R_B_3.BorderThickness = NoBoard;
- ShowDDBoxes();
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- R_C_5.Text = null;
- R_C_4.Text = null;
- R_C_3.Text = null;
- }
- if (DTimes.Count == 1)
- {
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- R_C_5.Text = null;
- R_C_4.Text = null;
- R_C_3.Text = null;
- R_C_2.Text = null;
- }
- if (DTimes.Count == 0)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- R_C_3.Width = 0;
- R_C_3.Height = 0;
- R_B_3.BorderThickness = NoBoard;
- R_C_2.Width = 0;
- R_C_2.Height = 0;
- R_B_2.BorderThickness = NoBoard;
- R_C_1.Width = 0;
- R_C_1.Height = 0;
- R_B_1.BorderThickness = NoBoard;
- R_C_10.Text = null;
- R_C_9.Text = null;
- R_C_8.Text = null;
- R_C_7.Text = null;
- R_C_6.Text = null;
- R_C_5.Text = null;
- R_C_4.Text = null;
- R_C_3.Text = null;
- R_C_2.Text = null;
- R_C_1.Text = null;
- }
- if (DTimes.Count >= 1)
- {
- TimeSpan D1Remaining = DateTime.Now - DTimes[0];
- TimeSpan Time = new TimeSpan(23 - D1Remaining.Hours, 60 - D1Remaining.Minutes, 0);
- R_C_1.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 2)
- {
- TimeSpan D2Remaining = DateTime.Now - DTimes[1];
- TimeSpan Time = new TimeSpan(23 - D2Remaining.Hours, 60 - D2Remaining.Minutes, 0);
- R_C_2.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 3)
- {
- TimeSpan D3Remaining = DateTime.Now - DTimes[2];
- TimeSpan Time = new TimeSpan(23 - D3Remaining.Hours, 60 - D3Remaining.Minutes, 0);
- R_C_3.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 4)
- {
- TimeSpan D4Remaining = DateTime.Now - DTimes[3];
- TimeSpan Time = new TimeSpan(23 - D4Remaining.Hours, 60 - D4Remaining.Minutes, 0);
- R_C_4.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 5)
- {
- TimeSpan D5Remaining = DateTime.Now - DTimes[4];
- TimeSpan Time = new TimeSpan(23 - D5Remaining.Hours, 60 - D5Remaining.Minutes, 0);
- R_C_5.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 6)
- {
- TimeSpan D6Remaining = DateTime.Now - DTimes[5];
- TimeSpan Time = new TimeSpan(23 - D6Remaining.Hours, 60 - D6Remaining.Minutes, 0);
- R_C_6.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 7)
- {
- TimeSpan D7Remaining = DateTime.Now - DTimes[6];
- TimeSpan Time = new TimeSpan(23 - D7Remaining.Hours, 60 - D7Remaining.Minutes, 0);
- R_C_7.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 8)
- {
- TimeSpan D8Remaining = DateTime.Now - DTimes[7];
- TimeSpan Time = new TimeSpan(23 - D8Remaining.Hours, 60 - D8Remaining.Minutes, 0);
- R_C_8.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 9)
- {
- TimeSpan D9Remaining = DateTime.Now - DTimes[8];
- TimeSpan Time = new TimeSpan(23 - D9Remaining.Hours, 60 - D9Remaining.Minutes, 0);
- R_C_9.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- if (DTimes.Count >= 10)
- {
- TimeSpan D10Remaining = DateTime.Now - DTimes[9];
- TimeSpan Time = new TimeSpan(23 - D10Remaining.Hours, 60 - D10Remaining.Minutes, 0);
- R_C_10.Text = string.Format("{0}:{1}", Time.Hours, Time.Minutes.ToString("D2"));
- }
- try
- {
- int ShowCount = Convert.ToInt32(R_DragonCount.Text);
- if (ShowCount == 0)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- R_C_3.Width = 0;
- R_C_3.Height = 0;
- R_B_3.BorderThickness = NoBoard;
- R_C_2.Width = 0;
- R_C_2.Height = 0;
- R_B_2.BorderThickness = NoBoard;
- R_C_1.Width = 0;
- R_C_1.Height = 0;
- R_B_1.BorderThickness = NoBoard;
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 1)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- R_C_3.Width = 0;
- R_C_3.Height = 0;
- R_B_3.BorderThickness = NoBoard;
- ShowDDBoxes();
- R_C_2.Width = 0;
- R_C_2.Height = 0;
- R_B_2.BorderThickness = NoBoard;
- D_Dragon_Specific.Text = "Dragon";
- }
- if (ShowCount == 2)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- R_C_3.Width = 0;
- R_C_3.Height = 0;
- R_B_3.BorderThickness = NoBoard;
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 3)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- ShowPDBoxes();
- R_C_4.Width = 0;
- R_C_4.Height = 0;
- R_B_4.BorderThickness = NoBoard;
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 4)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- R_C_5.Width = 0;
- R_C_5.Height = 0;
- R_B_5.BorderThickness = NoBoard;
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 5)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- ShowRDBoxes();
- R_C_6.Width = 0;
- R_C_6.Height = 0;
- R_B_6.BorderThickness = NoBoard;
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 6)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- R_C_7.Width = 0;
- R_C_7.Height = 0;
- R_B_7.BorderThickness = NoBoard;
- ShowRDBoxes();
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 7)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- ShowBDBoxes();
- R_C_8.Width = 0;
- R_C_8.Height = 0;
- R_B_8.BorderThickness = NoBoard;
- ShowRDBoxes();
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 8)
- {
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- R_C_9.Width = 0;
- R_C_9.Height = 0;
- R_B_9.BorderThickness = NoBoard;
- ShowBDBoxes();
- ShowRDBoxes();
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 9)
- {
- ShowWDBoxes();
- R_C_10.Width = 0;
- R_C_10.Height = 0;
- R_B_10.BorderThickness = NoBoard;
- ShowBDBoxes();
- ShowRDBoxes();
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- if (ShowCount == 10)
- {
- ShowWDBoxes();
- ShowBDBoxes();
- ShowRDBoxes();
- ShowPDBoxes();
- ShowDDBoxes();
- D_Dragon_Specific.Text = "Dragons";
- }
- }
- catch
- {
- }
- });
- }
- public void ShowDDBoxes()
- {
- R_C_1.Width = BaseWidth;
- R_C_1.Height = BaseHeight;
- R_B_1.BorderThickness = YesBoard;
- R_C_2.Width = BaseWidth;
- R_C_2.Height = BaseHeight;
- R_B_2.BorderThickness = YesBoard;
- }
- public void ShowPDBoxes()
- {
- R_C_3.Width = BaseWidth;
- R_C_3.Height = BaseHeight;
- R_B_3.BorderThickness = YesBoard;
- R_C_4.Width = BaseWidth;
- R_C_4.Height = BaseHeight;
- R_B_4.BorderThickness = YesBoard;
- }
- public void ShowRDBoxes()
- {
- R_C_5.Width = BaseWidth;
- R_C_5.Height = BaseHeight;
- R_B_5.BorderThickness = YesBoard;
- R_C_6.Width = BaseWidth;
- R_C_6.Height = BaseHeight;
- R_B_6.BorderThickness = YesBoard;
- }
- public void ShowBDBoxes()
- {
- R_C_7.Width = BaseWidth;
- R_C_7.Height = BaseHeight;
- R_B_7.BorderThickness = YesBoard;
- R_C_8.Width = BaseWidth;
- R_C_8.Height = BaseHeight;
- R_B_8.BorderThickness = YesBoard;
- }
- public void ShowWDBoxes()
- {
- R_C_9.Width = BaseWidth;
- R_C_9.Height = BaseHeight;
- R_B_9.BorderThickness = YesBoard;
- R_C_10.Width = BaseWidth;
- R_C_10.Height = BaseHeight;
- R_B_10.BorderThickness = YesBoard;
- }
- /*
- public void FindDailies()
- {
- string HTML;
- using (var wc = new WebClient())
- {
- HTML = wc.DownloadString("https://wiki.mabinogiworld.com/");
- }
- var doc = new HtmlDocument();
- doc.LoadHtml(HTML);
- }
- */
- public void TopMostWindow(object sender, EventArgs e)
- {
- if (TopMostBox.IsChecked == true)
- {
- Topmost = true;
- foreach (Window window in Application.Current.Windows)
- {
- if (window.GetType().Name != this.GetType().Name)
- {
- window.Topmost = false;
- }
- }
- }
- else
- {
- Topmost = false;
- }
- }
- public void HSCongrats(object sender, EventArgs e)
- {
- if (HS_Mined.IsChecked == true)
- {
- HS_Congrats.Text = "Yay c:";
- HS_Completed.IsChecked = true;
- }
- else
- {
- HS_Congrats.Text = "Aww :c";
- HS_Completed.IsChecked = false;
- }
- }
- public void DanUpdate(object sender, EventArgs e)
- {
- if (D_Box.IsChecked == true)
- {
- D_Complete.Text = "Huzzah!";
- Dan_Completed.IsChecked = true;
- }
- else
- {
- D_Complete.Text = "Riparino...";
- Dan_Completed.IsChecked = false;
- }
- }
- public void AlbanUpdate(object sender, EventArgs e)
- {
- int Count = 0;
- if (A_1stRun.IsChecked == true)
- {
- Count++;
- }
- if (A_2ndRun.IsChecked == true)
- {
- Count++;
- }
- if (A_3rdRun.IsChecked == true)
- {
- Count++;
- }
- if (Count == 3)
- {
- A_Completed.IsChecked = true;
- }
- if (Count <= 2 && Count >= 1)
- {
- A_Completed.IsChecked = null;
- }
- if (Count == 0)
- {
- A_Completed.IsChecked = false;
- }
- }
- public void LordUpdate(object sender, EventArgs e)
- {
- int Count = 0;
- if (L_1stRun.IsChecked == true)
- {
- Count++;
- }
- if (L_2ndRun.IsChecked == true)
- {
- Count++;
- }
- if (L_3rdRun.IsChecked == true)
- {
- Count++;
- }
- if (Count == 3)
- {
- L_Completed.IsChecked = true;
- }
- if (Count <= 2 && Count >= 1)
- {
- L_Completed.IsChecked = null;
- }
- if (Count == 0)
- {
- L_Completed.IsChecked = false;
- }
- }
- public void CheckForCompletion()
- {
- if (N_Completed.IsChecked == true)
- {
- RenownBox.IsChecked = null;
- }
- }
- public void UpdateStoneAmounts(object sender, EventArgs e)
- {
- try
- {
- long Stones = Convert.ToInt64(HS_Stones.Text);
- long Maint = Convert.ToInt64(HS_Maint.Text);
- HS_10Days.Text = Convert.ToString(Stones + (100 - (Maint * 10)));
- HS_30Days.Text = Convert.ToString(Stones + (300 - (Maint * 30)));
- HS_365Days.Text = Convert.ToString(Stones + (3650 - (Maint * 365)));
- }
- catch
- {
- }
- }
- public void Add2000NeleEXP(object sender, EventArgs e)
- {
- double NewTotal = Convert.ToDouble(N_TotalEXP.Text);
- N_TotalEXP.Text = Convert.ToString(NewTotal + 2000);
- N_Completed.IsChecked = true;
- UpdateNele(null, EventArgs.Empty);
- CheckForCompletion();
- }
- public void AddNeleEXP(object sender, EventArgs e)
- {
- double NewTotal = Convert.ToDouble(N_TotalEXP.Text);
- double AmntToAdd = Convert.ToDouble(N_EXPToAdd.Text);
- N_TotalEXP.Text = Convert.ToString(NewTotal + AmntToAdd);
- UpdateNele(null, EventArgs.Empty);
- }
- public void UpdateNele(object sender, EventArgs e)
- {
- try
- {
- int Level = CheckLevel(Convert.ToDouble(N_TotalEXP.Text));
- N_CurrentLevel.Text = Convert.ToString(Level);
- float N_CurrentBonusFloat = CheckNeleBonus(Level);
- N_CurrentBonus.Text = string.Format("Current: +{0}%", N_CurrentBonusFloat);
- double N_EXPNeeded = CheckEXPNeeded(Level);
- N_EXPToNext.Text = Convert.ToString(N_EXPNeeded);
- double EXPNeeded = 414040 - Convert.ToDouble(N_TotalEXP.Text);
- double Days = Math.Ceiling(EXPNeeded / 2000);
- if (Days < 0)
- {
- Days = 0;
- }
- N_TimeNeeded.Text = string.Format(Convert.ToString(Days) + " Days");
- N = false;
- Y = false;
- B = false;
- }
- catch
- {
- }
- }
- public double CheckEXPNeeded(int Lvl)
- {
- double TotalEXP = Convert.ToDouble(N_TotalEXP.Text);
- switch (Lvl)
- {
- case 1:
- return (100 - TotalEXP);
- case 2:
- return (300 - TotalEXP);
- case 3:
- return (700 - TotalEXP);
- case 4:
- return (1300 - TotalEXP);
- case 5:
- return (2100 - TotalEXP);
- case 6:
- return (3100 - TotalEXP);
- case 7:
- return (4300 - TotalEXP);
- case 8:
- return (6100 - TotalEXP);
- case 9:
- return (8100 - TotalEXP);
- case 10:
- return (10200 - TotalEXP);
- case 11:
- return (12400 - TotalEXP);
- case 12:
- return (14700 - TotalEXP);
- case 13:
- return (17100 - TotalEXP);
- case 14:
- return (19900 - TotalEXP);
- case 15:
- return (23380 - TotalEXP);
- case 16:
- return (27220 - TotalEXP);
- case 17:
- return (31420 - TotalEXP);
- case 18:
- return (36000 - TotalEXP);
- case 19:
- return (40960 - TotalEXP);
- case 20:
- return (46320 - TotalEXP);
- case 21:
- return (52080 - TotalEXP);
- case 22:
- return (58260 - TotalEXP);
- case 23:
- return (64860 - TotalEXP);
- case 24:
- return (71900 - TotalEXP);
- case 25:
- return (79400 - TotalEXP);
- case 26:
- return (87340 - TotalEXP);
- case 27:
- return (97540 - TotalEXP);
- case 28:
- return (104620 - TotalEXP);
- case 29:
- return (113980 - TotalEXP);
- case 30:
- return (123820 - TotalEXP);
- case 31:
- return (134160 - TotalEXP);
- case 32:
- return (145020 - TotalEXP);
- case 33:
- return (156380 - TotalEXP);
- case 34:
- return (168260 - TotalEXP);
- case 35:
- return (180680 - TotalEXP);
- case 36:
- return (193640 - TotalEXP);
- case 37:
- return (207140 - TotalEXP);
- case 38:
- return (221180 - TotalEXP);
- case 39:
- return (235780 - TotalEXP);
- case 40:
- return (250940 - TotalEXP);
- case 41:
- return (266680 - TotalEXP);
- case 42:
- return (283000 - TotalEXP);
- case 43:
- return (299900 - TotalEXP);
- case 44:
- return (317400 - TotalEXP);
- case 45:
- return (335500 - TotalEXP);
- case 46:
- return (354200 - TotalEXP);
- case 47:
- return (373520 - TotalEXP);
- case 48:
- return (393460 - TotalEXP);
- case 49:
- return (414040 - TotalEXP);
- default:
- return 0;
- }
- }
- public float CheckNeleBonus(int Lvl)
- {
- switch (Lvl)
- {
- case 1:
- return 0f;
- case 2:
- return 0.15f;
- case 3:
- return 0.3f;
- case 4:
- return 0.45f;
- case 5:
- return 0.75f;
- case 6:
- return 0.9f;
- case 7:
- return 1.25f;
- case 8:
- return 1.4f;
- case 9:
- return 1.55f;
- case 10:
- return 1.75f;
- case 11:
- return 1.9f;
- case 12:
- return 2.05f;
- case 13:
- return 2.2f;
- case 14:
- return 2.35f;
- case 15:
- return 2.75f;
- case 16:
- return 2.9f;
- case 17:
- return 3.05f;
- case 18:
- return 3.2f;
- case 19:
- return 3.35f;
- case 20:
- return 3.75f;
- case 21:
- return 3.85f;
- case 22:
- return 3.95f;
- case 23:
- return 4.05f;
- case 24:
- return 4.15f;
- case 25:
- return 4.25f;
- case 26:
- return 4.35f;
- case 27:
- return 4.45f;
- case 28:
- return 4.55f;
- case 29:
- return 4.65f;
- case 30:
- return 5f;
- case 31:
- return 5.1f;
- case 32:
- return 5.2f;
- case 33:
- return 5.3f;
- case 34:
- return 5.4f;
- case 35:
- return 5.5f;
- case 36:
- return 5.6f;
- case 37:
- return 5.7f;
- case 38:
- return 5.8f;
- case 39:
- return 5.9f;
- case 40:
- return 6.25f;
- case 41:
- return 6.35f;
- case 42:
- return 6.45f;
- case 43:
- return 6.55f;
- case 44:
- return 6.65f;
- case 45:
- return 6.75f;
- case 46:
- return 6.85f;
- case 47:
- return 6.95f;
- case 48:
- return 7.05f;
- case 49:
- return 7.15f;
- case 50:
- return 7.5f;
- default:
- return 0f;
- }
- }
- public int CheckLevel(double Number)
- {
- if (Number >= 0 && Number < 100)
- {
- return 1;
- }
- if (Number >= 100 && Number < 300)
- {
- return 2;
- }
- if (Number >= 300 && Number < 700)
- {
- return 3;
- }
- if (Number >= 700 && Number < 1300)
- {
- return 4;
- }
- if (Number >= 1300 && Number < 2100)
- {
- return 5;
- }
- if (Number >= 2100 && Number < 3200)
- {
- return 6;
- }
- if (Number >= 3200 && Number < 4300)
- {
- return 7;
- }
- if (Number >= 4300 && Number < 6100)
- {
- return 8;
- }
- if (Number >= 6100 && Number < 8100)
- {
- return 9;
- }
- if (Number >= 8100 && Number < 10200)
- {
- return 10;
- }
- if (Number >= 10200 && Number < 12400)
- {
- return 11;
- }
- if (Number >= 12400 && Number < 14700)
- {
- return 12;
- }
- if (Number >= 14700 && Number < 17100)
- {
- return 13;
- }
- if (Number >= 17100 && Number < 19900)
- {
- return 14;
- }
- if (Number >= 19900 && Number < 23380)
- {
- return 15;
- }
- if (Number >= 23380 && Number < 27220)
- {
- return 16;
- }
- if (Number >= 27220 && Number < 31420)
- {
- return 17;
- }
- if (Number >= 31420 && Number < 36000)
- {
- return 18;
- }
- if (Number >= 36000 && Number < 40960)
- {
- return 19;
- }
- if (Number >= 40960 && Number < 46320)
- {
- return 20;
- }
- if (Number >= 46320 && Number < 52080)
- {
- return 21;
- }
- if (Number >= 52080 && Number < 58260)
- {
- return 22;
- }
- if (Number >= 58260 && Number < 64860)
- {
- return 23;
- }
- if (Number >= 64860 && Number < 71900)
- {
- return 24;
- }
- if (Number >= 71900 && Number < 79400)
- {
- return 25;
- }
- if (Number >= 79400 && Number < 87340)
- {
- return 26;
- }
- if (Number >= 87340 && Number < 95740)
- {
- return 27;
- }
- if (Number >= 95740 && Number < 104620)
- {
- return 28;
- }
- if (Number >= 104620 && Number < 113980)
- {
- return 29;
- }
- if (Number >= 113980 && Number < 123820)
- {
- return 30;
- }
- if (Number >= 123820 && Number < 134160)
- {
- return 31;
- }
- if (Number >= 134160 && Number < 145020)
- {
- return 32;
- }
- if (Number >= 145020 && Number < 156380)
- {
- return 33;
- }
- if (Number >= 156380 && Number < 168260)
- {
- return 34;
- }
- if (Number >= 168260 && Number < 180680)
- {
- return 35;
- }
- if (Number >= 180680 && Number < 193640)
- {
- return 36;
- }
- if (Number >= 193640 && Number < 207140)
- {
- return 37;
- }
- if (Number >= 207140 && Number < 221180)
- {
- return 38;
- }
- if (Number >= 221180 && Number < 235780)
- {
- return 39;
- }
- if (Number >= 235780 && Number < 250940)
- {
- return 40;
- }
- if (Number >= 250940 && Number < 266680)
- {
- return 41;
- }
- if (Number >= 266680 && Number < 283000)
- {
- return 42;
- }
- if (Number >= 283000 && Number < 299900)
- {
- return 43;
- }
- if (Number >= 299900 && Number < 317400)
- {
- return 44;
- }
- if (Number >= 317400 && Number < 335500)
- {
- return 45;
- }
- if (Number >= 335500 && Number < 354200)
- {
- return 46;
- }
- if (Number >= 354200 && Number < 373520)
- {
- return 47;
- }
- if (Number >= 373520 && Number < 393460)
- {
- return 48;
- }
- if (Number >= 393460 && Number < 414040)
- {
- return 49;
- }
- if (Number >= 414040)
- {
- return 50;
- }
- else
- {
- return 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement