#include <BuyAccessoryDialog.h>

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_ |
| GLWTab * | sellTab_ |
| GLWTab * | favouritesTab_ |
| GLWPanel * | topPanel_ |
| GLWDropDownText * | sortDropDown_ |
| GLWCheckBoxText * | defaultTab_ |
| GLWFlag * | flag_ |
| std::map< unsigned int, Accessory * > | sellMap_ |
| std::map< unsigned int, Accessory * > | buyMap_ |
| std::map< unsigned int, Accessory * > | favMap_ |
| std::set< std::string > | favorites_ |
Static Protected Attributes | |
| static BuyAccessoryDialog * | instance_ = 0 |
Private Member Functions | |
| BuyAccessoryDialog () | |
| virtual | ~BuyAccessoryDialog () |
Definition at line 37 of file BuyAccessoryDialog.h.
| 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.
| 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().
BuyAccessoryDialog * BuyAccessoryDialog::instance_ = 0 [static, protected] |
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] |
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] |
std::map<unsigned int, Accessory *> BuyAccessoryDialog::sellMap_ [protected] |
std::map<unsigned int, Accessory *> BuyAccessoryDialog::buyMap_ [protected] |
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().
1.5.3