mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
- added new faction to html conversion tool with some modifications to run with relative paths directly from the folder the script is in.
- added a script to install required modules to run the script in Ubuntu
This commit is contained in:
parent
ffc9347641
commit
dfd1f59db3
1967
source/tools/convert_faction_xml2html/convert_faction_xml2html.pl
Executable file
1967
source/tools/convert_faction_xml2html/convert_faction_xml2html.pl
Executable file
File diff suppressed because it is too large
Load Diff
64
source/tools/convert_faction_xml2html/mg.ini
Normal file
64
source/tools/convert_faction_xml2html/mg.ini
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
[all]
|
||||||
|
debug = 1;
|
||||||
|
|
||||||
|
# Are paths below based on relative paths to the folder this script is running in
|
||||||
|
relative_paths = 1
|
||||||
|
|
||||||
|
# export functions, see "perldoc GraphViz" (or search.cpan.org for GraphViz) for a list
|
||||||
|
#export_graph=as_svg;as_png
|
||||||
|
export_graph=as_svg;as_png;as_canon;as_text;as_cmapx
|
||||||
|
|
||||||
|
# combine png and cmapx to clickable map
|
||||||
|
build_clickable_map=1
|
||||||
|
|
||||||
|
version=Megaglest 3.4.0
|
||||||
|
|
||||||
|
[files]
|
||||||
|
factions_path=../../../data/glest_game/techs/megapack/factions
|
||||||
|
resources_path=../../../data/glest_game/techs/megapack/resources
|
||||||
|
|
||||||
|
out_path=../../../html
|
||||||
|
|
||||||
|
glestkeys=../../../data/glest_game/glestkeys.ini
|
||||||
|
|
||||||
|
summary=glest_autodocument_summary.html
|
||||||
|
|
||||||
|
units_path=units
|
||||||
|
upgrades_path=upgrades
|
||||||
|
images_path=images
|
||||||
|
|
||||||
|
[style]
|
||||||
|
svg_fontcolor = 0.13472,0.809,0.925;
|
||||||
|
|
||||||
|
footer=<<EOT
|
||||||
|
<br>
|
||||||
|
created by VAR_CREATED_BY <br>
|
||||||
|
<a href="http://www.glest.org">www.glest.org</a> |
|
||||||
|
<a href="http://www.megaglest.org">www.megaglest.org</a> |
|
||||||
|
<a href="http://www.glestae.org">www.glestae.org</a>
|
||||||
|
EOT
|
||||||
|
|
||||||
|
header=<<EOT
|
||||||
|
<HEAD>
|
||||||
|
<TITLE>VAR_TITLE</TITLE>
|
||||||
|
<LINK TYPE="TEXT/CSS" REL="STYLESHEET" HREF="style.css" />
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<H1>VAR_TITLE</h1>
|
||||||
|
<p>
|
||||||
|
<a href="VAR_SUMMARY">Home</a><p>
|
||||||
|
EOT
|
||||||
|
|
||||||
|
|
||||||
|
resource_order=gold:wood:stone:food:energy:housing
|
||||||
|
|
||||||
|
map_legend=<<EOT
|
||||||
|
<H4>Arrow Styles:</H4>
|
||||||
|
<UL>
|
||||||
|
<LI>Bold: Unit creates building
|
||||||
|
<LI>Solid: Building produces unit or upgrade
|
||||||
|
<LI>Dashed: Units morphs/upgrades to other unit
|
||||||
|
<LI>Dotted: Unit or Upgrade is a requirement
|
||||||
|
</UL>
|
||||||
|
EOT
|
23
source/tools/convert_faction_xml2html/setupDeps.sh
Executable file
23
source/tools/convert_faction_xml2html/setupDeps.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
OSTYPE=`uname -m`
|
||||||
|
echo "Detected distro: [$OSTYPE]"
|
||||||
|
|
||||||
|
if [ -f /etc/fedora-release ]; then
|
||||||
|
echo "Fedora..."
|
||||||
|
#sudo yum groupinstall "Development Tools"
|
||||||
|
#sudo yum install subversion automake autoconf autogen jam
|
||||||
|
elif [ -f /etc/SuSE-release ]; then
|
||||||
|
echo "SuSE..."
|
||||||
|
#sudo zypper install subversion gcc gcc-c++ automake
|
||||||
|
else
|
||||||
|
echo "Debian / Ubuntu..."
|
||||||
|
sudo apt-get install perl
|
||||||
|
sudo apt-get install graphviz
|
||||||
|
sudo apt-get install libgraphviz-perl
|
||||||
|
sudo apt-get install libconfig-inifiles-perl
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "To run the techtree html builder edit mg.ini and run the script as follows:"
|
||||||
|
echo "./convert_faction_xml2html.pl mg.ini"
|
||||||
|
|
21
source/tools/convert_faction_xml2html/xpath.pl
Executable file
21
source/tools/convert_faction_xml2html/xpath.pl
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
# show xpath in file, google xpath for syntax
|
||||||
|
|
||||||
|
|
||||||
|
if ( !@ARGV ) {
|
||||||
|
die "\n\nusage $0 file xpath\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use XML::XPath;
|
||||||
|
use XML::XPath::XMLParser;
|
||||||
|
|
||||||
|
my $xpath = XML::XPath->new( filename => shift @ARGV );
|
||||||
|
|
||||||
|
my $nodeset = $xpath->find( shift @ARGV );
|
||||||
|
|
||||||
|
foreach my $node ( $nodeset->get_nodelist ) {
|
||||||
|
print XML::XPath::XMLParser::as_string( $node ) . "\n";
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user