2021-11-12 03:22:18 -08:00
|
|
|
/**
|
|
|
|
|
* Base class for all controls on the developer overlay.
|
|
|
|
|
*/
|
|
|
|
|
class DeveloperOverlayControl
|
|
|
|
|
{
|
|
|
|
|
constructor(handler, i)
|
|
|
|
|
{
|
|
|
|
|
this.handler = handler;
|
|
|
|
|
this.handler.update = () => this.update();
|
|
|
|
|
|
|
|
|
|
this.body = Engine.GetGUIObjectByName("dev_command[" + i + "]");
|
|
|
|
|
this.resize(i);
|
|
|
|
|
|
|
|
|
|
this.updater = this.update.bind(this);
|
|
|
|
|
|
|
|
|
|
if (this.handler.checked)
|
|
|
|
|
registerPlayersInitHandler(this.updater);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getHeight()
|
|
|
|
|
{
|
|
|
|
|
return this.body.size.bottom - this.body.size.top;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resize(i)
|
|
|
|
|
{
|
2025-05-29 15:23:46 -07:00
|
|
|
const height = this.body.size.bottom;
|
|
|
|
|
this.body.size.top = height * i;
|
|
|
|
|
this.body.size.bottom = height * (i + 1);
|
|
|
|
|
|
2021-11-12 03:22:18 -08:00
|
|
|
this.body.hidden = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|