summaryrefslogtreecommitdiff
path: root/src/gui/setup_players.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-02-11 09:30:26 +0000
committerDavid Athay <ko2fan@gmail.com>2009-02-11 09:30:26 +0000
commit91111ca5d13072ea3b834e23835df9c077329e39 (patch)
treef0af8dd08b766164835cf9b5412a9aa3267dbad7 /src/gui/setup_players.cpp
parent8046bb2626b30fecdcea54eb0aa3349cdb7d277b (diff)
parent63ac001daa7dfc0735dfefd9c2829c8786b4edaf (diff)
downloadmana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.gz
mana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.bz2
mana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.xz
mana-client-91111ca5d13072ea3b834e23835df9c077329e39.zip
Merge branch 'master' of git@gitorious.org:tmw/eathena
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r--src/gui/setup_players.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 1d8649eb..d25117de 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -19,26 +19,27 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "setup_players.h"
+#include <string>
+#include <vector>
+
+#include <guichan/widgets/label.hpp>
#include "button.h"
#include "checkbox.h"
+#include "listbox.h"
#include "ok_dialog.h"
+#include "scrollarea.h"
+#include "setup_players.h"
+#include "table.h"
+#include "widgets/dropdown.h"
#include "widgets/layouthelper.h"
#include "../configuration.h"
#include "../log.h"
-#include "../player_relations.h"
-#include "../sound.h"
#include "../utils/gettext.h"
-#include <guichan/widgets/dropdown.hpp>
-#include <guichan/widgets/label.hpp>
-
-#include <vector>
-
#define COLUMNS_NR 2 // name plus listbox
#define NAME_COLUMN 0
#define RELATION_CHOICE_COLUMN 1
@@ -136,8 +137,12 @@ public:
std::string name = (*player_names)[r];
gcn::Widget *widget = new gcn::Label(name);
mWidgets.push_back(widget);
+ gcn::ListModel *playerRelation = new PlayerRelationListModel();
- gcn::DropDown *choicebox = new gcn::DropDown(new PlayerRelationListModel());
+ gcn::DropDown *choicebox = new DropDown(playerRelation,
+ new ScrollArea(),
+ new ListBox(playerRelation),
+ false);
choicebox->setSelected(player_relations.getRelation(name));
mWidgets.push_back(choicebox);
}
@@ -198,7 +203,7 @@ public:
virtual std::string getElementAt(int i)
{
if (i >= getNumberOfElements()) {
- return "???";
+ return _("???");
}
return (*player_relations.getPlayerIgnoreStrategies())[i]->mDescription;
}
@@ -220,18 +225,22 @@ Setup_Players::Setup_Players():
player_relations.getDefault() & PlayerRelation::TRADE)),
mDefaultWhisper(new CheckBox(_("Allow whispers"),
player_relations.getDefault() & PlayerRelation::WHISPER)),
- mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this)),
- mIgnoreActionChoicesBox(new gcn::DropDown(new IgnoreChoicesListModel()))
+ mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this))
{
setOpaque(false);
+ mPlayerTable->setOpaque(false);
int table_width = NAME_COLUMN_WIDTH + RELATION_CHOICE_COLUMN_WIDTH;
mPlayerTableTitleModel->fixColumnWidth(NAME_COLUMN, NAME_COLUMN_WIDTH);
mPlayerTableTitleModel->fixColumnWidth(RELATION_CHOICE_COLUMN,
RELATION_CHOICE_COLUMN_WIDTH);
- mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width, 10));
+ mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width - 1, 10));
mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf));
+ gcn::ListModel *ignoreChoices = new IgnoreChoicesListModel();
+ mIgnoreActionChoicesBox = new DropDown(ignoreChoices, new ScrollArea(),
+ new ListBox(ignoreChoices), false);
+
for (int i = 0; i < COLUMNS_NR; i++)
{
mPlayerTableTitleModel->set(0, i,