View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005869||The Dark Mod||GUI||public||04.01.2022 06:42||04.01.2022 06:49|
|Product Version||TDM 2.10|
|Target Version||TDM 2.11|
|Summary||0005869: Better diagnostic for syntax errors in GUI code|
|Description||There are many errors in .gui which don't provided any kind of diagnostic.|
Instead, parsing just continues, despite the fact that sometimes all the subsequent code is broken by the first error.
One such example is adding a semicolon at the end of window parameters:
The code expects GUI keyword instead of it, so it gets into "else" clause in idWindow::Parse.
It calls idWindow::ParseRegEntry, which cannot find the variable, and thus creates a custom one with semicolon as its name.
One can set breakpoint to the second part of idWindow::ParseRegEntry and catch such cases.
The same thing happens if someone writes "indowDef" or "ontipe" (i.e. keyword with a typo).
Ideally, some special syntax should be used to add custom parameters, and unknown word without it should generate error.
Another weird code location is probably idGuiScript::Parse.
I guess if one forgets a semicolon at the end of script command, it can pass without error, especially for a "set" command.
|Steps To Reproduce||For instance, go to mainmenu_main.gui and add semicolon here:|
rect 280, 0, 320, 640;
Now you don't see the menu, although you at least see an error in this case =)
Or you can replace "windowDef LoadGameText" with "indowDef LoadGameText".
The menu boots up, but who knows which parts of GUI code are broken?
|Tags||No tags attached.|