diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-15 18:29:15 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-15 18:29:15 +0100 |
commit | 83bbc5cc3afeea0f0b248cd755e1011f4760a298 (patch) | |
tree | 1207131c234ad7c5ae6a5849d1d5d53de45b1b0b /src/gui | |
parent | 7b3b60f86c545e0c5b6b8cb1ab7b1cbbf22d5e02 (diff) | |
parent | 38708de52f00689088eda29f9b6ee257ce7038ad (diff) | |
download | mana-83bbc5cc3afeea0f0b248cd755e1011f4760a298.tar.gz mana-83bbc5cc3afeea0f0b248cd755e1011f4760a298.tar.bz2 mana-83bbc5cc3afeea0f0b248cd755e1011f4760a298.tar.xz mana-83bbc5cc3afeea0f0b248cd755e1011f4760a298.zip |
Merge commit 'aethyra/master'
Conflicts:
CMakeLists.txt
configure.ac
data/help/header.txt
packaging/windows/setup.nsi
po/POTFILES.in
src/being.cpp
src/being.h
src/game.cpp
src/gui/color.cpp
src/gui/color.h
src/gui/equipmentwindow.h
src/gui/popupmenu.cpp
src/gui/recorder.cpp
src/gui/setup_colors.h
src/gui/setup_keyboard.cpp
src/gui/setup_keyboard.h
src/gui/skill.cpp
src/gui/speechbubble.cpp
src/gui/speechbubble.h
src/gui/table.cpp
src/keyboardconfig.cpp
src/keyboardconfig.h
src/localplayer.cpp
src/main.cpp
src/main.h
src/map.cpp
src/resources/colordb.cpp
src/resources/colordb.h
src/resources/emotedb.cpp
src/resources/emotedb.h
src/text.cpp
src/text.h
src/tmw.rc
src/winver.h
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/color.cpp | 6 | ||||
-rw-r--r-- | src/gui/color.h | 10 | ||||
-rw-r--r-- | src/gui/itempopup.cpp | 6 | ||||
-rw-r--r-- | src/gui/setup.cpp | 4 | ||||
-rw-r--r-- | src/gui/setup_audio.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.h | 6 | ||||
-rw-r--r-- | src/gui/setup_joystick.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_keyboard.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_players.cpp | 57 | ||||
-rw-r--r-- | src/gui/setup_players.h | 2 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 132 | ||||
-rw-r--r-- | src/gui/setup_video.h | 12 | ||||
-rw-r--r-- | src/gui/shortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/shortcutcontainer.h | 6 | ||||
-rw-r--r-- | src/gui/skill.cpp | 3 | ||||
-rw-r--r-- | src/gui/speechbubble.cpp | 20 | ||||
-rw-r--r-- | src/gui/speechbubble.h | 2 | ||||
-rw-r--r-- | src/gui/table.cpp | 2 | ||||
-rw-r--r-- | src/gui/truetypefont.cpp | 4 | ||||
-rw-r--r-- | src/gui/truetypefont.h | 6 | ||||
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/dropdown.h | 6 |
23 files changed, 203 insertions, 101 deletions
diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 7a29025e..02469893 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -48,7 +48,7 @@ Color::~Color() col != colEnd; ++col) { - config.setValue("color" + col->text, toString(col->rgb)); + config.setValue("Color" + col->text, toString(col->rgb)); } } @@ -104,8 +104,8 @@ char Color::getColorCharAt(int i) void Color::addColor(const char c, const int rgb, const std::string &text) { - int trueRgb = (int)config.getValue("color" + text, rgb); - mColVector.push_back(colorElem(c, trueRgb, text)); + int trueRgb = (int) config.getValue("Color" + text, rgb); + mColVector.push_back(ColorElem(c, trueRgb, text)); } int Color::getColorAt(int i) diff --git a/src/gui/color.h b/src/gui/color.h index 509448e7..8684a1a7 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COLOUR_H -#define COLOUR_H +#ifndef COLOR_H +#define COLOR_H #include <string> #include <vector> @@ -109,16 +109,16 @@ class Color : public gcn::ListModel void rollback(); private: - struct colorElem + struct ColorElem { - colorElem(const char c, const int rgb, const std::string &text) : + ColorElem(const char c, const int rgb, const std::string &text) : ch(c), rgb(rgb), text(text) {} char ch; int rgb; int committedRgb; std::string text; }; - typedef std::vector<colorElem> ColVector; + typedef std::vector<ColorElem> ColVector; ColVector mColVector; /** diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index 4c117f0a..008a41d9 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -5,18 +5,18 @@ * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 09eaeff0..09f7109e 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -49,8 +49,8 @@ Setup::Setup(): Window(_("Setup")) { setCloseButton(true); - int width = 310; - int height = 310; + int width = 340; + int height = 340; setContentSize(width, height); static const char *buttonNames[] = { diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp index 5c189882..a4bc05ae 100644 --- a/src/gui/setup_audio.cpp +++ b/src/gui/setup_audio.cpp @@ -71,7 +71,7 @@ Setup_Audio::Setup_Audio(): place(0, 2, mMusicSlider); place(1, 2, musicLabel); - setDimension(gcn::Rectangle(0, 0, 290, 250)); + setDimension(gcn::Rectangle(0, 0, 325, 280)); } void Setup_Audio::apply() diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 372dbd17..4f88f212 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -126,7 +126,7 @@ Setup_Colors::Setup_Colors() : place(2, 10, mBlueSlider); place(3, 10, mBlueText).setPadding(1); - setDimension(gcn::Rectangle(0, 0, 290, 250)); + setDimension(gcn::Rectangle(0, 0, 325, 280)); } Setup_Colors::~Setup_Colors() diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index 8fd1ba59..2831297f 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SETUP_COLOURS_H -#define SETUP_COLOURS_H +#ifndef SETUP_COLORS_H +#define SETUP_COLORS_H #include <string> @@ -37,7 +37,7 @@ class BrowserBox; class Setup_Colors : public SetupTab, public gcn::ActionListener, - public TextFieldListener + public TextFieldListener { public: Setup_Colors(); diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index 2ebcdbde..c0c04949 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -56,7 +56,7 @@ Setup_Joystick::Setup_Joystick(): place = h.getPlacer(0, 1); place(0, 0, mCalibrateButton); - setDimension(gcn::Rectangle(0, 0, 290, 75)); + setDimension(gcn::Rectangle(0, 0, 325, 75)); } void Setup_Joystick::action(const gcn::ActionEvent &event) diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index 5d7519ef..6eef6f49 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, 295, 250)); + setDimension(gcn::Rectangle(0, 0, 325, 280)); } Setup_Keyboard::~Setup_Keyboard() diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index d25117de..44b52b54 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -1,6 +1,6 @@ /* * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Copyright (C) 2008 The Mana World Development Team * * This file is part of The Mana World. * @@ -47,17 +47,19 @@ #define ROW_HEIGHT 12 // The following column widths really shouldn't be hardcoded but should scale with the size of the widget... except // that, right now, the widget doesn't exactly scale either. -#define NAME_COLUMN_WIDTH 195 +#define NAME_COLUMN_WIDTH 230 #define RELATION_CHOICE_COLUMN_WIDTH 80 #define WIDGET_AT(row, column) (((row) * COLUMNS_NR) + column) -static const char *table_titles[COLUMNS_NR] = { +static const char *table_titles[COLUMNS_NR] = +{ N_("Name"), N_("Relation") }; -static const char *RELATION_NAMES[PlayerRelation::RELATIONS_NR] = { +static const char *RELATION_NAMES[PlayerRelation::RELATIONS_NR] = +{ N_("Neutral"), N_("Friend"), N_("Disregarded"), @@ -153,9 +155,10 @@ public: virtual void updateModelInRow(int row) { gcn::DropDown *choicebox = dynamic_cast<gcn::DropDown *>( - getElementAt(row, RELATION_CHOICE_COLUMN)); + getElementAt(row, RELATION_CHOICE_COLUMN)); player_relations.setRelation(getPlayerAt(row), - static_cast<PlayerRelation::relation>(choicebox->getSelected())); + static_cast<PlayerRelation::relation>( + choicebox->getSelected())); } @@ -170,7 +173,9 @@ public: delete mPlayers; mPlayers = NULL; - for (std::vector<gcn::Widget *>::const_iterator it = mWidgets.begin(); it != mWidgets.end(); it++) { + for (std::vector<gcn::Widget *>::const_iterator it = mWidgets.begin(); + it != mWidgets.end(); it++) + { delete *it; } @@ -202,9 +207,9 @@ public: virtual std::string getElementAt(int i) { - if (i >= getNumberOfElements()) { + if (i >= getNumberOfElements()) return _("???"); - } + return (*player_relations.getPlayerIgnoreStrategies())[i]->mDescription; } }; @@ -230,11 +235,9 @@ Setup_Players::Setup_Players(): setOpaque(false); mPlayerTable->setOpaque(false); - int table_width = NAME_COLUMN_WIDTH + RELATION_CHOICE_COLUMN_WIDTH; mPlayerTableTitleModel->fixColumnWidth(NAME_COLUMN, NAME_COLUMN_WIDTH); mPlayerTableTitleModel->fixColumnWidth(RELATION_CHOICE_COLUMN, RELATION_CHOICE_COLUMN_WIDTH); - mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width - 1, 10)); mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf)); gcn::ListModel *ignoreChoices = new IgnoreChoicesListModel(); @@ -256,7 +259,6 @@ Setup_Players::Setup_Players(): gcn::Label *ignore_action_label = new gcn::Label(_("When ignoring:")); - mIgnoreActionChoicesBox->setDimension(gcn::Rectangle(80, 132, 120, 12)); mIgnoreActionChoicesBox->setActionEventId(ACTION_STRATEGY); mIgnoreActionChoicesBox->addActionListener(this); @@ -289,7 +291,7 @@ Setup_Players::Setup_Players(): player_relations.addListener(this); - setDimension(gcn::Rectangle(0, 0, 290, 250)); + setDimension(gcn::Rectangle(0, 0, 325, 280)); } Setup_Players::~Setup_Players() @@ -304,9 +306,12 @@ void Setup_Players::reset() // current selection. We could use an index into the table of config // options in player_relations instead of strategies to sidestep this. int selection = 0; - for (unsigned int i = 0; i < player_relations.getPlayerIgnoreStrategies()->size(); ++i) + for (unsigned int i = 0; + i < player_relations.getPlayerIgnoreStrategies()->size(); + ++i) if ((*player_relations.getPlayerIgnoreStrategies())[i] == - player_relations.getPlayerIgnoreStrategy()) { + player_relations.getPlayerIgnoreStrategy()) + { selection = i; break; @@ -320,11 +325,14 @@ void Setup_Players::apply() player_relations.setPersistIgnores(mPersistIgnores->isSelected()); player_relations.store(); - unsigned int old_default_relations = - player_relations.getDefault() & ~(PlayerRelation::TRADE | PlayerRelation::WHISPER); + unsigned int old_default_relations = player_relations.getDefault() & + ~(PlayerRelation::TRADE | + PlayerRelation::WHISPER); player_relations.setDefault(old_default_relations - | (mDefaultTrading->isSelected()? PlayerRelation::TRADE : 0) - | (mDefaultWhisper->isSelected()? PlayerRelation::WHISPER : 0)); + | (mDefaultTrading->isSelected() ? + PlayerRelation::TRADE : 0) + | (mDefaultWhisper->isSelected() ? + PlayerRelation::WHISPER : 0)); } void Setup_Players::cancel() @@ -333,7 +341,8 @@ void Setup_Players::cancel() void Setup_Players::action(const gcn::ActionEvent &event) { - if (event.getId() == ACTION_TABLE) { + if (event.getId() == ACTION_TABLE) + { // temporarily eliminate ourselves: we are fully aware of this change, // so there is no need for asynchronous updates. (In fact, thouse // might destroy the widet that triggered them, which would be rather @@ -346,7 +355,9 @@ void Setup_Players::action(const gcn::ActionEvent &event) player_relations.addListener(this); - } else if (event.getId() == ACTION_DELETE) { + } + else if (event.getId() == ACTION_DELETE) + { int player_index = mPlayerTable->getSelectedRow(); if (player_index < 0) @@ -356,7 +367,9 @@ void Setup_Players::action(const gcn::ActionEvent &event) player_relations.removePlayer(name); - } else if (event.getId() == ACTION_STRATEGY) { + } + else if (event.getId() == ACTION_STRATEGY) + { PlayerIgnoreStrategy *s = (*player_relations.getPlayerIgnoreStrategies())[ mIgnoreActionChoicesBox->getSelected()]; diff --git a/src/gui/setup_players.h b/src/gui/setup_players.h index 74247b77..72d81f71 100644 --- a/src/gui/setup_players.h +++ b/src/gui/setup_players.h @@ -1,6 +1,6 @@ /* * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Copyright (C) 2008 The Mana World Development Team * * This file is part of The Mana World. * diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index c02025c8..6e26bab6 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -108,18 +108,19 @@ Setup_Video::Setup_Video(): mOpenGLEnabled(config.getValue("opengl", false)), mCustomCursorEnabled(config.getValue("customcursor", true)), mParticleEffectsEnabled(config.getValue("particleeffects", true)), - mSpeechBubbleEnabled(config.getValue("speechbubble", true)), mNameEnabled(config.getValue("showownname", false)), mOpacity(config.getValue("guialpha", 0.8)), mFps((int) config.getValue("fpslimit", 0)), + mSpeechMode((int) config.getValue("speech", 3)), mModeListModel(new ModeListModel), mModeList(new ListBox(mModeListModel)), mFsCheckBox(new CheckBox(_("Full screen"), mFullScreenEnabled)), mOpenGLCheckBox(new CheckBox(_("OpenGL"), mOpenGLEnabled)), mCustomCursorCheckBox(new CheckBox(_("Custom cursor"), mCustomCursorEnabled)), mParticleEffectsCheckBox(new CheckBox(_("Particle effects"), mParticleEffectsEnabled)), - mSpeechBubbleCheckBox(new CheckBox(_("Speech bubbles"), mSpeechBubbleEnabled)), mNameCheckBox(new CheckBox(_("Show name"), mNameEnabled)), + mSpeechSlider(new Slider(0, 3)), + mSpeechLabel(new gcn::Label("")), mAlphaSlider(new Slider(0.2, 1.0)), mFpsCheckBox(new CheckBox(_("FPS Limit:"))), mFpsSlider(new Slider(10, 200)), @@ -142,11 +143,12 @@ Setup_Video::Setup_Video(): ScrollArea *scrollArea = new ScrollArea(mModeList); scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - gcn::Label *alphaLabel = new gcn::Label(_("Gui opacity")); - gcn::Label *scrollRadiusLabel = new gcn::Label(_("Scroll radius")); - gcn::Label *scrollLazinessLabel = new gcn::Label(_("Scroll laziness")); - gcn::Label *overlayDetailLabel = new gcn::Label(_("Ambient FX")); - gcn::Label *particleDetailLabel = new gcn::Label(_("Particle Detail")); + speechLabel = new gcn::Label(_("Overhead text")); + alphaLabel = new gcn::Label(_("Gui opacity")); + scrollRadiusLabel = new gcn::Label(_("Scroll radius")); + scrollLazinessLabel = new gcn::Label(_("Scroll laziness")); + overlayDetailLabel = new gcn::Label(_("Ambient FX")); + particleDetailLabel = new gcn::Label(_("Particle Detail")); mModeList->setEnabled(true); #ifndef USE_OPENGL @@ -167,10 +169,10 @@ Setup_Video::Setup_Video(): mModeList->setActionEventId("videomode"); mCustomCursorCheckBox->setActionEventId("customcursor"); mParticleEffectsCheckBox->setActionEventId("particleeffects"); - mSpeechBubbleCheckBox->setActionEventId("speechbubble"); mNameCheckBox->setActionEventId("showownname"); mAlphaSlider->setActionEventId("guialpha"); mFpsCheckBox->setActionEventId("fpslimitcheckbox"); + mSpeechSlider->setActionEventId("speech"); mFpsSlider->setActionEventId("fpslimitslider"); mScrollRadiusSlider->setActionEventId("scrollradiusslider"); mScrollRadiusField->setActionEventId("scrollradiusfield"); @@ -184,10 +186,10 @@ Setup_Video::Setup_Video(): mModeList->addActionListener(this); mCustomCursorCheckBox->addActionListener(this); mParticleEffectsCheckBox->addActionListener(this); - mSpeechBubbleCheckBox->addActionListener(this); mNameCheckBox->addActionListener(this); mAlphaSlider->addActionListener(this); mFpsCheckBox->addActionListener(this); + mSpeechSlider->addActionListener(this); mFpsSlider->addActionListener(this); mFpsField->addKeyListener(this); mScrollRadiusSlider->addActionListener(this); @@ -205,6 +207,23 @@ Setup_Video::Setup_Video(): mScrollLazinessField->setText(toString(mOriginalScrollLaziness)); mScrollLazinessSlider->setValue(mOriginalScrollLaziness); + switch (mSpeechMode) + { + case 0: + mSpeechLabel->setCaption(_("No text")); + break; + case 1: + mSpeechLabel->setCaption(_("Text")); + break; + case 2: + mSpeechLabel->setCaption(_("Bubbles, no names")); + break; + case 3: + mSpeechLabel->setCaption(_("Bubbles with names")); + break; + } + mSpeechSlider->setValue(mSpeechMode); + switch (mOverlayDetail) { case 0: @@ -244,36 +263,71 @@ Setup_Video::Setup_Video(): place(1, 0, mFsCheckBox, 3); place(1, 1, mOpenGLCheckBox, 3); place(1, 2, mCustomCursorCheckBox, 3); - place(1, 3, mSpeechBubbleCheckBox, 3); - place(1, 4, mNameCheckBox, 3); - place(1, 5, mParticleEffectsCheckBox, 3); - - place(0, 7, mAlphaSlider); - place(0, 8, mFpsSlider); - place(0, 9, mScrollRadiusSlider); - place(0, 10, mScrollLazinessSlider); + place(1, 3, mNameCheckBox, 3); + place(1, 4, mParticleEffectsCheckBox, 3); + + place(0, 6, mAlphaSlider); + place(0, 7, mFpsSlider); + place(0, 8, mScrollRadiusSlider); + place(0, 9, mScrollLazinessSlider); + place(0, 10, mSpeechSlider); place(0, 11, mOverlayDetailSlider); place(0, 12, mParticleDetailSlider); - place(1, 7, alphaLabel, 2); - place(1, 8, mFpsCheckBox).setPadding(3); - place(1, 9, scrollRadiusLabel); - place(1, 10, scrollLazinessLabel); + place(1, 6, alphaLabel, 2); + place(1, 7, mFpsCheckBox).setPadding(3); + place(1, 8, scrollRadiusLabel); + place(1, 9, scrollLazinessLabel); + place(1, 10, speechLabel); place(1, 11, overlayDetailLabel); place(1, 12, particleDetailLabel); - place(2, 8, mFpsField).setPadding(1); - place(2, 9, mScrollRadiusField).setPadding(1); - place(2, 10, mScrollLazinessField).setPadding(1); + place(2, 7, mFpsField).setPadding(1); + place(2, 8, mScrollRadiusField).setPadding(1); + place(2, 9, mScrollLazinessField).setPadding(1); + place(2, 10, mSpeechLabel, 2).setPadding(2); place(2, 11, mOverlayDetailField, 2).setPadding(2); place(2, 12, mParticleDetailField, 2).setPadding(2); - setDimension(gcn::Rectangle(0, 0, 295, 250)); + setDimension(gcn::Rectangle(0, 0, 325, 280)); } Setup_Video::~Setup_Video() { delete mModeListModel; + + delete speechLabel; + delete alphaLabel; + delete scrollRadiusLabel; + delete scrollLazinessLabel; + delete overlayDetailLabel; + delete particleDetailLabel; + + delete mModeList; + delete mFsCheckBox; + delete mOpenGLCheckBox; + delete mCustomCursorCheckBox; + delete mParticleEffectsCheckBox; + delete mNameCheckBox; + + delete mSpeechSlider; + delete mSpeechLabel; + delete mAlphaSlider; + delete mFpsCheckBox; + delete mFpsSlider; + delete mFpsField; + + delete mScrollLazinessSlider; + delete mScrollLazinessField; + + delete mScrollRadiusSlider; + delete mScrollRadiusField; + + delete mOverlayDetailSlider; + delete mOverlayDetailField; + + delete mParticleDetailSlider; + delete mParticleDetailField; } void Setup_Video::apply() @@ -333,8 +387,8 @@ void Setup_Video::apply() mFullScreenEnabled = config.getValue("screen", false); mCustomCursorEnabled = config.getValue("customcursor", true); mParticleEffectsEnabled = config.getValue("particleeffects", true); - mSpeechBubbleEnabled = config.getValue("speechbubble", true); mNameEnabled = config.getValue("showownname", false); + mSpeechMode = (int) config.getValue("speech", 3); mOpacity = config.getValue("guialpha", 0.8); mOverlayDetail = (int) config.getValue("OverlayDetail", 2); mOpenGLEnabled = config.getValue("opengl", false); @@ -366,7 +420,7 @@ void Setup_Video::cancel() mOpenGLCheckBox->setSelected(mOpenGLEnabled); mCustomCursorCheckBox->setSelected(mCustomCursorEnabled); mParticleEffectsCheckBox->setSelected(mParticleEffectsEnabled); - mSpeechBubbleCheckBox->setSelected(mSpeechBubbleEnabled); + mSpeechSlider->setValue(mSpeechMode); mNameCheckBox->setSelected(mNameEnabled); mAlphaSlider->setValue(mOpacity); mOverlayDetailSlider->setValue(mOverlayDetail); @@ -380,7 +434,7 @@ void Setup_Video::cancel() config.setValue("screen", mFullScreenEnabled ? true : false); config.setValue("customcursor", mCustomCursorEnabled ? true : false); config.setValue("particleeffects", mParticleEffectsEnabled ? true : false); - config.setValue("speechbubble", mSpeechBubbleEnabled ? true : false); + config.setValue("speech", mSpeechMode); config.setValue("showownname", mNameEnabled ? true : false); config.setValue("guialpha", mOpacity); config.setValue("opengl", mOpenGLEnabled ? true : false); @@ -417,10 +471,26 @@ void Setup_Video::action(const gcn::ActionEvent &event) new OkDialog(_("Particle effect settings changed"), _("Restart your client or change maps for the change to take effect.")); } - else if (event.getId() == "speechbubble") + else if (event.getId() == "speech") { - config.setValue("speechbubble", - mSpeechBubbleCheckBox->isSelected() ? true : false); + int val = (int) mSpeechSlider->getValue(); + switch (val) + { + case 0: + mSpeechLabel->setCaption(_("No text")); + break; + case 1: + mSpeechLabel->setCaption(_("Text")); + break; + case 2: + mSpeechLabel->setCaption(_("Bubbles, no names")); + break; + case 3: + mSpeechLabel->setCaption(_("Bubbles with names")); + break; + } + mSpeechSlider->setValue(val); + config.setValue("speech", val); } else if (event.getId() == "showownname") { diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index 303b5bfc..13735e0f 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -52,21 +52,29 @@ class Setup_Video : public SetupTab, public gcn::ActionListener, bool mOpenGLEnabled; bool mCustomCursorEnabled; bool mParticleEffectsEnabled; - bool mSpeechBubbleEnabled; bool mNameEnabled; double mOpacity; int mFps; + int mSpeechMode; class ModeListModel *mModeListModel; + gcn::Label *speechLabel; + gcn::Label *alphaLabel; + gcn::Label *scrollRadiusLabel; + gcn::Label *scrollLazinessLabel; + gcn::Label *overlayDetailLabel; + gcn::Label *particleDetailLabel; + gcn::ListBox *mModeList; gcn::CheckBox *mFsCheckBox; gcn::CheckBox *mOpenGLCheckBox; gcn::CheckBox *mCustomCursorCheckBox; gcn::CheckBox *mParticleEffectsCheckBox; - gcn::CheckBox *mSpeechBubbleCheckBox; gcn::CheckBox *mNameCheckBox; + gcn::Slider *mSpeechSlider; + gcn::Label *mSpeechLabel; gcn::Slider *mAlphaSlider; gcn::CheckBox *mFpsCheckBox; gcn::Slider *mFpsSlider; diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp index 4472818e..9fed040e 100644 --- a/src/gui/shortcutcontainer.cpp +++ b/src/gui/shortcutcontainer.cpp @@ -4,18 +4,18 @@ * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h index f5f06163..b08c6d73 100644 --- a/src/gui/shortcutcontainer.h +++ b/src/gui/shortcutcontainer.h @@ -4,18 +4,18 @@ * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 03711a47..05b782d5 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -40,7 +40,8 @@ static const char *SKILLS_FILE = _("skills.xml"); -struct SkillInfo { +struct SkillInfo +{ std::string name; bool modifiable; }; diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index dd404a63..c1451d51 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -73,20 +73,28 @@ void SpeechBubble::setCaption(const std::string &name, const gcn::Color &color) mCaption->setForegroundColor(color); } -void SpeechBubble::setText(std::string mText) +void SpeechBubble::setText(std::string mText, bool showName) { - int width = mCaption->getWidth() + 3; + int width = mCaption->getWidth(); mSpeechBox->setTextWrapped(mText, 130 > width ? 130 : width); const int fontHeight = getFont()->getHeight(); - const int numRows = mSpeechBox->getNumberOfRows() + 1; + const int numRows = showName ? mSpeechBox->getNumberOfRows() + 1 : + mSpeechBox->getNumberOfRows(); + int yPos = showName ? fontHeight + 3 : 3; + int height = (numRows * fontHeight); if (width < mSpeechBox->getMinWidth()) width = mSpeechBox->getMinWidth(); - setContentSize(width + fontHeight, (numRows * fontHeight) + 6); - mSpeechArea->setDimension(gcn::Rectangle(4, fontHeight + 3, width + 5, - (numRows * fontHeight))); + if (numRows == 1) + { + yPos = (fontHeight / 4) + 3; + height = ((3 * fontHeight) / 2) + 1; + } + + setContentSize(width + fontHeight, height + 6); + mSpeechArea->setDimension(gcn::Rectangle(4, yPos, width + 5, height)); } unsigned int SpeechBubble::getNumRows() diff --git a/src/gui/speechbubble.h b/src/gui/speechbubble.h index d2d81332..323f6667 100644 --- a/src/gui/speechbubble.h +++ b/src/gui/speechbubble.h @@ -35,7 +35,7 @@ class SpeechBubble : public Window void setCaption(const std::string &name, const gcn::Color &color = 0x000000); - void setText(std::string mText); + void setText(std::string mText, bool showName = true); void setLocation(int x, int y); unsigned int getNumRows(); diff --git a/src/gui/table.cpp b/src/gui/table.cpp index 567272f0..76877c6b 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -1,6 +1,6 @@ /* * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Copyright (C) 2008 The Mana World Development Team * * This file is part of The Mana World. * diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp index 8e6636df..8481d80d 100644 --- a/src/gui/truetypefont.cpp +++ b/src/gui/truetypefont.cpp @@ -19,8 +19,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <list> - #include <guichan/exception.hpp> #include "truetypefont.h" @@ -74,8 +72,6 @@ class TextChunk gcn::Color color; }; -// Word surfaces cache -static std::list<TextChunk> cache; typedef std::list<TextChunk>::iterator CacheIterator; static int fontCounter; diff --git a/src/gui/truetypefont.h b/src/gui/truetypefont.h index cd68a94e..3ab24248 100644 --- a/src/gui/truetypefont.h +++ b/src/gui/truetypefont.h @@ -22,6 +22,7 @@ #ifndef TRUETYPEFONT_H #define TRUETYPEFONT_H +#include <list> #include <string> #include <guichan/font.hpp> @@ -31,6 +32,8 @@ #include <SDL_ttf.h> #endif +class TextChunk; + /** * A wrapper around SDL_ttf for allowing the use of TrueType fonts. * @@ -65,6 +68,9 @@ class TrueTypeFont : public gcn::Font private: TTF_Font *mFont; + + // Word surfaces cache + std::list<TextChunk> cache; }; #endif diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 79d9ff06..6219d98e 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -4,18 +4,18 @@ * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index e5919dc7..4aba73dd 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -4,18 +4,18 @@ * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |