BuyAccessoryDialog Class Reference

#include <BuyAccessoryDialog.h>

Inheritance diagram for BuyAccessoryDialog:

GLWWindow GLWButtonI GLWCheckBoxI GLWDropDownI GLWTabI GLWPanel GLWidget MetaClass

List of all members.

Public Member Functions

virtual void draw ()
virtual void buttonDown (unsigned int id)
virtual void display ()
virtual void stateChange (bool state, unsigned int id)
virtual void select (unsigned int id, const int pos, GLWSelectorEntry value)
virtual void tabDown (unsigned int id)
void playerRefreshKeepPos ()

Static Public Member Functions

static
BuyAccessoryDialog
instance ()

Protected Member Functions

void addTabs ()
void loadFavorites ()
void saveFavorites ()
void playerRefresh ()
void addPlayerName ()
void addPlayerWeapons ()
void addPlayerWeaponsSell ()
void addPlayerFavorites ()
void addPlayerWeaponsBuy (GLWTab *tab, const char *group)
bool addAccessory (Tank *tank, GLWTab *tab, float height, Accessory *current)

Protected Attributes

unsigned int okId_
unsigned int giftId_
bool firstDrawTime_
std::map
< std::string,
GLWTab * > 
buyTabs_
GLWTabsellTab_
GLWTabfavouritesTab_
GLWPaneltopPanel_
GLWDropDownTextsortDropDown_
GLWCheckBoxTextdefaultTab_
GLWFlagflag_
std::map< unsigned
int, Accessory * > 
sellMap_
std::map< unsigned
int, Accessory * > 
buyMap_
std::map< unsigned
int, Accessory * > 
favMap_
std::set< std::stringfavorites_

Static Protected Attributes

static
BuyAccessoryDialog
instance_ = 0

Private Member Functions

 BuyAccessoryDialog ()
virtual ~BuyAccessoryDialog ()


Detailed Description

Definition at line 37 of file BuyAccessoryDialog.h.


Constructor & Destructor Documentation

BuyAccessoryDialog::BuyAccessoryDialog (  )  [private]

Definition at line 52 of file BuyAccessoryDialog.cpp.

References GLWDropDownText::addText(), GLWPanel::addWidget(), GLWButton::ButtonFlagCenterX, GLWButton::ButtonFlagOk, defaultTab_, GLWCheckBoxText::getCheckBox(), GLWidget::getId(), GLWCheckBoxText::getLabel(), giftId_, GLWPanel::GLWPanel(), ScorchedClient::instance(), LANG_RESOURCE, okId_, GLWidget::setH(), GLWDropDown::setHandler(), GLWCheckBox::setHandler(), GLWidget::setName(), GLWLabel::setSize(), GLWidget::setW(), sortDropDown_, and topPanel_.

BuyAccessoryDialog::~BuyAccessoryDialog (  )  [private, virtual]

Definition at line 88 of file BuyAccessoryDialog.cpp.


Member Function Documentation

BuyAccessoryDialog * BuyAccessoryDialog::instance (  )  [static]

Definition at line 43 of file BuyAccessoryDialog.cpp.

References instance_.

Referenced by GiftMoneyDialog::buttonDown(), ClientGiftMoneyHandler::processMessage(), and ClientWindowSetup::setupGameWindows().

void BuyAccessoryDialog::draw (  )  [virtual]

Reimplemented from GLWWindow.

Definition at line 92 of file BuyAccessoryDialog.cpp.

References defaultTab_, GLFont2d::draw(), GLWWindow::draw(), firstDrawTime_, GLWFont::getGameFont(), GLViewPort::getHeight(), MetaClass::getMetaClassId(), GLWPanel::getWidgets(), GLWidget::getY(), GLWFont::instance(), LANG_RESOURCE_VAR, GLWWindow::needCentered_, sellTab_, GLWTab::setH(), GLWidget::setH(), GLWCheckBoxText::setY(), GLWidget::setY(), topPanel_, GLWPanel::GLWPanelEntry::widget, GLWidget::x_, and GLWidget::y_.

void BuyAccessoryDialog::buttonDown ( unsigned int  id  )  [virtual]

Implements GLWButtonI.

Definition at line 551 of file BuyAccessoryDialog.cpp.

