From 81d8129f0f5410d78182d6151468257652aa944d Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 19 May 2014 13:15:46 -0400 Subject: [PATCH] Styling on the language dropdown --- css/main.css | 15 +- script/engine.js | 1226 +++++++++++++++++++++++----------------------- 2 files changed, 634 insertions(+), 607 deletions(-) diff --git a/css/main.css b/css/main.css index fe4fc0f..7fee173 100644 --- a/css/main.css +++ b/css/main.css @@ -1,5 +1,5 @@ /* Fonts */ -body, .tooltip { +body, .tooltip, select.menuBtn { font-family: "Times New Roman", Times, serif; font-size: 16px; font-weight: normal; @@ -65,6 +65,19 @@ div#header { margin-left: 20px; } +.select-wrap { + display: inline-block; + overflow: hidden; + height: 20px; +} + +select.menuBtn { + color: #666; + border: none; + cursor: pointer; + margin: -1px -20px 0 0; +} + .menu span:hover { text-decoration: underline; } diff --git a/script/engine.js b/script/engine.js index abdba97..3b227c0 100644 --- a/script/engine.js +++ b/script/engine.js @@ -1,643 +1,657 @@ -var Engine = { +(function() { + var Engine = window.Engine = { - /* TODO *** MICHAEL IS A LAZY BASTARD AND DOES NOT WANT TO REFACTOR *** - * Here is what he should be doing: - * - All updating values (store numbers, incomes, etc...) should be objects that can register listeners to - * value-change events. These events should be fired whenever a value (or group of values, I suppose) is updated. - * That would be so elegant and awesome. - */ - SITE_URL: encodeURIComponent("http://adarkroom.doublespeakgames.com"), - VERSION: 1.3, - MAX_STORE: 99999999999999, - SAVE_DISPLAY: 30 * 1000, - GAME_OVER: false, - - //object event types - topics: {}, + /* TODO *** MICHAEL IS A LAZY BASTARD AND DOES NOT WANT TO REFACTOR *** + * Here is what he should be doing: + * - All updating values (store numbers, incomes, etc...) should be objects that can register listeners to + * value-change events. These events should be fired whenever a value (or group of values, I suppose) is updated. + * That would be so elegant and awesome. + */ + SITE_URL: encodeURIComponent("http://adarkroom.doublespeakgames.com"), + VERSION: 1.3, + MAX_STORE: 99999999999999, + SAVE_DISPLAY: 30 * 1000, + GAME_OVER: false, - Perks: { - 'boxer': { - name: _('boxer'), - desc: _('punches do more damage'), - notify: _('learned to throw punches with purpose') - }, - 'martial artist': { - name: _('martial artist'), - desc: _('punches do even more damage.'), - notify: _('learned to fight quite effectively without weapons') - }, - 'unarmed master': { - name: _('unarmed master'), - desc: _('punch twice as fast, and with even more force'), - notify: _('learned to strike faster without weapons') - }, - 'barbarian': { - name: _('barbarian'), - desc: _('melee weapons deal more damage'), - notify: _('learned to swing weapons with force') - }, - 'slow metabolism': { - name: _('slow metabolism'), - desc: _('go twice as far without eating'), - notify: _('learned how to ignore the hunger') - }, - 'desert rat': { - name: _('desert rat'), - desc: _('go twice as far without drinking'), - notify: _('learned to love the dry air') - }, - 'evasive': { - name: _('evasive'), - desc: _('dodge attacks more effectively'), - notify: _("learned to be where they're not") - }, - 'precise': { - name: _('precise'), - desc: _('land blows more often'), - notify: _('learned to predict their movement') - }, - 'scout': { - name: _('scout'), - desc: _('see farther'), - notify: _('learned to look ahead') - }, - 'stealthy': { - name: _('stealthy'), - desc: _('better avoid conflict in the wild'), - notify: _('learned how not to be seen') - }, - 'gastronome': { - name: _('gastronome'), - desc: _('restore more health when eating'), - notify: _('learned to make the most of food') - } - }, - - options: { - state: null, - debug: false, - log: false - }, - - init: function(options) { - this.options = $.extend( - this.options, - options - ); - this._debug = this.options.debug; - this._log = this.options.log; - - // Check for HTML5 support - if(!Engine.browserValid()) { - window.location = 'browserWarning.html'; - } - - // Check for mobile - if(Engine.isMobile()) { - window.location = 'mobileWarning.html'; - } - - Engine.disableSelection(); - - if(this.options.state != null) { - window.State = this.options.state; - } else { - Engine.loadGame(); - } - - $('
').attr('id', 'locationSlider').appendTo('#main'); - - var menu = $('
') - .addClass('menu') - .appendTo('body'); - - $('') + .addClass('menuBtn') + .append($('