mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-07-01 00:32:31 +08:00
@@ -508,6 +508,10 @@ body.noMask #description {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.take-all-button {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#buttons > .button {
|
||||
margin: 0 5px 5px;
|
||||
margin-right: 15px;
|
||||
|
||||
@@ -42,6 +42,7 @@ div#storesContainer {
|
||||
|
||||
div#stores {
|
||||
position: relative;
|
||||
z-index:10;
|
||||
border: 1px solid black;
|
||||
cursor: default;
|
||||
padding: 5px 10px;
|
||||
|
||||
+40
-5
@@ -42,6 +42,11 @@ var Events = {
|
||||
Events.activeScene = name;
|
||||
var scene = Events.activeEvent().scenes[name];
|
||||
|
||||
// onLoad
|
||||
if(scene.onLoad) {
|
||||
scene.onLoad();
|
||||
}
|
||||
|
||||
// Notify the scene change
|
||||
if(scene.notification) {
|
||||
Notifications.notify(null, scene.notification);
|
||||
@@ -52,11 +57,6 @@ var Events = {
|
||||
$SM.addM('stores', scene.reward);
|
||||
}
|
||||
|
||||
// onLoad
|
||||
if(scene.onLoad) {
|
||||
scene.onLoad();
|
||||
}
|
||||
|
||||
$('#description', Events.eventPanel()).empty();
|
||||
$('#buttons', Events.eventPanel()).empty();
|
||||
if(scene.combat) {
|
||||
@@ -503,9 +503,44 @@ var Events = {
|
||||
$('<div>').addClass('clear').appendTo(lootButtons);
|
||||
if(lootButtons.children().length > 1) {
|
||||
lootButtons.appendTo(desc);
|
||||
var takeAll = new Button.Button({
|
||||
id: 'loot_take_all',
|
||||
text: _('take all'),
|
||||
click: Events.takeAllLoot
|
||||
}).addClass('take-all-button').appendTo(lootButtons);
|
||||
}
|
||||
},
|
||||
|
||||
takeAllLoot: function(){
|
||||
|
||||
var stoppedEarly = false;
|
||||
$('#lootButtons')
|
||||
.children('.button')
|
||||
.each(function(){
|
||||
if( $(this).hasClass('take-all-button') ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var weight = $(this).data('numLeft') * Path.getWeight($(this).attr('id').substring(5).replace('-', ' '));
|
||||
while( $(this).data('numLeft') > 0 && weight < Path.getFreeSpace() ){
|
||||
$(this).click();
|
||||
}
|
||||
|
||||
if(weight > Path.getFreeSpace()){
|
||||
stoppedEarly = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if( !stoppedEarly ){
|
||||
|
||||
$('#leave').click();
|
||||
$('#leaveBtn').click();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
dropStuff: function(e) {
|
||||
e.stopPropagation();
|
||||
var btn = $(this);
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ var Outside = {
|
||||
}
|
||||
|
||||
if(needsAppend && village.children().length > 1) {
|
||||
village.appendTo('#outsidePanel');
|
||||
village.prependTo('#outsidePanel');
|
||||
village.animate({opacity:1}, 300, 'linear');
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ var Path = {
|
||||
}
|
||||
|
||||
if(needsAppend && perks.children().length > 0) {
|
||||
perks.appendTo(Path.panel);
|
||||
perks.prependTo(Path.panel);
|
||||
}
|
||||
|
||||
if(!ignoreStores && Engine.activeModule === Path) {
|
||||
|
||||
+1
-1
@@ -511,7 +511,7 @@ var Room = {
|
||||
}).appendTo('div#roomPanel');
|
||||
|
||||
// Create the stores container
|
||||
$('<div>').attr('id', 'storesContainer').appendTo('div#roomPanel');
|
||||
$('<div>').attr('id', 'storesContainer').prependTo('div#roomPanel');
|
||||
|
||||
//subscribe to stateUpdates
|
||||
$.Dispatch('stateUpdate').subscribe(Room.handleStateUpdates);
|
||||
|
||||
Reference in New Issue
Block a user