diff --git a/data/gui/addons_loading.stkgui b/data/gui/addons_loading.stkgui index 351029160..aa3c34a4a 100644 --- a/data/gui/addons_loading.stkgui +++ b/data/gui/addons_loading.stkgui @@ -1,38 +1,45 @@ - - -
- - -
-
- - -
- -
-
-
- - - -
- - - - - - -
-
-
+ + +
+ + +
+
+ + +
+ +
+
+
+ + + +
+ + + + + + +
+
+
diff --git a/src/addons/addon.cpp b/src/addons/addon.cpp index 68d005b56..36fa401df 100644 --- a/src/addons/addon.cpp +++ b/src/addons/addon.cpp @@ -46,6 +46,9 @@ Addon::Addon(const XMLNode &xml) m_icon_revision = 0; m_size = 0; m_date = 0; + m_min_include_ver = ""; + m_max_include_ver = ""; + m_rating = 0.0f; m_icon_ready = false; m_still_exists = false; m_type = xml.getName(); @@ -102,6 +105,8 @@ Addon::Addon(const XMLNode &xml) xml.get("min-include-version",&m_min_include_ver ); xml.get("max-include-version",&m_max_include_ver ); + xml.get("rating", &m_rating ); + }; // Addon(const XML&) // ---------------------------------------------------------------------------- @@ -121,6 +126,7 @@ void Addon::copyInstallData(const Addon &addon) m_date = addon.m_date; m_min_include_ver=addon.m_min_include_ver; m_max_include_ver=addon.m_max_include_ver; + m_rating = addon.m_rating; // Support if the type of an addon changes, e.g. this ie necessary // when we introduce 'arena' as type (formerly arenas had type 'track'). m_type = addon.m_type; diff --git a/src/addons/addon.hpp b/src/addons/addon.hpp index 5114cd5b2..29b84cf5c 100644 --- a/src/addons/addon.hpp +++ b/src/addons/addon.hpp @@ -92,6 +92,8 @@ private: bool m_installed; /** Compressed size of the addon package. */ int m_size; + /** Rating for thsi addon package. */ + float m_rating; /** Minimum version addon is included with. */ std::string m_min_include_ver; /** Maximum version addon is included with. */ @@ -124,6 +126,9 @@ public: /** Returns the maximum version the addon was included with. */ const std::string& getMaxIncludeVer() const {return m_max_include_ver; } // ------------------------------------------------------------------------ + /** Returns the rating of an addon. */ + const float getRating() const {return m_rating; } + // ------------------------------------------------------------------------ /** Returns the type of the addon. */ const std::string& getType() const { return m_type; } // ------------------------------------------------------------------------ diff --git a/src/states_screens/dialogs/addons_loading.cpp b/src/states_screens/dialogs/addons_loading.cpp index d813487f9..55d151b07 100644 --- a/src/states_screens/dialogs/addons_loading.cpp +++ b/src/states_screens/dialogs/addons_loading.cpp @@ -99,6 +99,11 @@ void AddonsLoading::beforeAddingWidgets() ->setText(m_addon.getDescription().c_str()); core::stringw revision = _("Version: %d", m_addon.getRevision()); getWidget("revision")->setText(revision, false); + char rating_val[4]; + std::sprintf(rating_val, "%.1f", m_addon.getRating()); + //I18N: for add-on rating, "Rating: 1.5/3.0" + core::stringw rating = _("Rating: %s/%s", rating_val, "3.0"); + getWidget("rating")->setText(rating, false); // Display flags for this addon // ============================