From 5b6848e817bea37e286f197f8702ab29f1de3bc8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 30 Oct 2015 21:19:30 +0300 Subject: Add item container max columns limit. Also fix some issues with adding items to npc item container. --- src/gui/windows/npcdialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/windows/npcdialog.cpp') diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index e94904a08..de74037f8 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -123,7 +123,8 @@ NpcDialog::NpcDialog(const BeingId npcId) : // TRANSLATORS: npc dialog button mResetButton(new Button(this, _("Reset"), "reset", this)), mInventory(new Inventory(InventoryType::NPC, 1)), - mItemContainer(new ItemContainer(this, mInventory, ShowEmptyRows_true)), + mItemContainer(new ItemContainer(this, mInventory, + 10000, ShowEmptyRows_true)), mItemScrollArea(new ScrollArea(this, mItemContainer, getOptionBool("showitemsbackground"), "npc_listbackground.xml")), mInputState(NPC_INPUT_NONE), @@ -374,7 +375,7 @@ void NpcDialog::action(const ActionEvent &event) } std::string str; - const int sz = mInventory->getNumberOfSlotsUsed(); + const int sz = mInventory->getSize(); if (sz == 0) { str = "0,0"; @@ -421,7 +422,7 @@ void NpcDialog::action(const ActionEvent &event) } std::string str; - const int sz = mInventory->getNumberOfSlotsUsed(); + const int sz = mInventory->getSize(); if (sz == 0) { str = "-1"; @@ -441,7 +442,6 @@ void NpcDialog::action(const ActionEvent &event) { str.append(";"); item = mInventory->getItem(f); - logger->log("tag=%d", item->getTag()); if (item) str.append(strprintf("%d", item->getTag())); else -- cgit v1.2.3-60-g2f50