-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1481 from EvaxTheFox/patch-1
Update ShowRoomName.csx to Work With Deltarune chapter 2.
- Loading branch information
Showing
1 changed file
with
22 additions
and
21 deletions.
There are no files selected for viewing
43 changes: 22 additions & 21 deletions
43
UndertaleModTool/Scripts/Builtin Scripts/ShowRoomName.csx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!"); |