Kaynağa Gözat

Merge pull request #7318 from Light-Beacon/main

feat(ModMain): varible 替换标记支持设置默认值
龙腾猫跃 1 yıl önce
ebeveyn
işleme
76f4e761b1
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      Plain Craft Launcher 2/Modules/ModMain.vb

+ 1 - 1
Plain Craft Launcher 2/Modules/ModMain.vb

@@ -883,7 +883,7 @@ NextFile:
         Text = Text.RegexReplaceEach("\{hint\}", Function() Replacer(PageOtherTest.GetRandomHint()))
         Text = Text.RegexReplaceEach("\{cave\}", Function() Replacer(PageOtherTest.GetRandomCave()))
         Text = Text.RegexReplaceEach("\{setup:([a-zA-Z0-9]+)\}", Function(m) Replacer(Setup.GetSafe(m.Groups(1).Value, McVersionCurrent)))
-        Text = Text.RegexReplaceEach("\{varible:([^\}]+)\}", Function(m) Replacer(ReadReg("CustomEvent" & m.Groups(1).Value, Nothing)))
+        Text = Text.RegexReplaceEach("\{varible:([^:\}]+)(?::([^\}]+))?\}", Function(m) Replacer(ReadReg("CustomEvent" & m.Groups(1).Value, m.Groups(2).Value)))
         Return Text
     End Function