Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Help: massive refactor and cleanup of the help backend
This basically splits all the stuff in help/help_impl.*pp into multiple files by their function, and refactors the entire workflow into a proper object-oriented interface in modern C++. There are still a features missing (such as hidden section parsing in the manager) that I'll get back to. Few incidental changes and fixes: * Terrain topics now sorted alphabetically. * Help text now small * Fixed wrong toggle button id in browser. This is what was making it impossible to expand any sections. The GUI2 help browser is now back in working order, inasmuch as you can view all sections' and topics' text (save units').
- Loading branch information
1 parent
0dc8869
commit 81388ad
Showing
26 changed files
with
3,137 additions
and
988 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
class config; | ||
|
||
namespace help { | ||
struct section; | ||
class section; | ||
} | ||
|
||
namespace gui2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#include "help/constants.hpp" | ||
|
||
namespace help | ||
{ | ||
const unsigned max_section_recursion_level = 15; | ||
const unsigned max_history = 100; | ||
|
||
const std::string default_topic = "..introduction"; | ||
const std::string unknown_unit_topic = ".unknown_unit"; | ||
|
||
const std::string ability_prefix = "ability_"; | ||
const std::string era_prefix = "era_"; | ||
const std::string faction_prefix = "faction_"; | ||
const std::string race_prefix = "race_"; | ||
const std::string terrain_prefix = "terrain_"; | ||
const std::string tod_prefix = "time_of_day_"; | ||
const std::string trait_prefix = "traits_"; | ||
const std::string unit_prefix = "unit_"; | ||
const std::string variation_prefix = "variation_"; | ||
const std::string weapon_special_prefix = "weaponspecial_"; | ||
|
||
} // namespace help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace help | ||
{ | ||
extern const unsigned max_section_recursion_level; | ||
extern const unsigned max_history; | ||
|
||
// | ||
// Constant topics IDs | ||
// | ||
|
||
/** Topic to open by default when opening the help browser. */ | ||
extern const std::string default_topic; | ||
|
||
/** Topic to show when a unit hasn't been encountered in-game yet */ | ||
extern const std::string unknown_unit_topic; | ||
|
||
// | ||
// Standard topic ID prefixes | ||
// | ||
|
||
extern const std::string ability_prefix; | ||
extern const std::string era_prefix; | ||
extern const std::string faction_prefix; | ||
extern const std::string race_prefix; | ||
extern const std::string terrain_prefix; | ||
extern const std::string tod_prefix; | ||
extern const std::string trait_prefix; | ||
extern const std::string unit_prefix; | ||
extern const std::string variation_prefix; | ||
extern const std::string weapon_special_prefix; | ||
|
||
} // namespace help |
Oops, something went wrong.