diff --git a/changelog b/changelog index 4d6f1b6edb11..73f2f7ea8b87 100644 --- a/changelog +++ b/changelog @@ -78,6 +78,8 @@ Version 1.13.0-dev: * Disabled the tod schedule and playlist menues in pure map mode. * Support for displaying the saved status of the selected area. * Fixed error messages about missing UI elements. + * Help Browser: + * Autogenerated Time of Day Schedule section * Language and i18n: * Updated translations: Czech, French, German, Greek, Hungarian, Italian, Lithuanian, Scottish Gaelic, Slovak, Vietnamese @@ -855,10 +857,10 @@ Version 1.11.7: have also been made: * S3: scenario now ends after dwarf leader is killed (no need to continue to the signpost any more) - * S3: add possibility to give Grüü instructions + * S3: add possibility to give Gr���� instructions * S6: new Lua AI code for the transports with somewhat different behavior * S14: Kapou'e cannot recruit troll whelps any more (this scenario only) - * S14: "It is now Grüü's turn" displayed correctly on Side 4 turn + * S14: "It is now Gr����'s turn" displayed correctly on Side 4 turn * S16: fix recalling of alternative units if Jetto/Inarix have been killed * S18: Howgarth's death now results in defeat, as stated in objectives * S18: Shan Taum death dialog shown correctly if Kapou'e kills him himself @@ -10552,7 +10554,7 @@ Version 0.8.2: * fixed problems with cache invalidation * fixed file descriptor leak * fixed 'gender' not working with move_unit_fake - * fixed grüü losing experience when joining + * fixed gr�������� losing experience when joining * fixed units moving through water not being submerged while moving * terrains tiles are now cut according to the hexagonal shape, to avoid some graphical glitches * workaround a SDL_TTF bug that makes it crash when presented an invalid UTF-8 string diff --git a/data/core/help.cfg b/data/core/help.cfg index 8d93a5e2d596..5e903aa33512 100644 --- a/data/core/help.cfg +++ b/data/core/help.cfg @@ -1,10 +1,17 @@ #textdomain wesnoth-help [help] [toplevel] - sections=introduction,gameplay,units,abilities_section,traits_section,weapon_specials,eras_section,terrains_section,addons,editor,commands,encyclopedia + sections=introduction,gameplay,units,abilities_section,traits_section,weapon_specials,eras_section,terrains_section,schedule,addons,editor,commands,encyclopedia topics=about,license [/toplevel] + [section] + id=schedule + title= _ "Time of Day Schedule" + generator=time_of_days + sort_topics=generated + [/section] + [section] id=introduction title= _ "Introduction" diff --git a/players_changelog b/players_changelog index 70f9538cc830..2fb5a3176a6f 100644 --- a/players_changelog +++ b/players_changelog @@ -30,6 +30,9 @@ Version 1.13.0-dev: * Graphics: * Smooth unit movement over terrain with elevation (e.g. keeps/bridges) + * Help Browser: + * Autogenerated Time of Day Schedule section + * Language and i18n: * Updated translations: Czech, French, German, Greek, Hungarian, Italian, Lithuanian, Scottish Gaelic, Slovak, Vietnamese. diff --git a/src/help.cpp b/src/help.cpp index 0884795a72e2..1fa540e71d37 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -40,6 +40,8 @@ #include "unit_helper.hpp" #include "wml_separators.hpp" #include "serialization/parser.hpp" +#include "time_of_day.hpp" +#include "tod_manager.hpp" #include @@ -578,6 +580,7 @@ enum UNIT_DESCRIPTION_TYPE {FULL_DESCRIPTION, NO_DESCRIPTION, NON_REVEALING_DESC /// encountered. static UNIT_DESCRIPTION_TYPE description_type(const unit_type &type); static std::vector generate_ability_topics(const bool); +static std::vector generate_time_of_day_topics(const bool); static std::vector generate_weapon_special_topics(const bool); static void generate_era_sections(const config *help_cfg, section &sec, int level); @@ -1071,6 +1074,8 @@ std::vector generate_topics(const bool sort_generated,const std::string & res = generate_ability_topics(sort_generated); } else if (generator == "weapon_specials") { res = generate_weapon_special_topics(sort_generated); + } else if (generator == "time_of_days") { + res = generate_time_of_day_topics(sort_generated); } else { std::vector parts = utils::split(generator, ':', utils::STRIP_SPACES); if (parts[0] == "units" && parts.size()>1) { @@ -1155,6 +1160,38 @@ const std::vector& topic_text::parsed_text() const return parsed_text_; } +std::vector generate_time_of_day_topics(const bool /*sort_generated*/) +{ + std::vector topics; + std::stringstream toplevel; + + if (! resources::tod_manager) { + toplevel << N_("Only available during a scenario."); + topics.push_back( topic("Time of Day Schedule", "..schedule", toplevel.str()) ); + return topics; + } + const std::vector& times = resources::tod_manager->times(); + BOOST_FOREACH(const time_of_day& time, times) + { + const std::string id = "time_of_day_" + time.id; + const std::string image = "src='" + time.image + "'"; + std::stringstream text; + + toplevel << make_link(time.name.str(), id) << jump_to(160) << + image << jump(30) << time.lawful_bonus << '\n'; + + text << image << '\n' << + time.description.str() << '\n' << + "Lawful Bonus: " << time.lawful_bonus << '\n' << + '\n' << make_link(N_("Schedule"), "..schedule"); + + topics.push_back( topic(time.name.str(), id, text.str()) ); + } + + topics.push_back( topic("Time of Day Schedule", "..schedule", toplevel.str()) ); + return topics; +} + std::vector generate_weapon_special_topics(const bool sort_generated) { std::vector topics; diff --git a/src/reports.cpp b/src/reports.cpp index 102813727850..b4d1d2aeedee 100644 --- a/src/reports.cpp +++ b/src/reports.cpp @@ -1099,7 +1099,7 @@ REPORT_GENERATOR(tod_stats, rc) int times = schedule.size(); text << current + 1 << "/" << times; - return text_report(text.str(), tooltip.str()); + return text_report(text.str(), tooltip.str(), "..schedule"); } static config time_of_day_at(reports::context & rc, const map_location& mouseover_hex) @@ -1142,7 +1142,7 @@ static config time_of_day_at(reports::context & rc, const map_location& mouseove else if (tod.bonus_modified < 0) tod_image += "~DARKEN()"; if (preferences::flip_time()) tod_image += "~FL(horiz)"; - return image_report(tod_image, tooltip.str(), "time_of_day"); + return image_report(tod_image, tooltip.str(), "time_of_day_" + tod.id); } REPORT_GENERATOR(time_of_day, rc) {