-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Warp.World integration which can be setup and enabled from Set…
…tings > Warp World Settings
- Loading branch information
1 parent
0eed8c2
commit 206b2ae
Showing
12 changed files
with
678 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace MarioMaker2OCR | ||
{ | ||
public partial class FormWarpWorld : Form | ||
{ | ||
public FormWarpWorld() | ||
{ | ||
InitializeComponent(); | ||
txtUsername.Text = Properties.Settings.Default.WarpWorldUsername; | ||
txtToken.Text = Properties.Settings.Default.WarpWorldToken; | ||
txtWarpBarURL.Text = String.Format("https://warp.world/warpbar-queue?streamer={0}&key={1}", txtUsername.Text, txtToken.Text); | ||
chkWarpWorld.Checked = Properties.Settings.Default.WarpWorldEnabled; | ||
|
||
if(!chkWarpWorld.Checked) | ||
{ | ||
txtWarpBarURL.Enabled = false; | ||
} | ||
} | ||
|
||
private void TxtWarpBarURL_TextChanged(object sender, EventArgs e) | ||
{ | ||
if (txtWarpBarURL.Text.Contains("streamer=")) | ||
{ | ||
txtUsername.Text = txtWarpBarURL.Text.Split(new String[] { "streamer=" }, StringSplitOptions.None)[1].Split('&')[0]; | ||
} | ||
|
||
if (txtWarpBarURL.Text.Contains("key=")) | ||
{ | ||
txtToken.Text = txtWarpBarURL.Text.Split(new String[] { "key=" }, StringSplitOptions.None)[1].Split('&')[0]; | ||
} | ||
|
||
// Possible the token size will change, but its a good validation for now | ||
if(txtUsername.TextLength > 2 && txtToken.TextLength == 16) | ||
{ | ||
Properties.Settings.Default.WarpWorldUsername = txtUsername.Text; | ||
Properties.Settings.Default.WarpWorldToken = txtToken.Text; | ||
Properties.Settings.Default.Save(); | ||
|
||
} | ||
} | ||
|
||
private void ChkWarpWorld_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
txtWarpBarURL.Enabled = chkWarpWorld.Checked; | ||
Properties.Settings.Default.WarpWorldEnabled = chkWarpWorld.Checked; | ||
Properties.Settings.Default.Save(); | ||
} | ||
} | ||
} |
Oops, something went wrong.