1
0
forked from 0ad/0ad

Made it easier to add new GuiInterface functions.

This commit is contained in:
paczek654321 2024-09-18 20:56:27 +02:00
parent b15eb6909e
commit 3013841560

View File

@ -2061,7 +2061,7 @@ GuiInterface.prototype.OnGlobalEntityRenamed = function(msg)
* trusted and indicates the player associated with the current client; no data should * trusted and indicates the player associated with the current client; no data should
* be returned unless this player is meant to be able to see it.) * be returned unless this player is meant to be able to see it.)
*/ */
let exposedFunctions = { GuiInterface.prototype.exposedFunctions = {
"GetSimulationState": 1, "GetSimulationState": 1,
"GetExtendedSimulationState": 1, "GetExtendedSimulationState": 1,
@ -2129,7 +2129,7 @@ let exposedFunctions = {
GuiInterface.prototype.ScriptCall = function(player, name, args) GuiInterface.prototype.ScriptCall = function(player, name, args)
{ {
if (exposedFunctions[name]) if (this.exposedFunctions[name])
return this[name](player, args); return this[name](player, args);
throw new Error("Invalid GuiInterface Call name \"" + name + "\""); throw new Error("Invalid GuiInterface Call name \"" + name + "\"");