generate_description -> generate_name.
This commit is contained in:
parent
d4b281f530
commit
acd3f95a70
5 changed files with 23 additions and 13 deletions
10
changelog
10
changelog
|
@ -26,12 +26,18 @@ Version 1.5.0-svn:
|
|||
* allow 100% defense instead of cutting off at 99%, if out of range set to
|
||||
100% instead of 50 (debian bug #467253)
|
||||
* The UnitWML [unit] tag is changed to [unit_type]. [unit] will still
|
||||
be accepted for backwards compatibility until. wmllint can safely
|
||||
be accepted for backwards compatibility until 1.5.3. wmllint can safely
|
||||
do this up-conversion.
|
||||
* In SingleUnitWML and SideWML, the description= attribute is now id=.
|
||||
description= will still be accepted for backwards compatibility.
|
||||
wmllint can safely do this up-conversion.
|
||||
* it's now possible to specify with loop= how many times a sample
|
||||
* In SingleUnitWML and SideWML, the user_description= attribute is now
|
||||
name=. user_description= will still be accepted for backwards
|
||||
compatibility. wmllint can safely do this up-conversion.
|
||||
* In SingleUnitWML and SideWML, the geneate_description= attribute is
|
||||
now generate_name=. generate_description= will still be accepted for
|
||||
backwards compatibility. wmllint can safely do this up-conversion.
|
||||
* it's now possible to specify with loop= how many times a sample
|
||||
associated with a sound source should be played
|
||||
* new [switch] conditional command
|
||||
* miscellaneous and bug fixes:
|
||||
|
|
|
@ -473,6 +473,7 @@ conversion2 = {
|
|||
linechanges = (
|
||||
("canrecruit=1", "canrecruit=yes"),
|
||||
("canrecruit=0", "canrecruit=no"),
|
||||
("generate_description", "generate_name"),
|
||||
)
|
||||
|
||||
def maptransform2(filename, baseline, inmap, y):
|
||||
|
|
21
src/unit.cpp
21
src/unit.cpp
|
@ -265,9 +265,10 @@ unit::unit(const game_data* gamedata, unit_map* unitmap, const gamemap* map,
|
|||
advance_to(&t->get_gender_unit_type(gender_));
|
||||
if(dummy_unit == false) validate_side(side_);
|
||||
if(use_traits) {
|
||||
// Units that don't have traits generated are just generic units,
|
||||
// so they shouldn't get a description either.
|
||||
name_ = generate_description();
|
||||
// Units that don't have traits generated are just
|
||||
// generic units, so they shouldn't get a description
|
||||
// either.
|
||||
name_ = generate_name();
|
||||
}
|
||||
generate_traits(!use_traits);
|
||||
apply_modifications();
|
||||
|
@ -306,9 +307,10 @@ unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit, unit_
|
|||
advance_to(&t->get_gender_unit_type(gender_));
|
||||
if(dummy_unit == false) validate_side(side_);
|
||||
if(use_traits) {
|
||||
// Units that don't have traits generated are just generic units,
|
||||
// so they shouldn't get a description either.
|
||||
name_ = generate_description();
|
||||
// Units that don't have traits generated are just
|
||||
// generic units, so they shouldn't get a description
|
||||
// either.
|
||||
name_ = generate_name();
|
||||
}
|
||||
generate_traits(!use_traits);
|
||||
apply_modifications();
|
||||
|
@ -1426,9 +1428,10 @@ void unit::read(const config& cfg, bool use_traits, game_state* state)
|
|||
} else if(cfg["type"]=="") {
|
||||
alignment_ = unit_type::NEUTRAL;
|
||||
}
|
||||
if(utils::string_bool(cfg["generate_description"])) {
|
||||
name_ = generate_description(state);
|
||||
cfg_["generate_description"] = "";
|
||||
// FIXME OBSOLETE Remove in 1.5.3
|
||||
if(utils::string_bool(cfg["generate_name"]) || utils::string_bool(cfg["generate_description"])) {
|
||||
name_ = generate_name(state);
|
||||
cfg_["generate_name"] = "";
|
||||
}
|
||||
|
||||
game_events::add_events(cfg_.get_children("event"),type_);
|
||||
|
|
|
@ -266,7 +266,7 @@ public:
|
|||
void add_trait(std::string /*trait*/);
|
||||
void generate_traits(bool musthaveonly=false, game_state* state = 0);
|
||||
void generate_traits_description();
|
||||
std::string generate_description( game_state* state = 0) const
|
||||
std::string generate_name( game_state* state = 0) const
|
||||
{ return race_->generate_name(string_gender(cfg_["gender"]), state); }
|
||||
|
||||
// Only see_all=true use caching
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
|
||||
unsigned int num_traits() const { return (cfg_["num_traits"].size() ? atoi(cfg_["num_traits"].c_str()) : race_->num_traits()); }
|
||||
|
||||
std::string generate_description() const { return race_->generate_name(string_gender(cfg_["gender"])); }
|
||||
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 cfg_["name"]; }
|
||||
|
|
Loading…
Add table
Reference in a new issue