mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11:54 +08:00
Adding ADR to Github
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Module that takes care of header buttons
|
||||
*/
|
||||
var Header = {
|
||||
|
||||
init: function(options) {
|
||||
this.options = $.extend(
|
||||
this.options,
|
||||
options
|
||||
);
|
||||
},
|
||||
|
||||
options: {}, // Nothing for now
|
||||
|
||||
canTravel: function() {
|
||||
return $('div#header div.headerButton').length > 1;
|
||||
},
|
||||
|
||||
addLocation: function(text, id, module) {
|
||||
return $('<div>').attr('id', "location_" + id)
|
||||
.addClass('headerButton')
|
||||
.text(text).click(function() {
|
||||
if(Header.canTravel()) {
|
||||
Engine.travelTo(module);
|
||||
}
|
||||
}).appendTo($('div#header'));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user