').attr({ 'id': 'buildBtns', 'data-legend': _('build:') }).css('opacity', 0);
- buildSection.appendTo('div#roomPanel').animate({ opacity: 1 }, 300, 'linear');
- }
- var craftSection = $('#craftBtns');
- if (craftSection.length === 0) {
- craftSection = $('
').attr({ 'id': 'craftBtns', 'data-legend': _('craft:') }).css('opacity', 0);
- craftSection.appendTo('div#roomPanel').animate({ opacity: 1 }, 300, 'linear');
- }
-
- var buySection = $('#buyBtns');
- if (buySection.length === 0) {
- buySection = $('
').attr({ 'id': 'buyBtns', 'data-legend': _('buy:') }).css('opacity', 0);
- buySection.appendTo('div#roomPanel').animate({ opacity: 1 }, 300, 'linear');
- }
-
- for (var k in Room.Craftables) {
- craftable = Room.Craftables[k];
- if (craftable.button == null) {
- var loc = Room.needsWorkshop(craftable.type) ? craftSection : buildSection;
- craftable.button = new Button.Button({
- id: 'build_' + k,
- cost: craftable.cost(),
- text: _(k),
- click: Room.build,
- width: '80px',
- ttPos: loc.children().length > 10 ? 'top right' : 'bottom right'
- }).css('opacity', 0).attr('buildThing', k).appendTo(loc).animate({ opacity: 1 }, 300, 'linear');
- }
-
- var max = $SM.num(k, craftable) + 1 > craftable.maximum;
- if (max) {
- Button.setDisabled(craftable.button, true);
- } else {
- Button.setDisabled(craftable.button, false);
- }
- }
-
- for (var g in Room.TradeGoods) {
- good = Room.TradeGoods[g];
- if (good.button == null) {
- good.button = new Button.Button({
- id: 'build_' + g,
- cost: good.cost(),
- text: _(g),
- click: Room.buy,
- width: '80px',
- ttPos: buySection.children().length > 10 ? 'top right' : 'bottom right'
- }).css('opacity', 0).attr('buildThing', g).appendTo(buySection).animate({ opacity: 1 }, 300, 'linear');
- }
-
- var goodsMax = $SM.num(g, good) + 1 > good.maximum;
- if (goodsMax) {
- Button.setDisabled(good.button, true);
- } else {
- Button.setDisabled(good.button, false);
- }
- }
-
- // set water/health
- Path.DEFAULT_BAG_SPACE = 1000;
- World.BASE_WATER = 1000;
- World.BASE_HEALTH = 1000;
- World.setHp(1000);
-
- // add all perks
- for (var key in Engine.Perks) {
- $SM.addPerk(key);
- }
-
- // give 100000 of all stores
- for (var i = 0; i < Prestige.storesMap.length; i++) {
- State.stores[Prestige.storesMap[i].store] = 100000;
-
- }
- for (var key in Room.TradeGoods) {
- State.stores[key] = 100000;
- }
-
- // open up all section
- if(!Outside.tab) {
- Outside.init();
- }
-
- if(!Path.tab) {
- Path.init();
- }
-
- if(!Ship.tab) {
- Ship.init();
- }
-
- // set world map mask to reveal entire map
- for(var j = 0; j <= World.RADIUS * 2; j++) {
- for(var i = 0; i <= World.RADIUS * 2; i++) {
- State.game.world.mask[i][j] = true;
- }
- }
-
- // remove all cooldowns
- $('.button').each(function (i, el) {
- $(el).off('click');
- $(el).click(function() {
- $(this).data("handler")($(this));
- })
- });
-
}
-
};
function eventNullifier(e) {