forked from Buttys/ReDevPro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.cs
More file actions
74 lines (65 loc) · 3.31 KB
/
MainForm.cs
File metadata and controls
74 lines (65 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using CefSharp;
using ReDevPro.Components;
using System;
using System.Windows.Forms;
namespace ReDevPro
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
Cef.Initialize(new CefSettings()); //required for cefsharp to work, only needs to be called once
//Add web tabs
WebTab Chat = new WebTab("https://discord.gg/zUqJTYP") { Text = "Chat" };
WebTab News = new WebTab("https://ygodevpro.com/forum/index.php/Board/14-Announcements/") { Text = "News" };
WebTab BugTracker = new WebTab("https://ygodevpro.com/forum/bugs/") { Text = "BugTracker" };
IntPtr h = MainTabControl.Handle; //required for insert to work
MainTabControl.TabPages.Insert(0, Chat);
MainTabControl.TabPages.Insert(1, News);
MainTabControl.TabPages.Insert(2, BugTracker);
MainTabControl.SelectedIndex = 0;
//Server Select
ServerSelect.Items.Add("LocalHost");
ServerSelect.SelectedIndex = 0;
//options
AddOptions();
YGOProOptionsControl.ItemCheck += UpdateOptions;
}
private void AddOptions()
{
YGOProOptionsControl.Items.Add("Auto Placement", Config.GetBool("Auto Placement", true));
YGOProOptionsControl.Items.Add("Auto Chain", Config.GetBool("Auto Chain", true));
YGOProOptionsControl.Items.Add("Random Placement", Config.GetBool("Auto-Placement", false));
YGOProOptionsControl.Items.Add("Enable User Covers", Config.GetBool("Enable User Covers", true));
YGOProOptionsControl.Items.Add("No Chain Delay", Config.GetBool("No Chain Delay", false));
YGOProOptionsControl.Items.Add("Mute Opponents", Config.GetBool("Mute Opponents", false));
YGOProOptionsControl.Items.Add("Mute Spectators", Config.GetBool("Mute Spectators", false));
YGOProOptionsControl.Items.Add("Save Last Replay", Config.GetBool("Save Last Replay", true));
YGOProOptionsControl.Items.Add("Mouse Mode", Config.GetBool("Mouse Mode", false));
YGOProOptionsControl.Items.Add("Hide Setnames", Config.GetBool("Hide Setnames", false));
YGOProOptionsControl.Items.Add("Hide Chain Buttons", Config.GetBool("Hide Chain Buttons", false));
YGOProOptionsControl.Items.Add("Old Replay Mode", Config.GetBool("Old Replay Mode", true));
YGOProOptionsControl.Items.Add("Enable Sound", Config.GetBool("Enable Sound", true));
YGOProOptionsControl.Items.Add("Enable Music", Config.GetBool("Enable Music", true));
YGOProOptionsControl.Items.Add("Enable Direct X", Config.GetBool("Enable Direct X", false));
}
private void UpdateOptions(object sender, ItemCheckEventArgs e)
{
Config.UpdateBool(YGOProOptionsControl.SelectedItem.ToString(), e.NewValue == CheckState.Checked);
}
private void DeckEditBtn_Click(object sender, EventArgs e)
{
YGOProHelper.OpenDeckEdit();
}
private void ReplayBtn_Click(object sender, EventArgs e)
{
YGOProHelper.OpenReplays();
}
private void AiBtn_Click(object sender, EventArgs e)
{
YGOProHelper.OpenAI();
}
}
}