summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-11 01:34:11 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-11 01:34:11 +0200
commitfcced13d9972ac70f0f01f19583b7868e255b6a7 (patch)
tree9b01df102c5f9ba032ea0f9bc413dd707e99d88b /src/gui
parent311783bebbe2bed366dca5097697ce34c690292d (diff)
parentef1b9856c86512fe73154c17da3ea98a7cd5f896 (diff)
downloadmanaverse-fcced13d9972ac70f0f01f19583b7868e255b6a7.tar.gz
manaverse-fcced13d9972ac70f0f01f19583b7868e255b6a7.tar.bz2
manaverse-fcced13d9972ac70f0f01f19583b7868e255b6a7.tar.xz
manaverse-fcced13d9972ac70f0f01f19583b7868e255b6a7.zip
Merge branch 'master' into invfiler
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charselectdialog.cpp2
-rw-r--r--src/gui/login.cpp8
-rw-r--r--src/gui/serverdialog.cpp18
-rw-r--r--src/gui/serverdialog.h2
-rw-r--r--src/gui/setup_colors.cpp2
-rw-r--r--src/gui/setup_other.cpp17
-rw-r--r--src/gui/setup_other.h3
-rw-r--r--src/gui/userpalette.cpp5
-rw-r--r--src/gui/userpalette.h2
9 files changed, 47 insertions, 12 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index d95930108..da1f59e46 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -433,7 +433,7 @@ void CharacterDisplay::update()
mButton->setCaption(_("Choose"));
mButton->setActionEventId("use");
mName->setCaption(strprintf("%s", character->getName().c_str()));
- mLevel->setCaption(strprintf("Level %d",
+ mLevel->setCaption(strprintf(_("Level %d"),
mCharacter->data.mAttributes[LEVEL]));
mMoney->setCaption(Units::formatCurrency(
mCharacter->data.mAttributes[MONEY]));
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 997895c95..b6139c6d0 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -53,9 +53,9 @@ std::string LoginDialog::savedPasswordKey = "";
const char *UPDATE_TYPE_TEXT[3] =
{
- _("Normal"),
- _("Auto Close"),
- _("Skip"),
+ N_("Normal"),
+ N_("Auto Close"),
+ N_("Skip"),
};
class UpdateTypeModel : public gcn::ListModel
@@ -74,7 +74,7 @@ public:
if (i >= getNumberOfElements() || i < 0)
return _("???");
- return UPDATE_TYPE_TEXT[i];
+ return gettext(UPDATE_TYPE_TEXT[i]);
}
};
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index c7e1d0f94..3556efc35 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -211,7 +211,8 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir):
mDownload(0),
mDownloadProgress(-1.0f),
mServers(ServerInfos()),
- mServerInfo(serverInfo)
+ mServerInfo(serverInfo),
+ mPersistentIPCheckBox(false)
{
if (isSafeMode)
setCaption("Choose Your Server *** SAFE MODE ***");
@@ -223,6 +224,9 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir):
Label *typeLabel = new Label(_("Server type:"));
mServerNameField = new TextField(mServerInfo->hostname);
mPortField = new TextField(toString(mServerInfo->port));
+ mPersistentIPCheckBox = new CheckBox(_("Use same ip for game sub servers"),
+ config.getBoolValue("usePersistentIP"),
+ this, "persitent ip");
loadCustomServers();
@@ -264,11 +268,12 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir):
place(1, 2, mTypeField, 5).setPadding(3);
place(0, 3, usedScroll, 6, 5).setPadding(3);
place(0, 8, mDescription, 6);
- place(0, 9, mManualEntryButton);
- place(1, 9, mDeleteButton);
- place(2, 9, mLoadButton);
- place(4, 9, mQuitButton);
- place(5, 9, mConnectButton);
+ place(0, 9, mPersistentIPCheckBox, 6);
+ place(0, 10, mManualEntryButton);
+ place(1, 10, mDeleteButton);
+ place(2, 10, mLoadButton);
+ place(4, 10, mQuitButton);
+ place(5, 10, mConnectButton);
// Make sure the list has enough height
getLayout().setRowHeight(3, 80);
@@ -390,6 +395,7 @@ void ServerDialog::action(const gcn::ActionEvent &event)
LoginDialog::savedPassword = "";
}
+ config.setValue("usePersistentIP", mPersistentIPCheckBox->isSelected());
Client::setState(STATE_CONNECT_SERVER);
}
}
diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h
index b9a67e246..e16dd09b5 100644
--- a/src/gui/serverdialog.h
+++ b/src/gui/serverdialog.h
@@ -23,6 +23,7 @@
#define SERVERDIALOG_H
#include "gui/widgets/window.h"
+#include "gui/widgets/checkbox.h"
#include "net/download.h"
#include "net/serverinfo.h"
@@ -199,6 +200,7 @@ class ServerDialog : public Window,
ServerInfos mServers;
ServerInfo *mServerInfo;
+ CheckBox *mPersistentIPCheckBox;
};
#endif
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 76510a283..68d517cae 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -302,6 +302,8 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event _UNUSED_)
case UserPalette::ROAD_POINT:
case UserPalette::MONSTER_HP:
case UserPalette::MONSTER_HP2:
+ case UserPalette::PLAYER_HP:
+ case UserPalette::PLAYER_HP2:
mGradDelayLabel->setCaption(_("Alpha:"));
mGradDelayText->setRange(0, 255);
mGradDelaySlider->setScale(0, 255);
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index 54ec1c65d..5a2b77a81 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -63,6 +63,7 @@
#define ACTION_WARP_PARTICLE "warp particle"
#define ACTION_AUTO_SHOP "auto shop"
#define ACTION_SHOW_MOB_HP "show mob hp"
+#define ACTION_SHOW_OWN_HP "show own hp"
Setup_Other::Setup_Other():
mShowMonstersTakedDamage(config.getBoolValue("showMonstersTakedDamage")),
@@ -87,7 +88,8 @@ Setup_Other::Setup_Other():
mQuickStats(config.getBoolValue("quickStats")),
mWarpParticle(config.getBoolValue("warpParticle")),
mAutoShop(config.getBoolValue("autoShop")),
- mShowMobHP(config.getBoolValue("showMobHP"))
+ mShowMobHP(config.getBoolValue("showMobHP")),
+ mShowOwnHP(config.getBoolValue("showOwnHP"))
{
setName(_("Misc"));
@@ -178,6 +180,10 @@ Setup_Other::Setup_Other():
mShowMobHP,
this, ACTION_SHOW_MOB_HP);
+ mShowOwnHPCheckBox = new CheckBox(_("Show own hp bar"),
+ mShowOwnHP,
+ this, ACTION_SHOW_OWN_HP);
+
// Do the layout
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -192,6 +198,7 @@ Setup_Other::Setup_Other():
place(12, 4, mWarpParticleCheckBox, 10);
place(12, 5, mAutoShopCheckBox, 10);
place(12, 6, mShowMobHPCheckBox, 10);
+ place(12, 7, mShowOwnHPCheckBox, 10);
place(0, 3, mFloorItemsHighlightCheckBox, 12);
place(0, 4, mHighlightAttackRangeCheckBox, 12);
place(0, 5, mHighlightMonsterAttackRangeCheckBox, 12);
@@ -320,6 +327,10 @@ void Setup_Other::action(const gcn::ActionEvent &event)
{
mShowMobHP = mShowMobHPCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_SHOW_OWN_HP)
+ {
+ mShowOwnHP = mShowOwnHPCheckBox->isSelected();
+ }
}
void Setup_Other::cancel()
@@ -389,6 +400,9 @@ void Setup_Other::cancel()
mShowMobHP = config.getBoolValue("showMobHP");
mShowMobHPCheckBox->setSelected(mShowMobHP);
+
+ mShowOwnHP = config.getBoolValue("showOwnHP");
+ mShowOwnHPCheckBox->setSelected(mShowOwnHP);
}
void Setup_Other::apply()
@@ -416,6 +430,7 @@ void Setup_Other::apply()
config.setValue("warpParticle", mWarpParticle);
config.setValue("autoShop", mAutoShop);
config.setValue("showMobHP", mShowMobHP);
+ config.setValue("showOwnHP", mShowOwnHP);
logger->setDebugLog(mDebugLog);
}
diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h
index b20401be5..6a092e93f 100644
--- a/src/gui/setup_other.h
+++ b/src/gui/setup_other.h
@@ -119,6 +119,9 @@ class Setup_Other : public SetupTab, public gcn::ActionListener
gcn::CheckBox *mShowMobHPCheckBox;
bool mShowMobHP;
+ gcn::CheckBox *mShowOwnHPCheckBox;
+ bool mShowOwnHP;
+
EditDialog *mEditDialog;
};
diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp
index 03e5c1eed..46f1b72b3 100644
--- a/src/gui/userpalette.cpp
+++ b/src/gui/userpalette.cpp
@@ -52,6 +52,8 @@ const std::string ColorTypeNames[] =
"ColorParticle",
"ColorPickupInfo",
"ColorExpInfo",
+ "ColorPlayerHp",
+ "ColorPlayerHp2",
"ColorHitPlayerMonster",
"ColorHitMonsterPlayer",
"ColorHitPlayerPlayer",
@@ -124,6 +126,9 @@ UserPalette::UserPalette():
addColor(PARTICLE, 0xffffff, STATIC, _("Particle Effects"));
addColor(PICKUP_INFO, 0x28dc28, STATIC, _("Pickup Notification"));
addColor(EXP_INFO, 0xffff00, STATIC, _("Exp Notification"));
+ addColor(PLAYER_HP, 0x00ff00, STATIC, _("Player HP bar"), 50);
+ addColor(PLAYER_HP2, 0xff0000, STATIC,
+ _("Player HP bar (second color)"), 50);
addColor(HIT_PLAYER_MONSTER, 0x0064ff, STATIC, _("Player Hits Monster"));
addColor(HIT_MONSTER_PLAYER, 0xff3232, STATIC, _("Monster Hits Player"));
addColor(HIT_PLAYER_PLAYER, 0xff5050, STATIC,
diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h
index 057d47113..db2463e20 100644
--- a/src/gui/userpalette.h
+++ b/src/gui/userpalette.h
@@ -53,6 +53,8 @@ class UserPalette : public Palette, public gcn::ListModel
PARTICLE,
PICKUP_INFO,
EXP_INFO,
+ PLAYER_HP,
+ PLAYER_HP2,
HIT_PLAYER_MONSTER,
HIT_MONSTER_PLAYER,
HIT_PLAYER_PLAYER,