added support for 'percent multiplier' in the techtree docummentation tools
This commit is contained in:
parent
9c203cd2b4
commit
7f55d9fc1d
|
@ -1 +1 @@
|
||||||
Subproject commit fa2a0cac9e6fe0fc3434edc2cad728ecb4b8e6b1
|
Subproject commit 07aca95635dac967fc258c5176ef116a302c5f18
|
|
@ -82,7 +82,6 @@ our $version = "0.8.1 beta";
|
||||||
|
|
||||||
# strange stuff in the techtrees:
|
# strange stuff in the techtrees:
|
||||||
# - persian magician splash radius 0?
|
# - persian magician splash radius 0?
|
||||||
# - tech workers move faster with load?
|
|
||||||
# - tech upgrades piercing/blade weapon don't work for battle machine?
|
# - tech upgrades piercing/blade weapon don't work for battle machine?
|
||||||
# - f.e. battle machine with "hold" will only attack land units
|
# - f.e. battle machine with "hold" will only attack land units
|
||||||
# - workers are able to help a technician build an aerodrome faster. is that wanted?
|
# - workers are able to help a technician build an aerodrome faster. is that wanted?
|
||||||
|
@ -1927,18 +1926,20 @@ sub get_value {
|
||||||
my $nodeset = $xpath->find("$location");
|
my $nodeset = $xpath->find("$location");
|
||||||
print "doing location $location\n";
|
print "doing location $location\n";
|
||||||
my ($node) = $nodeset->get_nodelist;
|
my ($node) = $nodeset->get_nodelist;
|
||||||
|
|
||||||
my $value;
|
my $value;
|
||||||
if ( $node ) {
|
if ( $node ) {
|
||||||
my $attribute = XML::XPath::XMLParser::as_string( $node );
|
my $attribute = XML::XPath::XMLParser::as_string( $node );
|
||||||
|
|
||||||
# get only the value of an attribute, XML::Xpath returns f.e. regeneration="3", we want just 3
|
# get only the value of an attribute, XML::Xpath returns f.e. regeneration="3", we want just 3
|
||||||
if ( $attribute =~ /\"(.+?)\"/ ) {
|
if ( $attribute =~ /(?<!value-percent-multiplier)[ \t]*=[ \t]*\"[ \t]*(.+?)[ \t]*\"/ ) {
|
||||||
$value = $1;
|
$value = $1;
|
||||||
|
|
||||||
|
if ( $attribute =~ /value-percent-multiplier[ \t]*=[ \t]*\"[ \t]*true[ \t]*\"/ ) {
|
||||||
|
$value = "$value%";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
#else {
|
||||||
$value = $attribute;
|
# $value = $attribute;
|
||||||
}
|
#}
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue