aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiButton.cpp3
-rw-r--r--src/gui/guiEngine.cpp2
-rw-r--r--src/gui/guiFormSpecMenu.cpp15
-rw-r--r--src/gui/guiScene.cpp3
4 files changed, 11 insertions, 12 deletions
diff --git a/src/gui/guiButton.cpp b/src/gui/guiButton.cpp
index c38d901c4..be7e0c439 100644
--- a/src/gui/guiButton.cpp
+++ b/src/gui/guiButton.cpp
@@ -329,10 +329,9 @@ void GUIButton::draw()
if (SpriteBank)
{
- core::position2di pos(buttonCenter);
-
if (isEnabled())
{
+ core::position2di pos(buttonCenter);
// pressed / unpressed animation
EGUI_BUTTON_STATE state = Pressed ? EGBS_BUTTON_DOWN : EGBS_BUTTON_UP;
drawSprite(state, ClickTime, pos);
diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp
index 01f3f8fd5..bcbc90e13 100644
--- a/src/gui/guiEngine.cpp
+++ b/src/gui/guiEngine.cpp
@@ -195,7 +195,7 @@ GUIEngine::GUIEngine(JoystickController *joystick,
try {
m_script->setMainMenuData(&m_data->script_data);
- m_data->script_data.errormessage = "";
+ m_data->script_data.errormessage.clear();
if (!loadMainMenuScript()) {
errorstream << "No future without main menu!" << std::endl;
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 1f9914e72..f1b33ab81 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -694,7 +694,7 @@ void GUIFormSpecMenu::parseScrollBar(parserData* data, const std::string &elemen
e->setMax(max);
e->setMin(min);
- e->setPos(stoi(parts[4]));
+ e->setPos(stoi(value));
e->setSmallStep(data->scrollbar_options.small_step);
e->setLargeStep(data->scrollbar_options.large_step);
@@ -1180,7 +1180,6 @@ void GUIFormSpecMenu::parseTable(parserData* data, const std::string &element)
std::string name = parts[2];
std::vector<std::string> items = split(parts[3],',');
std::string str_initial_selection;
- std::string str_transparent = "false";
if (parts.size() >= 5)
str_initial_selection = parts[4];
@@ -2264,7 +2263,7 @@ void GUIFormSpecMenu::parseBackgroundColor(parserData* data, const std::string &
}
// bgcolor
- if (parameter_count >= 1 && parts[0] != "")
+ if (parameter_count >= 1 && !parts[0].empty())
parseColorString(parts[0], m_bgcolor, false);
// fullscreen
@@ -2275,14 +2274,14 @@ void GUIFormSpecMenu::parseBackgroundColor(parserData* data, const std::string &
} else if (parts[1] == "neither") {
m_bgnonfullscreen = false;
m_bgfullscreen = false;
- } else if (parts[1] != "" || m_formspec_version < 3) {
+ } else if (!parts[1].empty() || m_formspec_version < 3) {
m_bgfullscreen = is_yes(parts[1]);
m_bgnonfullscreen = !m_bgfullscreen;
}
}
// fbgcolor
- if (parameter_count >= 3 && parts[2] != "")
+ if (parameter_count >= 3 && !parts[2].empty())
parseColorString(parts[2], m_fullscreen_bgcolor, false);
}
@@ -3047,7 +3046,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
}
} else {
// Don't keep old focus value
- m_focused_element = "";
+ m_focused_element.clear();
}
// Remove children
@@ -3865,7 +3864,7 @@ void GUIFormSpecMenu::acceptInput(FormspecQuitMode quitmode)
if (!current_field_enter_pending.empty()) {
fields["key_enter_field"] = current_field_enter_pending;
- current_field_enter_pending = "";
+ current_field_enter_pending.clear();
}
if (current_keys_pending.key_escape) {
@@ -4600,7 +4599,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
} else if (s.ftype == f_ScrollBar) {
s.fdefault = L"Changed";
acceptInput(quit_mode_no);
- s.fdefault = L"";
+ s.fdefault.clear();
} else if (s.ftype == f_Unknown || s.ftype == f_HyperText) {
if (!s.sound.empty() && m_sound_manager)
m_sound_manager->playSound(SimpleSoundSpec(s.sound, 1.0f));
diff --git a/src/gui/guiScene.cpp b/src/gui/guiScene.cpp
index ee2556b03..008e94db4 100644
--- a/src/gui/guiScene.cpp
+++ b/src/gui/guiScene.cpp
@@ -86,9 +86,10 @@ void GUIScene::draw()
core::rect<s32> oldViewPort = m_driver->getViewPort();
m_driver->setViewPort(getAbsoluteClippingRect());
- core::recti borderRect = Environment->getRootGUIElement()->getAbsoluteClippingRect();
if (m_bgcolor != 0) {
+ core::recti borderRect =
+ Environment->getRootGUIElement()->getAbsoluteClippingRect();
Environment->getSkin()->draw3DSunkenPane(
this, m_bgcolor, false, true, borderRect, 0);
}