From 3575c7a606c2d24c0d444e9999892c0390fa5ae8 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 14 Mar 2009 13:21:35 -0600 Subject: Made a label class derived from the guichan label class which utilizes the palette colors. While technically, this can be accomplished through other means, it's rather clumsy overall, and is prone to introducing in programmer errors. This commit finally catches every case where text is used, and applies the text color from the color dialog to each of them appropriately. Signed-off-by: Ira Rice --- src/gui/char_select.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gui/char_select.cpp') diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index fa0594d6..f88736c1 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -24,11 +24,10 @@ #include -#include - #include "button.h" #include "char_select.h" #include "confirm_dialog.h" +#include "label.h" #include "ok_dialog.h" #include "playerbox.h" #include "textfield.h" @@ -90,10 +89,10 @@ CharSelectDialog::CharSelectDialog(Network *network, mPlayerBox = new PlayerBox; mPlayerBox->setWidth(74); - mNameLabel = new gcn::Label(strprintf(_("Name: %s"), "")); - mLevelLabel = new gcn::Label(strprintf(_("Level: %d"), 0)); - mJobLevelLabel = new gcn::Label(strprintf(_("Job Level: %d"), 0)); - mMoneyLabel = new gcn::Label(strprintf(_("Money: %d"), 0)); + mNameLabel = new Label(strprintf(_("Name: %s"), "")); + mLevelLabel = new Label(strprintf(_("Level: %d"), 0)); + mJobLevelLabel = new Label(strprintf(_("Job Level: %d"), 0)); + mMoneyLabel = new Label(strprintf(_("Money: %d"), 0)); const std::string tempString = getFont()->getWidth(_("New")) < getFont()->getWidth(_("Delete")) ? @@ -259,13 +258,13 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network, mPlayer->setHairStyle(rand() % mPlayer->getNumOfHairstyles(), rand() % numberOfHairColors); mNameField = new TextField(""); - mNameLabel = new gcn::Label(_("Name:")); + mNameLabel = new Label(_("Name:")); mNextHairColorButton = new Button(">", "nextcolor", this); mPrevHairColorButton = new Button("<", "prevcolor", this); - mHairColorLabel = new gcn::Label(_("Hair Color:")); + mHairColorLabel = new Label(_("Hair Color:")); mNextHairStyleButton = new Button(">", "nextstyle", this); mPrevHairStyleButton = new Button("<", "prevstyle", this); - mHairStyleLabel = new gcn::Label(_("Hair Style:")); + mHairStyleLabel = new Label(_("Hair Style:")); mCreateButton = new Button(_("Create"), "create", this); mCancelButton = new Button(_("Cancel"), "cancel", this); mPlayerBox = new PlayerBox(mPlayer); -- cgit v1.2.3-70-g09d2