From 49079e08a33292d1fe41ab69934e5046de5923fd Mon Sep 17 00:00:00 2001 From: Evax The Fox Date: Sat, 16 Sep 2023 00:48:52 +0330 Subject: [PATCH 1/4] Update ShowRoomName.csx to Work With Deltarune chapter 2. only tested on deltarune. --- .../Scripts/Builtin Scripts/ShowRoomName.csx | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx index 9494c8fbc..95fe16f0e 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx @@ -1,23 +1,42 @@ + // Adds room ID and name display under the debug mode timer display EnsureDataLoaded(); - +ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap\n\n\nDeltarune Ch2 Patch By GattoDev"); +Data.Functions.EnsureDefined("room_get_name", Data.Strings); // required for Deltarune if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2") { - ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo"); + var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); +gml_Object_obj_time_Draw_64.AppendGML(@" +if scr_debug() +{ + draw_set_color(0xFFFF); + draw_text(10, 30, room); + draw_text(50, 30, room_get_name(room)); +}", Data); + +ChangeSelection(gml_Object_obj_time_Draw_64); +ScriptMessage("Patched!"); return; } else if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1&2") { - ScriptError("Error 1: Incompatible with the new Deltarune Chapter 1 & 2 demo"); + var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); +gml_Object_obj_time_Draw_64.AppendGML(@" +if scr_debug() +{ + draw_set_color(0xFFFF); + draw_text(10, 30, room); + draw_text(50, 30, room_get_name(room)); +}", Data); + +ChangeSelection(gml_Object_obj_time_Draw_64); +ScriptMessage("Patched!"); return; } - -ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap"); - -Data.Functions.EnsureDefined("room_get_name", Data.Strings); // required for Deltarune - -var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); +else +{ + var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); gml_Object_obj_time_Draw_64.AppendGML(@" if (global.debug) { @@ -25,6 +44,7 @@ if (global.debug) draw_text(10, 30, room); draw_text(50, 30, room_get_name(room)); }", Data); - ChangeSelection(gml_Object_obj_time_Draw_64); -ScriptMessage("Patched!"); \ No newline at end of file +ScriptMessage("Patched!"); + return; +} From bfa124c2e6213dc5457d7aeee38f696693ccfecb Mon Sep 17 00:00:00 2001 From: Evax The Fox Date: Sat, 16 Sep 2023 01:04:52 +0330 Subject: [PATCH 2/4] Update ShowRoomName.csx for deltarune --- UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx index 95fe16f0e..d698e53af 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx @@ -2,7 +2,7 @@ // Adds room ID and name display under the debug mode timer display EnsureDataLoaded(); -ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap\n\n\nDeltarune Ch2 Patch By GattoDev"); +ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap\n"); Data.Functions.EnsureDefined("room_get_name", Data.Strings); // required for Deltarune if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2") { From 364108c805ae4eab7366c18cca0c3f5a7e09f998 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 2 Jun 2024 16:42:00 +0200 Subject: [PATCH 3/4] Update ShowRoomName.csx --- .../Scripts/Builtin Scripts/ShowRoomName.csx | 36 ++----------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx index d698e53af..3eddad1d4 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx @@ -4,24 +4,9 @@ EnsureDataLoaded(); ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap\n"); Data.Functions.EnsureDefined("room_get_name", Data.Strings); // required for Deltarune -if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2") -{ - var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); -gml_Object_obj_time_Draw_64.AppendGML(@" -if scr_debug() -{ - draw_set_color(0xFFFF); - draw_text(10, 30, room); - draw_text(50, 30, room_get_name(room)); -}", Data); +string displayName = Data?.GeneralInfo?.DisplayName?.Content.ToLower(); -ChangeSelection(gml_Object_obj_time_Draw_64); -ScriptMessage("Patched!"); - return; -} -else if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1&2") -{ - var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); +var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); gml_Object_obj_time_Draw_64.AppendGML(@" if scr_debug() { @@ -32,19 +17,4 @@ if scr_debug() ChangeSelection(gml_Object_obj_time_Draw_64); ScriptMessage("Patched!"); - return; -} -else -{ - var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); -gml_Object_obj_time_Draw_64.AppendGML(@" -if (global.debug) -{ - draw_set_color(0xFFFF); - draw_text(10, 30, room); - draw_text(50, 30, room_get_name(room)); -}", Data); -ChangeSelection(gml_Object_obj_time_Draw_64); -ScriptMessage("Patched!"); - return; -} +return; From fd6a4b541845f3de35c38b8038fbdc53a99ea616 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Mon, 1 Jul 2024 15:08:11 +0200 Subject: [PATCH 4/4] Fix not working with UT again. --- .../Scripts/Builtin Scripts/ShowRoomName.csx | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx index 3eddad1d4..0272ff174 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx @@ -1,20 +1,31 @@ - // Adds room ID and name display under the debug mode timer display - EnsureDataLoaded(); ScriptMessage("Show room name and ID in debug mode\nby krzys_h, Kneesnap\n"); Data.Functions.EnsureDefined("room_get_name", Data.Strings); // required for Deltarune string displayName = Data?.GeneralInfo?.DisplayName?.Content.ToLower(); +bool isDeltarune = displayName.StartsWith("deltarune chapter 1"); var gml_Object_obj_time_Draw_64 = Data.GameObjects.ByName("obj_time").EventHandlerFor(EventType.Draw, EventSubtypeDraw.DrawGUI, Data.Strings, Data.Code, Data.CodeLocals); -gml_Object_obj_time_Draw_64.AppendGML(@" -if scr_debug() +if (isDeltarune) +{ + gml_Object_obj_time_Draw_64.AppendGML(@" + if (scr_debug()) + { + draw_set_color(0xFFFF); + draw_text(10, 30, room); + draw_text(50, 30, room_get_name(room)); + }", Data); +} +else { - draw_set_color(0xFFFF); - draw_text(10, 30, room); - draw_text(50, 30, room_get_name(room)); -}", Data); + gml_Object_obj_time_Draw_64.AppendGML(@" + if (global.debug) + { + draw_set_color(0xFFFF); + draw_text(10, 30, room); + draw_text(50, 30, room_get_name(room)); + }", Data); +} ChangeSelection(gml_Object_obj_time_Draw_64); ScriptMessage("Patched!"); -return;