38#include <guichan/key.hpp>
39#include <guichan/listmodel.hpp>
62 auto themeIt = std::find_if(themes.begin(),
65 return theme.getPath() == path;
67 return themeIt != themes.end() ? std::distance(themes.begin(), themeIt) : 0;
110 mShowMonsterDamageEnabled(
config.showMonstersTakedDamage),
111 mVisibleNamesEnabled(
config.visibleNames),
112 mNameEnabled(
config.showOwnName),
113 mNPCLogEnabled(
config.logNpcInGui),
114 mPickupChatEnabled(
config.showPickupChat),
115 mPickupParticleEnabled(
config.showPickupParticle),
116 mOpacity(
config.guiAlpha),
117 mSpeechMode(
config.speech),
118 mVisibleNamesCheckBox(new
CheckBox(
_(
"Visible names"),
119 mVisibleNamesEnabled)),
120 mNameCheckBox(new
CheckBox(
_(
"Show own name"), mNameEnabled)),
121 mNPCLogCheckBox(new
CheckBox(
_(
"Log NPC dialogue"), mNPCLogEnabled)),
122 mPickupNotifyLabel(new
Label(
_(
"Show pickup notification:"))),
124 mPickupChatCheckBox(new
CheckBox(
_(
"in chat"), mPickupChatEnabled)),
126 mPickupParticleCheckBox(new
CheckBox(
_(
"as particle"),
127 mPickupParticleEnabled)),
128 mSpeechSlider(new
Slider(0, 3)),
129 mSpeechLabel(new
Label(std::string())),
130 mAlphaSlider(new
Slider(0.2, 1.0))
135 auto *space =
new Spacer(0,10);
140 gcn::Label *speechLabel =
new Label(
_(
"Overhead text:"));
141 gcn::Label *alphaLabel =
new Label(
_(
"GUI opacity"));
142 gcn::Label *themeLabel =
new Label(
_(
"Theme:"));
143 gcn::Label *fontSizeLabel =
new Label(
_(
"Font size:"));
192 place(0, 2, space, 1, 1);
199 place(0, 5, space, 1, 1);
201 place(0, 6, themeLabel, 2);
204 place(0, 7, fontSizeLabel, 2);
207 place(0, 8, space, 1, 1);
210 place(2, 9, alphaLabel, 2);
213 place(2, 10, speechLabel, 2);
225 new OkDialog(
_(
"Changing Theme or Font Size"),
226 _(
"Theme and font size changes will apply after restart."));
265 const std::string &
id =
event.getId();
267 if (
id ==
"guialpha")
271 else if (
id ==
"monsterdamage")
275 else if (
id ==
"visiblenames")
279 else if (
id ==
"pickupchat")
283 else if (
id ==
"pickupparticle")
287 else if (
id ==
"speech")
294 else if (
id ==
"showownname")
298 else if (
id ==
"lognpc")
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
A drop down box from which you can select different values.
std::string getElementAt(int i) override
int getNumberOfElements() override
const std::vector< ThemeInfo > & getAvailableThemes() const
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
void setName(const std::string &name)
Sets the name displayed on the tab.
gcn::DropDown * mThemeDropDown
gcn::CheckBox * mVisibleNamesCheckBox
gcn::Slider * mAlphaSlider
gcn::CheckBox * mNameCheckBox
std::unique_ptr< gcn::ListModel > mThemesListModel
gcn::Label * mSpeechLabel
~Setup_Interface() override
bool mVisibleNamesEnabled
void cancel() override
Called when the Cancel button is pressed in the setup window.
void apply() override
Called when the Apply button is pressed in the setup window.
std::unique_ptr< gcn::ListModel > mFontSizeListModel
gcn::DropDown * mFontSizeDropDown
gcn::CheckBox * mNPCLogCheckBox
gcn::CheckBox * mPickupChatCheckBox
Being::Speech mSpeechMode
gcn::Label * mPickupNotifyLabel
gcn::CheckBox * mPickupParticleCheckBox
void action(const gcn::ActionEvent &event) override
bool mShowMonsterDamageEnabled
gcn::CheckBox * mShowMonsterDamageCheckBox
bool mPickupParticleEnabled
gcn::Slider * mSpeechSlider
int getNumberOfElements() override
std::string getElementAt(int i) override
static int getThemeIndex(const std::string &path)
Config config
Global settings (config.xml)
void setConfigValue(T Config::*member, const T &value)
Sets the given Config member and sends a change event.
const char * SIZE_NAME[4]
bool showMonstersTakedDamage