diff --git a/source/tools/convert_faction_xml2html/compare.html b/source/tools/convert_faction_xml2html/compare.html new file mode 100644 index 000000000..03344468c --- /dev/null +++ b/source/tools/convert_faction_xml2html/compare.html @@ -0,0 +1,19 @@ + + +
+ +
\n"; - - - my $graph_file; - - for my $type ('all', 'buildings_units', 'buildings') { - - if ( $graph_files{ "$faction:click_map:$type" } ) { - $graph_file = $graph_files{ "$faction:click_map:$type" }; - } - elsif ( $graph_files{ "$faction:svg:$type" } ) { - $graph_file =~ s/.+?\///g; - $graph_file ="$images_path/$faction/$graph_file"; - } - $graph_file =~ s/.+\///; - print HTML "
\n"; + print HTML &diagram_links_html( $faction )."
\n"; print HTML $overview_html; print HTML $full_all; @@ -1022,12 +1146,12 @@ foreach my $faction_path ( @factions ) { $title = "$faction_pretty Overview\n"; - print HTML &header( $title, $faction ); + $h_all_html_pages{"$faction:overview"} = "$outfile:$title"; - $tmp_links = $all_faction_links_overview; - $tmp_links =~ s/>($faction_pretty)>$1<\/b>; - print HTML "Choose faction: $tmp_links
\n"; - print HTML "
\n"; + print HTML &diagram_links_html( $faction )."
\n"; + print HTML &show_special_pages()."
\n"; print HTML $overview_html; print HTML $footer; @@ -1042,16 +1166,53 @@ my $outfile = "$out_path/$summary"; open (HTML, "> $outfile") || die "can't write summary page $outfile\n"; print HTML &header("Glest Autodocumentation Summary"); -print HTML "
\n"; +print HTML &show_special_pages()."
\n"; + print HTML header($title); + print HTML "Note: Keyboard assignment can be changed in glestuserkeys.ini.
\n"; print HTML "
Name | Key\n"; @@ -1092,7 +1254,7 @@ sub create_glestkey_page { $key =~ s/^vk//; $key =~ s/\'//g; - print HTML " | ||||
---|---|---|---|---|---|
$name_pretty | $key\n"; + print HTML " | ||||
$name_pretty | $key | ||||
Attack Command: $command_pretty".&html_icon_command( $c, 32 )." | \n"; + my $full_attack_tmp = " | ||||
Attack Command: $command_pretty".&html_icon_command( $c, 32 )." | \n";
my $skill = $attack_skill{ $c };
# attacks have own move_skills (charge)
@@ -1878,17 +2118,17 @@ sub show_attack {
$attack_land{ $s } &&
$attack_air{ $s }
) {
- $full_attack_tmp .= "Target: land and air units \n"; + $full_attack_tmp .= "Target: Ground and air units \n"; } elsif ( $attack_air{ $s } ) { - $full_attack_tmp .= "Target: only air units \n"; + $full_attack_tmp .= "Target: Only air units \n"; } elsif ( $attack_land{ $s } ) { - $full_attack_tmp .= "Target: only land units \n"; + $full_attack_tmp .= "Target: Only ground units \n"; } @@ -1919,7 +2159,7 @@ sub show_attack { my ( $s, $requirement ) = split(/;/, $skill_on_hold_position ); if ( $skill eq $s ) { $full_attack_tmp .= "This Attack Skill is used on \"Hold Position\" \n"; - $full_attack_tmp .= "(\"Hold Position\" requires ".&link_unit( $requirement).") \n" if ( $requirement); + $full_attack_tmp .= "(\"Hold Position\" requires ".&link_unit($faction, $requirement).") \n" if ( $requirement); } } @@ -1931,13 +2171,15 @@ sub show_attack { } } + $full_attack_tmp .= " |
\n"; + foreach my $armor ( @armor_types ) { + $table .= " | ".format_name($armor)." | \n"; + } + $table .= "||||
---|---|---|---|---|---|
".&format_name( $attack)." | \n"; + foreach my $armor ( @armor_types ) { + my $mul = ($damage_multiplier{"$attack:$armor"} || 1); + if ( $mul > 1 ) { + #$table .= ""; + $table .= " | "; + } + elsif ( $mul < 1 ) { + #$table .= " | "; + $table .= " | "; + } + else { + $table .= " | "; + } + + + $table .= " ".$mul; + $table .= " | "; + } + $table .= "
\n"; + + print HTML $table; + + my $pack_file_short = $pack_file; + $pack_file =~ s/.+\///; + print HTML "
\n"; + print HTML $footer; + close HTML; +} + +sub do_air_ground { + + # show if unit is on field air,ground or both + my ( $u ) = @_; + + my $overview_tmp .= "
-Home
+
EOT diff --git a/source/tools/convert_faction_xml2html/setupDeps.sh b/source/tools/convert_faction_xml2html/setupDeps.sh index f6145f4d0..aae915d10 100755 --- a/source/tools/convert_faction_xml2html/setupDeps.sh +++ b/source/tools/convert_faction_xml2html/setupDeps.sh @@ -16,6 +16,8 @@ else sudo apt-get install graphviz sudo apt-get install libgraphviz-perl sudo apt-get install libconfig-inifiles-perl + #sudo apt-get install libimage-size-perl + sudo apt-get install perlmagick fi echo "To run the techtree html builder edit mg.ini and run the script as follows:" diff --git a/source/tools/convert_faction_xml2html/style.css b/source/tools/convert_faction_xml2html/style.css new file mode 100644 index 000000000..4cfcc524f --- /dev/null +++ b/source/tools/convert_faction_xml2html/style.css @@ -0,0 +1,256 @@ +body { + margin: 0 auto; + width: 1016px; + + background-color: #161616; + font-size: 0.8em; + color: #fff6c0; + font-family: "Lucida Sans Unicode","Lucida Grande","Lucida Sans", sans-serif; +} + +/* + * Structure + */ + +/* Header */ +#header { + width: 1016px; + height: 313px; + margin: 0 auto; + background: url("header/header.jpg") no-repeat; +} + +/* Horizontal menu */ +#menu { + background-image: url("menu.jpg"); + background-repeat: no-repeat; + height: 65px; +} + +/* Side menus */ +#menu #first { float: left } +#menu #second { float: right } + +/* Main content */ +#content { + width: 512px; + margin: 0 auto; + background: url("wood_panel.jpg") repeat-y; +} + +/* Article (core text of the page) */ +#article { + font-size: 1.1em; + line-height: 1.5em; + padding: 2em; + text-align: justify; +} + +/* end of article has to be below side modules */ +#end_article { + clear: both; +} + +/* Side modules */ +#aside_left { + float: left; + width: 420px; + margin-left: -168px; +} +#aside_left ul { + padding: 0 17px 0 168px; + margin: 0 2em 2em 2em; +} + +#aside_right { + float: right; + width: 420px; + margin-right: -168px; +} +#aside_right ul { + padding: 0 140px 0 25px; + margin: 0 2em; +} + +.aside .up_image { + width: 420px; + height: 278px; +} +.aside .down_image { + width: 420px; + height: 191px; +} + +/* fill .up_image and .down_image with content */ +.aside .content { + margin-top: -210px; + margin-bottom: -80px; +} + +/* Footer */ +#footer { + width: 1016px; + height: 143px; + margin: 0 auto; + background-image: url("footer/footer.jpg"); +} + + +/* + * Text display: side, colors, etc. + */ +p { text-indent: 2em } +a { color: #ecc72d } +a:link { text-decoration: none } +a:hover { text-decoration: underline } +a img { border: 0; } +img.right { + float: right; + margin: 0 0 10px 10px; +} +img.left { + float: left; + margin: 0 10px 10px 0; +} + +/* news dates, scores: gold */ +.info, .date, #content h3 { color: #ecc72d; } +#content h3 { font-weight: normal; text-indent: 3em } + +/* Logo */ +#header h1 { + width: 365px; + margin: 0 auto; +} + +/* Download image */ +h2#download { + margin: 0 auto; + margin-top: -2em; + text-align: center; +} + +/* Module titles */ +.aside h3 { display: block; } + +.aside h3#news { margin-left: 240px; } +.aside h3#servers { margin-left: 50px; } +.aside h3.forums { margin-left: 230px; } +.aside h3#links { margin-left: 110px; } + +/* Menu links */ +#menu ul { margin: 0; padding: 0} +#menu li { display: inline; } +/* left horizontal menu should not "touch" the wood */ +#menu #second li:first-child { margin-left: 10px; } + +#menu a { + /* fixed available space: fixed size */ + font-size: 14px; + color: #b5dbb5; + font-variant: small-caps; + margin: 0 8px; +} + +/* + * Modules + */ +#aside_left { background: url("modules/l_repeat.jpg") repeat-y } +#aside_left .up_image { background: url("modules/l_up.jpg") } +#aside_left .down_image { background: url("modules/l_down.jpg") } + +#aside_right {background: url("modules/r_repeat.jpg") repeat-y} +#aside_right .up_image {background: url("modules/r_up.jpg")} +#aside_right .down_image {background: url("modules/r_down.jpg")} + +.aside ul li { + list-style-image: url("modules/star.png"); + clear: right; +} + +/* News module */ +.date { + display: block; + float: right; + margin-top: 1em; + margin-bottom: 1.5em; + /* Font */ + font-family: "DejaVu Serif Condensed", serif; + font-style: italic; + font-size: 0.9em; +} + +/* Servers module */ +.aside table { + width: 200px; + margin-left: 50px; + text-align:center; +} + +.aside table td:first-child { + text-align: left; +} + + + +/* Forums module */ +.forums .date { + margin-top: 3px; + font-size: 1em; +} + +/* Footer */ +#footer ul { + margin: 0 auto; + padding-top: 90px; + width: 25em; +} +#footer li { + list-style-type: none; + display: inline; + margin: 0 1em; +} +/* links in the dark space, images above */ +#footer img { + vertical-align: -20%; +} + +/* + * Additional background images + */ +#header_left { + float: left; + width: 140px; + height: 882px; + + background-image: url("header/left.jpg"); + background-repeat: no-repeat; + margin-left: -140px; +} + +#header_right { + float: right; + height: 843px; + width: 143px; + + background-image: url("header/right.jpg"); + background-repeat: no-repeat; + margin-right: -143px; +} + +#footer_left { + float: left; + height: 143px; + width: 101px; + margin-left: -101px; + background: url("footer/footer_left.jpg") no-repeat; +} + +#footer_right { + float: right; + height: 143px; + width: 106px; + margin-right: -106px; + background: url("footer/footer_right.jpg") no-repeat; + +}