Author: esr
Date: Wed Apr 9 16:46:08 2008
New Revision: 25703
URL: http://svn.gna.org/viewcvs/wesnoth?rev=25703&view=rev
Log:
Change some internal names to reduce confucion between unit names and
unit type names.
Modified:
trunk/src/dialogs.cpp
trunk/src/game_events.cpp
trunk/src/generate_report.cpp
trunk/src/help.cpp
trunk/src/leader_list.cpp
trunk/src/menu_events.cpp
trunk/src/multiplayer_connect.cpp
trunk/src/multiplayer_wait.cpp
trunk/src/unit.cpp
trunk/src/unit.hpp
trunk/src/unit_types.cpp
trunk/src/unit_types.hpp
Modified: trunk/src/dialogs.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/dialogs.cpp (original)
+++ trunk/src/dialogs.cpp Wed Apr 9 16:46:08 2008
@@ -69,9 +69,9 @@
const unit& type = sample_units.back();
#ifdef LOW_MEM
- lang_options.push_back(IMAGE_PREFIX + type.absolute_image() +
COLUMN_SEPARATOR + type.language_name());
+ lang_options.push_back(IMAGE_PREFIX + type.absolute_image() +
COLUMN_SEPARATOR + type.type_name());
#else
- lang_options.push_back(IMAGE_PREFIX + type.absolute_image() +
u->second.image_mods() + COLUMN_SEPARATOR + type.language_name());
+ lang_options.push_back(IMAGE_PREFIX + type.absolute_image() +
u->second.image_mods() + COLUMN_SEPARATOR + type.type_name());
#endif
preferences::encountered_units().insert(*op);
}
@@ -925,7 +925,7 @@
det.image = u.still_image();
det.name = u.name();
- det.lang_name = u.language_name();
+ det.lang_name = u.type_name();
det.level = u.level();
det.alignment = unit_type::alignment_description(u.alignment());
det.traits = u.traits_description();
@@ -984,7 +984,7 @@
det.image = image::get_image(t->image()+mod);
det.name = "";
- det.lang_name = t->language_name();
+ det.lang_name = t->type_name();
det.level = t->level();
det.alignment = unit_type::alignment_description(t->alignment());
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Wed Apr 9 16:46:08 2008
@@ -2030,7 +2030,7 @@
if(caption.empty()) {
caption = speaker->second.name();
if(caption.empty()) {
- caption =
speaker->second.language_name();
+ caption = speaker->second.type_name();
}
}
LOG_DP << "done scrolling to speaker...\n";
Modified: trunk/src/generate_report.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Wed Apr 9 16:46:08 2008
@@ -62,7 +62,7 @@
case UNIT_NAME:
return report(u->second.name(),"",u->second.name());
case UNIT_TYPE:
- return
report(u->second.language_name(),"",u->second.unit_description());
+ return
report(u->second.type_name(),"",u->second.unit_description());
case UNIT_RACE:
return report(u->second.race()->name(u->second.gender()));
case UNIT_SIDE: {
@@ -284,7 +284,7 @@
{
seen_units.insert(u_it->second.type_id());
const int resistance =
u_it->second.resistance_against(*at_it,false,u_it->first) - 100;
-
resistances[resistance].push_back(u_it->second.language_name());
+
resistances[resistance].push_back(u_it->second.type_name());
}
}
Modified: trunk/src/help.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/help.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/help.cpp (original)
+++ trunk/src/help.cpp Wed Apr 9 16:46:08 2008
@@ -1087,7 +1087,7 @@
if (!type.hide_help()) {
//add a link in the
list of units having this special
- std::string lang_name =
type.language_name();
+ std::string lang_name =
type.type_name();
std::string ref_id =
unit_prefix + type.id();
//we put the translated
name at the beginning of the hyperlink,
//so the automatic
alphabetic sorting of std::set can use it
@@ -1154,7 +1154,7 @@
if (!type.hide_help()) {
//add a link in the list of units
having this ability
- std::string lang_name =
type.language_name();
+ std::string lang_name =
type.type_name();
std::string ref_id = unit_prefix +
type.id();
//we put the translated name at the
beginning of the hyperlink,
//so the automatic alphabetic sorting
of std::set can use it
@@ -1244,7 +1244,7 @@
std::map<std::string,unit_type>::const_iterator
type = unit_type_data::types().find(unit_id);
if (type != unit_type_data::types().end())
{
- std::string lang_unit =
type->second.language_name();
+ std::string lang_unit =
type->second.type_name();
std::string ref_id;
if (description_type(type->second) ==
FULL_DESCRIPTION && !type->second.hide_help()) {
ref_id = unit_prefix +
type->second.id();
@@ -1271,7 +1271,7 @@
std::string unit_id = *advance_it;
std::map<std::string,unit_type>::const_iterator
type = unit_type_data::types().find(unit_id);
if(type != unit_type_data::types().end()) {
- std::string lang_unit =
type->second.language_name();
+ std::string lang_unit =
type->second.type_name();
std::string ref_id;
if (description_type(type->second) ==
FULL_DESCRIPTION && !type->second.hide_help()) {
ref_id = unit_prefix +
type->second.id();
@@ -1573,7 +1573,7 @@
if (desc_type != FULL_DESCRIPTION)
continue;
- const std::string lang_name = type.language_name();
+ const std::string lang_name = type.type_name();
const std::string ref_id = hidden_symbol(type.hide_help()) +
unit_prefix + type.id();
topic unit_topic(lang_name, ref_id, "");
//unit_topic.text = new unit_topic_generator(type);
Modified: trunk/src/leader_list.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/leader_list.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/leader_list.cpp (original)
+++ trunk/src/leader_list.cpp Wed Apr 9 16:46:08 2008
@@ -184,7 +184,7 @@
unit_type_data::unit_type_map_wrapper& utypes =
unit_type_data::types();
- //const std::string name =
data_->unit_types->find(*itor).language_name();
+ //const std::string name =
data_->unit_types->find(*itor).type_name();
if (utypes.find(*itor) != utypes.end()) {
const unit_type* ut;
ut = &(utypes.find(*itor)->second);
@@ -195,7 +195,7 @@
ut =
&(utypes.find(*itor)->second.get_gender_unit_type(unit_race::FEMALE));
}
}
- const std::string name = ut->language_name();
+ const std::string name = ut->type_name();
const std::string image = ut->image();
#ifdef LOW_MEM
Modified: trunk/src/menu_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Wed Apr 9 16:46:08 2008
@@ -83,7 +83,7 @@
#ifndef LOW_MEM
str << "~RC(" << type->second.flag_rgb() << ">" << team << ")";
#endif
- str << COLUMN_SEPARATOR << type->second.language_name() <<
COLUMN_SEPARATOR << i->second << "\n";
+ str << COLUMN_SEPARATOR << type->second.type_name() <<
COLUMN_SEPARATOR << i->second << "\n";
table.push_back(str.str());
}
@@ -401,7 +401,7 @@
// row << "<255,255,200>";
row << "<205,173,0>"; // gold3
}
- row << i->second.language_name() << COLUMN_SEPARATOR;
+ row << i->second.type_name() << COLUMN_SEPARATOR;
if(i->second.can_recruit() ) {
// row << "<255,255,200>";
row << "<205,173,0>"; // gold3
@@ -997,7 +997,7 @@
#ifndef LOW_MEM
description << "~RC(" << type->flag_rgb() << ">" <<
team::get_side_colour_index(team_num) << ")";
#endif
- description << COLUMN_SEPARATOR << font::LARGE_TEXT <<
prefix << type->language_name() << "\n"
+ description << COLUMN_SEPARATOR << font::LARGE_TEXT <<
prefix << type->type_name() << "\n"
<< prefix << type->cost() << " " <<
sngettext("unit^Gold", "Gold", type->cost());
items.push_back(description.str());
@@ -1148,7 +1148,7 @@
option << "~RC(" << u->team_color() << ">" <<
team::get_side_colour_index(team_num) << ")";
#endif
option << COLUMN_SEPARATOR
- << u->language_name() <<
COLUMN_SEPARATOR
+ << u->type_name() << COLUMN_SEPARATOR
<< name << COLUMN_SEPARATOR
<< u->level() << COLUMN_SEPARATOR
<< u->experience() << "/";
@@ -1614,7 +1614,7 @@
race = race_it->second.plural_name();
}
row << race << COLUMN_SEPARATOR;
- row << i->second.language_name() << COLUMN_SEPARATOR;
+ row << i->second.type_name() << COLUMN_SEPARATOR;
options.push_back(row.str());
unit_choices.push_back(&(i->second));
Modified: trunk/src/multiplayer_connect.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_connect.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/multiplayer_connect.cpp (original)
+++ trunk/src/multiplayer_connect.cpp Wed Apr 9 16:46:08 2008
@@ -173,11 +173,11 @@
leader_name_pseudolist.push_back("-");
} else {
if (gender_ == "female")
-
leader_name_pseudolist.push_back(leader_name->second.get_gender_unit_type(unit_race::FEMALE).language_name());
+
leader_name_pseudolist.push_back(leader_name->second.get_gender_unit_type(unit_race::FEMALE).type_name());
else if (gender_ == "male")
-
leader_name_pseudolist.push_back(leader_name->second.get_gender_unit_type(unit_race::MALE).language_name());
+
leader_name_pseudolist.push_back(leader_name->second.get_gender_unit_type(unit_race::MALE).type_name());
else
-
leader_name_pseudolist.push_back(leader_name->second.language_name());
+
leader_name_pseudolist.push_back(leader_name->second.type_name());
}
}
combo_leader_.set_items(leader_name_pseudolist);
@@ -234,7 +234,7 @@
if(leader_name == unit_type_data::types().end()) {
leader_name_pseudolist.push_back("?");
} else {
-
leader_name_pseudolist.push_back(leader_name->second.language_name());
+
leader_name_pseudolist.push_back(leader_name->second.type_name());
}
combo_leader_.set_items(leader_name_pseudolist);
combo_leader_.set_selected(0);
Modified: trunk/src/multiplayer_wait.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_wait.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/multiplayer_wait.cpp (original)
+++ trunk/src/multiplayer_wait.cpp Wed Apr 9 16:46:08 2008
@@ -112,7 +112,7 @@
} else
utg = ut;
- leader_name = utg->language_name();
+ leader_name = utg->type_name();
#ifdef LOW_MEM
image = utg->image();
#else
@@ -126,7 +126,7 @@
if (utypes.find(*itor) != utypes.end()) {
if(itor != recruit_list.begin())
recruit_string << ", ";
- recruit_string <<
utypes.find(*itor)->second.language_name();
+ recruit_string <<
utypes.find(*itor)->second.type_name();
}
}
@@ -481,7 +481,7 @@
} else
utg = ut;
- leader_name = utg->language_name();
+ leader_name = utg->type_name();
#ifdef LOW_MEM
leader_image = utg->image();
#else
Modified: trunk/src/unit.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Wed Apr 9 16:46:08 2008
@@ -94,7 +94,7 @@
id_(o.id_),
name_(o.name_),
underlying_id_(o.underlying_id_),
- language_name_(o.language_name_),
+ type_name_(o.type_name_),
undead_variation_(o.undead_variation_),
variation_(o.variation_),
@@ -516,7 +516,7 @@
advances_to_ = t->advances_to();
race_ = t->race_;
- language_name_ = t->language_name();
+ type_name_ = t->type_name();
cfg_["description"] = t->unit_description();
undead_variation_ = t->undead_variation();
max_experience_ = t->experience_needed(false);
@@ -1248,7 +1248,7 @@
advances_to_.clear();
}
- language_name_ = cfg["language_name"];
+ type_name_ = cfg["language_name"];
undead_variation_ = cfg["undead_variation"];
flag_rgb_ = cfg["flag_rgb"];
@@ -1503,7 +1503,7 @@
cfg["advances_to"] = utils::join(advances_to_);
cfg["race"] = race_->id();
- cfg["language_name"] = language_name_;
+ cfg["language_name"] = type_name_;
cfg["undead_variation"] = undead_variation_;
cfg["variation"] = variation_;
cfg["level"] = lexical_cast_default<std::string>(level_);
Modified: trunk/src/unit.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Wed Apr 9 16:46:08 2008
@@ -79,14 +79,16 @@
const unit_type* type() const;
//! The unique internal ID of the unit
- const std::string& id() const { if (id_.empty()) return
language_name(); else return id_; }
+ const std::string& id() const { if (id_.empty()) return type_name();
else return id_; }
const std::string& underlying_id() const { return underlying_id_; }
//! The unit type name
+ const t_string& type_name() const {return type_name_;}
+ const std::string& undead_variation() const {return undead_variation_;}
+
+ //! The unit name for display
const std::string& name() const {return (name_);}
void rename(const std::string& name) {if (!unrenamable_) name_= name;}
- const t_string& language_name() const {return language_name_;}
- const std::string& undead_variation() const {return undead_variation_;}
//! The unit's profile
const std::string& profile() const;
@@ -311,7 +313,7 @@
std::string id_;
std::string name_;
std::string underlying_id_;
- t_string language_name_;
+ t_string type_name_;
std::string undead_variation_;
std::string variation_;
Modified: trunk/src/unit_types.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Wed Apr 9 16:46:08 2008
@@ -484,7 +484,7 @@
}
unit_type::unit_type(const unit_type& o)
- : cfg_(o.cfg_), id_(o.id_), language_name_(o.language_name_),
description_(o.description_),
+ : cfg_(o.cfg_), id_(o.id_), type_name_(o.type_name_),
description_(o.description_),
undead_variation_(o.undead_variation_),
image_(o.image_), image_profile_(o.image_profile_),
flag_rgb_(o.flag_rgb_),
num_traits_(o.num_traits_), variations_(o.variations_), race_(o.race_),
@@ -679,7 +679,7 @@
cfg_ = cfg;
id_ = cfg_["id"];
- language_name_ = cfg_["name"];
+ type_name_ = cfg_["name"];
description_ = cfg_["description"];
undead_variation_ = cfg_["undead_variation"];
image_ = cfg_["image"];
Modified: trunk/src/unit_types.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.hpp?rev=25703&r1=25702&r2=25703&view=diff
==============================================================================
--- trunk/src/unit_types.hpp (original)
+++ trunk/src/unit_types.hpp Wed Apr 9 16:46:08 2008
@@ -177,7 +177,7 @@
std::string generate_name() const { return
race_->generate_name(string_gender(cfg_["gender"])); }
//! The name of the unit in the current language setting.
- const t_string& language_name() const { return language_name_; }
+ const t_string& type_name() const { return type_name_; }
const std::string& id() const { return id_; }
const std::string& image() const { return image_; }
@@ -247,7 +247,7 @@
config cfg_;
std::string id_;
- t_string language_name_;
+ t_string type_name_;
t_string description_;
std::string undead_variation_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits