Browse Source

bug #1893

tags/v0.10.6^2
Shaun 2 years ago
parent
commit
82919c1f77
4 changed files with 22 additions and 12 deletions
  1. +9
    -9
      src/client/ui/templates/inventory/inventory.js
  2. +4
    -0
      src/server/clientComponents/serverActions.js
  3. +8
    -2
      src/server/components/stash.js
  4. +1
    -1
      src/server/config/serverConfig.js

+ 9
- 9
src/client/ui/templates/inventory/inventory.js View File

@@ -328,17 +328,17 @@ define([
ctxConfig.push(menuItems.divider);
}

if ((!item.eq) && (!item.active)) {
if (!item.quest) {
if ((window.player.stash.active) && (!item.noStash))
ctxConfig.push(menuItems.stash);
if (!item.eq && !item.active && !item.quest) {
const isAtStash = window.player.serverActions.hasAction('openStash');

if (!item.noDrop)
ctxConfig.push(menuItems.drop);
if (isAtStash && !item.noStash)
ctxConfig.push(menuItems.stash);

if ((!item.material) && (!item.noSalvage))
ctxConfig.push(menuItems.salvage);
}
if (!item.noDrop)
ctxConfig.push(menuItems.drop);

if (!item.material && !item.noSalvage)
ctxConfig.push(menuItems.salvage);
}

if (item.quantity > 1 && !item.quest)


+ 4
- 0
src/server/clientComponents/serverActions.js View File

@@ -14,6 +14,10 @@ define([
this.hookEvent('onKeyUp', this.onKeyUp.bind(this));
},

hasAction: function (actionId) {
return this.actions.some(a => a.id === actionId);
},

onKeyUp: function (key) {
this.actions.forEach(function (a) {
if (a.key !== key)


+ 8
- 2
src/server/components/stash.js View File

@@ -71,7 +71,10 @@ module.exports = {
items.push(item);
},

deposit: function (item) {
deposit: async function (item) {
if (!this.items)
await this.getItemsFromDb();

const { active, items, maxItems, obj } = this;

if (!active)
@@ -126,10 +129,10 @@ module.exports = {
const { obj } = this;

this.active = active;
obj.syncer.set(true, 'stash', 'active', this.active);

const actionType = active ? 'addActions' : 'removeActions';
obj.syncer.setArray(true, 'serverActions', actionType, {
id: 'openStash',
key: 'u',
action: {
targetId: obj.id,
@@ -138,6 +141,9 @@ module.exports = {
}
});

if (!this.active)
return;

let msg = 'Press U to access your Shared Stash';
obj.instance.syncer.queue('onGetAnnouncement', {
src: obj.id,


+ 1
- 1
src/server/config/serverConfig.js View File

@@ -8,7 +8,7 @@ module.exports = {
// sqlite
// rethink
//eslint-disable-next-line no-process-env
db: process.env.IWD_DB || 'sqlite',
db: process.env.IWD_DB || 'rethink',
//eslint-disable-next-line no-process-env
dbHost: process.env.IWD_DB_HOST || 'localhost',
//eslint-disable-next-line no-process-env


Loading…
Cancel
Save