2012-05-17 11:36:25 +00:00
|
|
|
#ifndef MWGUI_TRADEWINDOW_H
|
|
|
|
#define MWGUI_TRADEWINDOW_H
|
|
|
|
|
|
|
|
#include "container.hpp"
|
|
|
|
#include "window_base.hpp"
|
|
|
|
|
2012-05-17 15:15:44 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2012-05-17 11:36:25 +00:00
|
|
|
namespace MyGUI
|
|
|
|
{
|
|
|
|
class Gui;
|
|
|
|
class Widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class WindowManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class TradeWindow : public ContainerBase, public WindowBase
|
|
|
|
{
|
|
|
|
public:
|
2012-08-12 16:11:09 +00:00
|
|
|
TradeWindow(MWBase::WindowManager& parWindowManager);
|
2012-05-17 11:36:25 +00:00
|
|
|
|
2012-05-17 15:15:44 +00:00
|
|
|
void startTrade(MWWorld::Ptr actor);
|
|
|
|
|
2012-05-18 20:06:25 +00:00
|
|
|
void sellToNpc(MWWorld::Ptr item, int count); ///< only used for adjusting the gold balance
|
|
|
|
void buyFromNpc(MWWorld::Ptr item, int count); ///< only used for adjusting the gold balance
|
|
|
|
|
2012-05-18 13:51:33 +00:00
|
|
|
bool npcAcceptsItem(MWWorld::Ptr item);
|
|
|
|
|
2012-05-17 11:36:25 +00:00
|
|
|
protected:
|
|
|
|
MyGUI::Button* mFilterAll;
|
|
|
|
MyGUI::Button* mFilterWeapon;
|
|
|
|
MyGUI::Button* mFilterApparel;
|
|
|
|
MyGUI::Button* mFilterMagic;
|
|
|
|
MyGUI::Button* mFilterMisc;
|
|
|
|
|
2012-05-17 19:15:48 +00:00
|
|
|
MyGUI::Button* mIncreaseButton;
|
|
|
|
MyGUI::Button* mDecreaseButton;
|
|
|
|
MyGUI::TextBox* mTotalBalanceLabel;
|
|
|
|
MyGUI::TextBox* mTotalBalance;
|
|
|
|
|
|
|
|
MyGUI::Widget* mBottomPane;
|
|
|
|
|
|
|
|
MyGUI::Button* mMaxSaleButton;
|
|
|
|
MyGUI::Button* mCancelButton;
|
|
|
|
MyGUI::Button* mOfferButton;
|
|
|
|
MyGUI::TextBox* mPlayerGold;
|
|
|
|
MyGUI::TextBox* mMerchantGold;
|
|
|
|
|
2012-05-17 19:56:16 +00:00
|
|
|
int mCurrentBalance;
|
|
|
|
|
2012-05-17 11:36:25 +00:00
|
|
|
void onWindowResize(MyGUI::Window* _sender);
|
|
|
|
void onFilterChanged(MyGUI::Widget* _sender);
|
2012-05-17 19:15:48 +00:00
|
|
|
void onOfferButtonClicked(MyGUI::Widget* _sender);
|
|
|
|
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
2012-05-17 19:56:16 +00:00
|
|
|
|
|
|
|
// don't show items that the NPC has equipped in his trade-window.
|
|
|
|
virtual bool ignoreEquippedItems() { return true; }
|
|
|
|
virtual std::vector<MWWorld::Ptr> getEquippedItems();
|
|
|
|
|
2012-05-18 15:27:55 +00:00
|
|
|
virtual bool isTrading() { return true; }
|
|
|
|
virtual bool isTradeWindow() { return true; }
|
|
|
|
|
2012-05-18 13:51:33 +00:00
|
|
|
virtual std::vector<MWWorld::Ptr> itemsToIgnore();
|
|
|
|
|
2012-05-17 19:56:16 +00:00
|
|
|
void updateLabels();
|
2012-05-26 23:14:33 +00:00
|
|
|
|
|
|
|
virtual void onReferenceUnavailable();
|
2012-05-17 11:36:25 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|