improve manual linebreak functionality outside table
also reformats some broken pages with manual breaks
This commit is contained in:
parent
ce9d3bdc38
commit
e4bffc04ce
2 changed files with 30 additions and 37 deletions
|
@ -93,9 +93,7 @@
|
|||
[topic]
|
||||
id=..introduction
|
||||
title= _ "Introduction"
|
||||
text="<img>src=misc/logo-bg.png~BLIT(misc/logo.png) align=middle</img>" + _ "
|
||||
|
||||
<italic>text='Battle for Wesnoth'</italic> is a turn-based fantasy strategy game somewhat unusual among modern strategy games. While other games strive for complexity, <italic>text='Battle for Wesnoth'</italic> strives for simplicity of both rules and gameplay. This does not make the game simple, however — from these simple rules arises a wealth of strategy, making the game easy to learn but a challenge to master.
|
||||
text="<img>src=misc/logo-bg.png~BLIT(misc/logo.png) align=middle</img>" + _ "<br/><italic>text='Battle for Wesnoth'</italic> is a turn-based fantasy strategy game somewhat unusual among modern strategy games. While other games strive for complexity, <italic>text='Battle for Wesnoth'</italic> strives for simplicity of both rules and gameplay. This does not make the game simple, however — from these simple rules arises a wealth of strategy, making the game easy to learn but a challenge to master.
|
||||
|
||||
The following pages outline all you need to know to play Wesnoth. As you play, new information is added to the various categories as you come across new aspects of the game. For more detailed information on special situations and exceptions, follow the included links."
|
||||
[/topic]
|
||||
|
@ -217,14 +215,12 @@ Units not only cost gold to Recruit or Recall, they also require money to suppor
|
|||
|
||||
Income is simple. You have a base income of 2 gold per turn. For every village you control, you gain one additional gold each turn. Thus, if you have ten villages, you would normally gain 12 gold each turn. Your upkeep costs are subtracted from this income, as detailed below." + "
|
||||
|
||||
<img>src=help/income-upkeep1.png align=middle box=no</img>" + _ "
|
||||
|
||||
<img>src=help/income-upkeep1.png align=middle box=no</img><br/>" + _ "
|
||||
Upkeep is also fairly simple. Each unit requires an amount of Upkeep equal to its level. You can support as many levels worth of units as you have villages, without paying any upkeep. However, for each level of unit beyond the number of villages you have, you must pay one gold per turn. For example, if you have twelve level one units and ten villages, you would have to pay two gold each turn in upkeep." + _ "
|
||||
|
||||
Upkeep costs are subtracted from your income, so in the case of twelve levels of units and ten villages, your resultant Income would be 10 gold per turn." + "
|
||||
|
||||
<img>src=help/income-upkeep2.png align=middle box=no</img>" + _ "
|
||||
|
||||
<img>src=help/income-upkeep2.png align=middle box=no</img><br/>" + _ "
|
||||
In general, the base income, the amount of gold you get per village per turn, and the number of unit levels each village can support are configurable, but in campaigns they are almost always the values described above. The <italic>text='Scenario Settings'</italic> tab of the <italic>text='Status Table'</italic> dialog shows the values for the current scenario." + _ "
|
||||
|
||||
There are two important exceptions to upkeep: units with the loyal trait and leaders never incur upkeep. Units you begin the scenario with (such as Delfador), or units who join you during a scenario (such as the horseman in the second scenario of <italic>text='Heir to the Throne'</italic>) will usually have the <italic>text='loyal'</italic> trait. The unit you are playing (such as Konrad) will almost always be a leader."
|
||||
|
@ -437,18 +433,15 @@ If a strike is determined to hit, it will always do at least 1 point of damage.
|
|||
id=crowns
|
||||
title= _ "Crowns and loyal markers"
|
||||
text=_ "Some units have an additional marker superimposed on their <ref>dst='orbs' text='orb'</ref>, and a corresponding shape to their <ref>dst='orbs' text='ellipses'</ref>:" + "
|
||||
|
||||
" +
|
||||
"<img>src='help/empty-square.png~CROP(0,0,72,36)~BLIT(misc/leader-crown.png~CROP(4,0,36,18)~XBRZ(2))'</img>" +
|
||||
"<img>src='help/empty-square.png~CROP(0,0,72,36)~BLIT(misc/hero-icon.png~CROP(4,0,36,18)~XBRZ(2))'</img>" +
|
||||
"<img>src='help/empty-square.png~CROP(0,0,72,36)~BLIT(misc/leader-expendable.png~CROP(4,0,36,18)~XBRZ(2))'</img>" +
|
||||
"<img>src='help/empty-square.png~CROP(0,0,72,36)~BLIT(misc/loyal-icon.png~CROP(4,0,36,18)~XBRZ(2))'</img>" + "
|
||||
" +
|
||||
"<img>src='help/empty-square.png~CROP(0,0,72,36)~BLIT(misc/loyal-icon.png~CROP(4,0,36,18)~XBRZ(2))'</img><br/>" +
|
||||
"<img>src='help/empty-square.png~BLIT(misc/ellipse-leader-top.png)~BLIT(misc/ellipse-leader-bottom.png)~BLIT(units/orcs/leader.png~TC(1, magenta))~BLIT(misc/leader-crown.png)'</img>" +
|
||||
"<img>src='help/empty-square.png~BLIT(misc/ellipse-hero-top.png)~BLIT(misc/ellipse-hero-bottom.png)~BLIT(units/dunefolk/herbalist/alchemist.png~TC(1, magenta))~BLIT(misc/hero-icon.png)'</img>" +
|
||||
"<img>src='help/empty-square.png~BLIT(misc/ellipse-leader-top.png)~BLIT(misc/ellipse-leader-bottom.png)~BLIT(units/human-magi/white-mage.png~TC(1, magenta))~BLIT(misc/leader-expendable.png)'</img>" +
|
||||
"<img>src='help/empty-square.png~BLIT(misc/ellipse-top.png)~BLIT(misc/ellipse-bottom.png)~BLIT(units/human-loyalists/spearman.png~TC(1, magenta))~BLIT(misc/loyal-icon.png)'</img>" + "
|
||||
|
||||
" +
|
||||
#po: The help page has a set of images above this paragraph, in the same order as the first set of bullet points, showing what the "loyal icon" is and the difference between "silver" and "blueish-silver".
|
||||
_ "• Leaders are shown with a <bold>text='gold crown'</bold>.
|
||||
|
|
|
@ -40,7 +40,15 @@
|
|||
static lg::log_domain log_rich_label("gui/widget/rich_label");
|
||||
#define DBG_GUI_RL LOG_STREAM(debug, log_rich_label)
|
||||
|
||||
#define DEBUG_LINES true
|
||||
#define LINK_DEBUG_BORDER false
|
||||
#define DEBUG_LINE \
|
||||
config& link_rect_cfg = text_dom.add_child("line"); \
|
||||
link_rect_cfg["x1"] = 0; \
|
||||
link_rect_cfg["y1"] = prev_blk_height_; \
|
||||
link_rect_cfg["x2"] = w_; \
|
||||
link_rect_cfg["y2"] = prev_blk_height_; \
|
||||
link_rect_cfg["color"] = "255, 0, 0, 255";
|
||||
|
||||
|
||||
namespace gui2
|
||||
{
|
||||
|
@ -342,6 +350,8 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
config& child = tag.cfg;
|
||||
|
||||
if(tag.key == "img") {
|
||||
prev_blk_height_ += txt_height_ + padding_;
|
||||
txt_height_ = 0;
|
||||
|
||||
std::string name = child["src"];
|
||||
std::string align = child["align"];
|
||||
|
@ -356,7 +366,7 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
wrap_mode = true;
|
||||
}
|
||||
}
|
||||
DBG_GUI_RL << "floating: " << wrap_mode << ", " << is_float;
|
||||
DBG_GUI_RL << "wrap mode: " << wrap_mode << ",floating: " << is_float;
|
||||
|
||||
curr_item = &(text_dom.add_child("image"));
|
||||
add_image(*curr_item, name, align, is_image, is_float, is_curr_float, img_size, float_size);
|
||||
|
@ -395,16 +405,6 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
txt_height_ = 0;
|
||||
row_y = prev_blk_height_;
|
||||
|
||||
// DEBUG: debug lines for table
|
||||
#if DEBUG_LINES
|
||||
config& link_rect_cfg = text_dom.add_child("line");
|
||||
link_rect_cfg["x1"] = 0;
|
||||
link_rect_cfg["y1"] = prev_blk_height_;
|
||||
link_rect_cfg["x2"] = w_;
|
||||
link_rect_cfg["y2"] = prev_blk_height_;
|
||||
link_rect_cfg["color"] = "255, 0, 0, 255";
|
||||
#endif
|
||||
|
||||
is_text = false;
|
||||
new_text_block = true;
|
||||
is_image = false;
|
||||
|
@ -420,7 +420,6 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
}
|
||||
|
||||
if (col_width > 0) {
|
||||
|
||||
max_col_height = std::max(max_col_height, txt_height_);
|
||||
max_col_height = std::max(max_col_height, static_cast<unsigned>(img_size.y));
|
||||
txt_height_ = 0;
|
||||
|
@ -465,24 +464,25 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
prev_blk_height_ += max_col_height + padding_;
|
||||
row_y = prev_blk_height_;
|
||||
|
||||
// DEBUG: debug lines for table
|
||||
#if DEBUG_LINES
|
||||
config& link_rect_cfg = text_dom.add_child("line");
|
||||
link_rect_cfg["x1"] = 0;
|
||||
link_rect_cfg["y1"] = prev_blk_height_;
|
||||
link_rect_cfg["x2"] = w_;
|
||||
link_rect_cfg["y2"] = prev_blk_height_;
|
||||
link_rect_cfg["color"] = "255, 0, 0, 255";
|
||||
#endif
|
||||
|
||||
(*curr_item)["actions"] = boost::str(boost::format("([set_var('pos_x', 0), set_var('pos_y', pos_y + %d + %d), set_var('tw', width - pos_x - %d)])") % max_col_height % padding_ % col_width);
|
||||
|
||||
is_image = false;
|
||||
max_col_height = 0;
|
||||
txt_height_ = 0;
|
||||
img_size = point(0,0);
|
||||
|
||||
} else {
|
||||
// TODO correct height update
|
||||
if (is_image && !is_float) {
|
||||
x_ = 0;
|
||||
(*curr_item)["actions"] = "([set_var('pos_x', 0), set_var('pos_y', pos_y + image_height + padding)])";
|
||||
img_size.y = 0;
|
||||
} else {
|
||||
add_text_with_attribute(*curr_item, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
is_image = false;
|
||||
img_size = point(0,0);
|
||||
|
||||
DBG_GUI_RL << "linebreak";
|
||||
|
||||
if (!is_image) {
|
||||
|
@ -703,7 +703,7 @@ config rich_label::get_parsed_text(const config& parsed_text)
|
|||
DBG_GUI_RL << "Height: " << h_;
|
||||
|
||||
// DEBUG: draw boxes around links
|
||||
#if DEBUG_LINES
|
||||
#if LINK_DEBUG_BORDER
|
||||
for (const auto& entry : links_) {
|
||||
config& link_rect_cfg = text_dom.add_child("rectangle");
|
||||
link_rect_cfg["x"] = entry.first.x;
|
||||
|
|
Loading…
Add table
Reference in a new issue