Skip to content

Commit

Permalink
Merge pull request #1762 from NC-devC/master
Browse files Browse the repository at this point in the history
DebugMsg fix
  • Loading branch information
Miepee authored Jun 2, 2024
2 parents abecdd2 + 5b93bc9 commit e099a1e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions UndertaleModTool/Scripts/Builtin Scripts/DebugMsg.csx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
ScriptError("This script is temporarily disabled as it doesn't work properly, causing the game to crash, sorry about that.");
return;
EnsureDataLoaded();
ScriptMessage("DebugMsg - Displays dialogue messages\nwhile debug mode is enabled.\n\nAuthor: krzys-h, Kneesnap");

if (false)
{
EnsureDataLoaded();
ScriptMessage("DebugMsg - Displays dialogue messages\nwhile debug mode is enabled.\n\nAuthor: krzys-h, Kneesnap");

var code = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals);
var code = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals);

code.ReplaceGML(@"
if (global.debug == 1) {
draw_set_color(0xFFFF);
for (var i = 0; i < 100; i++)
draw_text(50, (i * 15) + 50, global.msg[i]);
with (OBJ_WRITER)
draw_text(70, 30, mystring);
code.AppendGML(@"
if global.debug
{
draw_set_color(c_white);
var drawYPosition = 0
for (var i = 0; i < array_length_1d(global.msg); i++)
{
var currentMessage = global.msg[i]
if ((!(currentMessage == ""%%%"")) && (!(currentMessage == ""%%"")) && (!(currentMessage == ""%"")))
{
drawYPosition++
draw_text(10, (drawYPosition * 15 + 50), currentMessage)
}
}
}", Data);

ChangeSelection(code);
ScriptMessage("DebugMsg - Finished.");
}
ChangeSelection(code);
ScriptMessage("DebugMsg - Finished.");

0 comments on commit e099a1e

Please sign in to comment.