References TankAccessories::add(), buyMap_, Tank::getAccessories(), Accessory::getAccessoryId(), Accessory::getBundle(), TankContainer::getCurrentTank(), ScorchedContext::getGameState(), GLWidget::getId(), TankScore::getMoney(), Target::getPlayerId(), Accessory::getPrice(), Tank::getScore(), Accessory::getSellPrice(), ScorchedContext::getTankContainer(), giftId_, GLWWindowManager::hideWindow(), GiftMoneyDialog::instance(), GLWWindowManager::instance(), ScorchedClient::instance(), okId_, playerRefreshKeepPos(), TankAccessories::rm(), saveFavorites(), sellMap_, ComsMessageSender::sendToServer(), TankScore::setMoney(), GLWWindowManager::showWindow(), ClientState::StimAutoDefense, and GameState::stimulate().

void BuyAccessoryDialog::display (  )  [virtual]

Reimplemented from GLWPanel.

Definition at line 400 of file BuyAccessoryDialog.cpp.

References addTabs(), buyTabs_, OptionsDisplay::getBuyTab(), TankContainer::getCurrentTank(), MetaClass::getMetaClassId(), GLWTab::getName(), ScorchedContext::getTankContainer(), GLWPanel::getWidgets(), ScorchedClient::instance(), OptionsDisplay::instance(), LANG_RESOURCE, loadFavorites(), playerRefresh(), sellTab_, GLWDropDownText::setCurrentText(), GLWTab::setDepressed(), GLWDropDown::setHandler(), sortDropDown_, AccessoryStore::SortName, AccessoryStore::SortNothing, AccessoryStore::SortPrice, LangStringUtil::strcmp(), tabDown(), and GLWPanel::GLWPanelEntry::widget.

Referenced by select().

void BuyAccessoryDialog::stateChange ( bool  state,
unsigned int  id 
) [virtual]

Implements GLWCheckBoxI.

Definition at line 500 of file BuyAccessoryDialog.cpp.

References GLWScrollPanel::calculateVisible(), defaultTab_, favMap_, favorites_, favouritesTab_, OptionsDisplay::getBuyTabEntry(), GLWCheckBoxText::getCheckBox(), GLWTab::getDepressed(), GLWidget::getId(), MetaClass::getMetaClassId(), GLWTab::getName(), GLWCheckBox::getState(), GLWPanel::getWidgets(), OptionsDisplay::instance(), playerRefreshKeepPos(), sellTab_, OptionEntryString::setValue(), and GLWPanel::GLWPanelEntry::widget.

void BuyAccessoryDialog::select ( unsigned int  id,
const int  pos,
GLWSelectorEntry  value 
) [virtual]

Implements GLWDropDownI.

Definition at line 482 of file BuyAccessoryDialog.cpp.

References display(), OptionsDisplay::getAccessorySortKeyEntry(), GLWSelectorEntry::getDataText(), GLWidget::getId(), OptionsDisplay::instance(), playerRefreshKeepPos(), OptionEntryEnum::setValue(), sortDropDown_, AccessoryStore::SortName, AccessoryStore::SortNothing, AccessoryStore::SortPrice, and LangStringUtil::strcmp().

void BuyAccessoryDialog::tabDown ( unsigned int  id  )  [virtual]

Implements GLWTabI.

Definition at line 454 of file BuyAccessoryDialog.cpp.

References defaultTab_, OptionsDisplay::getBuyTab(), GLWCheckBoxText::getCheckBox(), GLWTab::getDepressed(), MetaClass::getMetaClassId(), GLWTab::getName(), GLWPanel::getWidgets(), OptionsDisplay::instance(), sellTab_, GLWCheckBox::setState(), LangStringUtil::strcmp(), and GLWPanel::GLWPanelEntry::widget.

Referenced by display().

void BuyAccessoryDialog::playerRefreshKeepPos (  ) 

Definition at line 186 of file BuyAccessoryDialog.cpp.

References addPlayerName(), addPlayerWeapons(), GLWScrollW::getCurrent(), MetaClass::getMetaClassId(), GLWTab::getName(), GLWScrollPanel::getScrollBar(), GLWPanel::getWidgets(), sellTab_, GLWScrollW::setCurrent(), and GLWPanel::GLWPanelEntry::widget.

Referenced by buttonDown(), ClientGiftMoneyHandler::processMessage(), select(), and stateChange().

