Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/campaigns/utils.js
- This file was added.
function _(obj) | |||||
{ | |||||
return Engine.GetGUIObjectByName(obj); | |||||
} | |||||
function _watch(object, callback) | |||||
{ | |||||
return new Proxy(object, { | |||||
"get": (obj, key) => { | |||||
return obj[key]; | |||||
}, | |||||
"set": (obj, key, value) => { | |||||
obj[key] = value; | |||||
callback(); | |||||
return true; | |||||
} | |||||
}); | |||||
} | |||||
class DefaultPage | |||||
{ | |||||
_watch(object, lambda = null) | |||||
{ | |||||
if (lambda == null) | |||||
lambda = () => { | |||||
if (this._ready) | |||||
this.render(); | |||||
}; | |||||
return _watch(object, lambda); | |||||
} | |||||
constructor() | |||||
{ | |||||
this._ready = false; | |||||
return this._watch(this); | |||||
} | |||||
render() | |||||
{ | |||||
} | |||||
} |
Wildfire Games · Phabricator