From 2debd445c71e65265359b6471795cab2cb2c7086 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 24 Aug 2007 12:32:19 +0000 Subject: Added trimming of name for new character creation and of chat messages appearing above players. Also improved resize mouse cursor indication, removing duplicated code and fixing indicator above resize grip. --- src/gui/char_select.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/gui/char_select.cpp') diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index fc6be59f..fe260561 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -41,6 +41,7 @@ #include "../net/messageout.h" #include "../utils/tostring.h" +#include "../utils/trim.h" // Defined in main.cpp, used here for setting the char create dialog extern CharServerHandler charServerHandler; @@ -249,11 +250,6 @@ bool CharSelectDialog::selectByName(const std::string &name) return false; } -std::string CharSelectDialog::getName() -{ - return mNameLabel->getCaption(); -} - CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network, unsigned char sex): Window("Create Character", true, parent), mNetwork(network), mSlot(slot) @@ -357,10 +353,12 @@ CharCreateDialog::action(const gcn::ActionEvent &event) } } -const std::string& +std::string CharCreateDialog::getName() { - return mNameField->getText(); + std::string name = mNameField->getText(); + trim(name); + return name; } void -- cgit v1.2.3-70-g09d2