-
Notifications
You must be signed in to change notification settings - Fork 239
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 #1762 from NC-devC/master
DebugMsg fix
- Loading branch information
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
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,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."); |