summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-09 02:15:28 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-09 04:03:03 +0300
commit333745260338c876989744468a5f9c707e9bcc66 (patch)
tree46a2a99bd2b1a88810f016896a77d4ddd872ec63 /src/gui
parente60ac0a6bc0fd662cb7a5834896b3953a1bd07e8 (diff)
downloadplus-333745260338c876989744468a5f9c707e9bcc66.tar.gz
plus-333745260338c876989744468a5f9c707e9bcc66.tar.bz2
plus-333745260338c876989744468a5f9c707e9bcc66.tar.xz
plus-333745260338c876989744468a5f9c707e9bcc66.zip
Fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/buydialog.cpp5
-rw-r--r--src/gui/gui.cpp4
-rw-r--r--src/gui/minimap.cpp4
-rw-r--r--src/gui/npcdialog.cpp2
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/gui/widgets/label.cpp2
6 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp
index c41f22de7..83207b3d8 100644
--- a/src/gui/buydialog.cpp
+++ b/src/gui/buydialog.cpp
@@ -91,8 +91,7 @@ void BuyDialog::init()
mSlider = new Slider(1.0);
mQuantityLabel = new Label(strprintf("%d / %d", mAmountItems, mMaxItems));
mQuantityLabel->setAlignment(gcn::Graphics::CENTER);
- mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"),
- "", ""));
+ mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"), "", ""));
mAmountField = new IntTextField(1, 1, 123);
mAmountField->setActionEventId("amount");
@@ -196,7 +195,7 @@ void BuyDialog::action(const gcn::ActionEvent &event)
// The following actions require a valid selection
if (selectedItem < 0 ||
- selectedItem >= static_cast<int>(mShopItems->getNumberOfElements()))
+ selectedItem >= mShopItems->getNumberOfElements())
{
return;
}
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 19361cf2d..e45bc71c0 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -492,7 +492,7 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,
if (!gcn::Widget::widgetExists(widget))
break;
- parent = static_cast<gcn::Widget*>(widget->getParent());
+ parent = widget->getParent();
if (widget->isEnabled() || force)
{
@@ -551,7 +551,7 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,
gcn::Widget* swap = widget;
widget = parent;
- parent = static_cast<gcn::Widget*>(swap->getParent());
+ parent = swap->getParent();
// If a non modal focused widget has been reach
// and we have modal focus cancel the distribution.
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 8089a2feb..9c7ab76cb 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -229,10 +229,10 @@ void Minimap::draw(gcn::Graphics *graphics)
mMapImage->mBounds.h > a.height)
{
const Vector &p = player_node->getPosition();
- mMapOriginX = ((a.width) / 2) - (static_cast<float>(p.x
+ mMapOriginX = (a.width / 2) - (static_cast<float>(p.x
+ viewport->getCameraRelativeX()) * mWidthProportion) / 32;
- mMapOriginY = ((a.height) / 2) - (static_cast<float>(p.y
+ mMapOriginY = (a.height / 2) - (static_cast<float>(p.y
+ viewport->getCameraRelativeY()) * mHeightProportion) / 32;
const int minOriginX = a.width - mMapImage->mBounds.w;
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 5e0e9d56f..24d94dc3f 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -84,7 +84,7 @@ NpcDialog::NpcDialog(int npcId) :
// Setup output text box
mTextBox = new BrowserBox(BrowserBox::AUTO_WRAP);
mTextBox->setOpaque(false);
- mTextBox->setMaxRow(static_cast<int>(config.getIntValue("ChatLogLength")));
+ mTextBox->setMaxRow(config.getIntValue("ChatLogLength"));
mTextBox->setLinkHandler(mItemLinkHandler);
mScrollArea = new ScrollArea(mTextBox);
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 9b3a00963..5f97cd613 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -60,8 +60,7 @@ ChatTab::ChatTab(const std::string &name) :
mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP);
mTextOutput->setOpaque(false);
- mTextOutput->setMaxRow(static_cast<int>(
- config.getIntValue("ChatLogLength")));
+ mTextOutput->setMaxRow(config.getIntValue("ChatLogLength"));
if (chatWindow)
mTextOutput->setLinkHandler(chatWindow->mItemLinkHandler);
mTextOutput->setAlwaysUpdate(false);
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 640010c62..dde7ddca3 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -38,5 +38,5 @@ Label::Label(const std::string &caption) :
void Label::draw(gcn::Graphics *graphics)
{
- gcn::Label::draw(static_cast<gcn::Graphics*>(graphics));
+ gcn::Label::draw(graphics);
}