From 0f4819d6f5ab5ff3f4bc4ea9d3b9db9a0260d882 Mon Sep 17 00:00:00 2001
From: dotcomboom <38927017+dotcomboom@users.noreply.github.com>
Date: Sat, 1 Apr 2023 13:25:11 -0500
Subject: [PATCH 1/2] Add own application ID stuff
---
Mario Kart Wii Rich Presence Redux/App.config | 6 +
.../Mario Kart Wii Rich Presence Redux.vbproj | 10 ++
.../My Project/Application.Designer.vb | 10 +-
.../My Project/Application.myapp | 5 +-
.../My Project/AssemblyInfo.vb | 8 +-
.../My Project/Settings.Designer.vb | 24 ++++
.../My Project/Settings.settings | 6 +
.../frmMain.Designer.vb | 55 +++++---
Mario Kart Wii Rich Presence Redux/frmMain.vb | 42 +++++-
.../frmOwnRPC.Designer.vb | 102 ++++++++++++++
.../frmOwnRPC.resx | 126 ++++++++++++++++++
.../frmOwnRPC.vb | 3 +
12 files changed, 362 insertions(+), 35 deletions(-)
create mode 100644 Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
create mode 100644 Mario Kart Wii Rich Presence Redux/frmOwnRPC.resx
create mode 100644 Mario Kart Wii Rich Presence Redux/frmOwnRPC.vb
diff --git a/Mario Kart Wii Rich Presence Redux/App.config b/Mario Kart Wii Rich Presence Redux/App.config
index 0b7007c..8eac3d9 100644
--- a/Mario Kart Wii Rich Presence Redux/App.config
+++ b/Mario Kart Wii Rich Presence Redux/App.config
@@ -19,6 +19,12 @@
0000-0000-0000
+
+ False
+
+
+
+
\ No newline at end of file
diff --git a/Mario Kart Wii Rich Presence Redux/Mario Kart Wii Rich Presence Redux.vbproj b/Mario Kart Wii Rich Presence Redux/Mario Kart Wii Rich Presence Redux.vbproj
index e16bb28..dbc0d55 100644
--- a/Mario Kart Wii Rich Presence Redux/Mario Kart Wii Rich Presence Redux.vbproj
+++ b/Mario Kart Wii Rich Presence Redux/Mario Kart Wii Rich Presence Redux.vbproj
@@ -97,10 +97,17 @@
frmMain.vb
Form
+
+ frmOwnRPC.vb
+
+
+ Form
+
True
Application.myapp
+ True
True
@@ -117,6 +124,9 @@
frmMain.vb
+
+ frmOwnRPC.vb
+
VbMyResourcesResXFileCodeGenerator
Resources.Designer.vb
diff --git a/Mario Kart Wii Rich Presence Redux/My Project/Application.Designer.vb b/Mario Kart Wii Rich Presence Redux/My Project/Application.Designer.vb
index 59e3a32..2e1b114 100644
--- a/Mario Kart Wii Rich Presence Redux/My Project/Application.Designer.vb
+++ b/Mario Kart Wii Rich Presence Redux/My Project/Application.Designer.vb
@@ -13,15 +13,15 @@ Option Explicit On
Namespace My
-
+
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'
Partial Friend Class MyApplication
-
- _
+
+ _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
@@ -29,8 +29,8 @@ Namespace My
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
-
- _
+
+ _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.Mario_Kart_Wii_Rich_Presence_Redux.frmMain
End Sub
diff --git a/Mario Kart Wii Rich Presence Redux/My Project/Application.myapp b/Mario Kart Wii Rich Presence Redux/My Project/Application.myapp
index 1243847..739ea6f 100644
--- a/Mario Kart Wii Rich Presence Redux/My Project/Application.myapp
+++ b/Mario Kart Wii Rich Presence Redux/My Project/Application.myapp
@@ -1,11 +1,10 @@
true
- Form1
+ frmMain
false
0
true
0
- 0
true
-
+
\ No newline at end of file
diff --git a/Mario Kart Wii Rich Presence Redux/My Project/AssemblyInfo.vb b/Mario Kart Wii Rich Presence Redux/My Project/AssemblyInfo.vb
index ec19de9..4542168 100644
--- a/Mario Kart Wii Rich Presence Redux/My Project/AssemblyInfo.vb
+++ b/Mario Kart Wii Rich Presence Redux/My Project/AssemblyInfo.vb
@@ -9,10 +9,10 @@ Imports System.Runtime.InteropServices
' Review the values of the assembly attributes
-
+
-
+
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/Mario Kart Wii Rich Presence Redux/My Project/Settings.Designer.vb b/Mario Kart Wii Rich Presence Redux/My Project/Settings.Designer.vb
index d479645..6b63200 100644
--- a/Mario Kart Wii Rich Presence Redux/My Project/Settings.Designer.vb
+++ b/Mario Kart Wii Rich Presence Redux/My Project/Settings.Designer.vb
@@ -89,6 +89,30 @@ Namespace My
Me("addText") = value
End Set
End Property
+
+ _
+ Public Property useOwnApp() As Boolean
+ Get
+ Return CType(Me("useOwnApp"),Boolean)
+ End Get
+ Set
+ Me("useOwnApp") = value
+ End Set
+ End Property
+
+ _
+ Public Property userAppId() As String
+ Get
+ Return CType(Me("userAppId"),String)
+ End Get
+ Set
+ Me("userAppId") = value
+ End Set
+ End Property
End Class
End Namespace
diff --git a/Mario Kart Wii Rich Presence Redux/My Project/Settings.settings b/Mario Kart Wii Rich Presence Redux/My Project/Settings.settings
index b4c27e5..9827ce2 100644
--- a/Mario Kart Wii Rich Presence Redux/My Project/Settings.settings
+++ b/Mario Kart Wii Rich Presence Redux/My Project/Settings.settings
@@ -11,5 +11,11 @@
0000-0000-0000
+
+ False
+
+
+
+
\ No newline at end of file
diff --git a/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb b/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
index 9be947d..aa81408 100644
--- a/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
+++ b/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
@@ -39,6 +39,7 @@ Partial Class frmMain
Me.Label2 = New System.Windows.Forms.Label()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
+ Me.useOwnApp = New System.Windows.Forms.CheckBox()
CType(Me.WebView21, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
@@ -54,34 +55,34 @@ Partial Class frmMain
Me.WebView21.Name = "WebView21"
Me.WebView21.Size = New System.Drawing.Size(0, 380)
Me.WebView21.Source = New System.Uri("https://wiimmfi.de/stats/mkw", System.UriKind.Absolute)
- Me.WebView21.TabIndex = 1
+ Me.WebView21.TabIndex = 13
Me.WebView21.Visible = False
Me.WebView21.ZoomFactor = 1.0R
'
'lblAddText
'
Me.lblAddText.AutoSize = True
- Me.lblAddText.Location = New System.Drawing.Point(11, 9)
+ Me.lblAddText.Location = New System.Drawing.Point(12, 9)
Me.lblAddText.Name = "lblAddText"
- Me.lblAddText.Size = New System.Drawing.Size(166, 15)
- Me.lblAddText.TabIndex = 2
- Me.lblAddText.Text = "Additional text or Friend Code"
+ Me.lblAddText.Size = New System.Drawing.Size(85, 15)
+ Me.lblAddText.TabIndex = 1
+ Me.lblAddText.Text = "Additional text"
'
'txtAddText
'
Me.txtAddText.Location = New System.Drawing.Point(14, 27)
Me.txtAddText.Name = "txtAddText"
Me.txtAddText.Size = New System.Drawing.Size(260, 23)
- Me.txtAddText.TabIndex = 3
+ Me.txtAddText.TabIndex = 2
'
'lvInfos
'
Me.lvInfos.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2})
Me.lvInfos.HideSelection = False
- Me.lvInfos.Location = New System.Drawing.Point(16, 213)
+ Me.lvInfos.Location = New System.Drawing.Point(14, 213)
Me.lvInfos.Name = "lvInfos"
- Me.lvInfos.Size = New System.Drawing.Size(259, 154)
- Me.lvInfos.TabIndex = 8
+ Me.lvInfos.Size = New System.Drawing.Size(260, 154)
+ Me.lvInfos.TabIndex = 10
Me.lvInfos.UseCompatibleStateImageBehavior = False
Me.lvInfos.View = System.Windows.Forms.View.Details
'
@@ -99,8 +100,8 @@ Partial Class frmMain
'
Me.txtUserURL.Location = New System.Drawing.Point(14, 81)
Me.txtUserURL.Name = "txtUserURL"
- Me.txtUserURL.Size = New System.Drawing.Size(259, 23)
- Me.txtUserURL.TabIndex = 11
+ Me.txtUserURL.Size = New System.Drawing.Size(260, 23)
+ Me.txtUserURL.TabIndex = 4
'
'lnkList
'
@@ -108,26 +109,26 @@ Partial Class frmMain
Me.lnkList.Location = New System.Drawing.Point(11, 63)
Me.lnkList.Name = "lnkList"
Me.lnkList.Size = New System.Drawing.Size(114, 15)
- Me.lnkList.TabIndex = 12
+ Me.lnkList.TabIndex = 3
Me.lnkList.TabStop = True
Me.lnkList.Tag = ""
Me.lnkList.Text = "Wiimmfi Profile URL"
'
'btnSaveUpdate
'
- Me.btnSaveUpdate.Location = New System.Drawing.Point(198, 119)
+ Me.btnSaveUpdate.Location = New System.Drawing.Point(198, 110)
Me.btnSaveUpdate.Name = "btnSaveUpdate"
Me.btnSaveUpdate.Size = New System.Drawing.Size(75, 23)
- Me.btnSaveUpdate.TabIndex = 13
+ Me.btnSaveUpdate.TabIndex = 6
Me.btnSaveUpdate.Text = "Save"
Me.btnSaveUpdate.UseVisualStyleBackColor = True
'
'lblTutorial
'
- Me.lblTutorial.Location = New System.Drawing.Point(13, 154)
+ Me.lblTutorial.Location = New System.Drawing.Point(13, 136)
Me.lblTutorial.Name = "lblTutorial"
Me.lblTutorial.Size = New System.Drawing.Size(263, 52)
- Me.lblTutorial.TabIndex = 17
+ Me.lblTutorial.TabIndex = 7
Me.lblTutorial.Text = "To get the profile URL, find your friend code on the linked Wiimmfi page during a" &
" match, right click the 👁 icon and copy the link."
'
@@ -136,7 +137,7 @@ Partial Class frmMain
Me.btnOpenClose.Location = New System.Drawing.Point(199, 373)
Me.btnOpenClose.Name = "btnOpenClose"
Me.btnOpenClose.Size = New System.Drawing.Size(76, 23)
- Me.btnOpenClose.TabIndex = 18
+ Me.btnOpenClose.TabIndex = 12
Me.btnOpenClose.Text = ">> Expand"
Me.btnOpenClose.UseVisualStyleBackColor = True
'
@@ -147,7 +148,7 @@ Partial Class frmMain
Me.lnkGithub.Location = New System.Drawing.Point(13, 377)
Me.lnkGithub.Name = "lnkGithub"
Me.lnkGithub.Size = New System.Drawing.Size(43, 15)
- Me.lnkGithub.TabIndex = 20
+ Me.lnkGithub.TabIndex = 11
Me.lnkGithub.TabStop = True
Me.lnkGithub.Text = "Github"
'
@@ -157,7 +158,7 @@ Partial Class frmMain
Me.chkShare.Location = New System.Drawing.Point(14, 110)
Me.chkShare.Name = "chkShare"
Me.chkShare.Size = New System.Drawing.Size(128, 19)
- Me.chkShare.TabIndex = 21
+ Me.chkShare.TabIndex = 5
Me.chkShare.Text = "Share link on status"
Me.chkShare.UseVisualStyleBackColor = True
'
@@ -177,7 +178,7 @@ Partial Class frmMain
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.ReadOnly = True
Me.TextBox2.Size = New System.Drawing.Size(92, 23)
- Me.TextBox2.TabIndex = 5
+ Me.TextBox2.TabIndex = 99999
Me.TextBox2.Visible = False
'
'TextBox3
@@ -186,15 +187,26 @@ Partial Class frmMain
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.ReadOnly = True
Me.TextBox3.Size = New System.Drawing.Size(49, 23)
- Me.TextBox3.TabIndex = 9
+ Me.TextBox3.TabIndex = 9999
Me.TextBox3.Visible = False
'
+ 'useOwnApp
+ '
+ Me.useOwnApp.AutoSize = True
+ Me.useOwnApp.Location = New System.Drawing.Point(14, 188)
+ Me.useOwnApp.Name = "useOwnApp"
+ Me.useOwnApp.Size = New System.Drawing.Size(176, 19)
+ Me.useOwnApp.TabIndex = 9
+ Me.useOwnApp.Text = "Use own Discord application"
+ Me.useOwnApp.UseVisualStyleBackColor = True
+ '
'frmMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(290, 401)
+ Me.Controls.Add(Me.useOwnApp)
Me.Controls.Add(Me.chkShare)
Me.Controls.Add(Me.lnkGithub)
Me.Controls.Add(Me.btnOpenClose)
@@ -236,4 +248,5 @@ Partial Class frmMain
Friend WithEvents Label2 As Label
Friend WithEvents TextBox2 As TextBox
Friend WithEvents TextBox3 As TextBox
+ Friend WithEvents useOwnApp As CheckBox
End Class
diff --git a/Mario Kart Wii Rich Presence Redux/frmMain.vb b/Mario Kart Wii Rich Presence Redux/frmMain.vb
index 7cb55c5..1c4a876 100644
--- a/Mario Kart Wii Rich Presence Redux/frmMain.vb
+++ b/Mario Kart Wii Rich Presence Redux/frmMain.vb
@@ -10,6 +10,8 @@ Public Class frmMain
Private small_image As String = ""
Private party_size As Integer = 0
+ Public default_app_id = "662481965840072717"
+
Private client As DiscordRpcClient
Private Async Sub WebView21_NavigationCompletedAsync(sender As Object, e As Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs) Handles WebView21.NavigationCompleted
@@ -125,7 +127,7 @@ Public Class frmMain
End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ Private Sub Form1_Load() Handles MyBase.Load
If My.Settings.startUrl.AbsolutePath = "about:blank" Then
My.Settings.startUrl = New Uri("https://wiimmfi.de/stats/mkw/room/p")
End If
@@ -134,12 +136,30 @@ Public Class frmMain
WebView21.Source = My.Settings.startUrl
txtAddText.Text = My.Settings.addText
- client = New DiscordRpcClient("662481965840072717")
+ useOwnApp.Checked = My.Settings.useOwnApp
+
+ init_client()
+ End Sub
+ Private Sub init_client()
+ If My.Settings.useOwnApp Then
+ Try
+ client = New DiscordRpcClient(My.Settings.userAppId)
+ Catch ex As Exception
+ MsgBox(ex.Message & "\r\nUsing own application ID has been disabled.", MsgBoxStyle.Exclamation)
+ client = New DiscordRpcClient(default_app_id)
+ End Try
+ Else
+ client = New DiscordRpcClient(default_app_id)
+ End If
+
client.Logger = New ConsoleLogger() With {
.Level = LogLevel.Warning
}
client.Initialize()
+ If Not client.IsInitialized Then
+ MsgBox("There could be an issue with the provided client ID, or you don't have Discord running.")
+ End If
client.SetPresence(New RichPresence() With {
.Details = "MKW-RPRedux active",
.State = "Starting up (or configuring)",
@@ -184,4 +204,22 @@ Public Class frmMain
Private Sub chkShare_CheckedChanged(sender As Object, e As EventArgs) Handles chkShare.CheckedChanged
My.Settings.shareBtn = chkShare.Checked
End Sub
+
+ Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles useOwnApp.Click
+ If useOwnApp.Checked Then
+ frmOwnRPC.ClientId.Text = My.Settings.userAppId
+ If frmOwnRPC.ShowDialog = DialogResult.OK Then
+ My.Settings.userAppId = frmOwnRPC.ClientId.Text
+ Else
+ useOwnApp.Checked = False
+ End If
+ End If
+ If My.Settings.userAppId = "" Then
+ useOwnApp.Checked = False
+ End If
+ My.Settings.useOwnApp = useOwnApp.Checked
+ client.ClearPresence()
+ client.Dispose()
+ init_client()
+ End Sub
End Class
diff --git a/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
new file mode 100644
index 0000000..4e0fbaa
--- /dev/null
+++ b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
@@ -0,0 +1,102 @@
+ _
+Partial Class frmOwnRPC
+ Inherits System.Windows.Forms.Form
+
+ 'Form overrides dispose to clean up the component list.
+ _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Required by the Windows Form Designer
+ Private components As System.ComponentModel.IContainer
+
+ 'NOTE: The following procedure is required by the Windows Form Designer
+ 'It can be modified using the Windows Form Designer.
+ 'Do not modify it using the code editor.
+ _
+ Private Sub InitializeComponent()
+ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmOwnRPC))
+ Me.ClientId = New System.Windows.Forms.TextBox()
+ Me.Button1 = New System.Windows.Forms.Button()
+ Me.Button2 = New System.Windows.Forms.Button()
+ Me.Caption = New System.Windows.Forms.RichTextBox()
+ Me.SuspendLayout()
+ '
+ 'ClientId
+ '
+ Me.ClientId.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.ClientId.Location = New System.Drawing.Point(12, 96)
+ Me.ClientId.Name = "ClientId"
+ Me.ClientId.Size = New System.Drawing.Size(591, 23)
+ Me.ClientId.TabIndex = 0
+ '
+ 'Button1
+ '
+ Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.Button1.DialogResult = System.Windows.Forms.DialogResult.OK
+ Me.Button1.Location = New System.Drawing.Point(516, 125)
+ Me.Button1.Name = "Button1"
+ Me.Button1.Size = New System.Drawing.Size(87, 27)
+ Me.Button1.TabIndex = 1
+ Me.Button1.Text = "OK"
+ Me.Button1.UseVisualStyleBackColor = True
+ '
+ 'Button2
+ '
+ Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Me.Button2.Location = New System.Drawing.Point(423, 125)
+ Me.Button2.Name = "Button2"
+ Me.Button2.Size = New System.Drawing.Size(87, 27)
+ Me.Button2.TabIndex = 2
+ Me.Button2.Text = "Cancel"
+ Me.Button2.UseVisualStyleBackColor = True
+ '
+ 'Caption
+ '
+ Me.Caption.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.Caption.BackColor = System.Drawing.SystemColors.Control
+ Me.Caption.BorderStyle = System.Windows.Forms.BorderStyle.None
+ Me.Caption.Cursor = System.Windows.Forms.Cursors.IBeam
+ Me.Caption.Location = New System.Drawing.Point(12, 10)
+ Me.Caption.Name = "Caption"
+ Me.Caption.ReadOnly = True
+ Me.Caption.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None
+ Me.Caption.Size = New System.Drawing.Size(591, 79)
+ Me.Caption.TabIndex = 4
+ Me.Caption.Text = resources.GetString("Caption.Text")
+ '
+ 'frmOwnRPC
+ '
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.ClientSize = New System.Drawing.Size(615, 164)
+ Me.Controls.Add(Me.Caption)
+ Me.Controls.Add(Me.Button2)
+ Me.Controls.Add(Me.Button1)
+ Me.Controls.Add(Me.ClientId)
+ Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
+ Me.MaximizeBox = False
+ Me.MinimizeBox = False
+ Me.Name = "frmOwnRPC"
+ Me.Text = "Discord application setup"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+
+ Friend WithEvents ClientId As TextBox
+ Friend WithEvents Button1 As Button
+ Friend WithEvents Button2 As Button
+ Friend WithEvents Caption As RichTextBox
+End Class
diff --git a/Mario Kart Wii Rich Presence Redux/frmOwnRPC.resx b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.resx
new file mode 100644
index 0000000..b52543a
--- /dev/null
+++ b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Create an application at https://discord.com/developers/applications with the game name you'd like to display (default is Mario Kart Wii), and upload images to the Rich Presence Assets section as from https://github.com/dotcomboom/mkwii-presence/tree/master/discord-assets.
+
+Enter or confirm the Application ID below, or leave it blank to use MKWii-RPRedux's default.
+
+
+
\ No newline at end of file
diff --git a/Mario Kart Wii Rich Presence Redux/frmOwnRPC.vb b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.vb
new file mode 100644
index 0000000..50dfa72
--- /dev/null
+++ b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.vb
@@ -0,0 +1,3 @@
+Public Class frmOwnRPC
+
+End Class
\ No newline at end of file
From 4b9c254e1476939c1b38bffc5238998a717ed066 Mon Sep 17 00:00:00 2001
From: dotcomboom <38927017+dotcomboom@users.noreply.github.com>
Date: Mon, 3 Apr 2023 22:48:02 -0500
Subject: [PATCH 2/2] Fix tab order in application ID dialog, rename some
controls
---
.../frmMain.Designer.vb | 38 ++++++-------
Mario Kart Wii Rich Presence Redux/frmMain.vb | 24 ++++-----
.../frmOwnRPC.Designer.vb | 53 ++++++++++---------
3 files changed, 58 insertions(+), 57 deletions(-)
diff --git a/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb b/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
index aa81408..104487a 100644
--- a/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
+++ b/Mario Kart Wii Rich Presence Redux/frmMain.Designer.vb
@@ -23,7 +23,7 @@ Partial Class frmMain
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
- Me.WebView21 = New Microsoft.Web.WebView2.WinForms.WebView2()
+ Me.webView = New Microsoft.Web.WebView2.WinForms.WebView2()
Me.lblAddText = New System.Windows.Forms.Label()
Me.txtAddText = New System.Windows.Forms.TextBox()
Me.lvInfos = New System.Windows.Forms.ListView()
@@ -40,24 +40,24 @@ Partial Class frmMain
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.useOwnApp = New System.Windows.Forms.CheckBox()
- CType(Me.WebView21, System.ComponentModel.ISupportInitialize).BeginInit()
+ CType(Me.webView, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
- 'WebView21
+ 'webView
'
- Me.WebView21.AllowExternalDrop = True
- Me.WebView21.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
+ Me.webView.AllowExternalDrop = True
+ Me.webView.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.WebView21.CreationProperties = Nothing
- Me.WebView21.DefaultBackgroundColor = System.Drawing.Color.White
- Me.WebView21.Location = New System.Drawing.Point(296, 9)
- Me.WebView21.Name = "WebView21"
- Me.WebView21.Size = New System.Drawing.Size(0, 380)
- Me.WebView21.Source = New System.Uri("https://wiimmfi.de/stats/mkw", System.UriKind.Absolute)
- Me.WebView21.TabIndex = 13
- Me.WebView21.Visible = False
- Me.WebView21.ZoomFactor = 1.0R
+ Me.webView.CreationProperties = Nothing
+ Me.webView.DefaultBackgroundColor = System.Drawing.Color.White
+ Me.webView.Location = New System.Drawing.Point(296, 9)
+ Me.webView.Name = "webView"
+ Me.webView.Size = New System.Drawing.Size(0, 380)
+ Me.webView.Source = New System.Uri("https://wiimmfi.de/stats/mkw", System.UriKind.Absolute)
+ Me.webView.TabIndex = 13
+ Me.webView.Visible = False
+ Me.webView.ZoomFactor = 1.0R
'
'lblAddText
'
@@ -195,9 +195,9 @@ Partial Class frmMain
Me.useOwnApp.AutoSize = True
Me.useOwnApp.Location = New System.Drawing.Point(14, 188)
Me.useOwnApp.Name = "useOwnApp"
- Me.useOwnApp.Size = New System.Drawing.Size(176, 19)
+ Me.useOwnApp.Size = New System.Drawing.Size(193, 19)
Me.useOwnApp.TabIndex = 9
- Me.useOwnApp.Text = "Use own Discord application"
+ Me.useOwnApp.Text = "Use custom Discord application"
Me.useOwnApp.UseVisualStyleBackColor = True
'
'frmMain
@@ -220,19 +220,19 @@ Partial Class frmMain
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.txtAddText)
Me.Controls.Add(Me.lblAddText)
- Me.Controls.Add(Me.WebView21)
+ Me.Controls.Add(Me.webView)
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "frmMain"
Me.Text = "MKWii-RPRedux"
- CType(Me.WebView21, System.ComponentModel.ISupportInitialize).EndInit()
+ CType(Me.webView, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
- Friend WithEvents WebView21 As Microsoft.Web.WebView2.WinForms.WebView2
+ Friend WithEvents webView As Microsoft.Web.WebView2.WinForms.WebView2
Friend WithEvents lblAddText As Label
Friend WithEvents txtAddText As TextBox
Friend WithEvents lvInfos As ListView
diff --git a/Mario Kart Wii Rich Presence Redux/frmMain.vb b/Mario Kart Wii Rich Presence Redux/frmMain.vb
index 1c4a876..fe20623 100644
--- a/Mario Kart Wii Rich Presence Redux/frmMain.vb
+++ b/Mario Kart Wii Rich Presence Redux/frmMain.vb
@@ -14,22 +14,22 @@ Public Class frmMain
Private client As DiscordRpcClient
- Private Async Sub WebView21_NavigationCompletedAsync(sender As Object, e As Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs) Handles WebView21.NavigationCompleted
- TextBox3.Text = WebView21.Source.AbsoluteUri
+ Private Async Sub UpdateRPC() Handles webView.NavigationCompleted
+ TextBox3.Text = webView.Source.AbsoluteUri
'get profile url
Dim rgx As Regex = New Regex("p([0-9])+")
- Dim matches = rgx.Matches(WebView21.Source.AbsoluteUri)
+ Dim matches = rgx.Matches(webView.Source.AbsoluteUri)
'CheckBox1.Checked = matches.Count > 0
If matches.Count > 0 Then
- TextBox2.Text = WebView21.Source.AbsoluteUri
- My.Settings.startUrl = WebView21.Source
+ TextBox2.Text = webView.Source.AbsoluteUri
+ My.Settings.startUrl = webView.Source
'scraping :)
' N64 Sherbet Land (Nintendo)
Dim html As String
- html = Await WebView21.ExecuteScriptAsync("document.documentElement.outerHTML;")
+ html = Await webView.ExecuteScriptAsync("document.documentElement.outerHTML;")
' "The Html comes back with unicode character codes, other escaped characters, and
' wrapped in double quotes, so I'm using this code to clean it up for what I'm doing."
@@ -133,7 +133,7 @@ Public Class frmMain
End If
chkShare.Checked = My.Settings.shareBtn
txtUserURL.Text = My.Settings.startUrl.AbsoluteUri
- WebView21.Source = My.Settings.startUrl
+ webView.Source = My.Settings.startUrl
txtAddText.Text = My.Settings.addText
useOwnApp.Checked = My.Settings.useOwnApp
@@ -145,7 +145,7 @@ Public Class frmMain
Try
client = New DiscordRpcClient(My.Settings.userAppId)
Catch ex As Exception
- MsgBox(ex.Message & "\r\nUsing own application ID has been disabled.", MsgBoxStyle.Exclamation)
+ MsgBox(ex.Message & vbNewLine & "Using own application ID has been disabled.", MsgBoxStyle.Exclamation)
client = New DiscordRpcClient(default_app_id)
End Try
Else
@@ -171,9 +171,9 @@ Public Class frmMain
})
End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnSaveUpdate.Click
+ Private Sub btnSaveUpdate_Click(sender As Object, e As EventArgs) Handles btnSaveUpdate.Click
My.Settings.addText = txtAddText.Text
- WebView21.CoreWebView2.Navigate(txtUserURL.Text)
+ webView.CoreWebView2.Navigate(txtUserURL.Text)
End Sub
Private Sub lnkList_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lnkList.LinkClicked
@@ -194,7 +194,7 @@ Public Class frmMain
Me.FormBorderStyle = FormBorderStyle.Sizable
btnOpenClose.Text = "<< Retract"
End If
- WebView21.Visible = Me.Tag = "expanded"
+ webView.Visible = Me.Tag = "expanded"
End Sub
Private Sub LinkGithub_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lnkGithub.LinkClicked
@@ -205,7 +205,7 @@ Public Class frmMain
My.Settings.shareBtn = chkShare.Checked
End Sub
- Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles useOwnApp.Click
+ Private Sub useOwnApp_CheckedChanged(sender As Object, e As EventArgs) Handles useOwnApp.Click
If useOwnApp.Checked Then
frmOwnRPC.ClientId.Text = My.Settings.userAppId
If frmOwnRPC.ShowDialog = DialogResult.OK Then
diff --git a/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
index 4e0fbaa..e8aa669 100644
--- a/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
+++ b/Mario Kart Wii Rich Presence Redux/frmOwnRPC.Designer.vb
@@ -24,8 +24,8 @@ Partial Class frmOwnRPC
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmOwnRPC))
Me.ClientId = New System.Windows.Forms.TextBox()
- Me.Button1 = New System.Windows.Forms.Button()
- Me.Button2 = New System.Windows.Forms.Button()
+ Me.btnOK = New System.Windows.Forms.Button()
+ Me.btnCancel = New System.Windows.Forms.Button()
Me.Caption = New System.Windows.Forms.RichTextBox()
Me.SuspendLayout()
'
@@ -36,29 +36,29 @@ Partial Class frmOwnRPC
Me.ClientId.Location = New System.Drawing.Point(12, 96)
Me.ClientId.Name = "ClientId"
Me.ClientId.Size = New System.Drawing.Size(591, 23)
- Me.ClientId.TabIndex = 0
+ Me.ClientId.TabIndex = 1
'
- 'Button1
+ 'btnOK
'
- Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.Button1.DialogResult = System.Windows.Forms.DialogResult.OK
- Me.Button1.Location = New System.Drawing.Point(516, 125)
- Me.Button1.Name = "Button1"
- Me.Button1.Size = New System.Drawing.Size(87, 27)
- Me.Button1.TabIndex = 1
- Me.Button1.Text = "OK"
- Me.Button1.UseVisualStyleBackColor = True
+ Me.btnOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK
+ Me.btnOK.Location = New System.Drawing.Point(516, 125)
+ Me.btnOK.Name = "btnOK"
+ Me.btnOK.Size = New System.Drawing.Size(87, 27)
+ Me.btnOK.TabIndex = 3
+ Me.btnOK.Text = "OK"
+ Me.btnOK.UseVisualStyleBackColor = True
'
- 'Button2
+ 'btnCancel
'
- Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel
- Me.Button2.Location = New System.Drawing.Point(423, 125)
- Me.Button2.Name = "Button2"
- Me.Button2.Size = New System.Drawing.Size(87, 27)
- Me.Button2.TabIndex = 2
- Me.Button2.Text = "Cancel"
- Me.Button2.UseVisualStyleBackColor = True
+ Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Me.btnCancel.Location = New System.Drawing.Point(423, 125)
+ Me.btnCancel.Name = "btnCancel"
+ Me.btnCancel.Size = New System.Drawing.Size(87, 27)
+ Me.btnCancel.TabIndex = 2
+ Me.btnCancel.Text = "Cancel"
+ Me.btnCancel.UseVisualStyleBackColor = True
'
'Caption
'
@@ -72,17 +72,18 @@ Partial Class frmOwnRPC
Me.Caption.ReadOnly = True
Me.Caption.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None
Me.Caption.Size = New System.Drawing.Size(591, 79)
- Me.Caption.TabIndex = 4
+ Me.Caption.TabIndex = 0
Me.Caption.Text = resources.GetString("Caption.Text")
'
'frmOwnRPC
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(615, 164)
Me.Controls.Add(Me.Caption)
- Me.Controls.Add(Me.Button2)
- Me.Controls.Add(Me.Button1)
+ Me.Controls.Add(Me.btnCancel)
+ Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.ClientId)
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
@@ -96,7 +97,7 @@ Partial Class frmOwnRPC
End Sub
Friend WithEvents ClientId As TextBox
- Friend WithEvents Button1 As Button
- Friend WithEvents Button2 As Button
+ Friend WithEvents btnOK As Button
+ Friend WithEvents btnCancel As Button
Friend WithEvents Caption As RichTextBox
End Class