From 33bcf31d8eb5c7712e8a9d0b31489186a5c68521 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 28 Dec 2004 10:48:44 +0000 Subject: Renamed stats dialog to status dialog, which it is and to make room for the real stats dialog that is currently called the skill dialog. --- src/gui/buysell.cpp | 6 ---- src/gui/buysell.h | 7 +---- src/gui/stats.cpp | 81 ----------------------------------------------------- src/gui/stats.h | 57 ------------------------------------- src/gui/status.cpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/gui/status.h | 57 +++++++++++++++++++++++++++++++++++++ 6 files changed, 139 insertions(+), 150 deletions(-) delete mode 100644 src/gui/stats.cpp delete mode 100644 src/gui/stats.h create mode 100644 src/gui/status.cpp create mode 100644 src/gui/status.h (limited to 'src/gui') diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp index 730689e0..eae19917 100644 --- a/src/gui/buysell.cpp +++ b/src/gui/buysell.cpp @@ -61,9 +61,3 @@ BuySellDialog::~BuySellDialog() delete sellButton; delete cancelButton; } - -void BuySellDialog::action(const std::string& eventId) -{ - if (eventId == "cancel") { - } -} diff --git a/src/gui/buysell.h b/src/gui/buysell.h index fb03cc9e..5289f649 100644 --- a/src/gui/buysell.h +++ b/src/gui/buysell.h @@ -32,7 +32,7 @@ * * \ingroup GUI */ -class BuySellDialog : public Window, public gcn::ActionListener { +class BuySellDialog : public Window { public: /** * Constructor. The action listener passed will receive "sell", "buy" @@ -47,11 +47,6 @@ class BuySellDialog : public Window, public gcn::ActionListener { */ ~BuySellDialog(); - /** - * Called when receiving actions from the widgets. - */ - void action(const std::string& eventId); - private: gcn::Button *buyButton; gcn::Button *sellButton; diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp deleted file mode 100644 index 949c6c27..00000000 --- a/src/gui/stats.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#include "stats.h" - -StatsDialog::StatsDialog(gcn::Container *parent): - Window(parent, "%s Lvl: % 2i Job: % 2i") -{ - hp = new gcn::Label("HP"); - sp = new gcn::Label("SP"); - gp = new gcn::Label("GP"); - healthBar = new ProgressBar(1.0f); - manaBar = new ProgressBar(1.0f); - - setSize(270, 40); - hp->setPosition(6, 20); - sp->setPosition(106, 20); - gp->setPosition(206, 20); - healthBar->setDimension(gcn::Rectangle(16, 6, 60, 18)); - manaBar->setDimension(gcn::Rectangle(116, 6, 60, 18)); - - add(hp); - add(sp); - add(gp); - add(healthBar); - add(manaBar); -} - -StatsDialog::~StatsDialog() -{ - delete hp; - delete sp; - delete gp; - delete healthBar; - delete manaBar; -} - -void StatsDialog::update() -{ - char *tempstr = new char[64]; - - sprintf(tempstr, "%s Lvl: % 2i Job: % 2i", - char_info->name, char_info->lv, char_info->job_lv); - setTitle(tempstr); - - sprintf(tempstr, "HP % 4d / % 4d", char_info->hp, char_info->max_hp); - hp->setCaption(tempstr); - hp->adjustSize(); - - sprintf(tempstr, "GP % 6i", char_info->gp); - gp->setCaption(tempstr); - gp->adjustSize(); - - sprintf(tempstr, "SP % 4d / % 4d", char_info->sp, char_info->max_sp); - sp->setCaption(tempstr); - sp->adjustSize(); - - healthBar->setProgress((float)char_info->hp / (float)char_info->max_hp); - - delete tempstr; -} diff --git a/src/gui/stats.h b/src/gui/stats.h deleted file mode 100644 index 19971469..00000000 --- a/src/gui/stats.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#ifdef WIN32 -#pragma warning(disable:4312) -#endif - -#ifndef _STATS_H -#define _STATS_H - -#include "../main.h" -#include "gui.h" -#include "window.h" -#include "progressbar.h" -#include - -/** - * The player statistics dialog. - * - * \ingroup GUI - */ -class StatsDialog : public Window { - public: - StatsDialog(gcn::Container *parent); - ~StatsDialog(); - - /** - * Updates this dialog with values from PLAYER_INFO *char_info - */ - void update(); - - private: - gcn::Label *hp, *sp, *gp; - ProgressBar *healthBar, *manaBar; -}; - -#endif diff --git a/src/gui/status.cpp b/src/gui/status.cpp new file mode 100644 index 00000000..026ac9a3 --- /dev/null +++ b/src/gui/status.cpp @@ -0,0 +1,81 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#include "status.h" + +StatusDialog::StatusDialog(gcn::Container *parent): + Window(parent, "%s Lvl: % 2i Job: % 2i") +{ + hp = new gcn::Label("HP"); + sp = new gcn::Label("SP"); + gp = new gcn::Label("GP"); + healthBar = new ProgressBar(1.0f); + manaBar = new ProgressBar(1.0f); + + setSize(270, 40); + hp->setPosition(6, 20); + sp->setPosition(106, 20); + gp->setPosition(206, 20); + healthBar->setDimension(gcn::Rectangle(16, 6, 60, 18)); + manaBar->setDimension(gcn::Rectangle(116, 6, 60, 18)); + + add(hp); + add(sp); + add(gp); + add(healthBar); + add(manaBar); +} + +StatusDialog::~StatusDialog() +{ + delete hp; + delete sp; + delete gp; + delete healthBar; + delete manaBar; +} + +void StatusDialog::update() +{ + char *tempstr = new char[64]; + + sprintf(tempstr, "%s Lvl: % 2i Job: % 2i", + char_info->name, char_info->lv, char_info->job_lv); + setTitle(tempstr); + + sprintf(tempstr, "HP % 4d / % 4d", char_info->hp, char_info->max_hp); + hp->setCaption(tempstr); + hp->adjustSize(); + + sprintf(tempstr, "GP % 6i", char_info->gp); + gp->setCaption(tempstr); + gp->adjustSize(); + + sprintf(tempstr, "SP % 4d / % 4d", char_info->sp, char_info->max_sp); + sp->setCaption(tempstr); + sp->adjustSize(); + + healthBar->setProgress((float)char_info->hp / (float)char_info->max_hp); + + delete tempstr; +} diff --git a/src/gui/status.h b/src/gui/status.h new file mode 100644 index 00000000..49a9595d --- /dev/null +++ b/src/gui/status.h @@ -0,0 +1,57 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifdef WIN32 +#pragma warning(disable:4312) +#endif + +#ifndef _STATS_H +#define _STATS_H + +#include "../main.h" +#include "gui.h" +#include "window.h" +#include "progressbar.h" +#include + +/** + * The player status dialog. + * + * \ingroup GUI + */ +class StatusDialog : public Window { + public: + StatusDialog(gcn::Container *parent); + ~StatusDialog(); + + /** + * Updates this dialog with values from PLAYER_INFO *char_info + */ + void update(); + + private: + gcn::Label *hp, *sp, *gp; + ProgressBar *healthBar, *manaBar; +}; + +#endif -- cgit v1.2.3-70-g09d2