Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsMerchantWindow Class Reference

The window that deals with interacting with a NPC merchant. More...

#include <pawsmerchantwindow.h>

List of all members.

Public Member Functions

void Close ()
 Simply calls Hide() unless overidden.
void DoTrade (int count, const char *itemName, const char *itemID)
void HandleMessage (MsgEntry *me)
bool OnButtonPressed (int mouseButton, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed.
void OnListAction (pawsListBox *listbox, int status)
 Called whenever an item in a child list box is selected.
void OnNumberEntered (const char *name, int param, int value)
 pawsMerchantWindow ()
bool PostSetup ()
 This is called after the widget and all of it's children have been created.
virtual ~pawsMerchantWindow ()

Protected Member Functions

void HandleCategories (const char *data)
void HandleItems (const char *data)
void HandleMerchant (const char *data)
void HandleMoney (const char *data)
void SetTradeMode (bool buy)
void TradeSelectedItem (bool all=false, bool single=false)
 Handles the command of trading the item by interacting with the player.
void UpdateMoney (const char *moneyName, const char *imageName, int value)

Protected Attributes

pawsListBoxcategoryBox
 index of item, selected in the itemsBox
csString currentID
csString currentItem
pawsListBoxitemsBox
int merchantID
int selectedItem
int tradeCommand
pawsTextBoxtrias

Detailed Description

The window that deals with interacting with a NPC merchant.

Definition at line 34 of file pawsmerchantwindow.h.


Constructor & Destructor Documentation

pawsMerchantWindow::pawsMerchantWindow ( )
virtual pawsMerchantWindow::~pawsMerchantWindow ( ) [virtual]

Member Function Documentation

void pawsMerchantWindow::Close ( ) [virtual]

Simply calls Hide() unless overidden.

Reimplemented from pawsWidget.

void pawsMerchantWindow::DoTrade ( int  count,
const char *  itemName,
const char *  itemID 
)
void pawsMerchantWindow::HandleCategories ( const char *  data) [protected]
void pawsMerchantWindow::HandleItems ( const char *  data) [protected]
void pawsMerchantWindow::HandleMerchant ( const char *  data) [protected]
void pawsMerchantWindow::HandleMessage ( MsgEntry me) [virtual]

Implements psClientNetSubscriber.

void pawsMerchantWindow::HandleMoney ( const char *  data) [protected]
bool pawsMerchantWindow::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

Called whenever a button is pressed.

Parameters:
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

void pawsMerchantWindow::OnListAction ( pawsListBox selected,
int  status 
) [virtual]

Called whenever an item in a child list box is selected.

Parameters:
selectedThe listbox that has the item selected.
statusFrom listbox when a row is selected.

Reimplemented from pawsWidget.

void pawsMerchantWindow::OnNumberEntered ( const char *  name,
int  param,
int  value 
) [virtual]
bool pawsMerchantWindow::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

void pawsMerchantWindow::SetTradeMode ( bool  buy) [protected]
void pawsMerchantWindow::TradeSelectedItem ( bool  all = false,
bool  single = false 
) [protected]

Handles the command of trading the item by interacting with the player.

Checks if we buy a single or multiple item and asks in case of uncertainity the amount of items to buy

Parameters:
allindicates that all the item in the current selected entry will be bought/sold
singleindicates only one item in the current selected entry will be bought/sold, even if more are available.
void pawsMerchantWindow::UpdateMoney ( const char *  moneyName,
const char *  imageName,
int  value 
) [protected]

Member Data Documentation

index of item, selected in the itemsBox

Definition at line 75 of file pawsmerchantwindow.h.

csString pawsMerchantWindow::currentID [protected]

Definition at line 79 of file pawsmerchantwindow.h.

csString pawsMerchantWindow::currentItem [protected]

Definition at line 79 of file pawsmerchantwindow.h.

Definition at line 76 of file pawsmerchantwindow.h.

Definition at line 71 of file pawsmerchantwindow.h.

Definition at line 73 of file pawsmerchantwindow.h.

Definition at line 72 of file pawsmerchantwindow.h.

Definition at line 77 of file pawsmerchantwindow.h.


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