Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Plain Craft Launcher 2/Modules/ModEvent.vb
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ Public Class CustomEvent
End Sub

''' <summary>
''' 获取自定义变量的值。若不存在这个变量则返回 Nothing
''' 获取自定义变量的值。若不存在这个变量则返回指定的 defaultValue
''' </summary>
Public Shared Function GetCustomVariable(name As String) As String
Public Shared Function GetCustomVariable(name As String, Optional defaultValue As String = "") As String
If States.CustomVariables.ContainsKey(name) Then Return States.CustomVariables(name)
Return Nothing
Return defaultValue
End Function

''' <summary>
Expand Down
4 changes: 2 additions & 2 deletions Plain Craft Launcher 2/Modules/ModMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,8 @@ NextFile:
text = text.RegexReplaceEach("\{hint\}", Function() replacer(PageToolsTest.GetRandomHint()))
text = text.RegexReplaceEach("\{cave\}", Function() replacer(PageToolsTest.GetRandomCave()))
text = text.RegexReplaceEach("\{setup:([a-zA-Z0-9]+)\}", Function(m) replacer(Setup.GetSafe(m.Groups(1).Value, McInstanceSelected)))
text = text.RegexReplaceEach("\{varible:([^\}]+)\}", Function(m) replacer(CustomEvent.GetCustomVariable(m.Groups(1).Value)))
text = text.RegexReplaceEach("\{variable:([^\}]+)\}", Function(m) replacer(CustomEvent.GetCustomVariable(m.Groups(1).Value)))
text = text.RegexReplaceEach("\{varible:([^:\}]+)(?::([^\}]+))?\}", Function(m) replacer(CustomEvent.GetCustomVariable(m.Groups(1).Value, m.Groups(2).Value)))
text = text.RegexReplaceEach("\{variable:([^:\}]+)(?::([^\}]+))?\}", Function(m) replacer(CustomEvent.GetCustomVariable(m.Groups(1).Value, m.Groups(2).Value)))
Return text
End Function
#End Region
Expand Down
Binary file modified Plain Craft Launcher 2/Resources/Help.zip
Comment thread
wyc-26 marked this conversation as resolved.
Binary file not shown.
Loading