mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-09-25 19:09:00 +02:00
Updated variable names and set defaults
This commit is contained in:
parent
ad9e71a550
commit
3aad0934c9
@ -39,14 +39,15 @@ Public Class Presence
|
|||||||
' Description of fields is found here
|
' Description of fields is found here
|
||||||
' https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
|
' https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
|
||||||
|
|
||||||
Dim APP_Details As String = "" ' Defaults - DO NOT CHANGE
|
' Reset the local variables
|
||||||
Dim APP_State As String = "Playing Solo" ' Defaults - DO NOT CHANGE
|
Dim Presence_Details As String = Default_Details
|
||||||
Dim APP_LargeImageName As String = "default" ' Defaults - DO NOT CHANGE
|
Dim Presence_State As String = Default_State
|
||||||
Dim APP_LargeImageText As String = "Pokemon 3D" ' Defaults - DO NOT CHANGE
|
Dim Presence_LargeImageName As String = Default_LargeImageName
|
||||||
Dim APP_SmallImageName As String = "" ' Defaults - DO NOT CHANGE
|
Dim Presence_LargeImageText As String = Default_LargeImageText
|
||||||
Dim APP_SmallImageText As String = "" ' Defaults - DO NOT CHANGE
|
Dim Presence_SmallImageName As String = Default_SmallImageName
|
||||||
Dim APP_Party_Size As Integer = 0 ' Defaults - DO NOT CHANGE
|
Dim Presence_SmallImageText As String = Default_SmallImageText
|
||||||
Dim APP_Party_Size_Max As Integer = 0 ' Defaults - DO NOT CHANGE
|
Dim Presence_Party_Size As Integer = Default_Party_Size
|
||||||
|
Dim Presence_Party_Size_Max As Integer = Default_Party_Size_Max
|
||||||
|
|
||||||
' WHAT SHOULD THE FIELDS BE USED FOR?
|
' WHAT SHOULD THE FIELDS BE USED FOR?
|
||||||
'
|
'
|
||||||
@ -109,28 +110,28 @@ Public Class Presence
|
|||||||
PreviousMapLevel = CurrentMapLevel
|
PreviousMapLevel = CurrentMapLevel
|
||||||
End If
|
End If
|
||||||
CurrentMapLevelFileName = CurrentMapLevel.ToLower.Replace(" ", "_")
|
CurrentMapLevelFileName = CurrentMapLevel.ToLower.Replace(" ", "_")
|
||||||
APP_Details = "In " & CurrentMapLevel
|
Presence_Details = "In " & CurrentMapLevel
|
||||||
Logger.Log(Logger.LogTypes.Debug, "Presence.vb: CurrentMapLevelFileName: " & CurrentMapLevelFileName)
|
Logger.Log(Logger.LogTypes.Debug, "Presence.vb: CurrentMapLevelFileName: " & CurrentMapLevelFileName)
|
||||||
If CurrentMapLevelFileNames.Contains(CurrentMapLevelFileName) Then
|
If CurrentMapLevelFileNames.Contains(CurrentMapLevelFileName) Then
|
||||||
APP_LargeImageName = CurrentMapLevel.ToLower.Replace(" ", "_").Replace(".", "")
|
Presence_LargeImageName = CurrentMapLevel.ToLower.Replace(" ", "_").Replace(".", "")
|
||||||
APP_LargeImageText = CurrentMapLevel
|
Presence_LargeImageText = CurrentMapLevel
|
||||||
APP_SmallImageName = "default" ' Defaults - DO NOT CHANGE
|
Presence_SmallImageName = Default_LargeImageName ' When a map is show, icon should be moved to small
|
||||||
APP_SmallImageText = "Pokemon 3D" ' Defaults - DO NOT CHANGE
|
Presence_SmallImageText = Default_LargeImageText ' When a map is show, icon should be moved to small
|
||||||
End If
|
End If
|
||||||
ShouldUpdate = True
|
ShouldUpdate = True
|
||||||
ElseIf CurrentScreen IsNot PreviousScreen Then
|
ElseIf CurrentScreen IsNot PreviousScreen Then
|
||||||
PreviousScreen = CurrentScreen
|
PreviousScreen = CurrentScreen
|
||||||
ShouldUpdate = True
|
ShouldUpdate = True
|
||||||
If MenuScreens.Contains(CurrentScreen) Then
|
If MenuScreens.Contains(CurrentScreen) Then
|
||||||
APP_Details = "In the menus"
|
Presence_Details = "In the menus"
|
||||||
ElseIf PokedexScreens.Contains(CurrentScreen) Then
|
ElseIf PokedexScreens.Contains(CurrentScreen) Then
|
||||||
APP_Details = "In the Pokedex"
|
Presence_Details = "In the Pokédex"
|
||||||
ElseIf BattleScreens.Contains(CurrentScreen) Then
|
ElseIf BattleScreens.Contains(CurrentScreen) Then
|
||||||
APP_Details = "In a battle"
|
Presence_Details = "In a battle"
|
||||||
ElseIf InventoryScreens.Contains(CurrentScreen) Then
|
ElseIf InventoryScreens.Contains(CurrentScreen) Then
|
||||||
APP_Details = "In the inventory"
|
Presence_Details = "In the inventory"
|
||||||
ElseIf GameController.IS_DEBUG_ACTIVE = True Then
|
ElseIf GameController.IS_DEBUG_ACTIVE = True Then
|
||||||
APP_Details = "Debuging: " & CurrentScreen ' This is just for debug purposes
|
Presence_Details = "Debuging: " & CurrentScreen ' This is just for debug purposes
|
||||||
ShouldUpdate = True ' This is just for debug purposes
|
ShouldUpdate = True ' This is just for debug purposes
|
||||||
Else
|
Else
|
||||||
ShouldUpdate = False
|
ShouldUpdate = False
|
||||||
@ -138,26 +139,26 @@ Public Class Presence
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ServersManager.ServerConnection.Connected = True Then
|
If ServersManager.ServerConnection.Connected = True Then
|
||||||
APP_State = "Playing Multiplayer"
|
Presence_State = "Playing Multiplayer"
|
||||||
Else
|
Else
|
||||||
APP_State = "Playing Solo"
|
Presence_State = "Playing Solo"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim NewPresence As DiscordRichPresence = New DiscordRichPresence With {
|
Dim Presence As DiscordRichPresence = New DiscordRichPresence With {
|
||||||
.Details = APP_Details,
|
.Details = Presence_Details,
|
||||||
.State = APP_State,
|
.State = Presence_State,
|
||||||
.LargeImageKey = APP_LargeImageName,
|
.LargeImageKey = Presence_LargeImageName,
|
||||||
.LargeImageText = APP_LargeImageText,
|
.LargeImageText = Presence_LargeImageText,
|
||||||
.SmallImageKey = APP_SmallImageName,
|
.SmallImageKey = Presence_SmallImageName,
|
||||||
.SmallImageText = APP_SmallImageText,
|
.SmallImageText = Presence_SmallImageText,
|
||||||
.PartySize = APP_Party_Size,
|
.PartySize = Presence_Party_Size,
|
||||||
.PartyMax = APP_Party_Size_Max,
|
.PartyMax = Presence_Party_Size_Max,
|
||||||
.StartTimestamp = APP_StartTimestamp
|
.StartTimestamp = StartTimestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
If ShouldUpdate And Environment.Is64BitProcess = False Then
|
If ShouldUpdate And Environment.Is64BitProcess = False Then
|
||||||
Logger.Log(Logger.LogTypes.Message, "Presence.vb: Updating Discord Presence.")
|
Logger.Log(Logger.LogTypes.Message, "Presence.vb: Updating Discord Presence.")
|
||||||
Discord_UpdatePresence(NewPresence)
|
Discord_UpdatePresence(Presence)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user