Skip to content

Commit 04d89e8

Browse files
committed
Scripting fixes
1 parent bda664c commit 04d89e8

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

UndertaleModCli/Program.UMTLibInherited.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ public void ScriptMessage(string message)
8484
if (IsInteractive) Pause();
8585
}
8686

87+
/// <inheritdoc/>
88+
public void ScriptWarning(string message)
89+
{
90+
Console.WriteLine($"WARNING: {message}");
91+
if (IsInteractive) Pause();
92+
}
93+
8794
/// <inheritdoc/>
8895
public void SetUMTConsoleText(string message)
8996
{

UndertaleModLib/Scripting/IScriptInterface.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,17 @@ void EnsureDataLoaded()
113113
bool MakeNewDataFile();
114114

115115
/// <summary>
116-
/// Used in Scripts in order to show a message to the user.
116+
/// Used in scripts in order to show a message to the user.
117117
/// </summary>
118118
/// <param name="message">The message to show.</param>
119119
void ScriptMessage(string message);
120120

121+
/// <summary>
122+
/// Used in scripts in order to show a warning message to the user.
123+
/// </summary>
124+
/// <param name="message">The warning message to show.</param>
125+
void ScriptWarning(string message);
126+
121127
//TODO: currently should get repurposed/renamed?
122128
/// <summary>
123129
/// Sets the message of the variable holding text from the console. Currently only used in GUI.
@@ -133,7 +139,7 @@ void EnsureDataLoaded()
133139
bool ScriptQuestion(string message);
134140

135141
/// <summary>
136-
/// Used in Scripts in order to show an error to the user.
142+
/// Used in scripts in order to show an error to the user.
137143
/// </summary>
138144
/// <param name="error">The error message to show.</param>
139145
/// <param name="title">A short-descriptive title.</param>

UndertaleModTests/GameScriptTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public void ScriptMessage(string message)
6666
Console.WriteLine(message);
6767
}
6868

69+
public void ScriptWarning(string message)
70+
{
71+
Console.WriteLine($"Warning: {message}");
72+
}
73+
6974
public bool ScriptQuestion(string message)
7075
{
7176
Console.WriteLine(message);

UndertaleModTool/Scripts/Community Scripts/FontEditor.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ UndertaleFont FontPickerResult()
12511251
comboBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
12521252
foreach (UndertaleFont font in Data.Fonts)
12531253
{
1254-
if (font is null || font.Name?.Content? is null)
1254+
if (font is null || font.Name?.Content is null)
12551255
continue;
12561256
comboBox.Items.Add(font.Name.Content);
12571257
}

0 commit comments

Comments
 (0)