OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MWGui::TradeWindow Class Reference

#include <tradewindow.hpp>

Inheritance diagram for MWGui::TradeWindow:
Collaboration diagram for MWGui::TradeWindow:

Public Types

typedef
MyGUI::delegates::CMultiDelegate0 
EventHandle_TradeDone
 
- Public Types inherited from MWGui::WindowBase
typedef
MyGUI::delegates::CMultiDelegate1
< WindowBase * > 
EventHandle_WindowBase
 

Public Member Functions

 TradeWindow ()
 
void setPtr (const MWWorld::Ptr &actor)
 Open this object in the GUI, for windows that support it. More...
 
void onFrame (float dt)
 Called every frame if the window is in an active GUI mode. More...
 
void clear ()
 Clear any state specific to the running game. More...
 
void borrowItem (int index, size_t count)
 
void returnItem (int index, size_t count)
 
int getMerchantServices ()
 
virtual bool exit ()
 Gracefully exits the window. More...
 
virtual void resetReference ()
 
- Public Member Functions inherited from MWGui::WindowBase
 WindowBase (const std::string &parLayout)
 
virtual MyGUI::Widget * getDefaultKeyFocus ()
 
virtual void onOpen ()
 Notify that window has been made visible. More...
 
virtual void onClose ()
 Notify that window has been hidden. More...
 
virtual void setVisible (bool visible)
 Sets the visibility of the window. More...
 
bool isVisible ()
 Returns the visibility state of the window. More...
 
void center ()
 
virtual void onResChange (int width, int height)
 Called when GUI viewport changes size. More...
 
- Public Member Functions inherited from MWGui::Layout
 Layout (const std::string &_layout, MyGUI::Widget *_parent=nullptr)
 
virtual ~Layout ()
 
MyGUI::Widget * getWidget (const std::string &_name)
 
template<typename T >
void getWidget (T *&_widget, const std::string &_name)
 
void setCoord (int x, int y, int w, int h)
 
void setText (const std::string &name, const std::string &caption)
 
void setTitle (const std::string &title)
 
- Public Member Functions inherited from MWGui::ReferenceInterface
 ReferenceInterface ()
 
virtual ~ReferenceInterface ()
 
void checkReferenceAvailable ()
 closes the window, if the MW-reference has become unavailable More...
 

Public Attributes

EventHandle_TradeDone eventTradeDone
 
- Public Attributes inherited from MWGui::Layout
MyGUI::Widget * mMainWidget
 

Private Member Functions

void sellToNpc (const MWWorld::Ptr &item, int count, bool boughtItem)
 only used for adjusting the gold balance More...
 
void buyFromNpc (const MWWorld::Ptr &item, int count, bool soldItem)
 only used for adjusting the gold balance More...
 
void updateOffer ()
 
void onItemSelected (int index)
 
void sellItem (MyGUI::Widget *sender, int count)
 
void onFilterChanged (MyGUI::Widget *_sender)
 
void onOfferButtonClicked (MyGUI::Widget *_sender)
 
