summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-05-14 12:16:34 +0100
committerDavid Athay <ko2fan@gmail.com>2009-05-14 12:16:34 +0100
commitdc1eb0895382451b1c79c60ecb7ca7dbbec89681 (patch)
tree56742cbe8674d68e152f23885a7e062becf9b5ce /src/gui
parentc96fbe557a3274325399411456e98a5a63b1bc54 (diff)
parent39e06227df101a73aa5b9078a3afb6a7a71b89ba (diff)
downloadmana-dc1eb0895382451b1c79c60ecb7ca7dbbec89681.tar.gz
mana-dc1eb0895382451b1c79c60ecb7ca7dbbec89681.tar.bz2
mana-dc1eb0895382451b1c79c60ecb7ca7dbbec89681.tar.xz
mana-dc1eb0895382451b1c79c60ecb7ca7dbbec89681.zip
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp8
-rw-r--r--src/gui/itemcontainer.cpp8
-rw-r--r--src/gui/npcdialog.cpp19
-rw-r--r--src/gui/npcdialog.h2
-rw-r--r--src/gui/partywindow.cpp25
-rw-r--r--src/gui/partywindow.h2
-rw-r--r--src/gui/setup.cpp4
-rw-r--r--src/gui/setup_audio.cpp2
-rw-r--r--src/gui/setup_colors.cpp2
-rw-r--r--src/gui/setup_joystick.cpp2
-rw-r--r--src/gui/setup_keyboard.cpp2
-rw-r--r--src/gui/setup_players.cpp4
-rw-r--r--src/gui/setup_video.cpp6
-rw-r--r--src/gui/truetypefont.cpp8
-rw-r--r--src/gui/widgets/avatar.cpp13
-rw-r--r--src/gui/widgets/chattab.cpp7
-rw-r--r--src/gui/widgets/dropdown.cpp6
17 files changed, 76 insertions, 44 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index eca224fc..414d1e02 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -105,14 +105,6 @@ ChatWindow::ChatWindow():
mReturnToggles = config.getValue("ReturnToggles", "0") == "1";
-#ifdef EATHENA_SUPPORT
- // If the player had @assert on in the last session, ask the server to
- // run the @assert command for the player again. Convenience for GMs.
- if (config.getValue(player_node->getName() + "GMassert", 0)) {
- std::string cmd = "@assert";
- chatInput(cmd);
- }
-#endif
mRecorder = new Recorder(this);
}
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 26382cd2..54aa818b 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -192,7 +192,7 @@ void ItemContainer::distributeValueChangedEvent()
void ItemContainer::keyPressed(gcn::KeyEvent &event)
{
- switch (event.getKey().getValue())
+ /*switch (event.getKey().getValue())
{
case Key::LEFT:
moveHighlight(Left);
@@ -216,12 +216,12 @@ void ItemContainer::keyPressed(gcn::KeyEvent &event)
case Key::RIGHT_CONTROL:
mDescItems = true;
break;
- }
+ }*/
}
void ItemContainer::keyReleased(gcn::KeyEvent &event)
{
- switch (event.getKey().getValue())
+ /*switch (event.getKey().getValue())
{
case Key::LEFT_ALT:
case Key::RIGHT_ALT:
@@ -230,7 +230,7 @@ void ItemContainer::keyReleased(gcn::KeyEvent &event)
case Key::RIGHT_CONTROL:
mDescItems = false;
break;
- }
+ }*/
}
void ItemContainer::mousePressed(gcn::MouseEvent &event)
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index eeb76b88..c4b1ec88 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -281,6 +281,25 @@ void NpcDialog::integerRequest(int defaultValue, int min, int max)
buildLayout();
}
+void NpcDialog::move(int amount)
+{
+ if (mActionState != NPC_ACTION_INPUT)
+ return;
+
+ switch (mInputState)
+ {
+ case NPC_INPUT_INTEGER:
+ mIntField->setValue(mIntField->getValue() + amount);
+ break;
+ case NPC_INPUT_LIST:
+ mItemList->setSelected(mItemList->getSelected() - amount);
+ break;
+ case NPC_INPUT_NONE:
+ case NPC_INPUT_STRING:
+ break;
+ }
+}
+
void NpcDialog::widgetResized(const gcn::Event &event)
{
Window::widgetResized(event);
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h
index bd738e81..ecce0c62 100644
--- a/src/gui/npcdialog.h
+++ b/src/gui/npcdialog.h
@@ -141,6 +141,8 @@ class NpcDialog : public Window, public gcn::ActionListener,
*/
void integerRequest(int defaultValue = 0, int min = 0, int max = 2000);
+ void move(int amount);
+
/**
* Called when resizing the window.
*
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp
index 8958c1ec..1260a2c3 100644
--- a/src/gui/partywindow.cpp
+++ b/src/gui/partywindow.cpp
@@ -53,9 +53,9 @@ PartyWindow::PartyWindow() :
setResizable(true);
setSaveVisible(true);
setCloseButton(true);
- setMinWidth(212);
+ setMinWidth(120);
setMinHeight(200);
- setDefaultSize(590, 200, 212, 200);
+ setDefaultSize(590, 200, 150, 200);
loadWindowState();
}
@@ -92,9 +92,10 @@ PartyMember *PartyWindow::findOrCreateMember(int id)
{
member = new PartyMember;
mMembers[id] = member;
- add(member->avatar, 0, (mMembers.size() - 1) * 14);
}
+ buildLayout();
+
return member;
}
@@ -148,6 +149,8 @@ void PartyWindow::removeMember(int id)
void PartyWindow::removeMember(const std::string &name)
{
removeMember(findMember(name));
+
+ buildLayout();
}
void PartyWindow::updateOnlne(int id, bool online)
@@ -225,3 +228,19 @@ void PartyWindow::clearMembers()
delete_all(mMembers);
mMembers.clear();
}
+
+void PartyWindow::buildLayout()
+{
+ clearLayout();
+ int lastPos = 0;
+
+ PartyList::iterator it;
+ PartyMember *member;
+
+ for (it = mMembers.begin(); it != mMembers.end(); it++)
+ {
+ member = (*it).second;
+ add(member->avatar, 0, lastPos);
+ lastPos += member->avatar->getHeight() + 2;
+ }
+}
diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h
index 8cea500f..19e611ed 100644
--- a/src/gui/partywindow.h
+++ b/src/gui/partywindow.h
@@ -125,6 +125,8 @@ class PartyWindow : public Window, gcn::ActionListener
*/
PartyMember *findOrCreateMember(int id);
+ void buildLayout();
+
typedef std::map<int, PartyMember*> PartyList;
PartyList mMembers;
std::string mPartyInviter;
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index a1765f24..e73f9b74 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -64,7 +64,7 @@ Setup::Setup():
Window(_("Setup"))
{
setCloseButton(true);
- int width = 340;
+ int width = 380;
int height = 360;
setContentSize(width, height);
@@ -104,7 +104,7 @@ Setup::Setup():
add(panel);
Label *version = new Label(FULL_VERSION);
- version->setPosition(5, height - version->getHeight() - 5);
+ version->setPosition(9, height - version->getHeight() - 9);
add(version);
center();
diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp
index 9417ad68..9da74c2e 100644
--- a/src/gui/setup_audio.cpp
+++ b/src/gui/setup_audio.cpp
@@ -72,7 +72,7 @@ Setup_Audio::Setup_Audio():
place(0, 2, mMusicSlider);
place(1, 2, musicLabel);
- setDimension(gcn::Rectangle(0, 0, 325, 280));
+ setDimension(gcn::Rectangle(0, 0, 365, 280));
}
void Setup_Audio::apply()
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index a0be62cd..efa03ba4 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -176,7 +176,7 @@ Setup_Colors::Setup_Colors() :
mGradTypeText->setCaption("");
- setDimension(gcn::Rectangle(0, 0, 325, 280));
+ setDimension(gcn::Rectangle(0, 0, 365, 280));
}
Setup_Colors::~Setup_Colors()
diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp
index 08a80bf7..f050e334 100644
--- a/src/gui/setup_joystick.cpp
+++ b/src/gui/setup_joystick.cpp
@@ -55,7 +55,7 @@ Setup_Joystick::Setup_Joystick():
place = h.getPlacer(0, 1);
place(0, 0, mCalibrateButton);
- setDimension(gcn::Rectangle(0, 0, 325, 75));
+ setDimension(gcn::Rectangle(0, 0, 365, 75));
}
void Setup_Joystick::action(const gcn::ActionEvent &event)
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp
index 0c15a1ee..938c1c4e 100644
--- a/src/gui/setup_keyboard.cpp
+++ b/src/gui/setup_keyboard.cpp
@@ -98,7 +98,7 @@ Setup_Keyboard::Setup_Keyboard():
place(0, 6, mMakeDefaultButton);
place(3, 6, mAssignKeyButton);
- setDimension(gcn::Rectangle(0, 0, 325, 280));
+ setDimension(gcn::Rectangle(0, 0, 365, 280));
}
Setup_Keyboard::~Setup_Keyboard()
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index f0d88a30..6372d318 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -283,15 +283,15 @@ Setup_Players::Setup_Players():
place(0, 0, mPlayerTitleTable, 4);
place(0, 1, mPlayerScrollArea, 4, 4).setPadding(2);
place(0, 5, mDeleteButton);
- place(0, 6, mWhisperTabCheckBox);
place(2, 5, ignore_action_label);
place(2, 6, mIgnoreActionChoicesBox, 2).setPadding(2);
place(2, 7, mDefaultTrading);
place(2, 8, mDefaultWhisper);
+ place(0, 9, mWhisperTabCheckBox, 4).setPadding(4);
player_relations.addListener(this);
- setDimension(gcn::Rectangle(0, 0, 325, 280));
+ setDimension(gcn::Rectangle(0, 0, 365, 280));
}
Setup_Players::~Setup_Players()
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 1c4043f7..a9c892b2 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -299,13 +299,13 @@ Setup_Video::Setup_Video():
place(1, 3, mParticleEffectsCheckBox, 3);
- place(1, 4, mPickupNotifyLabel, 3);
+ place(1, 4, mPickupNotifyLabel, 4);
place(1, 5, mPickupChatCheckBox, 1);
place(2, 5, mPickupParticleCheckBox, 2);
place(0, 6, fontSizeLabel, 3);
- place(1, 6, mFontSizeDropDown, 3);
+ place(1, 6, mFontSizeDropDown, 2);
place(0, 7, mAlphaSlider);
place(1, 7, alphaLabel, 3);
@@ -326,7 +326,7 @@ Setup_Video::Setup_Video():
place(1, 11, particleDetailLabel);
place(2, 11, mParticleDetailField, 3).setPadding(2);
- setDimension(gcn::Rectangle(0, 0, 325, 300));
+ setDimension(gcn::Rectangle(0, 0, 365, 300));
}
void Setup_Video::apply()
diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp
index 62a27651..e07adc9f 100644
--- a/src/gui/truetypefont.cpp
+++ b/src/gui/truetypefont.cpp
@@ -19,12 +19,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <guichan/exception.hpp>
+#include "gui/truetypefont.h"
-#include "truetypefont.h"
+#include "graphics.h"
+#include "resources/image.h"
-#include "../graphics.h"
-#include "../resources/image.h"
+#include <guichan/exception.hpp>
#define CACHE_SIZE 256
diff --git a/src/gui/widgets/avatar.cpp b/src/gui/widgets/avatar.cpp
index b120c51f..16c77233 100644
--- a/src/gui/widgets/avatar.cpp
+++ b/src/gui/widgets/avatar.cpp
@@ -42,7 +42,6 @@ Avatar::Avatar():
mMaxHp(0)
{
setOpaque(false);
- setSize(200, 12);
if (avatarCount == 0)
{
@@ -54,12 +53,17 @@ Avatar::Avatar():
avatarStatusOffline->incRef();
avatarStatusOnline->incRef();
+ mLabel = new Label;
+ mLabel->adjustSize();
+
mStatus = new Icon(avatarStatusOffline);
mStatus->setSize(12, 12);
- add(mStatus, 1, 0);
- mLabel = new Label;
- mLabel->setSize(174, 12);
+
+ add(mStatus, 1, (mLabel->getHeight() - 12) / 2);
add(mLabel, 16, 0);
+
+ setSize(250, mLabel->getHeight());
+
}
Avatar::~Avatar()
@@ -108,4 +112,5 @@ void Avatar::updateAvatarLabel()
ss << " (" << mHp << "/" << mMaxHp << ")";
mLabel->setCaption(ss.str());
+ mLabel->adjustSize();
}
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index defc06f0..711680d1 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -162,13 +162,6 @@ void ChatTab::chatLog(std::string line, int own, bool ignoreRecord)
lineColor = "##S";
}
-#ifdef EATHENA_SUPPORT
- if (tmp.nick.empty() && tmp.text.substr(0, 17) == "Visible GM status")
- {
- player_node->setGM(true);
- }
-#endif
-
// Get the current system time
time_t t;
time(&t);
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 491e6396..e838aab6 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -140,15 +140,15 @@ void DropDown::draw(gcn::Graphics* graphics)
const int alpha = (int) (mAlpha * 255.0f);
gcn::Color faceColor = getBaseColor();
faceColor.a = alpha;
- const gcn::Color* highlightColor = &guiPalette->getColor(Palette::HIGHLIGHT,
- alpha);
+ const gcn::Color *highlightColor =
+ &guiPalette->getColor(Palette::HIGHLIGHT, alpha);
gcn::Color shadowColor = faceColor - 0x303030;
shadowColor.a = alpha;
if (mListBox->getListModel() && mListBox->getSelected() >= 0)
{
graphics->setFont(getFont());
- graphics->setColor(guiPalette->getColor(Palette::TEXT, alpha));
+ graphics->setColor(guiPalette->getColor(Palette::TEXT));
graphics->drawText(mListBox->getListModel()->getElementAt(mListBox->getSelected()), 1, 0);
}