From 0fbfd04fe113e448ada74af6e8e028d089113afc Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 15 Dec 2010 18:31:07 +0100 Subject: Small hacking cleanups. In preparation for resolution of mana-issue: #211. Trivial. --- src/gui/charselectdialog.cpp | 18 ++++++++++++------ src/gui/widgets/playerbox.h | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 1c292759..d8794afd 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -154,7 +154,8 @@ CharSelectDialog::CharSelectDialog(LoginData *loginData): place = getPlacer(0, 1); - for (int i = 0; i < MAX_CHARACTER_COUNT; i++) { + for (int i = 0; i < MAX_CHARACTER_COUNT; i++) + { mCharacterEntries[i] = new CharacterDisplay(this); place(i, 0, mCharacterEntries[i]); } @@ -191,7 +192,8 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) { attemptCharacterSelect(selected); } - else if (eventId == "new" && !mCharacterEntries[selected]->getCharacter()) + else if (eventId == "new" + && !mCharacterEntries[selected]->getCharacter()) { // Start new character dialog CharCreateDialog *charCreateDialog = @@ -268,7 +270,8 @@ void CharSelectDialog::setCharacters(const Net::Characters &characters) for (i = characters.begin(); i != i_end; ++i) { Net::Character *character = *i; - if (character->slot >= MAX_CHARACTER_COUNT) { + if (character->slot >= MAX_CHARACTER_COUNT) + { logger->log("Warning: slot out of range: %d", character->slot); continue; } @@ -309,9 +312,12 @@ bool CharSelectDialog::selectByName(const std::string &name, if (mLocked) return false; - for (int i = 0; i < MAX_CHARACTER_COUNT; ++i) { - if (Net::Character *character = mCharacterEntries[i]->getCharacter()) { - if (character->dummy->getName() == name) { + for (int i = 0; i < MAX_CHARACTER_COUNT; ++i) + { + if (Net::Character *character = mCharacterEntries[i]->getCharacter()) + { + if (character->dummy->getName() == name) + { mCharacterEntries[i]->requestFocus(); if (action == Choose) attemptCharacterSelect(i); diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index 4505367f..4ce6782d 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -51,7 +51,8 @@ class PlayerBox : public gcn::ScrollArea * player to NULL causes the box not to draw any * character. */ - void setPlayer(const Being *being) { mBeing = being; } + void setPlayer(const Being *being) + { mBeing = being; } /** * Draws the scroll area. -- cgit v1.2.3-70-g09d2