diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-19 19:36:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-19 19:36:11 +0300 |
commit | c097592c3f05168499603901a19479cb07fc6cc1 (patch) | |
tree | 3273a274d7241b861dbd4c9d4dfb047cd9b2d43b /src/gui | |
parent | 87539666b11b2e61c4259404bf01ec8a5695052c (diff) | |
download | plus-c097592c3f05168499603901a19479cb07fc6cc1.tar.gz plus-c097592c3f05168499603901a19479cb07fc6cc1.tar.bz2 plus-c097592c3f05168499603901a19479cb07fc6cc1.tar.xz plus-c097592c3f05168499603901a19479cb07fc6cc1.zip |
Add visual page in settings.
Move pickup particle settings to visual tab page.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 43 | ||||
-rw-r--r-- | src/gui/setup_video.h | 6 | ||||
-rw-r--r-- | src/gui/setup_visual.cpp | 64 | ||||
-rw-r--r-- | src/gui/setup_visual.h | 40 |
5 files changed, 114 insertions, 41 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 3408fba33..c7908a6ac 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -38,6 +38,7 @@ #include "gui/setup_players.h" #include "gui/setup_relations.h" #include "gui/setup_video.h" +#include "gui/setup_visual.h" #include "gui/widgets/button.h" #include "gui/widgets/label.h" @@ -92,6 +93,7 @@ Setup::Setup(): mPanel->enableScrollButtons(true); mTabs.push_back(new Setup_Video); + mTabs.push_back(new Setup_Visual); mTabs.push_back(new Setup_Audio); mTabs.push_back(new Setup_Perfomance); mTabs.push_back(new Setup_Joystick); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index cc3063a68..31060dcfd 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -275,8 +275,6 @@ Setup_Video::Setup_Video(): mOpenGLEnabled(config.getIntValue("opengl")), mCustomCursorEnabled(config.getBoolValue("customcursor")), mParticleEffectsEnabled(config.getBoolValue("particleeffects")), - mPickupChatEnabled(config.getBoolValue("showpickupchat")), - mPickupParticleEnabled(config.getBoolValue("showpickupparticle")), mOpacity(config.getFloatValue("guialpha")), mFps(config.getIntValue("fpslimit")), mAltFps(config.getIntValue("altfpslimit")), @@ -291,12 +289,6 @@ Setup_Video::Setup_Video(): mCustomCursorEnabled)), mParticleEffectsCheckBox(new CheckBox(_("Particle effects"), mParticleEffectsEnabled)), - mPickupNotifyLabel(new Label(_("Show pickup notification"))), - // TRANSLATORS: Refers to "Show own name" - mPickupChatCheckBox(new CheckBox(_("in chat"), mPickupChatEnabled)), - // TRANSLATORS: Refers to "Show own name" - mPickupParticleCheckBox(new CheckBox(_("as particle"), - mPickupParticleEnabled)), mEnableResizeCheckBox(new CheckBox(_("Enable resize"), mEnableResize)), mNoFrameCheckBox(new CheckBox(_("No frame"), mNoFrame)), mSpeechSlider(new Slider(0, 3)), @@ -358,8 +350,6 @@ Setup_Video::Setup_Video(): mModeList->setActionEventId("videomode"); mCustomCursorCheckBox->setActionEventId("customcursor"); mParticleEffectsCheckBox->setActionEventId("particleeffects"); - mPickupChatCheckBox->setActionEventId("pickupchat"); - mPickupParticleCheckBox->setActionEventId("pickupparticle"); mAlphaSlider->setActionEventId("guialpha"); mFpsCheckBox->setActionEventId("fpslimitcheckbox"); mSpeechSlider->setActionEventId("speech"); @@ -376,8 +366,6 @@ Setup_Video::Setup_Video(): mModeList->addActionListener(this); mCustomCursorCheckBox->addActionListener(this); mParticleEffectsCheckBox->addActionListener(this); - mPickupChatCheckBox->addActionListener(this); - mPickupParticleCheckBox->addActionListener(this); mAlphaSlider->addActionListener(this); mFpsCheckBox->addActionListener(this); mSpeechSlider->addActionListener(this); @@ -407,8 +395,6 @@ Setup_Video::Setup_Video(): place(0, 0, scrollArea, 1, 6).setPadding(2); place(0, 6, mOpenGLDropDown, 1); -// place(0, 6, mHwAccelCheckBox, 6); - place(1, 0, mFsCheckBox, 2); place(1, 1, mCustomCursorCheckBox, 3); @@ -416,11 +402,9 @@ Setup_Video::Setup_Video(): place(1, 2, mEnableResizeCheckBox, 2); place(1, 3, mNoFrameCheckBox, 2); - place(1, 4, mParticleEffectsCheckBox, 2); - - place(1, 5, mPickupNotifyLabel, 4); - place(1, 6, mPickupChatCheckBox, 1); - place(2, 6, mPickupParticleCheckBox, 2); +// place(1, 5, mPickupNotifyLabel, 4); +// place(1, 6, mPickupChatCheckBox, 1); +// place(2, 6, mPickupParticleCheckBox, 2); place(0, 7, mAlphaSlider); place(1, 7, alphaLabel, 3); @@ -440,9 +424,11 @@ Setup_Video::Setup_Video(): place(1, 12, overlayDetailLabel); place(2, 12, mOverlayDetailField, 3).setPadding(2); - place(0, 13, mParticleDetailSlider); - place(1, 13, particleDetailLabel); - place(2, 13, mParticleDetailField, 3).setPadding(2); + place(0, 13, mParticleEffectsCheckBox, 5); + + place(0, 14, mParticleDetailSlider); + place(1, 14, particleDetailLabel); + place(2, 14, mParticleDetailField, 3).setPadding(2); int width = 600; @@ -547,8 +533,6 @@ void Setup_Video::apply() mOpacity = config.getFloatValue("guialpha"); mOverlayDetail = config.getIntValue("OverlayDetail"); mOpenGLEnabled = config.getIntValue("opengl"); - mPickupChatEnabled = config.getBoolValue("showpickupchat"); - mPickupParticleEnabled = config.getBoolValue("showpickupparticle"); mEnableResize = config.getBoolValue("enableresize"); mNoFrame = config.getBoolValue("noframe"); } @@ -589,8 +573,6 @@ void Setup_Video::cancel() config.setValue("guialpha", mOpacity); Image::setEnableAlpha(mOpacity != 1.0f); config.setValue("opengl", mOpenGLEnabled); - config.setValue("showpickupchat", mPickupChatEnabled); - config.setValue("showpickupparticle", mPickupParticleEnabled); config.setValue("enableresize", mEnableResize); config.setValue("noframe", mNoFrame); } @@ -674,15 +656,6 @@ void Setup_Video::action(const gcn::ActionEvent &event) _("Changes will take effect on map change.")); } } - else if (id == "pickupchat") - { - config.setValue("showpickupchat", mPickupChatCheckBox->isSelected()); - } - else if (id == "pickupparticle") - { - config.setValue("showpickupparticle", - mPickupParticleCheckBox->isSelected()); - } else if (id == "speech") { Being::Speech val = static_cast<Being::Speech>( diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index 31d45d93d..ad6ca12d7 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -57,8 +57,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener int mOpenGLEnabled; bool mCustomCursorEnabled; bool mParticleEffectsEnabled; - bool mPickupChatEnabled; - bool mPickupParticleEnabled; float mOpacity; int mFps; int mAltFps; @@ -83,10 +81,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener gcn::CheckBox *mCustomCursorCheckBox; gcn::CheckBox *mParticleEffectsCheckBox; - gcn::Label *mPickupNotifyLabel; - gcn::CheckBox *mPickupChatCheckBox; - gcn::CheckBox *mPickupParticleCheckBox; - gcn::CheckBox *mEnableResizeCheckBox; gcn::CheckBox *mNoFrameCheckBox; diff --git a/src/gui/setup_visual.cpp b/src/gui/setup_visual.cpp new file mode 100644 index 000000000..6df2dbf82 --- /dev/null +++ b/src/gui/setup_visual.cpp @@ -0,0 +1,64 @@ +/* + * The ManaPlus Client + * Copyright (C) 2009-2010 Andrei Karas + * Copyright (C) 2011-2012 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "gui/setup_visual.h" + +#include "gui/chatwindow.h" + +#include "gui/widgets/button.h" +#include "gui/widgets/chattab.h" +#include "gui/widgets/checkbox.h" +#include "gui/widgets/label.h" +#include "gui/widgets/layouthelper.h" +#include "gui/widgets/scrollarea.h" +#include "gui/widgets/setupitem.h" + +#include "configuration.h" +#include "localplayer.h" +#include "logger.h" + +#include "utils/gettext.h" + +#include "debug.h" + +Setup_Visual::Setup_Visual() +{ + setName(_("Visual")); + + // Do the layout + LayoutHelper h(this); + ContainerPlacer place = h.getPlacer(0, 0); + place(0, 0, mScroll, 10, 10); + + new SetupItemCheckBox(_("Show pickup notifications in chat"), "", + "showpickupchat", this, "showpickupchatEvent"); + + new SetupItemCheckBox(_("Show pickup notifications as particle effects"), + "", "showpickupparticle", this, "showpickupparticleEvent"); + + setDimension(gcn::Rectangle(0, 0, 550, 350)); +} + +void Setup_Visual::apply() +{ + SetupTabScroll::apply(); +} diff --git a/src/gui/setup_visual.h b/src/gui/setup_visual.h new file mode 100644 index 000000000..f5001b9e4 --- /dev/null +++ b/src/gui/setup_visual.h @@ -0,0 +1,40 @@ +/* + * The ManaPlus Client + * Copyright (C) 2009-2010 Andrei Karas + * Copyright (C) 2011-2012 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef GUI_SETUP_VISUAL_H +#define GUI_SETUP_VISUAL_H + +#include "guichanfwd.h" + +#include "gui/widgets/setuptabscroll.h" + +#include <guichan/actionlistener.hpp> + +class Setup_Visual : public SetupTabScroll +{ + public: + Setup_Visual(); + + void apply(); +}; + +#endif |