Skip to content

Commit

Permalink
Merge pull request #1481 from EvaxTheFox/patch-1
Browse files Browse the repository at this point in the history
Update ShowRoomName.csx to Work With Deltarune chapter 2.
  • Loading branch information
colinator27 authored Jul 9, 2024
2 parents 1bf549f + fd6a4b5 commit 83ff2fc
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx
Original file line number Diff line number Diff line change
@@ -1,30 +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");

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);
if (isDeltarune)
{
ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo");
return;
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 if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1&2")
else
{
ScriptError("Error 1: Incompatible with the new Deltarune Chapter 1 & 2 demo");
return;
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);
}

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);
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!");
ScriptMessage("Patched!");

0 comments on commit 83ff2fc

Please sign in to comment.