Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ShowRoomName.csx to Work With Deltarune chapter 2. #1481

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Changes from 2 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
42 changes: 31 additions & 11 deletions UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@

// 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
EvaxTheFox marked this conversation as resolved.
Show resolved Hide resolved
if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2")
Miepee marked this conversation as resolved.
Show resolved Hide resolved
{
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)
{
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!");
return;
}