summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/chargedialog.cpp3
-rw-r--r--src/gui/connection.cpp9
-rw-r--r--src/gui/ministatus.cpp15
-rw-r--r--src/gui/newskill.cpp2
-rw-r--r--src/gui/progressbar.cpp12
-rw-r--r--src/gui/progressbar.h2
-rw-r--r--src/gui/status.cpp69
-rw-r--r--src/gui/updatewindow.cpp28
8 files changed, 77 insertions, 63 deletions
diff --git a/src/gui/chargedialog.cpp b/src/gui/chargedialog.cpp
index 9b300950..349ca223 100644
--- a/src/gui/chargedialog.cpp
+++ b/src/gui/chargedialog.cpp
@@ -34,7 +34,8 @@ ChargeDialog::ChargeDialog():
Window("")
{
setContentSize(180, 70);
- mProgBar = new ProgressBar(0.0f, 20, 40, 140, 25, 128, 128, 128);
+ mProgBar = new ProgressBar(0.0f, 140, 25, 128, 128, 128);
+ mProgBar->setPosition(20, 40);
add(mProgBar);
}
diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp
index 36fa316d..89f145c4 100644
--- a/src/gui/connection.cpp
+++ b/src/gui/connection.cpp
@@ -51,12 +51,11 @@ ConnectionDialog::ConnectionDialog():
Button *cancelButton = new Button("Cancel", "cancelButton",
&connectionActionListener);
- cancelButton->setPosition(5, 100 - 5 - cancelButton->getHeight());
+ mProgressBar = new ProgressBar(0.0, 200 - 10, 20, 128, 128, 128);
+ gcn::Label *label = new gcn::Label("Connecting...");
- mProgressBar = new ProgressBar(0.0, 5, cancelButton->getY() - 25,
- 200 - 10, 20, 128, 128, 128);
- gcn::Label *label;
- label = new gcn::Label("Connecting...");
+ cancelButton->setPosition(5, 100 - 5 - cancelButton->getHeight());
+ mProgressBar->setPosition(5, cancelButton->getY() - 25);
label->setPosition(5, mProgressBar->getY() - 25);
add(label);
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index 4f070acd..e4cfc6a6 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -40,18 +40,17 @@ MiniStatusWindow::MiniStatusWindow():
setMovable(false);
setTitleBarHeight(0);
- mHpBar = new ProgressBar(1.0f,
- 0, 3, 100, 20,
- 0, 171, 34);
-
- mMpBar = new ProgressBar(1.0f,
- mHpBar->getX() + mHpBar->getWidth() + 3,
- mHpBar->getY(), 100, 20, 26, 102, 230);
-
+ mHpBar = new ProgressBar(1.0f, 100, 20, 0, 171, 34);
+ mMpBar = new ProgressBar(1.0f, 100, 20, 26, 102, 230);
mHpLabel = new gcn::Label("");
mMpLabel = new gcn::Label("");
+
+ mHpBar->setPosition(0, 3);
+ mMpBar->setPosition(mHpBar->getWidth() + 3, 3);
+
mHpLabel->setForegroundColor(gcn::Color(255, 255, 255));
mMpLabel->setForegroundColor(gcn::Color(255, 255, 255));
+
mHpLabel->setFont(speechFont);
mMpLabel->setFont(speechFont);
diff --git a/src/gui/newskill.cpp b/src/gui/newskill.cpp
index be62cd5f..809dd811 100644
--- a/src/gui/newskill.cpp
+++ b/src/gui/newskill.cpp
@@ -77,7 +77,7 @@ NewSkillDialog::NewSkillDialog():
{
mSkillLabel[i] = new gcn::Label("Empty ");
mSkillLevel[i] = new gcn::Label("00000");
- mSkillbar[i] = new ProgressBar(0.0f,0,0,100,15,0,0,255);
+ mSkillbar[i] = new ProgressBar(0.0f,100,15,0,0,255);
mSkillLevel[i]->setAlignment(Graphics::RIGHT);
add(mSkillLabel[i],40,5+i*25);
add(mSkillLevel[i],150,5+i*25);
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 0863db98..5f047c6a 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -33,7 +33,7 @@
ImageRect ProgressBar::mBorder;
int ProgressBar::mInstances = 0;
-ProgressBar::ProgressBar(float progress, int x, int y,
+ProgressBar::ProgressBar(float progress,
unsigned int width, unsigned int height,
Uint8 red, Uint8 green, Uint8 blue):
gcn::Widget(),
@@ -41,8 +41,6 @@ ProgressBar::ProgressBar(float progress, int x, int y,
mRedToGo(red), mGreenToGo(green), mBlueToGo(blue)
{
setProgress(progress);
- setX(x);
- setY(y);
setWidth(width);
setHeight(height);
@@ -98,16 +96,16 @@ void
ProgressBar::draw(gcn::Graphics *graphics)
{
dynamic_cast<Graphics*>(graphics)->drawImageRect(0, 0,
- getWidth(), getHeight(),
- mBorder);
+ getWidth(), getHeight(),
+ mBorder);
// The bar
if (mProgress > 0)
{
graphics->setColor(gcn::Color(mRed, mGreen, mBlue, 200));
graphics->fillRectangle(gcn::Rectangle(4, 4,
- (int)(mProgress * (getWidth() - 8)),
- getHeight() - 8));
+ (int)(mProgress * (getWidth() - 8)),
+ getHeight() - 8));
}
}
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h
index cd62c498..3e58f14e 100644
--- a/src/gui/progressbar.h
+++ b/src/gui/progressbar.h
@@ -41,7 +41,7 @@ class ProgressBar : public gcn::Widget {
/**
* Constructor, initializes the progress with the given value.
*/
- ProgressBar(float progress = 0.0f, int x = 0, int y = 0,
+ ProgressBar(float progress = 0.0f,
unsigned int width = 40, unsigned int height = 7,
Uint8 red = 150, Uint8 green = 150, Uint8 blue = 150);
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index 18bde30c..28108fca 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -51,40 +51,55 @@ StatusWindow::StatusWindow(LocalPlayer *player):
mLvlLabel = new gcn::Label("Level:");
mGpLabel = new gcn::Label("Money:");
+
mHpLabel = new gcn::Label("HP:");
+ mHpBar = new ProgressBar(1.0f, 80, 15, 0, 171, 34);
mHpValueLabel = new gcn::Label("");
- mMpLabel = new gcn::Label("MP:");
- mMpValueLabel = new gcn::Label("");
+
mXpLabel = new gcn::Label("Exp:");
+ mXpBar = new ProgressBar(1.0f, 80, 15, 143, 192, 211);
mXpValueLabel = new gcn::Label("");
+
+ mMpLabel = new gcn::Label("MP:");
+ mMpBar = new ProgressBar(1.0f, 80, 15, 26, 102, 230);
+ mMpValueLabel = new gcn::Label("");
+
mJobXpLabel = new gcn::Label("Job:");
+ mJobXpBar = new ProgressBar(1.0f, 60, 15, 220, 135, 203);
mJobValueLabel = new gcn::Label("");
- mLvlLabel->setPosition(5, 3);
- mGpLabel->setPosition(mLvlLabel->getX() + mLvlLabel->getWidth() + 40, 3);
- mHpLabel->setPosition(5, mLvlLabel->getY() + mLvlLabel->getHeight() + 5);
- mHpBar = new ProgressBar(1.0f,
- mHpLabel->getX() + mHpLabel->getWidth() + 5,
- mHpLabel->getY(), 80, 15, 0, 171, 34);
- mHpValueLabel->setPosition(mHpBar->getX() + mHpBar->getWidth() + 5,
- mHpBar->getY());
- mMpLabel->setPosition(5, mHpLabel->getY() + mHpLabel->getHeight() + 5);
- mMpBar = new ProgressBar(1.0f,
- mHpBar->getX(),
- mMpLabel->getY(), 80, 15, 26, 102, 230);
- mMpValueLabel->setPosition(mHpValueLabel->getX(), mMpBar->getY());
-
- mXpLabel->setPosition(175, mHpLabel->getY());
- mXpBar = new ProgressBar(1.0f, 205, mXpLabel->getY(), 80, 15,
- 143, 192, 211);
- mXpValueLabel->setPosition(290, mXpBar->getY());
- mJobXpLabel->setPosition(175, mMpLabel->getY());
- mJobXpBar = new ProgressBar(1.0f,
- mXpBar->getX() + mXpBar->getWidth() - 60,
- mJobXpLabel->getY(),
- 60, 15,
- 220, 135, 203);
- mJobValueLabel->setPosition(290, mJobXpBar->getY());
+ int y = 3;
+ int x = 5;
+
+ mLvlLabel->setPosition(x, y);
+ x += mLvlLabel->getWidth() + 40;
+ mGpLabel->setPosition(x, y);
+
+ y += mLvlLabel->getHeight() + 5; // Next Row
+ x = 5;
+
+ mHpLabel->setPosition(x, y);
+ x += mHpLabel->getWidth() + 5;
+ mHpBar->setPosition(x, y);
+ x += mHpBar->getWidth() + 5;
+ mHpValueLabel->setPosition(x, y);
+
+ mXpLabel->setPosition(175, y);
+ mXpBar->setPosition(205, y);
+ mXpValueLabel->setPosition(290, y);
+
+ y += mHpLabel->getHeight() + 5; // Next Row
+ x = 5;
+
+ mMpLabel->setPosition(x, y);
+ x += mMpLabel->getWidth() + 5;
+ mMpBar->setPosition(x, y);
+ x += mMpBar->getWidth() + 5;
+ mMpValueLabel->setPosition(x, y);
+
+ mJobXpLabel->setPosition(175, y);
+ mJobXpBar->setPosition(225, y);
+ mJobValueLabel->setPosition(290, y);
add(mLvlLabel);
add(mGpLabel);
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 51be2f2d..9db09f27 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -51,26 +51,28 @@ UpdaterWindow::UpdaterWindow():
{
mCurlError[0] = 0;
- int h = 240;
- int w = 320;
+ const int h = 240;
+ const int w = 320;
setContentSize(w, h);
mBrowserBox = new BrowserBox();
- mBrowserBox->setOpaque(false);
+ mScrollArea = new ScrollArea(mBrowserBox);
+ mLabel = new gcn::Label("Connecting...");
+ mProgressBar = new ProgressBar(0.0, w - 10, 20, 37, 70, 200);
mCancelButton = new Button("Cancel", "cancel", this);
- mCancelButton->setPosition(5, h - 5 - mCancelButton->getHeight());
mPlayButton = new Button("Play", "play", this);
- mPlayButton->setPosition(mCancelButton->getX() +
- mCancelButton->getWidth() + 5,
- h - 5 - mPlayButton->getHeight());
+
+ mBrowserBox->setOpaque(false);
mPlayButton->setEnabled(false);
- mProgressBar = new ProgressBar(0.0, 5, mCancelButton->getY() - 20 - 5,
- w - 10, 20, 37, 70, 200);
- mLabel = new gcn::Label("Connecting...");
+
+ mCancelButton->setPosition(5, h - 5 - mCancelButton->getHeight());
+ mPlayButton->setPosition(
+ mCancelButton->getX() + mCancelButton->getWidth() + 5,
+ h - 5 - mPlayButton->getHeight());
+ mProgressBar->setPosition(5, mCancelButton->getY() - 20 - 5);
mLabel->setPosition(5, mProgressBar->getY() - mLabel->getHeight() - 5);
- mScrollArea = new ScrollArea(mBrowserBox);
- mScrollArea->setDimension(gcn::Rectangle(5, 5, 310,
- mLabel->getY() - 12));
+
+ mScrollArea->setDimension(gcn::Rectangle(5, 5, 310, mLabel->getY() - 12));
add(mScrollArea);
add(mLabel);