void BuyAccessoryDialog::addTabs (  )  [protected]

Definition at line 153 of file BuyAccessoryDialog.cpp.

References GLWPanel::addWidget(), buyTabs_, favouritesTab_, ScorchedClient::instance(), LANG_RESOURCE, sellTab_, and GLWTab::setHandler().

Referenced by display().

void BuyAccessoryDialog::loadFavorites (  )  [protected]

Definition at line 607 of file BuyAccessoryDialog.cpp.

References S3D::dialogMessage(), favorites_, file, S3D::formatStringBuffer(), XMLNode::getNamedChild(), XMLFile::getParserError(), XMLFile::getRootNode(), S3D::getSettingsFile(), ScorchedClient::instance(), and XMLFile::readFile().

Referenced by display().

void BuyAccessoryDialog::saveFavorites (  )  [protected]

Definition at line 632 of file BuyAccessoryDialog.cpp.

References XMLNode::addChild(), favorites_, S3D::formatStringBuffer(), S3D::getSettingsFile(), ScorchedClient::instance(), and XMLNode::writeToFile().

Referenced by buttonDown().

void BuyAccessoryDialog::playerRefresh (  )  [protected]

Definition at line 180 of file BuyAccessoryDialog.cpp.

References addPlayerName(), and addPlayerWeapons().

Referenced by display().

void BuyAccessoryDialog::addPlayerName (  )  [protected]

Definition at line 134 of file BuyAccessoryDialog.cpp.

References GLWPanel::addWidget(), GLWPanel::clear(), flag_, S3D::formatStringBuffer(), Tank::getColor(), TankContainer::getCurrentTank(), TankScore::getMoney(), GLWFlag::getOffset(), Tank::getScore(), ScorchedContext::getTankContainer(), Target::getTargetName(), ScorchedClient::instance(), LANG_RESOURCE_2, LANG_STRING, GLWFlag::setOffset(), and topPanel_.

Referenced by playerRefresh(), and playerRefreshKeepPos().

void BuyAccessoryDialog::addPlayerWeapons (  )  [protected]

Definition at line 218 of file BuyAccessoryDialog.cpp.

References addPlayerFavorites(), addPlayerWeaponsBuy(), addPlayerWeaponsSell(), buyTabs_, GLWScrollPanel::clear(), MetaClass::getMetaClassId(), GLWPanel::getWidgets(), ScorchedClient::instance(), sellTab_, and GLWPanel::GLWPanelEntry::widget.

Referenced by playerRefresh(), and playerRefreshKeepPos().

void BuyAccessoryDialog::addPlayerWeaponsSell (  )  [protected]

Definition at line 292 of file BuyAccessoryDialog.cpp.

References addAccessory(), Tank::getAccessories(), ScorchedContext::getAccessoryStore(), TankAccessories::getAllAccessories(), TankContainer::getCurrentTank(), ScorchedContext::getTankContainer(), OptionsDisplay::instance(), ScorchedClient::instance(), sellTab_, and AccessoryStore::sortList().

Referenced by addPlayerWeapons().

void BuyAccessoryDialog::addPlayerFavorites (  )  [protected]

Definition at line 248 of file BuyAccessoryDialog.cpp.

References addAccessory(), favorites_, favouritesTab_, TankContainer::getCurrentTank(), Accessory::getName(), ScorchedContext::getTankContainer(), OptionsDisplay::instance(), and ScorchedClient::instance().

Referenced by addPlayerWeapons().

void BuyAccessoryDialog::addPlayerWeaponsBuy ( GLWTab tab,
const char *  group 
) [protected]

Definition at line 271 of file BuyAccessoryDialog.cpp.

References addAccessory(), TankContainer::getCurrentTank(), ScorchedContext::getTankContainer(), OptionsDisplay::instance(), and ScorchedClient::instance().

Referenced by addPlayerWeapons().

bool BuyAccessoryDialog::addAccessory ( Tank tank,
GLWTab tab,
float  height,
Accessory current 
) [protected]

Definition at line 313 of file BuyAccessoryDialog.cpp.