void onAccept (MyGUI::EditBox *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 onBalanceValueChanged (int value)
 
void onRepeatClick (MyGUI::Widget *widget, MyGUI::ControllerItem *controller)
 
void addRepeatController (MyGUI::Widget *widget)
 
void onIncreaseButtonTriggered ()
 
void onDecreaseButtonTriggered ()
 
void addOrRemoveGold (int gold, const MWWorld::Ptr &actor)
 
void updateLabels ()
 
virtual void onReferenceUnavailable ()
 called when reference has become unavailable More...
 
int getMerchantGold ()
 
void restock ()
 

Private Attributes

ItemViewmItemView
 
SortFilterItemModelmSortModel
 
TradeItemModelmTradeModel
 
MWMechanics::Trading mTrading
 
MyGUI::Button * mFilterAll
 
MyGUI::Button * mFilterWeapon
 
MyGUI::Button * mFilterApparel
 
MyGUI::Button * mFilterMagic
 
MyGUI::Button * mFilterMisc
 
MyGUI::Button * mIncreaseButton
 
MyGUI::Button * mDecreaseButton
 
MyGUI::TextBox * mTotalBalanceLabel
 
Gui::NumericEditBoxmTotalBalance
 
MyGUI::Widget * mBottomPane
 
MyGUI::Button * mMaxSaleButton
 
MyGUI::Button * mCancelButton
 
MyGUI::Button * mOfferButton
 
MyGUI::TextBox * mPlayerGold
 
MyGUI::TextBox * mMerchantGold
 
int mItemToSell
 
int mCurrentBalance
 
int mCurrentMerchantOffer
 

Static Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from MWGui::Layout
std::string mPrefix
 
std::string mLayoutName
 
MyGUI::VectorWidgetPtr mListWindowRoot
 
- Protected Attributes inherited from MWGui::ReferenceInterface
MWWorld::Ptr mPtr
 

Member Typedef Documentation

typedef MyGUI::delegates::CMultiDelegate0 MWGui::TradeWindow::EventHandle_TradeDone

Constructor & Destructor Documentation

MWGui::TradeWindow::TradeWindow ( )

Here is the call graph for this function:

Member Function Documentation

void MWGui::TradeWindow::addOrRemoveGold ( int  gold,
const MWWorld::Ptr actor 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::addRepeatController ( MyGUI::Widget *  widget)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::borrowItem ( int  index,
size_t  count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::buyFromNpc ( const MWWorld::Ptr item,
int  count,
bool  soldItem 
)
private

only used for adjusting the gold balance

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::clear ( )
inlinevirtual

Clear any state specific to the running game.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

bool MWGui::TradeWindow::exit ( )
virtual

Gracefully exits the window.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

Here is the caller graph for this function:

int MWGui::TradeWindow::getMerchantGold ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

int MWGui::TradeWindow::getMerchantServices ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onAccept ( MyGUI::EditBox *  sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onBalanceButtonReleased ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
)
private

Here is the caller graph for this function:

void MWGui::TradeWindow::onBalanceValueChanged ( int  value)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onCancelButtonClicked ( MyGUI::Widget *  _sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onDecreaseButtonPressed ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onDecreaseButtonTriggered ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onFilterChanged ( MyGUI::Widget *  _sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onFrame ( float  duration)
virtual

Called every frame if the window is in an active GUI mode.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

void MWGui::TradeWindow::onIncreaseButtonPressed ( MyGUI::Widget *  _sender,
int  _left,
int  _top,
MyGUI::MouseButton  _id 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onIncreaseButtonTriggered ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onItemSelected ( int  index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onMaxSaleButtonClicked ( MyGUI::Widget *  _sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onOfferButtonClicked ( MyGUI::Widget *  _sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::onReferenceUnavailable ( )
privatevirtual

called when reference has become unavailable

Implements MWGui::ReferenceInterface.

Here is the call graph for this function:

void MWGui::TradeWindow::onRepeatClick ( MyGUI::Widget *  widget,
MyGUI::ControllerItem *  controller 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::resetReference ( )
virtual

Reimplemented from MWGui::ReferenceInterface.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::restock ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::returnItem ( int  index,
size_t  count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::sellItem ( MyGUI::Widget *  sender,
int  count 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::sellToNpc ( const MWWorld::Ptr item,
int  count,
bool  boughtItem 
)
private

only used for adjusting the gold balance

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::setPtr ( const MWWorld::Ptr ptr)
virtual

Open this object in the GUI, for windows that support it.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

void MWGui::TradeWindow::updateLabels ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::TradeWindow::updateOffer ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

EventHandle_TradeDone MWGui::TradeWindow::eventTradeDone
MyGUI::Widget* MWGui::TradeWindow::mBottomPane
private
MyGUI::Button* MWGui::TradeWindow::mCancelButton
private
int MWGui::TradeWindow::mCurrentBalance
private
int MWGui::TradeWindow::mCurrentMerchantOffer
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
int MWGui::TradeWindow::mItemToSell
private
ItemView* MWGui::TradeWindow::mItemView
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
SortFilterItemModel* MWGui::TradeWindow::mSortModel
private
Gui::NumericEditBox* MWGui::TradeWindow::mTotalBalance
private
MyGUI::TextBox* MWGui::TradeWindow::mTotalBalanceLabel
private
TradeItemModel* MWGui::TradeWindow::mTradeModel
private
MWMechanics::Trading MWGui::TradeWindow::mTrading
private
const float MWGui::TradeWindow::sBalanceChangeInitialPause = 0.5f
staticprivate
const float MWGui::TradeWindow::sBalanceChangeInterval = 0.1f
staticprivate

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