Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Plain Craft Launcher 2/Modules/ModEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ public static void Raise(EventType type, string arg)
}
}

public static string GetCustomVariable(string name) =>
States.CustomVariables.TryGetValue(name, out var value) ? value : null;
public static string GetCustomVariable(string name, string defaultValue = "") =>
States.CustomVariables.TryGetValue(name, out var value) ? value : defaultValue;

public static string[] GetAbsoluteUrls(string relativeUrl, EventType type)
{
Expand Down
4 changes: 2 additions & 2 deletions Plain Craft Launcher 2/Modules/ModMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,8 +1527,8 @@ public static string ArgumentReplace(string text, Func<string, string> escapeHan
text = ModBase.RegexReplaceEach(text, @"\{hint\}", m => replacer(PageToolsTest.GetRandomHint()));
text = ModBase.RegexReplaceEach(text, @"\{cave\}", m => replacer(PageToolsTest.GetRandomCave()));
text = ModBase.RegexReplaceEach(text, @"\{setup:([a-zA-Z0-9]+)\}", m => replacer(ModBase.Setup.GetSafe(m.Groups[1].Value, ModMinecraft.McInstanceSelected)?.ToString() ?? ""));
text = ModBase.RegexReplaceEach(text, @"\{varible:([^\}]+)\}", m => replacer(CustomEvent.GetCustomVariable(m.Groups[1].Value)));
text = ModBase.RegexReplaceEach(text, @"\{variable:([^\}]+)\}", m => replacer(CustomEvent.GetCustomVariable(m.Groups[1].Value)));
text = ModBase.RegexReplaceEach(text, @"\{varible:([^:\}]+)(?::([^\}]+))?\}", m => replacer(CustomEvent.GetCustomVariable(m.Groups[1].Value, m.Groups[2].Value)));
text = ModBase.RegexReplaceEach(text, @"\{variable:([^:\}]+)(?::([^\}]+))?\}", m => replacer(CustomEvent.GetCustomVariable(m.Groups[1].Value, m.Groups[2].Value)));

return text;
}
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