vgui/build/vgui.js
(function(global, exports) {
/**
* @license ISC
* Copyright (c) 2016, Max Maton
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
global = global;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/**
* Represents an event that bubbles up
*/
var Event = exports.Event = function() {
/**
* Creates a default Event
*/
function Event() {
_classCallCheck(this, Event);
this._target = global.document;
this._cancelable = false;
this._defaultPrevented = false;
this._propagating = true;
}
/**
* The type of the event
*/
_createClass(Event, [ {
key: "_cancel",
/**
* @access private
* @protected
* Should be overridden for cancelation effects
*/
value: function _cancel() {}
}, {
key: "stopPropagation",
value: function stopPropagation() {
this._propagating = false;
}
}, {
key: "preventDefault",
value: function preventDefault() {
if (!this.cancelable) return;
if (this._defaultPrevented) return;
this._cancel();
}
}, {
key: "type",
get: function get() {
return "Event";
}
}, {
key: "target",
get: function get() {
return this._target;
}
}, {
key: "bubbles",
get: function get() {
return this._propagating;
}
}, {
key: "cancelable",
get: function get() {
return this._cancelable;
}
} ]);
return Event;
}();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/** Represents a placeholder for a more specific Node type
* Should not be used directly
*/
var Node = exports.Node = function() {
/**
* Creates a Node with a given VPANEL id
*/
function Node(id) {
_classCallCheck(this, Node);
if (!id) throw new Error("Invalid Panel id");
this._id = id;
if (Node._cache == undefined) Node._cache = {};
}
/**
* Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
*/
_createClass(Node, [ {
key: "toString",
/**
* Returns a string representation of the Node
*/
value: function toString() {
return this._className;
}
}, {
key: "_specialize",
value: function _specialize() {
if (Node._cache[this._id] != undefined) return Node._cache[this._id];
var result = this;
switch (this._className) {
case "Label":
result = new Label(this._id);
break;
case "CVguiJavascriptContext":
result = new JsChild(this._id);
break;
case "Panel":
result = new Panel(this._id);
break;
case "EditablePanel":
result = new EditablePanel(this._id);
break;
case "CEmpVguiSteamUser":
result = new SteamUser(this._id);
break;
case "Button":
result = new Button(this._id);
break;
case "CAvatarImagePanel":
result = new CAvatarImage(this._id);
break;
case "ImagePanel":
result = new ImagePanel(this._id);
break;
default:
result = new Element(this._id);
console.log("Unknown element class " + this._className + " found. Assuming Element");
break;
}
Node._cache[this._id] = result;
return result;
}
}, {
key: "_getAttrInt",
value: function _getAttrInt(key) {
return __vgui_GetSettingInt(this._id, key);
}
}, {
key: "_getAttrString",
value: function _getAttrString(key) {
return __vgui_GetSettingString(this._id, key);
}
}, {
key: "_getAttrFloat",
value: function _getAttrFloat(key) {
return __vgui_GetSettingFloat(this._id, key);
}
}, {
key: "_setAttrInt",
value: function _setAttrInt(key, value) {
__vgui_SetSettingInt(this._id, key, value);
}
}, {
key: "_setAttrString",
value: function _setAttrString(key, value) {
__vgui_SetSettingString(this._id, key, value);
}
}, {
key: "_setAttrFloat",
value: function _setAttrFloat(key, value) {
__vgui_SetSettingFloat(this._id, key, value);
}
}, {
key: "parentNode",
get: function get() {
var id = __vgui_GetParent(this._id);
if (id === 0) return null;
var node = new Node(id);
return node._specialize();
}
}, {
key: "_className",
get: function get() {
return __vgui_GetType(this._id);
}
}, {
key: "childNodes",
get: function get() {
var noChildren = __vgui_GetChildCount(this._id);
var result = [];
for (var i = 0; i < noChildren; i++) {
var id = __vgui_GetNthChild(this._id, i);
if (id == 0) continue;
result.push(new Node(id)._specialize());
}
return result;
}
} ]);
return Node;
}();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Event that is dispatched when a registered binding changes
*/
var BindEvent = exports.BindEvent = function(_Event) {
_inherits(BindEvent, _Event);
/**
* Creates a new BindEvent
* @param {string} key - The key that changed
* @param value - The new value
*/
function BindEvent(key, value) {
_classCallCheck(this, BindEvent);
if (!key) throw new Error("Parameter key not set!");
var _this = _possibleConstructorReturn(this, (BindEvent.__proto__ || Object.getPrototypeOf(BindEvent)).call(this));
_this._key = key;
_this._value = value;
return _this;
}
/**
* The key that changed
*/
_createClass(BindEvent, [ {
key: "key",
get: function get() {
return this._key;
}
}, {
key: "value",
get: function get() {
return this._value;
}
}, {
key: "type",
get: function get() {
return "BindEvent";
}
} ]);
return BindEvent;
}(Event);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents an element in the res file
*/
var Element = exports.Element = function(_Node) {
_inherits(Element, _Node);
function Element(id) {
_classCallCheck(this, Element);
var _this = _possibleConstructorReturn(this, (Element.__proto__ || Object.getPrototypeOf(Element)).call(this, id));
_this._attrHandler = {};
_this._attrHandler["xpos"] = "int";
_this._attrHandler["ypos"] = "int";
_this._attrHandler["wide"] = "int";
_this._attrHandler["tall"] = "int";
_this._attrHandler["visible"] = "int";
_this._attrHandler["enabled"] = "int";
_this._attrHandler["fieldName"] = "string";
_this._eventHandler = {};
return _this;
}
/**
* Returns the fieldName of the element
*/
_createClass(Element, [ {
key: "setAttribute",
/**
* Sets an attribute on the element
* In order to support a new attribute an overloading class needs to add the setting type to _attrHandler
*/
value: function setAttribute(name, value) {
if (!name) throw new Error("Parameter name not set");
var handler = this._attrHandler[name];
if (handler == undefined) {
handler = "string";
console.log("Unknown attribute " + name + ", assuming string type");
}
switch (handler) {
case "int":
this._setAttrInt(name, value);
break;
case "string":
this._setAttrString(name, value);
break;
case "float":
this._setAttrFloat(name, value);
break;
}
}
}, {
key: "getAttribute",
value: function getAttribute(name) {
if (!name) throw new Error("Parameter name not set");
var handler = this._attrHandler[name];
if (handler == undefined) {
handler = "string";
console.log("Unknown attribute " + name + ", assuming string type");
}
switch (handler) {
case "int":
return this._getAttrInt(name);
break;
case "string":
return this._getAttrString(name);
break;
case "float":
return this._getAttrFloat(name);
break;
}
}
}, {
key: "dispatchEvent",
value: function dispatchEvent(event) {
if (!event) throw new Error("Unable to dispatch invalid event");
event._target = this;
if (this._eventHandler[event.type] !== undefined) {
var handlers = this._eventHandler[event.type];
for (var i = 0; i < handlers.length; i++) {
handlers[i](event);
}
}
if (!event._defaultPrevented && event.bubbles && this.parentNode !== null) return this.parentNode.dispatchEvent(event);
return !event._defaultPrevented;
}
}, {
key: "addEventListener",
value: function addEventListener(type, listener) {
if (this._eventHandler[type] == undefined) this._eventHandler[type] = [];
this._eventHandler[type].push(listener);
}
}, {
key: "startAnimation",
value: function startAnimation(animationName) {
if (!animationName) throw new Error("Parameter animationName not set");
return __vgui_StartAnimation(this._id, animationName);
}
}, {
key: "removeEventListener",
value: function removeEventListener(type, listener) {
if (this._eventHandler[type] == undefined) this._eventHandler[type] = [];
this._eventHandler[type] = this._eventHandler[type].filter(function(e) {
return e != listener;
});
if (this._eventHandler[type].length == 0) this._eventHandler[type] = undefined;
}
}, {
key: "id",
get: function get() {
var result = this.getAttribute("fieldName");
if (result == "") return null;
return result;
}
} ]);
return Element;
}(Node);
/**
* Polyfill for SetSettingBool (represented as int internally)
* @ignore
*/
var __vgui_SetSettingBool = exports.__vgui_SetSettingBool = function __vgui_SetSettingBool(panel, name, value) {
return __vgui_SetSettingInt(panel, name, value == true);
};
/**
* Polyfill for GetSetting calls (everything is a string internally)
* @ignore
*/
var __vgui_GetSettingBool = exports.__vgui_GetSettingBool = function __vgui_GetSettingBool(panel, name) {
return __vgui_GetSettingString(panel, name) == true;
};
/**
* Polyfill for GetSetting calls (everything is a string internally)
* @ignore
*/
var __vgui_GetSettingInt = exports.__vgui_GetSettingInt = function __vgui_GetSettingInt(panel, name) {
return parseInt(__vgui_GetSettingString(panel, name));
};
/**
* Polyfill for GetSetting calls (everything is a string internally)
* @ignore
*/
var __vgui_GetSettingFloat = exports.__vgui_GetSettingFloat = function __vgui_GetSettingFloat(panel, name) {
return parseFloat(__vgui_GetSettingString(panel, name));
};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Event that is dispatched when the panel is resized by a parent
*/
var ResizeEvent = exports.ResizeEvent = function(_Event) {
_inherits(ResizeEvent, _Event);
/**
* Creates a new ResizeEvent
* @param {int} width - The new width of the panel
* @param {int} height - The new height of the panel
*/
function ResizeEvent(width, height) {
_classCallCheck(this, ResizeEvent);
if (!width) throw new Error("Parameter width not set!");
if (!height) throw new Error("Parameter height not set!");
var _this = _possibleConstructorReturn(this, (ResizeEvent.__proto__ || Object.getPrototypeOf(ResizeEvent)).call(this));
_this._width = width;
_this._height = height;
return _this;
}
/**
* The new width of the panel
*/
_createClass(ResizeEvent, [ {
key: "width",
get: function get() {
return this._width;
}
}, {
key: "height",
get: function get() {
return this._height;
}
}, {
key: "type",
get: function get() {
return "ResizeEvent";
}
} ]);
return ResizeEvent;
}(Event);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Dispatched on document if the settings of the VguiJavascriptContext are changed
*/
var SettingsEvent = exports.SettingsEvent = function(_Event) {
_inherits(SettingsEvent, _Event);
function SettingsEvent() {
_classCallCheck(this, SettingsEvent);
return _possibleConstructorReturn(this, (SettingsEvent.__proto__ || Object.getPrototypeOf(SettingsEvent)).call(this));
}
/**
* @override
*/
_createClass(SettingsEvent, [ {
key: "type",
get: function get() {
return "SettingsEvent";
}
} ]);
return SettingsEvent;
}(Event);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Base event for Source Engine events
*/
var SourceEvent = exports.SourceEvent = function(_Event) {
_inherits(SourceEvent, _Event);
function SourceEvent(type) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, SourceEvent);
if (!type) throw new Error("Need event type parameter");
var _this = _possibleConstructorReturn(this, (SourceEvent.__proto__ || Object.getPrototypeOf(SourceEvent)).call(this));
if (!(data instanceof KeyValues)) data = KeyValues.fromObject(data);
_this.data = data;
_this._type = type;
return _this;
}
/**
* @override
*/
_createClass(SourceEvent, [ {
key: "type",
get: function get() {
if (this._type) return this._type + "Event";
return "SourceEvent";
}
}, {
key: "canEscape",
get: function get() {
return false;
}
} ], [ {
key: "__createSpecific",
value: function __createSpecific(type, data) {
var classType = SourceEvent.__eventTypes[type];
if (classType) return new classType.__fromSource(type, data);
console.info("Received event type " + type + " but have no corresponding class. Defaulting to SourceEvent");
return new SourceEvent(type, data);
}
} ]);
return SourceEvent;
}(Event);
SourceEvent.__eventTypes = {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by toggle buttons
*/
var ButtonToggledEvent = exports.ButtonToggledEvent = function(_SourceEvent) {
_inherits(ButtonToggledEvent, _SourceEvent);
function ButtonToggledEvent(isSelected) {
_classCallCheck(this, ButtonToggledEvent);
return _possibleConstructorReturn(this, (ButtonToggledEvent.__proto__ || Object.getPrototypeOf(ButtonToggledEvent)).call(this, "ButtonToggled", {
state: isSelected
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(ButtonToggledEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new ButtonToggledEvent();
result.data = data;
return result;
}
} ]);
return ButtonToggledEvent;
}(SourceEvent);
SourceEvent.__eventTypes["ButtonToggled"] = ButtonToggledEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by checkbuttons
*/
var CheckButtonCheckedEvent = exports.CheckButtonCheckedEvent = function(_SourceEvent) {
_inherits(CheckButtonCheckedEvent, _SourceEvent);
function CheckButtonCheckedEvent(state) {
_classCallCheck(this, CheckButtonCheckedEvent);
return _possibleConstructorReturn(this, (CheckButtonCheckedEvent.__proto__ || Object.getPrototypeOf(CheckButtonCheckedEvent)).call(this, "CheckButtonChecked", {
state: state
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(CheckButtonCheckedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CheckButtonCheckedEvent();
result.data = data;
return result;
}
} ]);
return CheckButtonCheckedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CheckButtonChecked"] = CheckButtonCheckedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by RickText
*/
var ClickPanelEvent = exports.ClickPanelEvent = function(_SourceEvent) {
_inherits(ClickPanelEvent, _SourceEvent);
function ClickPanelEvent(index) {
_classCallCheck(this, ClickPanelEvent);
return _possibleConstructorReturn(this, (ClickPanelEvent.__proto__ || Object.getPrototypeOf(ClickPanelEvent)).call(this, "ClickPanel", {
index: index
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(ClickPanelEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new ClickPanelEvent();
result.data = data;
return result;
}
} ]);
return ClickPanelEvent;
}(SourceEvent);
SourceEvent.__eventTypes["ClickPanel"] = ClickPanelEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by buttons
*/
var CommandEvent = exports.CommandEvent = function(_SourceEvent) {
_inherits(CommandEvent, _SourceEvent);
function CommandEvent(command) {
_classCallCheck(this, CommandEvent);
return _possibleConstructorReturn(this, (CommandEvent.__proto__ || Object.getPrototypeOf(CommandEvent)).call(this, "Command", {
command: command
}));
}
/**
* @override
*/
_createClass(CommandEvent, [ {
key: "canEscape",
get: function get() {
return true;
}
} ], [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CommandEvent();
result.data = data;
return result;
}
} ]);
return CommandEvent;
}(SourceEvent);
SourceEvent.__eventTypes["Command"] = CommandEvent;
SourceEvent.__eventTypes["command"] = CommandEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Emitted by consoledialog.cpp
*/
var CommandSubmittedEvent = exports.CommandSubmittedEvent = function(_SourceEvent) {
_inherits(CommandSubmittedEvent, _SourceEvent);
function CommandSubmittedEvent(command) {
_classCallCheck(this, CommandSubmittedEvent);
return _possibleConstructorReturn(this, (CommandSubmittedEvent.__proto__ || Object.getPrototypeOf(CommandSubmittedEvent)).call(this, "CommandSubmitted", {
command: command
}));
}
/**
* @override
*/
_createClass(CommandSubmittedEvent, [ {
key: "canEscape",
get: function get() {
return true;
}
} ], [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CommandSubmittedEvent();
result.data = data;
return result;
}
} ]);
return CommandSubmittedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CommandSubmitted"] = CommandSubmittedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by buttons when they become the default button (will responed to ENTER/SPACE).
*/
var CurrentDefaultButtonSetEvent = exports.CurrentDefaultButtonSetEvent = function(_SourceEvent) {
_inherits(CurrentDefaultButtonSetEvent, _SourceEvent);
function CurrentDefaultButtonSetEvent(button) {
_classCallCheck(this, CurrentDefaultButtonSetEvent);
return _possibleConstructorReturn(this, (CurrentDefaultButtonSetEvent.__proto__ || Object.getPrototypeOf(CurrentDefaultButtonSetEvent)).call(this, "CurrentDefaultButtonSet", {
button: button
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(CurrentDefaultButtonSetEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CurrentDefaultButtonSetEvent();
result.data = data;
return result;
}
} ]);
return CurrentDefaultButtonSetEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CurrentDefaultButtonSet"] = CurrentDefaultButtonSetEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when the mouse enters a panel
*/
var CursorEnteredEvent = exports.CursorEnteredEvent = function(_SourceEvent) {
_inherits(CursorEnteredEvent, _SourceEvent);
function CursorEnteredEvent() {
_classCallCheck(this, CursorEnteredEvent);
return _possibleConstructorReturn(this, (CursorEnteredEvent.__proto__ || Object.getPrototypeOf(CursorEnteredEvent)).call(this, "CursorEntered", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(CursorEnteredEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CursorEnteredEvent();
result.data = data;
return result;
}
} ]);
return CursorEnteredEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CursorEntered"] = CursorEnteredEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when the mouse exits a panel
*/
var CursorExitedEvent = exports.CursorExitedEvent = function(_SourceEvent) {
_inherits(CursorExitedEvent, _SourceEvent);
function CursorExitedEvent() {
_classCallCheck(this, CursorExitedEvent);
return _possibleConstructorReturn(this, (CursorExitedEvent.__proto__ || Object.getPrototypeOf(CursorExitedEvent)).call(this, "CursorExited", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(CursorExitedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CursorExitedEvent();
result.data = data;
return result;
}
} ]);
return CursorExitedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CursorExited"] = CursorExitedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when the mouse moves in the panel
*/
var CursorMovedEvent = exports.CursorMovedEvent = function(_SourceEvent) {
_inherits(CursorMovedEvent, _SourceEvent);
function CursorMovedEvent(x, y) {
_classCallCheck(this, CursorMovedEvent);
return _possibleConstructorReturn(this, (CursorMovedEvent.__proto__ || Object.getPrototypeOf(CursorMovedEvent)).call(this, "CursorMovedEvent", {
x: x,
y: y
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(CursorMovedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new CursorMovedEvent();
result.data = data;
return result;
}
} ]);
return CursorMovedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["CursorMoved"] = CursorMovedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var _get = function get(object, property, receiver) {
if (object === null) object = Function.prototype;
var desc = Object.getOwnPropertyDescriptor(object, property);
if (desc === undefined) {
var parent = Object.getPrototypeOf(object);
if (parent === null) {
return undefined;
} else {
return get(parent, property, receiver);
}
} else if ("value" in desc) {
return desc.value;
} else {
var getter = desc.get;
if (getter === undefined) {
return undefined;
}
return getter.call(receiver);
}
};
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
var instance = false;
/**
* Represents the root node of the Element tree.
* This is the VguiJavascriptContext panel or a subclass.
*/
var Document = exports.Document = function(_Element) {
_inherits(Document, _Element);
/**
* Creates a new Document. There can only be one document per context.
* @private
*/
function Document() {
_classCallCheck(this, Document);
var _this = _possibleConstructorReturn(this, (Document.__proto__ || Object.getPrototypeOf(Document)).call(this, __vgui_GetMe()));
if (instance) throw new Error("Can't construct a second Document");
instance = true;
return _this;
}
/**
* @override
*/
_createClass(Document, [ {
key: "dispatchEvent",
/**
* @override
*/
value: function dispatchEvent(e) {
// Try handling locally
if (!_get(Document.prototype.__proto__ || Object.getPrototypeOf(Document.prototype), "dispatchEvent", this).call(this, e)) return false;
// Otherwise dispatch to Source Engine
if (!e.bubbles) return;
if (!(e instanceof SourceEvent)) return;
if (!e.canEscape) return;
__vgui_EmitEvent(e.data._serialize(e._type));
return true;
}
}, {
key: "getElementById",
value: function getElementById(id) {
var _rec = undefined;
_rec = function rec(e, id) {
if (e.id == id) return e;
var children = e.childNodes;
for (var i = 0; i < children.length; i++) {
var result = _rec(children[i], id);
if (result != null) return result;
}
return null;
};
return _rec(this, id);
}
}, {
key: "activateBuildMode",
value: function activateBuildMode() {}
}, {
key: "registerBind",
value: function registerBind(key) {
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "int";
switch (type) {
case "int":
__vgui_SubscribeBindingInt(key);
break;
case "string":
__vgui_SubscribeBindingString(key);
break;
case "bool":
__vgui_SubscribeBindingBool(key);
break;
case "float":
__vgui_SubscribeBindingFloat(key);
break;
default:
throw new Error("Unknown binding type " + type);
}
}
}, {
key: "playSound",
value: function playSound(soundName) {
if (!soundName) throw new Error("soundName not set");
__vgui_PlaySound(soundName);
}
}, {
key: "toString",
value: function toString() {
return "Document";
}
}, {
key: "__constructEvent",
value: function __constructEvent(panelId, type, keyValues) {
var target = this;
if (panelId != 0) target = new Node(panelId)._specialize();
var e = SourceEvent.__createSpecific(type, keyValues);
try {
target.dispatchEvent(e);
} catch (err) {
console.log("Error during " + e.type + " event dispatch: " + err.stack);
}
}
}, {
key: "parentNode",
get: function get() {
// Prevent traversal to panels above me
return null;
}
} ]);
return Document;
}(Element);
var root = new Document();
if (!exports.Node) exports.Node = {};
exports.Node._cache = exports.Node._cache || {};
exports.Node._cache[root._id] = root;
/**
* @ignore
*/
var document = exports.document = root;
global.document = root;
/**
* @ignore
*/
var __vgui_SettingsChanged = exports.__vgui_SettingsChanged = function __vgui_SettingsChanged() {
var event = new SettingsEvent();
try {
root.dispatchEvent(event);
} catch (e) {
console.error("Error occured during external event: " + e.stack);
}
};
/**
* @ignore
*/
var __vgui_BindTrigger = exports.__vgui_BindTrigger = function __vgui_BindTrigger(key, value) {
var event = new BindEvent(key, value);
try {
root.dispatchEvent(event);
} catch (e) {
console.error("Error occured during bind event: " + e.stack);
}
};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Emitted when a key is pressed
*/
var KeyCodeReleasedEvent = exports.KeyCodeReleasedEvent = function(_SourceEvent) {
_inherits(KeyCodeReleasedEvent, _SourceEvent);
function KeyCodeReleasedEvent(code) {
_classCallCheck(this, KeyCodeReleasedEvent);
return _possibleConstructorReturn(this, (KeyCodeReleasedEvent.__proto__ || Object.getPrototypeOf(KeyCodeReleasedEvent)).call(this, "KeyCodeReleased", {
code: code
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(KeyCodeReleasedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new KeyCodeReleasedEvent();
result.data = data;
return result;
}
} ]);
return KeyCodeReleasedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["KeyCodeReleased"] = KeyCodeReleasedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Emitted when a key is pressed
*/
var KeyCodeTypedEvent = exports.KeyCodeTypedEvent = function(_SourceEvent) {
_inherits(KeyCodeTypedEvent, _SourceEvent);
function KeyCodeTypedEvent(code) {
_classCallCheck(this, KeyCodeTypedEvent);
return _possibleConstructorReturn(this, (KeyCodeTypedEvent.__proto__ || Object.getPrototypeOf(KeyCodeTypedEvent)).call(this, "KeyCodeTyped", {
code: code
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(KeyCodeTypedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new KeyCodeTypedEvent();
result.data = data;
return result;
}
} ]);
return KeyCodeTypedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["KeyCodeTyped"] = KeyCodeTypedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Emitted very tick while window has keyboard focus.
* Note: Avoid using.
*/
var KeyFocusTickedEvent = exports.KeyFocusTickedEvent = function(_SourceEvent) {
_inherits(KeyFocusTickedEvent, _SourceEvent);
function KeyFocusTickedEvent() {
_classCallCheck(this, KeyFocusTickedEvent);
return _possibleConstructorReturn(this, (KeyFocusTickedEvent.__proto__ || Object.getPrototypeOf(KeyFocusTickedEvent)).call(this, "KeyFocusTicked"));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(KeyFocusTickedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new KeyFocusTickedEvent();
result.data = data;
return result;
}
} ]);
return KeyFocusTickedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["KeyFocusTicked"] = KeyFocusTickedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired every tick when the mouse is in the panel
*/
var MouseFocusTickedEvent = exports.MouseFocusTickedEvent = function(_SourceEvent) {
_inherits(MouseFocusTickedEvent, _SourceEvent);
function MouseFocusTickedEvent() {
_classCallCheck(this, MouseFocusTickedEvent);
return _possibleConstructorReturn(this, (MouseFocusTickedEvent.__proto__ || Object.getPrototypeOf(MouseFocusTickedEvent)).call(this, "MouseFocusTicked", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(MouseFocusTickedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new MouseFocusTickedEvent();
result.data = data;
return result;
}
} ]);
return MouseFocusTickedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["MouseFocusTicked"] = MouseFocusTickedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when the mouse leaves the panel
*/
var MouseOutEvent = exports.MouseOutEvent = function(_SourceEvent) {
_inherits(MouseOutEvent, _SourceEvent);
function MouseOutEvent() {
_classCallCheck(this, MouseOutEvent);
return _possibleConstructorReturn(this, (MouseOutEvent.__proto__ || Object.getPrototypeOf(MouseOutEvent)).call(this, "MouseOut", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(MouseOutEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new MouseOutEvent();
result.data = data;
return result;
}
} ]);
return MouseOutEvent;
}(SourceEvent);
SourceEvent.__eventTypes["MouseOut"] = MouseOutEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when the mouse enters the panel
*/
var MouseOverEvent = exports.MouseOverEvent = function(_SourceEvent) {
_inherits(MouseOverEvent, _SourceEvent);
function MouseOverEvent() {
_classCallCheck(this, MouseOverEvent);
return _possibleConstructorReturn(this, (MouseOverEvent.__proto__ || Object.getPrototypeOf(MouseOverEvent)).call(this, "MouseOver", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(MouseOverEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new MouseOverEvent();
result.data = data;
return result;
}
} ]);
return MouseOverEvent;
}(SourceEvent);
SourceEvent.__eventTypes["MouseOver"] = MouseOverEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when a mouse button is pressed in the panel
*/
var MousePressedEvent = exports.MousePressedEvent = function(_SourceEvent) {
_inherits(MousePressedEvent, _SourceEvent);
function MousePressedEvent(code) {
_classCallCheck(this, MousePressedEvent);
return _possibleConstructorReturn(this, (MousePressedEvent.__proto__ || Object.getPrototypeOf(MousePressedEvent)).call(this, "MousePressed", {
code: code
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(MousePressedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new MousePressedEvent();
result.data = data;
return result;
}
} ]);
return MousePressedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["MousePressed"] = MousePressedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Fired when a mouse button is pressed in the panel
*/
var MouseReleasedEvent = exports.MouseReleasedEvent = function(_SourceEvent) {
_inherits(MouseReleasedEvent, _SourceEvent);
function MouseReleasedEvent(code) {
_classCallCheck(this, MouseReleasedEvent);
return _possibleConstructorReturn(this, (MouseReleasedEvent.__proto__ || Object.getPrototypeOf(MouseReleasedEvent)).call(this, "MouseReleased", {
code: code
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(MouseReleasedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new MouseReleasedEvent();
result.data = data;
return result;
}
} ]);
return MouseReleasedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["MouseReleased"] = MouseReleasedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Mouse related
*/
var OnMouseFocusTickedEvent = exports.OnMouseFocusTickedEvent = function(_SourceEvent) {
_inherits(OnMouseFocusTickedEvent, _SourceEvent);
function OnMouseFocusTickedEvent() {
_classCallCheck(this, OnMouseFocusTickedEvent);
return _possibleConstructorReturn(this, (OnMouseFocusTickedEvent.__proto__ || Object.getPrototypeOf(OnMouseFocusTickedEvent)).call(this, "OnMouseFocusTicked", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(OnMouseFocusTickedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new OnMouseFocusTickedEvent();
result.data = data;
return result;
}
} ]);
return OnMouseFocusTickedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["OnMouseFocusTicked"] = OnMouseFocusTickedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Called after a panel requests focus to fix up the whole chain
*/
var OnRequestFocusEvent = exports.OnRequestFocusEvent = function(_SourceEvent) {
_inherits(OnRequestFocusEvent, _SourceEvent);
function OnRequestFocusEvent(subFocus, defaultPanel) {
_classCallCheck(this, OnRequestFocusEvent);
return _possibleConstructorReturn(this, (OnRequestFocusEvent.__proto__ || Object.getPrototypeOf(OnRequestFocusEvent)).call(this, "OnRequestFocus", {
subFocus: subFocus,
defaultPanel: defaultPanel
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(OnRequestFocusEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new OnRequestFocusEvent();
result.data = data;
return result;
}
} ]);
return OnRequestFocusEvent;
}(SourceEvent);
SourceEvent.__eventTypes["OnRequestFocus"] = OnRequestFocusEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a panel element
*/
var Panel = exports.Panel = function(_Element) {
_inherits(Panel, _Element);
function Panel(id) {
_classCallCheck(this, Panel);
var _this = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, id));
_this._attrHandler["labelText"] = "string";
_this._attrHandler["bgcolor_override"] = "string";
return _this;
}
/**
* @override
*/
_createClass(Panel, [ {
key: "toString",
value: function toString() {
return "Panel";
}
} ]);
return Panel;
}(Element);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by radio buttons
*/
var RadioButtonCheckedEvent = exports.RadioButtonCheckedEvent = function(_SourceEvent) {
_inherits(RadioButtonCheckedEvent, _SourceEvent);
function RadioButtonCheckedEvent(tabposition) {
_classCallCheck(this, RadioButtonCheckedEvent);
return _possibleConstructorReturn(this, (RadioButtonCheckedEvent.__proto__ || Object.getPrototypeOf(RadioButtonCheckedEvent)).call(this, "RadioButtonChecked", {
tabposition: tabposition
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(RadioButtonCheckedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new RadioButtonCheckedEvent();
result.data = data;
return result;
}
} ]);
return RadioButtonCheckedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["RadioButtonRadioed"] = RadioButtonCheckedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by ScrollBar
*/
var ScrollBarSliderMovedEvent = exports.ScrollBarSliderMovedEvent = function(_SourceEvent) {
_inherits(ScrollBarSliderMovedEvent, _SourceEvent);
function ScrollBarSliderMovedEvent(position) {
_classCallCheck(this, ScrollBarSliderMovedEvent);
return _possibleConstructorReturn(this, (ScrollBarSliderMovedEvent.__proto__ || Object.getPrototypeOf(ScrollBarSliderMovedEvent)).call(this, "ScrollBarSliderMoved", {
position: position
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(ScrollBarSliderMovedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new ScrollBarSliderMovedEvent();
result.data = data;
return result;
}
} ]);
return ScrollBarSliderMovedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["ScrollBarSliderMoved"] = ScrollBarSliderMovedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by Slider
*/
var SliderDragEndEvent = exports.SliderDragEndEvent = function(_SourceEvent) {
_inherits(SliderDragEndEvent, _SourceEvent);
function SliderDragEndEvent(position) {
_classCallCheck(this, SliderDragEndEvent);
return _possibleConstructorReturn(this, (SliderDragEndEvent.__proto__ || Object.getPrototypeOf(SliderDragEndEvent)).call(this, "SliderDragEnd", {
position: position
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(SliderDragEndEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new SliderDragEnd();
result.data = data;
return result;
}
} ]);
return SliderDragEndEvent;
}(SourceEvent);
SourceEvent.__eventTypes["SliderDragEnd"] = SliderDragEndEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by Slider
*/
var SliderDragStartEvent = exports.SliderDragStartEvent = function(_SourceEvent) {
_inherits(SliderDragStartEvent, _SourceEvent);
function SliderDragStartEvent(position) {
_classCallCheck(this, SliderDragStartEvent);
return _possibleConstructorReturn(this, (SliderDragStartEvent.__proto__ || Object.getPrototypeOf(SliderDragStartEvent)).call(this, "SliderDragStart", {
position: position
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(SliderDragStartEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new SliderDragStart();
result.data = data;
return result;
}
} ]);
return SliderDragStartEvent;
}(SourceEvent);
SourceEvent.__eventTypes["SliderDragStart"] = SliderDragStartEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by Slider
*/
var SliderMovedEvent = exports.SliderMovedEvent = function(_SourceEvent) {
_inherits(SliderMovedEvent, _SourceEvent);
function SliderMovedEvent(position) {
_classCallCheck(this, SliderMovedEvent);
return _possibleConstructorReturn(this, (SliderMovedEvent.__proto__ || Object.getPrototypeOf(SliderMovedEvent)).call(this, "SliderMoved", {
position: position
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(SliderMovedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new SliderMovedEvent();
result.data = data;
return result;
}
} ]);
return SliderMovedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["SliderMoved"] = SliderMovedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by TextBoxes
*/
var TextChangedEvent = exports.TextChangedEvent = function(_SourceEvent) {
_inherits(TextChangedEvent, _SourceEvent);
function TextChangedEvent(text) {
_classCallCheck(this, TextChangedEvent);
return _possibleConstructorReturn(this, (TextChangedEvent.__proto__ || Object.getPrototypeOf(TextChangedEvent)).call(this, "TextChanged", {
text: text
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(TextChangedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new TextChangedEvent();
result.data = data;
return result;
}
} ]);
return TextChangedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["TextChanged"] = TextChangedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by RichText
*/
var TextClickedEvent = exports.TextClickedEvent = function(_SourceEvent) {
_inherits(TextClickedEvent, _SourceEvent);
function TextClickedEvent(text) {
_classCallCheck(this, TextClickedEvent);
return _possibleConstructorReturn(this, (TextClickedEvent.__proto__ || Object.getPrototypeOf(TextClickedEvent)).call(this, "TextClicked", {
text: text
}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(TextClickedEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new TextClickedEvent();
result.data = data;
return result;
}
} ]);
return TextClickedEvent;
}(SourceEvent);
SourceEvent.__eventTypes["TextClicked"] = TextClickedEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by TextEntry
*/
var TextKillFocusEvent = exports.TextKillFocusEvent = function(_SourceEvent) {
_inherits(TextKillFocusEvent, _SourceEvent);
function TextKillFocusEvent() {
_classCallCheck(this, TextKillFocusEvent);
return _possibleConstructorReturn(this, (TextKillFocusEvent.__proto__ || Object.getPrototypeOf(TextKillFocusEvent)).call(this, "TextKillFocus", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(TextKillFocusEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new TextKillFocusEvent();
result.data = data;
return result;
}
} ]);
return TextKillFocusEvent;
}(SourceEvent);
SourceEvent.__eventTypes["TextKillFocus"] = TextKillFocusEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Usually emitted by TextEntry
*/
var TextNewLineEvent = exports.TextNewLineEvent = function(_SourceEvent) {
_inherits(TextNewLineEvent, _SourceEvent);
function TextNewLineEvent() {
_classCallCheck(this, TextNewLineEvent);
return _possibleConstructorReturn(this, (TextNewLineEvent.__proto__ || Object.getPrototypeOf(TextNewLineEvent)).call(this, "TextNewLine", {}));
}
/**
* Creates this type based on a source engine KeyValues entry
*/
_createClass(TextNewLineEvent, null, [ {
key: "__fromSource",
value: function __fromSource(type, data) {
var result = new TextNewLineEvent();
result.data = data;
return result;
}
} ]);
return TextNewLineEvent;
}(SourceEvent);
SourceEvent.__eventTypes["TextNewLine"] = TextNewLineEvent;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a CAvatarImage element
*/
var CAvatarImage = exports.CAvatarImage = function(_Panel) {
_inherits(CAvatarImage, _Panel);
function CAvatarImage(id) {
_classCallCheck(this, CAvatarImage);
var _this = _possibleConstructorReturn(this, (CAvatarImage.__proto__ || Object.getPrototypeOf(CAvatarImage)).call(this, id));
_this._attrHandler["scaleImage"] = "int";
return _this;
}
/**
* @override
*/
_createClass(CAvatarImage, [ {
key: "toString",
value: function toString() {
return "CAvatarImage";
}
} ]);
return CAvatarImage;
}(Panel);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents an editablepanel element
*/
var EditablePanel = exports.EditablePanel = function(_Panel) {
_inherits(EditablePanel, _Panel);
function EditablePanel(id) {
_classCallCheck(this, EditablePanel);
return _possibleConstructorReturn(this, (EditablePanel.__proto__ || Object.getPrototypeOf(EditablePanel)).call(this, id));
}
/**
* @override
*/
_createClass(EditablePanel, [ {
key: "toString",
value: function toString() {
return "EditablePanel";
}
} ]);
return EditablePanel;
}(Panel);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents an ImagePanel element
*/
var ImagePanel = exports.ImagePanel = function(_Panel) {
_inherits(ImagePanel, _Panel);
function ImagePanel(id) {
_classCallCheck(this, ImagePanel);
var _this = _possibleConstructorReturn(this, (ImagePanel.__proto__ || Object.getPrototypeOf(ImagePanel)).call(this, id));
_this._attrHandler["image"] = "string";
_this._attrHandler["fillcolor"] = "string";
_this._attrHandler["border"] = "string";
_this._attrHandler["positionImage"] = "int";
_this._attrHandler["scaleImage"] = "int";
_this._attrHandler["scaleAmount"] = "float";
_this._attrHandler["tileImage"] = "int";
_this._attrHandler["tileHorizontally"] = "int";
_this._attrHandler["tileVertically"] = "int";
return _this;
}
/**
* @override
*/
_createClass(ImagePanel, [ {
key: "toString",
value: function toString() {
return "ImagePanel";
}
} ]);
return ImagePanel;
}(Panel);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a child instance of VguiJavascriptContext
*/
var JsChild = exports.JsChild = function(_Element) {
_inherits(JsChild, _Element);
function JsChild(id) {
_classCallCheck(this, JsChild);
return _possibleConstructorReturn(this, (JsChild.__proto__ || Object.getPrototypeOf(JsChild)).call(this, id));
}
// Prevent enumeration inside other environment
/**
* @override
*/
_createClass(JsChild, [ {
key: "toString",
/**
* @override
*/
value: function toString() {
return "JS Environment[" + this.id + "]";
}
}, {
key: "childNodes",
get: function get() {
return [];
}
} ]);
return JsChild;
}(Element);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a label element
*/
var Label = exports.Label = function(_Panel) {
_inherits(Label, _Panel);
function Label(id) {
_classCallCheck(this, Label);
var _this = _possibleConstructorReturn(this, (Label.__proto__ || Object.getPrototypeOf(Label)).call(this, id));
_this._attrHandler["labelText"] = "string";
return _this;
}
/**
* Gets the text of the label
*/
_createClass(Label, [ {
key: "toString",
/**
* @override
*/
value: function toString() {
return "Label[" + this.text + "]";
}
}, {
key: "text",
get: function get() {
return this.getAttribute("labelText");
},
set: function set(value) {
return this.setAttribute("labelText", value);
}
} ]);
return Label;
}(Panel);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a SteamUser element
*/
var SteamUser = exports.SteamUser = function(_Panel) {
_inherits(SteamUser, _Panel);
function SteamUser(id) {
_classCallCheck(this, SteamUser);
var _this = _possibleConstructorReturn(this, (SteamUser.__proto__ || Object.getPrototypeOf(SteamUser)).call(this, id));
_this._attrHandler["steamid"] = "string";
return _this;
}
/**
* @override
*/
_createClass(SteamUser, [ {
key: "toString",
value: function toString() {
return "SteamUser";
}
} ]);
return SteamUser;
}(Panel);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
/**
* Represents a button element
*/
var Button = exports.Button = function(_Label) {
_inherits(Button, _Label);
function Button(id) {
_classCallCheck(this, Button);
var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, id));
_this._attrHandler["command"] = "string";
_this._attrHandler["default"] = "int";
_this._attrHandler["selected"] = "1";
_this._attrHandler["sound_armed"] = "string";
_this._attrHandler["sound_depressed"] = "string";
_this._attrHandler["sound_released"] = "string";
_this._attrHandler["defaultFgColor_override"] = "string";
_this._attrHandler["defaultBgColor_override"] = "string";
_this._attrHandler["armedFgColor_override"] = "string";
_this._attrHandler["armedBgColor_override"] = "string";
_this._attrHandler["depressedFgColor_override"] = "string";
_this._attrHandler["depressedBgColor_override"] = "string";
_this._attrHandler["selectedFgColor_override"] = "string";
_this._attrHandler["selectedBgColor_override"] = "string";
_this._attrHandler["keyboardFocusColor_override"] = "string";
_this._attrHandler["blinkFgColor_override"] = "string";
return _this;
}
/**
* @override
*/
_createClass(Button, [ {
key: "toString",
value: function toString() {
return "Button[" + this.text + "]";
}
} ]);
return Button;
}(Label);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/**
* List of hud hiding behavors.
* Can be combined using |
*
* - weaponSelection: Hides when player is no longer able to select a weapon (in certain vehicles for example).
* - flashlight: Hides if server / map doesn't allow flashlight usage
* - all: Don't use this. Has no extra behaviour
* - health: Hides when health elements are hidden (command mode)
* - playerDead: Hides the hud element when the player is dead
* - needSuit: Not unused in Empires
* - chat: Hides when chat elements hide
* - crosshair: Hides when crosshair hides
* - vehicleCrosshair: Hides when vehicle crosshair hides
* - inVehicle: Hides when player is in vehicle
* - bonusProgress: Unused
* - commander: Hide when player is not command mode
*
* @type {HideType[]}
*/
var HideType = exports.HideType = {
weaponSelection: 1 << 0,
flashlight: 1 << 1,
all: 1 << 2,
// Don't use this, it is always set for every HudElement. See: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/client/hud.cpp#L948
health: 1 << 3,
playerDead: 1 << 4,
needSuit: 1 << 5,
miscStatus: 1 << 6,
chat: 1 << 7,
crosshair: 1 << 8,
vehicleCrosshair: 1 << 9,
inVehicle: 1 << 10,
bonusProgress: 1 << 11,
commander: 1 << 12
};
var Hud = exports.Hud = function() {
function Hud() {
_classCallCheck(this, Hud);
}
_createClass(Hud, null, [ {
key: "setHideType",
/**
* Controls if the hud element should be visible in certain situations.
*/
value: function setHideType(type) {
if (document._className != "CEmpHudJavascript") throw new Error("Unable to set hidden bits for non-hud elements");
__hud_SetHiddenBits(type);
}
} ]);
return Hud;
}();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/**
* Convenience methods to work with binds
*/
var bind = exports.bind = function() {
function bind() {
_classCallCheck(this, bind);
}
_createClass(bind, null, [ {
key: "register",
/**
* Registers a new bind
* @param {!string} name - The name of the bind
* @param {!string} type - The type of the bind
* @param {!Function} callback - The callback function to use
*/
value: function register(name, type, callback) {
if (!name) throw new Error("Name argument not set");
if (!type) throw new Error("Type argument not set");
if (!callback) throw new Error("Callback argument not set");
document.addEventListener("BindEvent", function(e) {
if (e.key != name) return;
callback(e.value);
});
document.registerBind(name, type);
}
} ]);
return bind;
}();
})(global, exports);