From 24fcf548c2d570d1b23bf799159b64f170f738bd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Dec 2012 19:29:00 +0300 Subject: Fix code style and other small issues. --- src/being.cpp | 3 ++- src/game.cpp | 3 ++- src/gui/outfitwindow.cpp | 2 +- src/gui/outfitwindow.h | 2 +- src/gui/skilldialog.cpp | 12 ++++++------ src/gui/widgets/popuplist.cpp | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 09ec02389..d65686805 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -771,7 +771,8 @@ void Being::handleSkill(Being *const victim, const int damage, setAction(Being::ATTACK, 1); SkillInfo *const skill = skillDialog->getSkill(skillId); - const SkillData *const data = skill ? skill->getData1(skillLevel) : nullptr; + const SkillData *const data = skill + ? skill->getData1(skillLevel) : nullptr; if (data) fireMissile(victim, data->particle); diff --git a/src/game.cpp b/src/game.cpp index f3d57df9e..dbae184c6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -935,7 +935,8 @@ void Game::handleInput() BLOCK_START("Game::handleInput 2") if (mLogInput) Client::logEvent(event); - updateHistory(event); + if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) + updateHistory(event); checkKeys(); if (inputManager.handleEvent(event)) diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index a79fd5fbc..383b85ca7 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -65,6 +65,7 @@ OutfitWindow::OutfitWindow(): serverConfig.getValueBool("OutfitUnequip0", true))), mAwayOutfitCheck(new CheckBox(this, _("Away outfit"), serverConfig.getValue("OutfitAwayIndex", OUTFITS_COUNT - 1))), + mCurrentOutfit(0), mKeyLabel(new Label(this, strprintf(_("Key: %s"), keyName(mCurrentOutfit).c_str()))), mBoxWidth(33), @@ -77,7 +78,6 @@ OutfitWindow::OutfitWindow(): mItemMoved(nullptr), mItemSelected(-1), mItemColorSelected(1), - mCurrentOutfit(0), mAwayOutfit(0) { setWindowName("Outfits"); diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index c70d97fa6..2893c8495 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -115,6 +115,7 @@ class OutfitWindow final : public Window, private gcn::ActionListener Label *mCurrentLabel; CheckBox *mUnequipCheck; CheckBox *mAwayOutfitCheck; + int mCurrentOutfit; Label *mKeyLabel; int getIndexFromGrid(const int pointX, @@ -137,7 +138,6 @@ class OutfitWindow final : public Window, private gcn::ActionListener int mItemSelected; unsigned char mItemColorSelected; - int mCurrentOutfit; int mAwayOutfit; gcn::Color mBorderColor; diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index ee2834a35..aa60fedb1 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -714,22 +714,22 @@ void SkillInfo::draw(Graphics *const graphics, const int padding, graphics->drawText(skillLevel, width - skillLevelWidth, yPad); } -void SkillInfo::addData(const int l, SkillData *const d) +void SkillInfo::addData(const int level1, SkillData *const data1) { - dataMap[l] = d; + dataMap[level1] = data1; } -SkillData *SkillInfo::getData(const int l) +SkillData *SkillInfo::getData(const int level1) { - SkillDataMapIter it = dataMap.find(l); + SkillDataMapIter it = dataMap.find(level1); if (it == dataMap.end()) return nullptr; return (*it).second; } -SkillData *SkillInfo::getData1(const int l) +SkillData *SkillInfo::getData1(const int level) { - SkillDataMapIter it = dataMap.find(l); + SkillDataMapIter it = dataMap.find(level); if (it == dataMap.end()) return dataMap[0]; return (*it).second; diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index d9f44da94..211de45e5 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -115,7 +115,7 @@ void PopupList::adjustSize() mListBox->setWidth(getWidth() - pad2); } -void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) +void PopupList::mousePressed(gcn::MouseEvent& mouseEvent A_UNUSED) { if (mDropDown) mDropDown->updateSelection(); -- cgit v1.2.3-70-g09d2