mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 15:54:25 +02:00
Made <system.token(str_tokenname)> and <system.button(str_buttonname)> constructs
This commit is contained in:
parent
32dba7e878
commit
39aaed5577
@ -99,20 +99,6 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub FormatText()
|
Private Sub FormatText()
|
||||||
Dim tokenSearchBuffer As String() = Me.Text.Split(CChar("<token."))
|
|
||||||
Dim tokenEndIdx As Integer = 0
|
|
||||||
Dim validToken As String = ""
|
|
||||||
Dim token As Token = Nothing
|
|
||||||
For Each possibleToken As String In tokenSearchBuffer
|
|
||||||
tokenEndIdx = possibleToken.IndexOf(">")
|
|
||||||
If Not tokenEndIdx = -1 Then
|
|
||||||
validToken = possibleToken.Substring(0, tokenEndIdx)
|
|
||||||
If Localization.LocalizationTokens.ContainsKey(validToken) = True Then
|
|
||||||
Me.Text = Me.Text.Replace("<token." & validToken & ">", Localization.GetString(validToken, validToken))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
Me.Text = Me.Text.Replace("<playername>", Core.Player.Name)
|
Me.Text = Me.Text.Replace("<playername>", Core.Player.Name)
|
||||||
Me.Text = Me.Text.Replace("<player.name>", Core.Player.Name)
|
Me.Text = Me.Text.Replace("<player.name>", Core.Player.Name)
|
||||||
|
|
||||||
|
@ -116,71 +116,6 @@
|
|||||||
result = result.Replace("<rivalname>", Core.Player.RivalName)
|
result = result.Replace("<rivalname>", Core.Player.RivalName)
|
||||||
result = result.Replace("<player.name>", Core.Player.RivalName)
|
result = result.Replace("<player.name>", Core.Player.RivalName)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim tokenSearchBuffer As String() = result.Split("<button.")
|
|
||||||
Dim tokenEndIdx As Integer = 0
|
|
||||||
Dim validToken As String = ""
|
|
||||||
For Each possibleToken As String In tokenSearchBuffer
|
|
||||||
tokenEndIdx = possibleToken.IndexOf(">")
|
|
||||||
If Not tokenEndIdx = -1 Then
|
|
||||||
Dim key As Keys
|
|
||||||
validToken = possibleToken.Substring(0, tokenEndIdx)
|
|
||||||
Select Case validToken.ToLower()
|
|
||||||
Case "moveforward"
|
|
||||||
key = KeyBindings.ForwardMoveKey
|
|
||||||
Case "moveleft"
|
|
||||||
key = KeyBindings.LeftMoveKey
|
|
||||||
Case "movebackward"
|
|
||||||
key = KeyBindings.BackwardMoveKey
|
|
||||||
Case "moveright"
|
|
||||||
key = KeyBindings.RightMoveKey
|
|
||||||
Case "openmenu"
|
|
||||||
key = KeyBindings.OpenInventoryKey
|
|
||||||
Case "chat"
|
|
||||||
key = KeyBindings.ChatKey
|
|
||||||
Case "special", "phone"
|
|
||||||
key = KeyBindings.SpecialKey
|
|
||||||
Case "muteaudio"
|
|
||||||
key = KeyBindings.MuteAudioKey
|
|
||||||
Case "cameraleft"
|
|
||||||
key = KeyBindings.LeftKey
|
|
||||||
Case "cameraright"
|
|
||||||
key = KeyBindings.RightKey
|
|
||||||
Case "cameraup"
|
|
||||||
key = KeyBindings.UpKey
|
|
||||||
Case "cameradown"
|
|
||||||
key = KeyBindings.DownKey
|
|
||||||
Case "cameralock"
|
|
||||||
key = KeyBindings.CameraLockKey
|
|
||||||
Case "guicontrol"
|
|
||||||
key = KeyBindings.GUIControlKey
|
|
||||||
Case "screenshot"
|
|
||||||
key = KeyBindings.ScreenshotKey
|
|
||||||
Case "debugcontrol"
|
|
||||||
key = KeyBindings.DebugKey
|
|
||||||
Case "perspectiveswitch"
|
|
||||||
key = KeyBindings.PerspectiveSwitchKey
|
|
||||||
Case "fullscreen"
|
|
||||||
key = KeyBindings.FullScreenKey
|
|
||||||
Case "enter1"
|
|
||||||
key = KeyBindings.EnterKey1
|
|
||||||
Case "enter2"
|
|
||||||
key = KeyBindings.EnterKey2
|
|
||||||
Case "back1"
|
|
||||||
key = KeyBindings.BackKey1
|
|
||||||
Case "back2"
|
|
||||||
key = KeyBindings.BackKey2
|
|
||||||
Case "escape", "esc"
|
|
||||||
key = KeyBindings.EscapeKey
|
|
||||||
Case "onlinestatus"
|
|
||||||
key = KeyBindings.OnlineStatusKey
|
|
||||||
Case "lighting"
|
|
||||||
key = KeyBindings.LightKey
|
|
||||||
End Select
|
|
||||||
result = result.Replace("<button." & validToken & ">", KeyBindings.GetKeyName(key))
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
Return result
|
Return result
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
@ -11,6 +11,70 @@
|
|||||||
Dim argument As String = GetSubClassArgumentPair(subClass).Argument
|
Dim argument As String = GetSubClassArgumentPair(subClass).Argument
|
||||||
|
|
||||||
Select Case command.ToLower()
|
Select Case command.ToLower()
|
||||||
|
Case "token"
|
||||||
|
Dim tokenName As String = Localization.GetString(argument)
|
||||||
|
Return tokenName
|
||||||
|
Case "button"
|
||||||
|
Dim key As Keys = Nothing
|
||||||
|
Dim buttonName As String = argument
|
||||||
|
Select Case buttonName.ToLower()
|
||||||
|
Case "moveforward"
|
||||||
|
key = KeyBindings.ForwardMoveKey
|
||||||
|
Case "moveleft"
|
||||||
|
key = KeyBindings.LeftMoveKey
|
||||||
|
Case "movebackward"
|
||||||
|
key = KeyBindings.BackwardMoveKey
|
||||||
|
Case "moveright"
|
||||||
|
key = KeyBindings.RightMoveKey
|
||||||
|
Case "openmenu"
|
||||||
|
key = KeyBindings.OpenInventoryKey
|
||||||
|
Case "chat"
|
||||||
|
key = KeyBindings.ChatKey
|
||||||
|
Case "special", "phone"
|
||||||
|
key = KeyBindings.SpecialKey
|
||||||
|
Case "muteaudio"
|
||||||
|
key = KeyBindings.MuteAudioKey
|
||||||
|
Case "cameraleft"
|
||||||
|
key = KeyBindings.LeftKey
|
||||||
|
Case "cameraright"
|
||||||
|
key = KeyBindings.RightKey
|
||||||
|
Case "cameraup"
|
||||||
|
key = KeyBindings.UpKey
|
||||||
|
Case "cameradown"
|
||||||
|
key = KeyBindings.DownKey
|
||||||
|
Case "cameralock"
|
||||||
|
key = KeyBindings.CameraLockKey
|
||||||
|
Case "guicontrol"
|
||||||
|
key = KeyBindings.GUIControlKey
|
||||||
|
Case "screenshot"
|
||||||
|
key = KeyBindings.ScreenshotKey
|
||||||
|
Case "debugcontrol"
|
||||||
|
key = KeyBindings.DebugKey
|
||||||
|
Case "perspectiveswitch"
|
||||||
|
key = KeyBindings.PerspectiveSwitchKey
|
||||||
|
Case "fullscreen"
|
||||||
|
key = KeyBindings.FullScreenKey
|
||||||
|
Case "enter1"
|
||||||
|
key = KeyBindings.EnterKey1
|
||||||
|
Case "enter2"
|
||||||
|
key = KeyBindings.EnterKey2
|
||||||
|
Case "back1"
|
||||||
|
key = KeyBindings.BackKey1
|
||||||
|
Case "back2"
|
||||||
|
key = KeyBindings.BackKey2
|
||||||
|
Case "escape", "esc"
|
||||||
|
key = KeyBindings.EscapeKey
|
||||||
|
Case "onlinestatus"
|
||||||
|
key = KeyBindings.OnlineStatusKey
|
||||||
|
Case "lighting"
|
||||||
|
key = KeyBindings.LightKey
|
||||||
|
Case "hidegui"
|
||||||
|
key = KeyBindings.GUIControlKey
|
||||||
|
End Select
|
||||||
|
If key <> Nothing Then
|
||||||
|
buttonName = KeyBindings.GetKeyName(key)
|
||||||
|
End If
|
||||||
|
Return buttonName
|
||||||
Case "random"
|
Case "random"
|
||||||
Dim minRange As Integer = 1
|
Dim minRange As Integer = 1
|
||||||
Dim maxRange As Integer = 2
|
Dim maxRange As Integer = 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user