Skip to content

Commit

Permalink
Merge pull request #1876 from weluvgoatz/world-description-help
Browse files Browse the repository at this point in the history
Show world description at bottom of screen
  • Loading branch information
serano01 authored Nov 8, 2021
2 parents b78078c + 3fb2f5d commit ff44367
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions data/levels/bonus1/info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;SuperTux-Level-Subset
(supertux-level-subset
(title (_ "Bonus Island I"))
(description "Levels from the Bonus World 1")
(description (_ "Compilation of early fan-submitted levels. Added in 0.1.2"))
(levelset #f)
(hide-from-contribs #f)
)
4 changes: 2 additions & 2 deletions data/levels/bonus2/info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;SuperTux-Level-Subset
(supertux-level-subset
(title (_ "Bonus Island II"))
(description "Levels from the Bonus World 2")
(description (_ "Compilation of more early fan-submitted levels. Added in 0.1.3"))
(levelset #f)
(hide-from-contribs #f)
)
3 changes: 2 additions & 1 deletion data/levels/bonus3/info
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(supertux-level-subset
(title (_ "Bonus Island III"))
(description "Collection of the multitudes of levels submitted to the bugtracker prior to development moving over to Git.")
(description (_ "Collection of the multitudes of levels submitted to the old bugtracker. Added in 0.3.5"))
(levelset #f)
(hide-from-contribs #f)
)
2 changes: 1 addition & 1 deletion data/levels/bonus4/info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(supertux-level-subset
(title (_ "Bonus Island IV"))
(description (_ ""))
(description (_ "Collection of levels with many varying themes. Added in 0.6.1"))
(levelset #f)
(hide-from-contribs #f)
)
4 changes: 2 additions & 2 deletions data/levels/community2016/info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(supertux-level-subset
(title (_ "Community Island 2020"))
(description (_ ""))
(title (_ "Community Island"))
(description (_ "Level pack consisting of level contest winners"))
(levelset #f)
(hide-from-contribs #f)
)
2 changes: 1 addition & 1 deletion data/levels/revenge_in_redmond/info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(supertux-level-subset
(title (_ "Revenge in Redmond"))
(description (_ "A small and simple level pack celebrating the good old days of early SuperTux, Revenge in Redmond."))
(description (_ "Level pack celebrating the good ol' days of SuperTux for its 20th anniversary"))
(levelset #f)
(hide-from-contribs #f)
)
9 changes: 7 additions & 2 deletions src/supertux/menu/contrib_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <physfs.h>
#include <sstream>

#include "gui/item_action.hpp"
#include "gui/menu_item.hpp"
#include "gui/menu_manager.hpp"
#include "physfs/util.hpp"
Expand Down Expand Up @@ -114,7 +115,9 @@ ContribMenu::ContribMenu() :

std::ostringstream title;
title << "[" << world->get_title() << "]";
add_entry(i++, title.str());
std::ostringstream desc;
desc << world->get_description();
add_entry(i++, title.str()).set_help(desc.str());
m_contrib_worlds.push_back(std::move(world));
}
else if (world->is_worldmap())
Expand All @@ -137,7 +140,9 @@ ContribMenu::ContribMenu() :

std::ostringstream title;
title << world->get_title();
add_entry(i++, title.str());
std::ostringstream desc;
desc << world->get_description();
add_entry(i++, title.str()).set_help(desc.str());
m_contrib_worlds.push_back(std::move(world));
}
else
Expand Down
1 change: 1 addition & 0 deletions src/supertux/world.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class World final
public:
std::string get_basedir() const { return m_basedir; }
std::string get_title() const { return m_title; }
std::string get_description() const { return m_description; }

bool hide_from_contribs() const { return m_hide_from_contribs; }

Expand Down

0 comments on commit ff44367

Please sign in to comment.