LWWidget.GameSelector = LWWidget.Page.inherits({ constructor: function () { this.base(); this.games = []; this.addEvent('Select'); }, setGames: function (games) { if (games instanceof Array) { this.games = games; this.draw(); } }, draw: function () { var cc = '"return Base.Comp.get(' + this._cid + ').select()"', st = ' style="color:white;font-size:13px;background-color:#3f7fff;width:100%" ', st2 = ' style="color:white;font-size:13px;background-color:#3f7fff" ', str = '
'; this.writeContents(str); var _cb = document.getElementById('grem'); if (_cb) { _cb.checked = (LWWidget.main.getPreference('lwRemGame') == '1'); } }, select: function () { var _s = document.getElementById('gsel'); if (!_s) { return false; } var sv = parseInt(_s.options[_s.selectedIndex].value, 10), rem = document.getElementById('grem').checked; LWWidget.main.setPreference('lwRemGame', rem ? '1' : '0'); if (rem) { LWWidget.main.setPreference('lwGame', this.games[sv].path); } this.onSelect(this.games[sv]); return false; } });