From 4729d390af864d7f4614ca76ab74dc2cd7e7c1ae Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Dec 2014 14:16:17 +0300 Subject: Add chat command for move item from inventory to storage. New command: /invtostorage INDEX Alias: /invstorage INDEX --- src/actions/actions.cpp | 13 +++++++++++++ src/actions/actions.h | 1 + 2 files changed, 14 insertions(+) (limited to 'src/actions') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index bc641d331..165a9add0 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1390,4 +1390,17 @@ impHandler(useItemInv) return true; } +impHandler(invToStorage) +{ + const int index = atoi(event.args.c_str()); + const Inventory *const inv = PlayerInfo::getInventory(); + if (inv) + { + Item *const item = inv->getItem(index); + ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, + inventoryWindow, item); + } + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 5d7482642..eaf900fbe 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -98,6 +98,7 @@ namespace Actions decHandler(mercenaryFire); decHandler(useItem); decHandler(useItemInv); + decHandler(invToStorage); } // namespace Actions #undef decHandler -- cgit v1.2.3-70-g09d2