mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 14:11:41 +00:00
fixes invisible text widget labels
also fixes some loop scope errors
This commit is contained in:
parent
d56f88b047
commit
7f6841f75e
@ -549,11 +549,10 @@ dialog::dimension_measurements dialog::layout(int xloc, int yloc) const
|
||||
const int text_widget_y = dim.y+top_padding+text_and_image_height-6+menu_hpadding;
|
||||
|
||||
if(use_textbox) {
|
||||
const int text_widget_y_unpadded = text_widget_y + (text_widget_height - text_widget_->location().h)/2;
|
||||
dim.textbox.x = dim.x + left_padding + text_widget_width - text_widget_->location().w;
|
||||
dim.textbox.y = text_widget_y_unpadded;
|
||||
dim.caption_x = dim.x+left_padding;
|
||||
dim.caption_y = text_widget_y_unpadded;
|
||||
dim.textbox.y = text_widget_y + (text_widget_height - text_widget_->location().h)/2;
|
||||
dim.label_x = dim.x+left_padding;
|
||||
dim.label_y = dim.textbox.y;
|
||||
}
|
||||
|
||||
dim.menu_x = dim.x+image_width+left_padding+image_h_padding;
|
||||
|
11
src/unit.cpp
11
src/unit.cpp
@ -1156,16 +1156,17 @@ void unit::read(const config& cfg)
|
||||
const unit_type* ut = &uti->second.get_gender_unit_type(gender_).get_variation(variation_);
|
||||
config t_atks;
|
||||
config u_atks;
|
||||
for(config::const_child_itors range = ut->cfg_.child_range("attack");
|
||||
config::const_child_itors range;
|
||||
for(range = ut->cfg_.child_range("attack");
|
||||
range.first != range.second; ++range.first) {
|
||||
t_atks.add_child("attack",**range.first);
|
||||
}
|
||||
for(config::const_child_itors range = cfg.child_range("attack");
|
||||
for(range = cfg.child_range("attack");
|
||||
range.first != range.second; ++range.first) {
|
||||
u_atks.add_child("attack",**range.first);
|
||||
}
|
||||
u_atks = t_atks.merge_with(u_atks);
|
||||
for(config::const_child_itors range = u_atks.child_range("attack");
|
||||
for(range = u_atks.child_range("attack");
|
||||
range.first != range.second; ++range.first) {
|
||||
attacks_.push_back(attack_type(**range.first,id(),image_fighting((**range.first)["range"] == "ranged" ? attack_type::LONG_RANGE : attack_type::SHORT_RANGE)));
|
||||
}
|
||||
@ -1284,8 +1285,8 @@ void unit::read(const config& cfg)
|
||||
for(config::child_list::const_iterator t = teleports.begin(); t != teleports.end(); ++t) {
|
||||
teleport_animations_.push_back(unit_animation(**t));
|
||||
}
|
||||
for(config::child_list::const_iterator t = extra_anims.begin(); t != extra_anims.end(); ++t) {
|
||||
extra_animations_.insert(std::pair<std::string,unit_animation>((**t)["flag"],unit_animation(**t)));
|
||||
for(config::child_list::const_iterator extra_anim = extra_anims.begin(); extra_anim != extra_anims.end(); ++extra_anim) {
|
||||
extra_animations_.insert(std::pair<std::string,unit_animation>((**extra_anim)["flag"],unit_animation(**extra_anim)));
|
||||
}
|
||||
for(config::child_list::const_iterator death = deaths.begin(); death != deaths.end(); ++death) {
|
||||
death_animations_.push_back(death_animation(**death));
|
||||
|
Loading…
x
Reference in New Issue
Block a user