References TankAccessories::accessoryAllowed(), GLWPanel::addWidget(), GLWButton::ButtonFlagCenterX, buyMap_, favMap_, favorites_, S3D::formatStringBuffer(), Tank::getAccessories(), TankAccessories::getAccessoryCount(), TankAccessories::getAccessoryCountString(), Accessory::getBundle(), GLWidget::getH(), GLWidget::getId(), TankScore::getMoney(), Accessory::getName(), Accessory::getNoBuy(), Accessory::getPrice(), Tank::getScore(), Accessory::getSellPrice(), Accessory::getTexture(), Accessory::getToolTip(), GLWLabel::getW(), GLWidget::getX(), LANG_RESOURCE, LANG_RESOURCE_2, LANG_RESOURCE_3, LANG_STRING, sellMap_, GLWLabel::setColor(), GLWTextButton::setColor(), GLWidget::setH(), GLWCheckBox::setHandler(), GLWCheckBox::setState(), GLWidget::setToolTip(), GLWidget::setW(), GLWidget::setX(), and ToolTip::ToolTipHelp.

Referenced by addPlayerFavorites(), addPlayerWeaponsBuy(), and addPlayerWeaponsSell().


Member Data Documentation

BuyAccessoryDialog * BuyAccessoryDialog::instance_ = 0 [static, protected]

Definition at line 63 of file BuyAccessoryDialog.h.

Referenced by instance().

unsigned int BuyAccessoryDialog::okId_ [protected]

Definition at line 64 of file BuyAccessoryDialog.h.

Referenced by buttonDown(), and BuyAccessoryDialog().

unsigned int BuyAccessoryDialog::giftId_ [protected]

Definition at line 64 of file BuyAccessoryDialog.h.

Referenced by buttonDown(), and BuyAccessoryDialog().

bool BuyAccessoryDialog::firstDrawTime_ [protected]

Definition at line 65 of file BuyAccessoryDialog.h.

Referenced by draw().

std::map<std::string, GLWTab *> BuyAccessoryDialog::buyTabs_ [protected]

Definition at line 66 of file BuyAccessoryDialog.h.

Referenced by addPlayerWeapons(), addTabs(), and display().

GLWTab* BuyAccessoryDialog::sellTab_ [protected]

Definition at line 67 of file BuyAccessoryDialog.h.

Referenced by addPlayerWeapons(), addPlayerWeaponsSell(), addTabs(), display(), draw(), playerRefreshKeepPos(), stateChange(), and tabDown().

GLWTab* BuyAccessoryDialog::favouritesTab_ [protected]

Definition at line 68 of file BuyAccessoryDialog.h.

Referenced by addPlayerFavorites(), addTabs(), and stateChange().

GLWPanel* BuyAccessoryDialog::topPanel_ [protected]

Definition at line 69 of file BuyAccessoryDialog.h.

Referenced by addPlayerName(), BuyAccessoryDialog(), and draw().

GLWDropDownText* BuyAccessoryDialog::sortDropDown_ [protected]

Definition at line 70 of file BuyAccessoryDialog.h.

Referenced by BuyAccessoryDialog(), display(), and select().

GLWCheckBoxText* BuyAccessoryDialog::defaultTab_ [protected]

Definition at line 71 of file BuyAccessoryDialog.h.

Referenced by BuyAccessoryDialog(), draw(), stateChange(), and tabDown().

GLWFlag* BuyAccessoryDialog::flag_ [protected]

Definition at line 72 of file BuyAccessoryDialog.h.

Referenced by addPlayerName().

std::map<unsigned int, Accessory *> BuyAccessoryDialog::sellMap_ [protected]

Definition at line 73 of file BuyAccessoryDialog.h.

Referenced by addAccessory(), and buttonDown().

std::map<unsigned int, Accessory *> BuyAccessoryDialog::buyMap_ [protected]

Definition at line 74 of file BuyAccessoryDialog.h.

Referenced by addAccessory(), and buttonDown().

std::map<unsigned int, Accessory *> BuyAccessoryDialog::favMap_ [protected]

Definition at line 75 of file BuyAccessoryDialog.h.

Referenced by addAccessory(), and stateChange().

std::set<std::string> BuyAccessoryDialog::favorites_ [protected]

Definition at line 76 of file BuyAccessoryDialog.h.

Referenced by addAccessory(), addPlayerFavorites(), loadFavorites(), saveFavorites(), and stateChange().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:00 2009 for Scorched3D by  doxygen 1.5.3