OpenMW
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
MWGui::TradeWindow Class Reference

#include <tradewindow.hpp>

List of all members.

Public Member Functions

 TradeWindow ()
void startTrade (const MWWorld::Ptr &actor)
void addOrRemoveGold (int gold, const MWWorld::Ptr &actor)
void onFrame (float frameDuration)
void borrowItem (int index, size_t count)
void returnItem (int index, size_t count)
int getMerchantServices ()

Private Types

enum  BalanceButtonsState { BBS_None, BBS_Increase, BBS_Decrease }

Private Member Functions

void sellToNpc (const MWWorld::Ptr &item, int count, bool boughtItem)
 only used for adjusting the gold balance
void buyFromNpc (const MWWorld::Ptr &item, int count, bool soldItem)
 only used for adjusting the gold balance
void onItemSelected (int index)
void sellItem (MyGUI::Widget *sender, int count)
void onFilterChanged (MyGUI::Widget *_sender)
void onOfferButtonClicked (MyGUI::Widget *_sender)
void onCancelButtonClicked (MyGUI::Widget *_sender)
void onMaxSaleButtonClicked (MyGUI::Widget *_sender)
void onIncreaseButtonPressed (MyGUI::Widget *_sender, int _left, int _top, MyGUI::MouseButton _id)
void onDecreaseButtonPressed (MyGUI::Widget *_sender, int _left, int _top, MyGUI::MouseButton _id)
void onBalanceButtonReleased (MyGUI::Widget *_sender, int _left, int _top, MyGUI::MouseButton _id)
void onIncreaseButtonTriggered ()
void onDecreaseButtonTriggered ()
void updateLabels ()
virtual void onReferenceUnavailable ()
 called when reference has become unavailable
int getMerchantGold ()

Private Attributes

ItemViewmItemView
SortFilterItemModelmSortModel
TradeItemModelmTradeModel
MyGUI::Button * mFilterAll
MyGUI::Button * mFilterWeapon
MyGUI::Button * mFilterApparel
MyGUI::Button * mFilterMagic
MyGUI::Button * mFilterMisc
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
int mItemToSell
int mCurrentBalance
int mCurrentMerchantOffer
enum
MWGui::TradeWindow::BalanceButtonsState 
mBalanceButtonsState
float mBalanceChangePause
 pause before next balance change will trigger while user holds +/- button pressed

Static Private Attributes

static const float sBalanceChangeInitialPause = 0.5
static const float sBalanceChangeInterval = 0.1

Member Enumeration Documentation

Enumerator:
BBS_None 
BBS_Increase 
BBS_Decrease 

Constructor & Destructor Documentation


Member Function Documentation

void MWGui::TradeWindow::addOrRemoveGold ( int  gold,
const MWWorld::Ptr actor 
)
void MWGui::TradeWindow::borrowItem ( int  index,
size_t  count 
)
void MWGui::TradeWindow::buyFromNpc ( const MWWorld::Ptr item,
int  count,
bool  soldItem 
) [private]

only used for adjusting the gold balance

void MWGui::TradeWindow::onBalanceButtonReleased ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
) [private]
void MWGui::TradeWindow::onCancelButtonClicked ( MyGUI::Widget *  _sender) [private]
void MWGui::TradeWindow::onDecreaseButtonPressed ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
) [private]
void MWGui::TradeWindow::onFilterChanged ( MyGUI::Widget *  _sender) [private]
void MWGui::TradeWindow::onFrame ( float  frameDuration)
void MWGui::TradeWindow::onIncreaseButtonPressed ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
) [private]
void MWGui::TradeWindow::onItemSelected ( int  index) [private]
void MWGui::TradeWindow::onMaxSaleButtonClicked ( MyGUI::Widget *  _sender) [private]
void MWGui::TradeWindow::onOfferButtonClicked ( MyGUI::Widget *  _sender) [private]
void MWGui::TradeWindow::onReferenceUnavailable ( ) [private, virtual]

called when reference has become unavailable

Implements MWGui::ReferenceInterface.

void MWGui::TradeWindow::returnItem ( int  index,
size_t  count 
)
void MWGui::TradeWindow::sellItem ( MyGUI::Widget *  sender,
int  count 
) [private]
void MWGui::TradeWindow::sellToNpc ( const MWWorld::Ptr item,
int  count,
bool  boughtItem 
) [private]

only used for adjusting the gold balance


Member Data Documentation

pause before next balance change will trigger while user holds +/- button pressed

MyGUI::Widget* MWGui::TradeWindow::mBottomPane [private]
MyGUI::Button* MWGui::TradeWindow::mCancelButton [private]
MyGUI::Button* MWGui::TradeWindow::mDecreaseButton [private]
MyGUI::Button* MWGui::TradeWindow::mFilterAll [private]
MyGUI::Button* MWGui::TradeWindow::mFilterApparel [private]
MyGUI::Button* MWGui::TradeWindow::mFilterMagic [private]
MyGUI::Button* MWGui::TradeWindow::mFilterMisc [private]
MyGUI::Button* MWGui::TradeWindow::mFilterWeapon [private]
MyGUI::Button* MWGui::TradeWindow::mIncreaseButton [private]
MyGUI::Button* MWGui::TradeWindow::mMaxSaleButton [private]
MyGUI::TextBox* MWGui::TradeWindow::mMerchantGold [private]
MyGUI::Button* MWGui::TradeWindow::mOfferButton [private]
MyGUI::TextBox* MWGui::TradeWindow::mPlayerGold [private]
MyGUI::TextBox* MWGui::TradeWindow::mTotalBalance [private]
MyGUI::TextBox* MWGui::TradeWindow::mTotalBalanceLabel [private]
const float MWGui::TradeWindow::sBalanceChangeInitialPause = 0.5 [static, private]
const float MWGui::TradeWindow::sBalanceChangeInterval = 0.1 [static, private]

The documentation for this class was generated from the following files: