mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-04-15 06:31:28 +00:00
Allow GUI scripts to do debug printing to the console
Example: onActivate { set "print" "this windowDefs rect:" "$rect"; } (added to the Desktop of a GUI) prints "GUI debug: this windowDefs rect: 0 0 640 480" to the ingame console
This commit is contained in:
parent
4aef5c1dd4
commit
384fd0cca1
1 changed files with 12 additions and 0 deletions
|
@ -63,6 +63,18 @@ void Script_Set(idWindow *window, idList<idGSWinVar> *src) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// DG: allow debugprinting to the console with `set "print" "this windowDefs rect:" "$rect"`
|
||||
if (idStr::Icmp(*dest, "print") == 0) {
|
||||
idStr msg;
|
||||
int parmCount = src->Num();
|
||||
for (int i=1; i<parmCount; ++i) {
|
||||
msg += (*src)[i].var->c_str();
|
||||
msg += " ";
|
||||
}
|
||||
common->Printf("GUI debug: %s\n", msg.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
(*src)[0].var->Set((*src)[1].var->c_str());
|
||||
(*src)[0].var->SetEval(false);
|
||||
|
|
Loading…
Reference in a new issue