diff --git a/src/addons/addons_manager.cpp b/src/addons/addons_manager.cpp index 3fe7ff51f..f5f7e8d5f 100644 --- a/src/addons/addons_manager.cpp +++ b/src/addons/addons_manager.cpp @@ -583,13 +583,19 @@ bool AddonsManager::uninstall(const Addon &addon) */ void AddonsManager::saveInstalled() { - //Put the addons in the xml file - //Manually because the irrlicht xml writer doesn't seem finished, FIXME ? + // Put the addons in the xml file + // Manually because the irrlicht xml writer doesn't seem finished, FIXME ? std::ofstream xml_installed(m_file_installed.c_str()); - //write the header of the xml file + // Write the header of the xml file xml_installed << "" << std::endl; - xml_installed << "" + + // Get server address from config + std::string server = UserConfigParams::m_server_addons; + // Find the third slash (end of the domain) + std::string::size_type index = server.find('/'); + index = server.find('/', index + 2) + 1; // Omit one slash + xml_installed << "" << std::endl; for(unsigned int i = 0; i < m_addons_list.getData().size(); i++) diff --git a/src/config/hardware_stats.cpp b/src/config/hardware_stats.cpp index 6780fa5ad..900733b64 100644 --- a/src/config/hardware_stats.cpp +++ b/src/config/hardware_stats.cpp @@ -313,9 +313,6 @@ void reportHardwareStats() std::string vendor, renderer, full_version; irr_driver->getOpenGLData(&vendor, &renderer, &full_version); - json.add("GL_VENDOR", vendor ); - json.add("GL_RENDERER", renderer ); - json.add("GL_VERSION", full_version ); json.add("gfx_drv_ver", "OpenGL "+vendor); std::string card_name = vendor; diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index f948ea28d..71a99f5a5 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -1374,9 +1374,9 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget, const core::recti source_area(0, 0, texture_w, texture_h); draw2DImage(texture, - dest_area, source_area, - 0 /* no clipping */, 0, - true /* alpha */); + dest_area, source_area, + 0 /* no clipping */, 0, + true /* alpha */); } @@ -1598,15 +1598,28 @@ void Skin::drawCheckBox(const core::recti &rect, Widget* widget, bool focused) SColor(100,255,255,255), SColor(100,255,255,255), SColor(100,255,255,255) }; - draw2DImage( texture, rect, source_area, - 0 /* no clipping */, colors, - true /* alpha */); + draw2DImage(texture, rect, source_area, + 0 /* no clipping */, colors, + true /* alpha */); } else { - draw2DImage( texture, rect, source_area, - 0 /* no clipping */, 0, - true /* alpha */); + draw2DImage(texture, rect, source_area, + 0 /* no clipping */, 0, + true /* alpha */); + } + + + if (focused && widget->hasTooltip()) + { + const core::position2di mouse_position = + irr_driver->getDevice()->getCursorControl()->getPosition(); + + if (rect.isPointInside(mouse_position)) + { + m_tooltip_at_mouse.push_back(true); + m_tooltips.push_back(widget); + } } } // drawCheckBox @@ -1842,7 +1855,7 @@ void Skin::drawTooltip(Widget* widget, bool atMouse) if (atMouse) { pos = irr_driver->getDevice()->getCursorControl()->getPosition() - + core::position2di(15, 15); + + core::position2di(10 - size.Width / 2, 20); } core::recti r(pos, size); diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index 1a740830f..568bd5958 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -432,3 +432,38 @@ void SpinnerWidget::setCustomText(const core::stringw& text) } } +// ----------------------------------------------------------------------------- + +void SpinnerWidget::onClick() +{ + if (m_children[1].m_deactivated || + m_children[1].m_properties[PROP_ID] != "spinnerbody" || + !isGauge()) + { + return; + } + + const core::position2di mouse_position + = irr_driver->getDevice()->getCursorControl()->getPosition(); + + core::recti body_rect + = m_children[1].getIrrlichtElement()->getAbsolutePosition(); + + if (body_rect.isPointInside(mouse_position)) + { + float exact_hover = (float)((mouse_position.X - + body_rect.UpperLeftCorner.X) / + (float)body_rect.getWidth()) * (m_max-m_min); + + float new_value_f = ((exact_hover * (m_max - m_min)) / + (m_max - m_min)) + m_min; + int new_value = (int)roundf(new_value_f); + + if (new_value > m_max) new_value = m_max; + if (new_value < m_min) new_value = m_min; + + setValue(new_value); + } +} + +// ----------------------------------------------------------------------------- diff --git a/src/guiengine/widgets/spinner_widget.hpp b/src/guiengine/widgets/spinner_widget.hpp index 02a908788..2347ab3d0 100644 --- a/src/guiengine/widgets/spinner_widget.hpp +++ b/src/guiengine/widgets/spinner_widget.hpp @@ -91,6 +91,9 @@ namespace GUIEngine /** \brief implementing method from base class Widget */ virtual EventPropagation leftPressed(const int playerID); + + /** \brief implementing method from base class Widget */ + virtual void onClick(); /** When inferring widget size from its label length, this method will be called to * if/how much space must be added to the raw label's size for the widget to be large enough */ diff --git a/src/states_screens/options_screen_ui.cpp b/src/states_screens/options_screen_ui.cpp index f1c2e8728..f885987b7 100644 --- a/src/states_screens/options_screen_ui.cpp +++ b/src/states_screens/options_screen_ui.cpp @@ -151,6 +151,7 @@ void OptionsScreenUI::init() CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty"); assert( difficulty != NULL ); difficulty->setState( UserConfigParams::m_per_player_difficulty ); + difficulty->setTooltip(_("Players can select handicapped (more difficult) profiles on the kart selection screen")); CheckBoxWidget* show_login = getWidget("show-login"); assert( show_login!= NULL );