From 862e8f821789014b6167f37976b80694d6d310e3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Apr 2017 04:44:53 +0300 Subject: Add item options into item and get it from server. --- src/gui/windows/tradewindow.cpp | 5 +++++ src/gui/windows/tradewindow.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src/gui/windows') diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 995db35eb..bab8da9c2 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -52,6 +52,7 @@ #include "resources/db/unitsdb.h" #include "resources/item/item.h" +#include "resources/item/itemoptionslist.h" #include "net/serverfeatures.h" #include "net/tradehandler.h" @@ -222,6 +223,7 @@ void TradeWindow::addItem(const int id, void TradeWindow::addItem2(const int id, const ItemTypeT type, const int *const cards, + const ItemOptionsList *const options, const int sz, const bool own, const int quantity, @@ -244,7 +246,10 @@ void TradeWindow::addItem2(const int id, equipment, Equipped_false); if (slot >= 0) + { inv->setCards(slot, cards, sz); + inv->setOptions(slot, options); + } } void TradeWindow::changeQuantity(const int index, const bool own, diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index 4cf062c76..6cfc89a3f 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -43,6 +43,8 @@ class ItemContainer; class Label; class TextField; +struct ItemOptionsList; + /** * Trade dialog. * @@ -94,6 +96,7 @@ class TradeWindow final : public Window, void addItem2(const int id, const ItemTypeT type, const int *const cards, + const ItemOptionsList *const options, const int sz, const bool own, const int quantity, -- cgit v1.2.3-70-g09d2