diff options
author | Norbert Preining <norbert@preining.info> | 2022-09-27 03:02:45 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-09-27 03:02:45 +0000 |
commit | 358efc294299fa1b336a63da305121fb8b71447b (patch) | |
tree | 0c0b70e0c71feb835e4645799d4d9b4eba1fdd3a /macros/latex/contrib/wargame | |
parent | 3416c5679e9cfa1ebba2296ecf401319a9f1cfe6 (diff) |
CTAN sync 202209270302
Diffstat (limited to 'macros/latex/contrib/wargame')
18 files changed, 333 insertions, 542 deletions
diff --git a/macros/latex/contrib/wargame/README.md b/macros/latex/contrib/wargame/README.md index a66da25247..000f3cd68b 100644 --- a/macros/latex/contrib/wargame/README.md +++ b/macros/latex/contrib/wargame/README.md @@ -1,6 +1,8 @@ -# A package to make Hex'n'Counter wargames in LaTeX +A package to make Hex'n'Counter wargames in LaTeX +================================================= -## Version 0.2.1 +Version 0.3.2 +------------- This package can help make classic [Hex'n'Counter wargames](https://en.wikipedia.org/wiki/Wargame) using LaTeX. The @@ -23,12 +25,50 @@ one will need for a game (rules, charts, boards, counter sheets). - The package support exporting the game to a [VASSAL](#vassal-support%20'Section%20below') module -## Sources +Sources +------- The sources of the package are kept at [GitLab](https://gitlab.com/wargames_tex/wargame_tex) -## CTAN +Download from GitLab +-------------------- + +- [Zip file of package and support + files](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist) +- [Browse content of + package](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/browse?job=dist) +- [Documentation](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/wargame.pdf?job=dist) +- [Tutorial](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/tutorial.pdf?job=dist) + (and associated VASSAL + [module](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/Game.vmod?job=dist)) +- [Table of + symbols](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/symbols.pdf?job=dist) +- [Compatibility](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/compat.pdf?job=dist) + +To install, get the ([zip +file](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist)) +and unzip into your TeX tree, for example + + mkdir -p ~/texmf + (cd ~/texmf && unzip ../artifacts.zip) + +on Un\*x like systems. + +If you clone from GitLab +(`git clone https://gitlab.com/wargames_tex/wargame_tex.git`) to get the +sources, then you can do + + cd wargame + make install + +to install in `~/texmf`. If you prefer another destination, say +`/usr/local/share/texmf`, do + + make install DESTDIR=/usr/local/share/texmf + +Download from CTAN +------------------ The package is available from [CTAN](https://ctan.org/tex-archive/macros/latex/contrib/wargame) in the @@ -36,19 +76,40 @@ directory `/macros/latex/contrib/wargame`. As of this writing, the package has not hit any of the major distributions (e.g., [TeXLive](https://tug.org/texlive/index.html)). -If you get the sources (`wargame.ins`, all `.dtx` and `.py`) files, then -to install do +### From TDS zip archive + +You can get the *TDS* [zip +file](https://mirrors.ctan.org/install/macros/latex/contrib/wargame.tds.zip) +and unpack that into your desired destination, e.g., `~/texmf` + + unzip wargame.tds.zip -d ~/texmf + +### From sources + +If you get the source (`wargame.ins`, all `.dtx`,`.py`, and `Makefile`) +files, then do + + make install + +to install into `~/texmf`. If you prefer to install somewhere else, say +`/usr/local/share/texmf`, then do + + make install DESTDIR=/usr/local/share/texmf + +If you do not have `make` (or `gmake` on MacOSX), or because you are on +some system which does not have that tool (e.g., Windows), then do (the +equivalent of) latex wargame.ins - pdflatex beach - pdflatex city - pdflatex light_woods - pdflatex mountains - pdflatex rough - pdflatex swamp - pdflatex town - pdflatex village - pdflatex woods + pdflatex wargame.beach + pdflatex wargame.city + pdflatex wargame.light_woods + pdflatex wargame.mountains + pdflatex wargame.rough + pdflatex wargame.swamp + pdflatex wargame.town + pdflatex wargame.village + pdflatex wargame.woods (You need to use `pdflatex`, `xelatex`, or `lualatex` - plain `latex` with DVI output will not work) @@ -56,19 +117,12 @@ with DVI output will not work) Then copy the relevant files to your TeX tree (e.g., `~/texmf/`) as mkdir ~/texmf/tex/latex/wargame - cp tikzlibrary*.tex ~/texmf/tex/latex/wargame/ - cp wargame.sty ~/texmf/tex/latex/wargame/ - cp wgexpor.sty ~/texmf/tex/latex/wargame/ - cp city.pdf ~/texmf/tex/latex/wargame/ - cp light_woods.pdf ~/texmf/tex/latex/wargame/ - cp mountains.pdf ~/texmf/tex/latex/wargame/ - cp rough.pdf ~/texmf/tex/latex/wargame/ - cp swamp.pdf ~/texmf/tex/latex/wargame/ - cp town.pdf ~/texmf/tex/latex/wargame/ - cp village.pdf ~/texmf/tex/latex/wargame/ - cp woods.pdf ~/texmf/tex/latex/wargame/ - cp export.py ~/texmf/tex/latex/wargame/ - cp svg2tikz.py ~/texmf/tex/latex/wargame/ + cp tikzlibrary*.tex ~/texmf/tex/latex/wargame/ + cp wargame.sty ~/texmf/tex/latex/wargame/ + cp wgexport.cls ~/texmf/tex/latex/wargame/ + cp wargame.*.pdf ~/texmf/tex/latex/wargame/ + cp wgexport.py ~/texmf/tex/latex/wargame/ + cp wgsvg2tikz.py ~/texmf/tex/latex/wargame/ To generate the documentation, after having done the above, do @@ -92,6 +146,11 @@ You can install these into your TeX tree with (e.g., `~/texmf/`) If you want to generate the tutorial document, do + cd tutorial + make + +or + cd tutorial pdflatex game pdflatex game @@ -100,42 +159,27 @@ If you also want to make the tutorial VASSAL module, do (also in `tutorial`), do pdflatex export.tex - ../export.py export.pdf export.json -o Game.vmod \ + ../wgexport.py export.pdf export.json -o Game.vmod \ -d "Example module from LaTeX PnP game" \ -t "LaTeX wargame tutorial" -v 0.1 \ -p patch.py + -## Download from GitLab - -- [Zip file of package and support - files](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist) -- [Browse content of - package](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/browse?job=dist) -- [Documentation](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/wargame.pdf?job=dist) -- [Tutorial](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/tutorial.pdf?job=dist) - (and associated VASSAL - [module](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/Game.vmod?job=dist)) -- [Table of - symbols](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/symbols.pdf?job=dist) -- [Compatibility](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/compat.pdf?job=dist) - -To install, get the ([zip -file](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist)) -and unzip into your TeX tree, for example +Note, you need `pdfinfo` and `pdftocairo` from Poppler, and Python with +the module `PIL` for this. On Debian based systems, do - mkdir -p ~/texmf - (cd ~/texmf && unzip ../artifacts.zip) - -on Un\*x like systems. + sudo apt install poppler-utils python3-pil -## Tutorial +Tutorial +-------- See the [tutorial](tutorial/README.md "Link works on GitLab only") page for more ([here](https://ctan.org/tex-archive/macros/latex/contrib/wargame/doc/tutorial/) if you browse from CTAN). -## Examples +Examples +-------- Below are some print'n'play board wargames made with this package. These are not original games but rather revamps of existing games. All credits @@ -144,11 +188,7 @@ goes to the original authors of these games. - WWII - Eastern Front - [Battle for Moscow](https://gitlab.com/wargames_tex/bfm_tex) - - [Hell's Gate](https://gitlab.com/wargames_tex/hellsgate_tex) - (private) - - [Unternehmung - 25](https://gitlab.com/wargames_tex/unternehmung_tex) - (private) + (classic introductory game) - Western Front - [D-Day](https://gitlab.com/wargames_tex/dday_tex) (Avalon Hill classic) @@ -160,25 +200,22 @@ goes to the original authors of these games. - [First Blood](https://gitlab.com/wargames_tex/firstblood_tex) (Avalon Hill International Kriegspiel Association classic) - - [Malaya](https://gitlab.com/wargames_tex/malaya_tex) - (private) - Africa - [Afrika Korps](https://gitlab.com/wargames_tex/afrikakorps_tex) (Avalon Hill classic) - - [Battles of El - Alamein](https://gitlab.com/wargames_tex/boel_tex) (private) - Modern/Speculative - [Strike Force One](https://gitlab.com/wargames_tex/sfo_tex) - [Kriegspiel](https://gitlab.com/wargames_tex/kriegspiel_tex) (Avalon Hill classic) -## VASSAL support +VASSAL support +-------------- -The packages has the script [`export.py`](utils/export.py) to generate a -draft [VASSAL](https://vassalengine.org) module from the defined charts, -boards, counters, OOBs, and so on. More about this is given in the -documentation. +The packages has the script [`wgexport.py`](utils/wgexport.py) to +generate a draft [VASSAL](https://vassalengine.org) module from the +defined charts, boards, counters, OOBs, and so on. More about this is +given in the documentation. The script will generate a first draft of a module, which then can be edited in the VASSAL editor for the final thing. @@ -194,7 +231,8 @@ An example of this is given in the [Battle for Moscow](https://gitlab.com/wargames_tex/bfm_tex) project, and of course in the [tutorial](tutorial/ "Link works on GitLab only") -## NATO App6 +NATO App6 +--------- The package supports @@ -219,7 +257,8 @@ standard. - Other LaTeX package for making NATO symbology [XMilSymb](https://github.com/ralphieraccoon/MilSymb) -## Copyright and license +Copyright and license +--------------------- (c) 2022 Christian Holm Christensen diff --git a/macros/latex/contrib/wargame/doc/README.md b/macros/latex/contrib/wargame/doc/README.md deleted file mode 100644 index a66da25247..0000000000 --- a/macros/latex/contrib/wargame/doc/README.md +++ /dev/null @@ -1,265 +0,0 @@ -# A package to make Hex'n'Counter wargames in LaTeX - -## Version 0.2.1 - -This package can help make classic [Hex'n'Counter -wargames](https://en.wikipedia.org/wiki/Wargame) using LaTeX. The -package provide tools for generating - -- Hex maps and boards -- Counters (called *chits* since TeX have already taken *counters*) - for units, markers, and so on -- Counter sheets -- Order of Battle charts -- Illustrations in the rules using the defined maps and counters - -The result will often be a PDF (or set of PDFs) that contain everything -one will need for a game (rules, charts, boards, counter sheets). - -- The package uses [NATO App6](#nato-app6 "Section below") symbology - for units. -- The package uses [TikZ](https://github.com/pgf-tikz/pgf) for most - things. -- The package support exporting the game to a - [VASSAL](#vassal-support%20'Section%20below') module - -## Sources - -The sources of the package are kept at -[GitLab](https://gitlab.com/wargames_tex/wargame_tex) - -## CTAN - -The package is available from -[CTAN](https://ctan.org/tex-archive/macros/latex/contrib/wargame) in the -directory `/macros/latex/contrib/wargame`. As of this writing, the -package has not hit any of the major distributions (e.g., -[TeXLive](https://tug.org/texlive/index.html)). - -If you get the sources (`wargame.ins`, all `.dtx` and `.py`) files, then -to install do - - latex wargame.ins - pdflatex beach - pdflatex city - pdflatex light_woods - pdflatex mountains - pdflatex rough - pdflatex swamp - pdflatex town - pdflatex village - pdflatex woods - -(You need to use `pdflatex`, `xelatex`, or `lualatex` - plain `latex` -with DVI output will not work) - -Then copy the relevant files to your TeX tree (e.g., `~/texmf/`) as - - mkdir ~/texmf/tex/latex/wargame - cp tikzlibrary*.tex ~/texmf/tex/latex/wargame/ - cp wargame.sty ~/texmf/tex/latex/wargame/ - cp wgexpor.sty ~/texmf/tex/latex/wargame/ - cp city.pdf ~/texmf/tex/latex/wargame/ - cp light_woods.pdf ~/texmf/tex/latex/wargame/ - cp mountains.pdf ~/texmf/tex/latex/wargame/ - cp rough.pdf ~/texmf/tex/latex/wargame/ - cp swamp.pdf ~/texmf/tex/latex/wargame/ - cp town.pdf ~/texmf/tex/latex/wargame/ - cp village.pdf ~/texmf/tex/latex/wargame/ - cp woods.pdf ~/texmf/tex/latex/wargame/ - cp export.py ~/texmf/tex/latex/wargame/ - cp svg2tikz.py ~/texmf/tex/latex/wargame/ - -To generate the documentation, after having done the above, do - - pdflatex wargame.dtx - makeindex -s gind -o wargame.ind wargame.idx - pdflatex wargame.dtx - pdflatex wargame.dtx - pdflatex symbols.tex - pdflatex compat.tex - pdflatex compat.tex - -(You need to use `pdflatex`, `xelatex`, or `lualatex` - plain `latex` -with DVI output will not work) - -You can install these into your TeX tree with (e.g., `~/texmf/`) - - mkdir -p ~/texmf/doc/latex/wargame/ - cp wargame.pdf ~/texmf/doc/latex/wargame/ - cp symbols.py ~/texmf/doc/latex/wargame/ - cp compat.py ~/texmf/doc/latex/wargame/ - -If you want to generate the tutorial document, do - - cd tutorial - pdflatex game - pdflatex game - -If you also want to make the tutorial VASSAL module, do (also in -`tutorial`), do - - pdflatex export.tex - ../export.py export.pdf export.json -o Game.vmod \ - -d "Example module from LaTeX PnP game" \ - -t "LaTeX wargame tutorial" -v 0.1 \ - -p patch.py - -## Download from GitLab - -- [Zip file of package and support - files](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist) -- [Browse content of - package](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/browse?job=dist) -- [Documentation](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/wargame.pdf?job=dist) -- [Tutorial](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/tutorial.pdf?job=dist) - (and associated VASSAL - [module](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/Game.vmod?job=dist)) -- [Table of - symbols](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/symbols.pdf?job=dist) -- [Compatibility](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/file/public/doc/latex/wargame/compat.pdf?job=dist) - -To install, get the ([zip -file](https://gitlab.com/wargames_tex/wargame_tex/-/jobs/artifacts/master/download?job=dist)) -and unzip into your TeX tree, for example - - mkdir -p ~/texmf - (cd ~/texmf && unzip ../artifacts.zip) - -on Un\*x like systems. - -## Tutorial - -See the [tutorial](tutorial/README.md "Link works on GitLab only") page -for more -([here](https://ctan.org/tex-archive/macros/latex/contrib/wargame/doc/tutorial/) -if you browse from CTAN). - -## Examples - -Below are some print'n'play board wargames made with this package. These -are not original games but rather revamps of existing games. All credits -goes to the original authors of these games. - -- WWII - - Eastern Front - - [Battle for Moscow](https://gitlab.com/wargames_tex/bfm_tex) - - [Hell's Gate](https://gitlab.com/wargames_tex/hellsgate_tex) - (private) - - [Unternehmung - 25](https://gitlab.com/wargames_tex/unternehmung_tex) - (private) - - Western Front - - [D-Day](https://gitlab.com/wargames_tex/dday_tex) (Avalon - Hill classic) - - [Paul Koenig's Market - Garden](https://gitlab.com/wargames_tex/pkmg_tex) - - [Paul Koenig's - D-Day](https://gitlab.com/wargames_tex/pkdday_tex) - - Pacific theatre - - [First - Blood](https://gitlab.com/wargames_tex/firstblood_tex) - (Avalon Hill International Kriegspiel Association classic) - - [Malaya](https://gitlab.com/wargames_tex/malaya_tex) - (private) - - Africa - - [Afrika - Korps](https://gitlab.com/wargames_tex/afrikakorps_tex) - (Avalon Hill classic) - - [Battles of El - Alamein](https://gitlab.com/wargames_tex/boel_tex) (private) -- Modern/Speculative - - [Strike Force One](https://gitlab.com/wargames_tex/sfo_tex) - - [Kriegspiel](https://gitlab.com/wargames_tex/kriegspiel_tex) - (Avalon Hill classic) - -## VASSAL support - -The packages has the script [`export.py`](utils/export.py) to generate a -draft [VASSAL](https://vassalengine.org) module from the defined charts, -boards, counters, OOBs, and so on. More about this is given in the -documentation. - -The script will generate a first draft of a module, which then can be -edited in the VASSAL editor for the final thing. - -Alternatively, one can provide a Python script to do more on the -generated module, such as defining starting positions, fixing grid -layouts, and so on. Using such a patch script, one can get an (almost) -final module. This means, that even if one makes changes to the original -content, it is easy to remake the module without much need for the -VASSAL editor. - -An example of this is given in the [Battle for -Moscow](https://gitlab.com/wargames_tex/bfm_tex) project, and of course -in the [tutorial](tutorial/ "Link works on GitLab only") - -## NATO App6 - -The package supports - -- All air, equipment, installation, land, sea surface, sub surface, - and space command symbols, including amplifiers and modifiers -- All friendly, hostile, neutral, and unknown faction frame. Undecided - faction frames can be made by specifying `dashed` line styles. -- Some, but very few, other kinds of symbology. - -Here are some references for more information on the NATO App6 symbology -standard. - -- The [Wikipedia - page](https://en.wikipedia.org/wiki/NATO_Joint_Military_Symbology) - on NATO Joint Military Symbology -- The [NATO - page](https://nso.nato.int/nso/nsdd/main/standards/ap-details/1912/EN). - If this does not work for you, then try to go to the [standards - page](https://nso.nato.int/nso/nsdd/main/standards) and put in and - write in `SYMBOLOGY` in the *Document Title Contains Words* field - and press *Start*. -- Other LaTeX package for making NATO symbology - [XMilSymb](https://github.com/ralphieraccoon/MilSymb) - -## Copyright and license - -(c) 2022 Christian Holm Christensen - -This work is licensed under the Creative Commons Attribution-ShareAlike -4.0 International License (CC-BY-SA-4.0). To view a copy of this -license, visit [CC](http://creativecommons.org/licenses/by-sa/4.0/) or -send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, -USA. - -### Some comments on copyright - -*Caveat*: I am not a lawyer. - -Note that this license applies to the `wargame` package as such. What -you generate using the package is *not* required to be licensed -according to the *ShareAlike* clause of CC-BY-SA-4.0. That is, you can -license your materials *any way you want*. - -However, that copyright rights on games is not as prohibitive as you may -think (see [this thread on -BGG](https://boardgamegeek.com/thread/493249/)). What you *can* -copyright is original, artistic expression. That is, the copyrighted -work must not be a copy of something else (originality) and must be some -form of expression. One *cannot* copyright ideas, only their expression -in so far as it is *artistic* (i.e., not a trivial expression that -anyone knowledgeable within the field can do with rudimentary effort). - -So you *can not* copyright your game mechanics, for example, only how -you described them. You *can not* copyright a title (but you may be able -to claim trademark on it). You *can* copyright the wording of the rules, -the graphics that you use, and so on. - -This also means, that you are essentially free to make your own version -of previously published game, *as long as* - -- you do not copy existing text -- you do not copy existing graphics -- you respect any kind of trademark claims - -However, it is advisable to contact the copyright holders of the -previously published game to avoid -[SNAFU](https://en.wikipedia.org/wiki/SNAFU). If in doubt, seek -professional help. diff --git a/macros/latex/contrib/wargame/doc/compat.pdf b/macros/latex/contrib/wargame/doc/compat.pdf Binary files differindex 3e9956c6d7..70583eca2f 100644 --- a/macros/latex/contrib/wargame/doc/compat.pdf +++ b/macros/latex/contrib/wargame/doc/compat.pdf diff --git a/macros/latex/contrib/wargame/doc/symbols.pdf b/macros/latex/contrib/wargame/doc/symbols.pdf Binary files differindex 20dcb7101b..b7f8a0a6c0 100644 --- a/macros/latex/contrib/wargame/doc/symbols.pdf +++ b/macros/latex/contrib/wargame/doc/symbols.pdf diff --git a/macros/latex/contrib/wargame/doc/tutorial/Makefile b/macros/latex/contrib/wargame/doc/tutorial/Makefile index 5d4061c347..4947d84ee0 100644 --- a/macros/latex/contrib/wargame/doc/tutorial/Makefile +++ b/macros/latex/contrib/wargame/doc/tutorial/Makefile @@ -6,7 +6,7 @@ LATEX_FLAGS := -interaction=nonstopmode \ -file-line-error \ --synctex=15 \ -shell-escape -EXPORT := ../utils/export.py +EXPORT := ../utils/wgexport.py EXPORT_FLAGS := ifdef VERBOSE diff --git a/macros/latex/contrib/wargame/doc/tutorial/README.md b/macros/latex/contrib/wargame/doc/tutorial/README.md index 92c884f6ef..38fd222142 100644 --- a/macros/latex/contrib/wargame/doc/tutorial/README.md +++ b/macros/latex/contrib/wargame/doc/tutorial/README.md @@ -33,7 +33,7 @@ LaTeX from there. To build the VASSAL module, simply do pdflatex export.tex - `kpsewhich export.py` export.pdf export.json -o Game.vmod \ + `kpsewhich wgexport.py` export.pdf export.json -o Game.vmod \ -d "Example module from LaTeX PnP game" \ -t "LaTeX wargame tutorial" -v 0.1 \ -p patch.py diff --git a/macros/latex/contrib/wargame/doc/tutorial/export.tex b/macros/latex/contrib/wargame/doc/tutorial/export.tex index adbb65ba6e..d51ecf0e5c 100644 --- a/macros/latex/contrib/wargame/doc/tutorial/export.tex +++ b/macros/latex/contrib/wargame/doc/tutorial/export.tex @@ -15,7 +15,7 @@ % % The trick is to prepare a separate \LaTeX{} document, say % \texttt{export.tex} as in this tutorial, which exports the images as -% single pages. Then, the Python script \texttt{export.py} +% single pages. Then, the Python script \texttt{wgexport.py} % distributed with the \textsf{wargame} package picks up this output % (\texttt{export.pdf} and \texttt{export.json}) and generates a draft % VASSAL module. @@ -202,14 +202,16 @@ % \end{macrocode} % % This looks like -% \tikz{\draw[fill=friendly] (.1,0) rectangle(.5,-.1); -% \draw[fill=friendly] (.1,-.15) rectangle(.3,-.25); -% \draw[fill=friendly] (.1,-.3) rectangle(.2,-.4); -% \draw[fill=hostile] (-.1,0) rectangle(-.3,-.25);} -% -% Normally the \texttt{export.py} script used the \emph{undo} image +% \tikz{ +% \draw[fill=friendly] (.1,0) rectangle(.5,-.1); +% \draw[fill=friendly] (.1,-.15) rectangle(.3,-.25); +% \draw[fill=friendly] (.1,-.3) rectangle(.2,-.4); +% \draw[fill=hostile] (-.1,0) rectangle(-.3,-.25);} +% +% Normally the \texttt{wgexport.py} script used the \emph{undo} mage % for the flip button. However, that may be a bit confusing, so we -% will use a large ``F'' instead. \tikz{\node[color=blue!75!black,font=\sffamily\bfseries\LARGE]{F}} +% will use a large ``F'' +% instead. \tikz{\node[color=blue!75!black,font=\sffamily\bfseries\LARGE]{F}} % % And similarly for the ``Eliminate''\tikz{\node[color=red!75!black,font=\sffamily\bfseries\LARGE]{E}} % @@ -245,11 +247,11 @@ % We run \LaTeX{} on the above \texttt{export.tex} file (the source of % this section) to generate \texttt{export.pdf} and % \texttt{export.json}. We then process these with the -% \texttt{export.py} Python script to get the draft VASSAL module +% \texttt{wgexport.py} Python script to get the draft VASSAL module % \texttt{Draft.vmod}. % % \begin{verbatim} -% `kpsewhich export.py` export.pdf export.json +% `kpsewhich wgexport.py` export.pdf export.json % \end{verbatim} % % The utility \texttt{kpsewhich}\footnotemark{\TeX{}Live and similar @@ -273,7 +275,7 @@ % \texttt{game.pdf}, then we can do % % \begin{verbatim} -% `kpsewhich export.py` export.pdf export.json \ +% `kpsewhich wgexport.py` export.pdf export.json \ % -r game.pdf -o Game.vmod % \end{verbatim} % @@ -298,7 +300,7 @@ % complete module, we would do something like % % \begin{verbatim} -% `kpsewhich export.py` export.pdf export.json \ +% `kpsewhich wgexport.py` export.pdf export.json \ % -r game.pdf -o Game.vmod \ % -t "LaTeX Wargame tutorial" \ % -d "Example of using wargame to make a module" \ @@ -313,7 +315,7 @@ % % We will take one more step on the VASSAL module, and then we will % get back to the Print'n'Play version of the game. We can provide -% the \texttt{export.py} script with an additional Python script that +% the \texttt{wgexport.py} script with an additional Python script that % can tweak the VASSAL module any way we like. We can for example % move counters into their starting positions, to the OOB, adjust % grids, add more materials, and so on. It is only your imagination, @@ -322,7 +324,7 @@ % % Here we will make a simple \texttt{patch.py} Python script which % does very little. The \textsf{wargame} package, -% \textsf{wgexport} class, and \texttt{export.py} script has already +% \textsf{wgexport} class, and \texttt{wgexport.py} script has already % done the heavy work for us. Not least be because we have taken care % to add in \texttt{zone} styles where needed. % @@ -332,7 +334,7 @@ % do much. % % \begin{verbatim} -% `kpsewhich export.py` export.pdf export.json \ +% `kpsewhich wgexport.py` export.pdf export.json \ % -r game.pdf -o Game.vmod % -t "LaTeX Wargame tutorial" \ % -d "Example of using wargame to make a module" \ @@ -344,37 +346,34 @@ % \begin{verbatim} % def patch(build,data,vmod,verbose=False): % # We need to import the export module :-) -% import export +% import wgexport as wg % % # Get the game and last free GPID -% game = export.get_game(build) +% game = wg.get_game(build) % gpid = int(game.getAttribute('nextPieceSlotId')) % % # Get all boards -% maps = export.get_maps(build) +% maps = wg.get_maps(build) % board = maps['Board'] % -% mkeys = export.get_masskey(board,'name') -% export.set_node_attr(mkeys['Eliminate'], -% icon='eliminate-icon.png') -% export.set_node_attr(mkeys['Flip'], -% icon='flip-icon.png') +% mkeys = wg.get_masskey(board,'name') +% wg.set_node_attr(mkeys['Eliminate'],icon='eliminate-icon.png') +% wg.set_node_attr(mkeys['Flip'],icon='flip-icon.png') % % # Get main map % pool = maps['DeadMap'] -% export.set_node_attr(pool,icon='pool-icon.png') +% wg.set_node_attr(pool,icon='pool-icon.png') % -% mkeys = export.get_masskey(pool,'name') -% export.set_node_attr(mkeys['Restore'], -% icon='restore-icon.png') +% mkeys = wg.get_masskey(pool,'name') +% wg.set_node_attr(mkeys['Restore'],icon='restore-icon.png') % % # Get the OOB map -% oob = export.get_chartwindows(game)['OOBs'] -% export.set_node_attr(oob,icon='oob-icon.png') +% oob = wg.get_chartwindows(game)['OOBs'] +% wg.set_node_attr(oob,icon='oob-icon.png') % \end{verbatim} % % In the \texttt{patch.py} script we can use all the functionality -% provided by \texttt{export.py}. Elements are XML elements that we +% provided by \texttt{wgexport.py}. Elements are XML elements that we % apply \texttt{xml.dom.minidom} operations on. % % \iffalse diff --git a/macros/latex/contrib/wargame/doc/tutorial/game.pdf b/macros/latex/contrib/wargame/doc/tutorial/game.pdf Binary files differindex 875523b4d4..14bcde8f98 100644 --- a/macros/latex/contrib/wargame/doc/tutorial/game.pdf +++ b/macros/latex/contrib/wargame/doc/tutorial/game.pdf diff --git a/macros/latex/contrib/wargame/doc/tutorial/patch.py b/macros/latex/contrib/wargame/doc/tutorial/patch.py index 71785252bb..0fcdd49645 100644 --- a/macros/latex/contrib/wargame/doc/tutorial/patch.py +++ b/macros/latex/contrib/wargame/doc/tutorial/patch.py @@ -1,29 +1,29 @@ def patch(build,data,vmod,verbose=False): # We need to import the export module :-) - import export + import wgexport as wg # Get the game and last free GPID - game = export.get_game(build) + game = wg.get_game(build) gpid = int(game.getAttribute('nextPieceSlotId')) # Get all boards - maps = export.get_maps(build) + maps = wg.get_maps(build) board = maps['Board'] - mkeys = export.get_masskey(board,'name') - export.set_node_attr(mkeys['Eliminate'],icon='eliminate-icon.png') - export.set_node_attr(mkeys['Flip'],icon='flip-icon.png') + mkeys = wg.get_masskey(board,'name') + wg.set_node_attr(mkeys['Eliminate'],icon='eliminate-icon.png') + wg.set_node_attr(mkeys['Flip'],icon='flip-icon.png') # Get main map pool = maps['DeadMap'] - export.set_node_attr(pool,icon='pool-icon.png') + wg.set_node_attr(pool,icon='pool-icon.png') - mkeys = export.get_masskey(pool,'name') - export.set_node_attr(mkeys['Restore'],icon='restore-icon.png') + mkeys = wg.get_masskey(pool,'name') + wg.set_node_attr(mkeys['Restore'],icon='restore-icon.png') # Get the OOB map - oob = export.get_chartwindows(game)['OOBs'] - export.set_node_attr(oob,icon='oob-icon.png') + oob = wg.get_chartwindows(game)['OOBs'] + wg.set_node_attr(oob,icon='oob-icon.png') diff --git a/macros/latex/contrib/wargame/doc/wargame.pdf b/macros/latex/contrib/wargame/doc/wargame.pdf Binary files differindex a030c938f4..c25e83c175 100644 --- a/macros/latex/contrib/wargame/doc/wargame.pdf +++ b/macros/latex/contrib/wargame/doc/wargame.pdf diff --git a/macros/latex/contrib/wargame/source/Makefile b/macros/latex/contrib/wargame/source/Makefile index bfb4db8e27..faca441091 100644 --- a/macros/latex/contrib/wargame/source/Makefile +++ b/macros/latex/contrib/wargame/source/Makefile @@ -2,7 +2,7 @@ # # NAME := wargame -VERSION := 0.2.1 +VERSION := 0.3 LATEX_FLAGS := -interaction=nonstopmode \ -file-line-error \ --synctex=15 \ @@ -67,7 +67,7 @@ SOURCES := wargame.ins \ natoapp6c/util.dtx \ tests/map.dtx \ tests/chits.dtx -SCRIPTS := utils/svg2tikz.py utils/export.py +SCRIPTS := utils/wgsvg2tikz.py utils/wgexport.py DESTDIR := $(HOME)/texmf/ instdir := tex/latex/$(NAME) @@ -84,7 +84,9 @@ TILES := beach \ swamp \ town \ village \ - woods + woods +TILES_PDF := $(TILES:%=wargame.%.pdf) +TILES_TEX := $(TILES:%=wargame.%.tex) TABLES := air \ missile \ land \ @@ -101,7 +103,7 @@ PKG_FILES := wargame.sty \ tikzlibrarywargame.natoapp6c.code.tex \ tikzlibrarywargame.chit.code.tex \ wgexport.cls \ - $(TILES:%=%.pdf) + $(TILES_PDF) # beach.png \ # city.png \ @@ -187,7 +189,7 @@ clean: $(MUTE)rm -f tikzlibrarywargame.natoapp6c.code.tex $(MUTE)rm -f tikzlibrarywargame.chit.code.tex $(MUTE)rm -f wgexport.cls mksvg.pdf README.md.version - $(MUTE)rm -f $(TILES:%=%.tex) $(TILES:%=%.pdf) + $(MUTE)rm -f $(TILES_TEX) $(TILES_PDF) $(MUTE)rm -rf public texmf $(MUTE)rm -rf $(distsdir) $(MUTE)rm -f $(distsdir).tar.gz @@ -209,12 +211,12 @@ tikzlibrarywargame.hex.code.tex \ tikzlibrarywargame.natoapp6c.code.tex \ tikzlibrarywargame.chit.code.tex \ wgexport.cls \ -$(TILES:%=%.tex) \ +$(TILES_TEX) \ $(TABLES:%=cmp_%.tex): $(SOURCES) @echo "DOCSTRIP $<" $(MUTE)$(LATEX) $< $(REDIR) -wargame.idx: wargame.dtx wargame.sty $(TILES:%=%.pdf) +wargame.idx: wargame.dtx wargame.sty $(TILES_PDF) wargame.pdf: wargame.aux wargame.ind fast: wargame.idx symbols.aux: symbols.tex wargame.sty @@ -317,7 +319,7 @@ docker: docker-prep: apt update - apt install -y poppler-utils python3-pil pandoc \ + apt install -y poppler-utils python3-pil pandoc zip \ libwww-mechanize-perl libfile-copy-recursive-perl pwd ls diff --git a/macros/latex/contrib/wargame/source/chit/misc.dtx b/macros/latex/contrib/wargame/source/chit/misc.dtx index 6c406af3f8..de373864e6 100644 --- a/macros/latex/contrib/wargame/source/chit/misc.dtx +++ b/macros/latex/contrib/wargame/source/chit/misc.dtx @@ -169,7 +169,7 @@ \ifx\u\m\def\m{1}\fi \foreach \n in {1,...,\m}{% \ifx\u\chit@blank\else - \chit[\u=\ti,zone point={\u}{\c}{\r}](\c,\r) + \chit[\u=\ti,zone oob point={\u}{\c}{\r}](\c,\r); \fi \chit@oob@cellupdate(\c,\r){#2}{#3}{\y} } @@ -452,7 +452,8 @@ % % \begin{macrocode} \tikzset{ - zone point/.code n args={3}{}} + zone point/.code n args={3}{}, + zone oob point/.code n args={3}{}} % \end{macrocode} % % \iffalse diff --git a/macros/latex/contrib/wargame/source/hex/terrain.dtx b/macros/latex/contrib/wargame/source/hex/terrain.dtx index 765b38e759..42155ca5c9 100644 --- a/macros/latex/contrib/wargame/source/hex/terrain.dtx +++ b/macros/latex/contrib/wargame/source/hex/terrain.dtx @@ -65,15 +65,15 @@ \else \tikzset{ /hex/terrain/.cd,% - beach/.style={image=beach}, - light woods/.style={image=light_woods}, - woods/.style={image=woods}, - swamp/.style={image=swamp}, - rough/.style={image=rough}, - mountains/.style={image=mountains}, - village/.style={image=village}, - town/.style={image=town}, - city/.style={image=city}, + beach/.style={image=wargame.beach}, + light woods/.style={image=wargame.light_woods}, + woods/.style={image=wargame.woods}, + swamp/.style={image=wargame.swamp}, + rough/.style={image=wargame.rough}, + mountains/.style={image=wargame.mountains}, + village/.style={image=wargame.village}, + town/.style={image=wargame.town}, + city/.style={image=wargame.city}, } \fi % \end{macrocode} diff --git a/macros/latex/contrib/wargame/source/util/core.dtx b/macros/latex/contrib/wargame/source/util/core.dtx index 506cb19ece..1d95aa38c6 100644 --- a/macros/latex/contrib/wargame/source/util/core.dtx +++ b/macros/latex/contrib/wargame/source/util/core.dtx @@ -1225,6 +1225,23 @@ \@rbchar, } %\message{^^JZone point \the\mk@point\space ##1: ##2,##3 -> \px,\py} }, + zone oob point/.code n args={3}{ + \pgf@xa=##2 cm + \pgf@ya=##3 cm + \advance\pgf@xa.1cm + \advance\pgf@ya.1cm + \pgfpointtransformed{\pgfpoint{\pgf@xa}{\pgf@ya}} + % \pgfpointtransformed{\pgfpoint{0pt}{0pt}} + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + \pt@to@cm{\the\pgf@xa}\edef\px{\pgfmathresult} + \pt@to@cm{\the\pgf@ya}\edef\py{\pgfmathresult} + \advance\mk@point1 + \global\mk@point=\mk@point + \mk@w{ \mk@i "point\the\mk@point": \@lbchar "name": "##1", "type": "point", "coords": [\px,\py] + \@rbchar, } + %\message{^^JZone point \the\mk@point\space ##1: ##2,##3 -> \px,\py} + }, zone global point/.code n args={3}{ \advance\mk@point1 \global\mk@point=\mk@point diff --git a/macros/latex/contrib/wargame/source/utils/export.py b/macros/latex/contrib/wargame/source/utils/wgexport.py index d62c9e5f77..9ad370cfcd 100755 --- a/macros/latex/contrib/wargame/source/utils/export.py +++ b/macros/latex/contrib/wargame/source/utils/wgexport.py @@ -320,6 +320,10 @@ def get_helpfiles(doc,key='fileName',asdict=True): return get_asdict(doc,MODULE+'documentation.HelpFile',key,asdict) # -------------------------------------------------------------------- +def get_tutorials(doc,key='name',asdict=True): + return get_asdict(doc,MODULE+'documentation.Tutorial',key,asdict) + +# -------------------------------------------------------------------- def get_inventories(doc,key='name',asdict=False): return get_asdict(doc,MODULE+'Inventory',key,asdict) @@ -723,6 +727,20 @@ def add_htmlfile(root,doc,title,startingPage='index.html'): title=title) # -------------------------------------------------------------------- +def add_tutorial(root,doc, + name = 'Tutorial', + logfile = 'tutorial.vlog', + promptMessage = 'Load the tutorial?', + welcomeMessage = 'Press "Step forward" (PnDn) to step through the tutorial', + launchOnStartup = True): + return add_node(root,doc,MODULE+'documentation.Tutorial', + name = name, + logfile = logfile, + promptMessage = promptMessage, + welcomeMessage = welcomeMessage, + launchOnStartup = launchOnStartup) + +# -------------------------------------------------------------------- def add_roster(root,doc,buttonKeyStroke='', buttonText='Retire', buttonToolTip='Switch sides, become observer, or release faction'): @@ -775,7 +793,7 @@ def add_inventory(root,doc, foldersOnly = False, forwardKeystroke = True, groupBy = '', - hotkey = key('I'), + hotkey = key('I',ALT), icon = '/images/inventory.gif', include = '{}', launchFunction = 'functionHide', @@ -786,7 +804,7 @@ def add_inventory(root,doc, pieceZoom2 = '0.5', pieceZoom3 = '0.6', propertyGate = '', - refreshHotkey = key('I',195), + refreshHotkey = key('I',ALT_SHIFT), showMenu = True, sides = '', sortFormat = '$PieceName$', @@ -1292,7 +1310,7 @@ def add_counterviewer(root,map, def add_globalmap(root,map, buttonText = '', color = rgb(255,0,0), - hotkey = '79,195', + hotkey = key('O',CTRL_SHIFT), icon = '/images/overview.gif', scale = 0.2, tooltip = 'Show/Hide overview window'): @@ -1315,7 +1333,7 @@ def add_zoomer(root,map, pickButtonText = '', pickIconName = '/images/zoom.png', pickTooltip = 'Select Zoom', - zoomInKey = '61,195', + zoomInKey = key('=',CTRL_SHIFT), zoomLevels = [0.2,0.25,0.333,0.4,0.5,0.555,0.625,0.75,1.0,1.25,1.6], zoomOutKey = key('-'), zoomPickKey = key('='), @@ -2240,7 +2258,7 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, </ul> <p> both generated by LaTeX using the <b>wargame</b> [1] package, and - processed by the Python script <code>export.py</code> from that + processed by the Python script <code>wgexport.py</code> from that package. </p> <p> @@ -2252,7 +2270,7 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, </p> <h2>Content of the module</h2> <p> - The <code>export.py</code> Python script has identified the + The <code>wgexport.py</code> Python script has identified the factions of the game to be </p> <ul> @@ -2305,94 +2323,11 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, then that has been included in the module and is accessible from the "Help" menu. </p> - <h2>Key-bindings</h2> - <p> - The following key bindings have been defined - </p> - <table> - <tr> - <td>Alt-A</td> - <td>Show the charts panel</td> - </tr> - <tr> - <td>Alt-B</td> - <td>Show the OOBs</td> - </tr> - <tr> - <td>Alt-C</td> - <td>Show the counters panel</td> - </tr> - <tr> - <td>Alt-E</td> - <td>Show the eliminated units</td> - </tr> - <tr> - <td>Alt-6</td> - <td>Roll the die</td> - </tr> - <tr> - <td>Ctrl-O</td> - <td>Hide/show counters</td> - </tr> - <tr> - <td>Ctrl-F</td> - <td>Flip selected counters</td> - </tr> - <tr> - <td>Ctrl-E</td> - <td>Eliminate selected counters</td> - </tr> - <tr> - <td>Ctrl-+</td> - <td>Zoom in</td> - </tr> - <tr> - <td>Ctrl--</td> - <td>Zoom out</td> - </tr> - <tr> - <td>Ctrl-=</td> - <td>Select zoom</td> - </tr> - <tr> - <td>Ctrl-Shift-O</td> - <td>Show overview map</td> - </tr> - </table> - - Counter short cuts (may not work, right click and use context menu) - <table> - <tr> - <td>Ctrl-F</td> - <td>Flip counter</td> - </tr> - <tr> - <td>Ctrl-D</td> - <td>Delete counter</td> - </tr> - <tr> - <td>Ctrl-M</td> - <td>Toggle "moved" marker</td> - </tr> - <tr> - <td>Ctrl-T</td> - <td>Toggle move trail</td> - </tr> - <tr> - <td>Ctrl-E</td> - <td>Eliminate unit</td> - </tr> - <tr> - <td>Ctrl-R</td> - <td>Restore unit (from dead pool)</td> - </tr> - </table> <h2>After finalising the module</h2> <p> After the developer has finalised the module (added more pieces, fixed board zones a and grids, add in more commands), then this - Help menu entry should be deleted. You may want to keep key - bindings information in some help file. + Help menu entry should be deleted. </p> </body> </html> @@ -2436,24 +2371,64 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, <td>Show the eliminated units</td> </tr> <tr> + <td>Alt-I</td> + <td>-</td> + <td>Show/refresh inventory window</td> + </tr> + <tr> + <td>Alt-M</td> + <td>-</td> + <td>Show map</td> + </tr> + <tr> + <td>Alt-T</td> + <td>-</td> + <td>Increase turn track</td> + </tr> + <tr> + <td>Alt-Shift-T</td> + <td>-</td> + <td>Decrease turn track</td> + </tr> + <tr> <td>Alt-6</td> <td>-</td> <td>Roll the dice</td> </tr> <tr> - <td>Ctrl-O</td> - <td>Board</td> - <td>Hide/show counters</td> + <td>Ctrl-D</td> + <td>Board,Counter</td> + <td>Delete selected counters</td> + </tr> + <tr> + <td>Ctrl-E</td> + <td>Board,Counter</td> + <td>Eliminate selected counters</td> </tr> <tr> <td>Ctrl-F</td> - <td>Board</td> + <td>Board,Counter</td> <td>Flip selected counters</td> </tr> <tr> - <td>Ctrl-E</td> + <td>Ctrl-M</td> + <td>Board,Counter</td> + <td>Toggle "moved" markers on selected counters</td> + </tr> + <tr> + <td>Ctrl-O</td> <td>Board</td> - <td>Eliminate selected counters</td> + <td>Hide/show counters</td> + </tr> + <tr> + <td>Ctrl-R</td> + <td>Board,Counter</td> + <td>Restore unit (from dead pool)</td> + </tr> + <tr> + <td>Ctrl-T</td> + <td>Board,Counter</td> + <td>Toggle move trail</td> </tr> <tr> <td>Ctrl-+</td> @@ -2476,40 +2451,41 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, <td>Show overview map</td> </tr> <tr> - <td>Ctrl-F</td> - <td>Counter</td> - <td>Flip counter</td> + <td>←,→,↑↓</td> + <td>Board</td> + <td>Scroll board left, right, up, down (slowly)</td> </tr> <tr> - <td>Ctrl-D</td> - <td>Counter</td> - <td>Delete counter</td> + <td>PnUp,PnDn</td> + <td>Board</td> + <td>Scroll board up/down (fast)</td> </tr> <tr> - <td>Ctrl-M</td> - <td>Counter</td> - <td>Toggle "moved" marker</td> + <td>Ctrl-PnUp,Ctrl-PnDn</td> + <td>Board</td> + <td>Scroll board left/right (fast)</td> </tr> <tr> - <td>Ctrl-T</td> - <td>Counter</td> - <td>Toggle move trail</td> + <td>Mouse-scroll up/down</td> + <td>Board</td> + <td>Scroll board up//down</td> </tr> <tr> - <td>Ctrl-E</td> - <td>Counter</td> - <td>Eliminate unit</td> + <td>Shift-Mouse-scroll up/down</td> + <td>Board</td> + <td>Scroll board right/leftown</td> </tr> <tr> - <td>Ctrl-R</td> - <td>Counter</td> - <td>Restore unit (from dead pool)</td> + <td>Ctrl-Mouse-scroll up/down</td> + <td>Board</td> + <td>Zoom board out/in</td> + </tr> + <tr> + <td>Mouse-2</td> + <td>Board</td> + <td>Centre on mouse</td> </tr> </table> - <p> - Counter short cuts (may not work, right click and use context - menu) - </p> </body> </html> ''' @@ -2522,6 +2498,17 @@ def add_notes(root,doc,zipfile,title,version,sides,pdffile,infofile,rules, return notes # -------------------------------------------------------------------- +def add_tut(root,doc,zipfile,tutorial,verbose=False): + if tutorial is None: + return None + + if verbose: + print(f'Adding tutorial {tutorial}') + zipfile.write(tutorial,'tutorial.vlog') + + return add_tutorial(root,doc,name='Tutorial',logfile='tutorial.vlog') + +# -------------------------------------------------------------------- def add_basics_to_map(root,map,**attr): '''Add a map to the document @@ -2555,6 +2542,7 @@ def add_basics_to_map(root,map,**attr): add_keybufferer (root,map) add_selectionhighlighters(root,map) # TBD add_highlightlastmoved (root,map) + add_zoomer (root,map) return stacking @@ -2976,7 +2964,6 @@ def add_map_board(root,game,name,board,gpid,verbose=False,visible=False): add_counterviewer (root,map) add_hidepieces (root,map) add_globalmap (root,map) - add_zoomer (root,map) add_basics_to_map (root,map) add_masskey (root,map,'Flip', key('F'),key('F'), icon = '/images/Undo16.gif', @@ -3054,7 +3041,6 @@ def add_oob(root,widget,name,oob,gpid,hotkey='',verbose=False,visible=False): bpicker = add_boardpicker(root,map) add_counterviewer (root,map) - add_zoomer (root,map) add_basics_to_map (root,map) @@ -3305,6 +3291,7 @@ def create_build(info, version, desc = '', rules = None, + tutorial = None, pdffile = '', infofile = '', verbose = False, @@ -3365,7 +3352,8 @@ def create_build(info, # Add document parts doc = add_documentation(root,game) add_splash(root, doc, categories, title,verbose) - add_rules(root, doc, zipfile, rules,verbose) + add_rules(root, doc, zipfile, rules, verbose) + add_tut(root, doc, zipfile, tutorial, verbose) notes = add_notes(root,doc,zipfile,title,version, sides,pdffile,infofile,rules,verbose) @@ -3479,6 +3467,7 @@ def create_vmod(vmodname, version, desc = '', rules = None, + tutorial = None, pdfname = '', infoname = '', patch = None, @@ -3580,6 +3569,7 @@ def create_vmod(vmodname, version, desc, rules, + tutorial, pdfname, infoname, verbose, @@ -3628,6 +3618,7 @@ def export(vmodname = 'Draft.vmod', version = 'Draft', desc = '', rules = None, + tutorial = None, patch = None, verbose = False, visible = False): @@ -3649,7 +3640,8 @@ def export(vmodname = 'Draft.vmod', f'Title : {title}\n' f'Version : {version}\n' f'Description : {desc}\n' - f'Rules : {rules}\n') + f'Rules : {rules}\n' + f'Tutorial : {tutorial}') info = convert_pages(pdfname=pdfname,infoname=infoname) return create_vmod(vmodname = vmodname, info = info, @@ -3657,6 +3649,7 @@ def export(vmodname = 'Draft.vmod', version = version, desc = desc, rules = rules, + tutorial = tutorial, pdfname = pdfname, infoname = infoname, patch = patch, @@ -3695,6 +3688,9 @@ if __name__ == '__main__': ap.add_argument('-r','--rules', help='Rules PDF file', type=FileType('r')) + ap.add_argument('-T','--tutorial', + help='Tutorial (v)log file', + type=FileType('r')) ap.add_argument('-d','--description', help='Short description of module', type=str, @@ -3711,9 +3707,10 @@ if __name__ == '__main__': args = ap.parse_args() - - vmodname = args.output.name - rulesname = args.rules.name if args.rules is not None else None + + vmodname = args.output.name + rulesname = args.rules.name if args.rules is not None else None + tutname = args.tutorial.name if args.tutorial is not None else None args.output.close() patchname = args.patch.name if args.patch is not None else None @@ -3731,6 +3728,7 @@ if __name__ == '__main__': version = args.version, desc = args.description, rules = rulesname, + tutorial = tutname, patch = patchname, verbose = args.verbose, visible = args.visible_grids) diff --git a/macros/latex/contrib/wargame/source/utils/svg2tikz.py b/macros/latex/contrib/wargame/source/utils/wgsvg2tikz.py index a9f3c60203..a9f3c60203 100755 --- a/macros/latex/contrib/wargame/source/utils/svg2tikz.py +++ b/macros/latex/contrib/wargame/source/utils/wgsvg2tikz.py diff --git a/macros/latex/contrib/wargame/source/wargame.dtx b/macros/latex/contrib/wargame/source/wargame.dtx index a2e7d06a94..d721befdb6 100644 --- a/macros/latex/contrib/wargame/source/wargame.dtx +++ b/macros/latex/contrib/wargame/source/wargame.dtx @@ -415,27 +415,27 @@ % \tikz{\hex[](r=0,c=0) } % & Clear % & \texttt{} -% & \tikz{\hex[terrain={image=beach}](r=0,c=0) } +% & \tikz{\hex[terrain={image=wargame.beach}](r=0,c=0) } % & Beach -% & \texttt{\{image=beach\}}\\ -% \tikz{\hex[terrain={image=light_woods}](r=0,c=0) } +% & \texttt{\{image=wargame.beach\}}\\ +% \tikz{\hex[terrain={image=wargame.light_woods}](r=0,c=0) } % & Light woods -% & \texttt{\{image=light\_woods\}} -% & \tikz{\hex[terrain={image=woods}](r=0,c=0)} +% & \texttt{\{image=wargame.light\_woods\}} +% & \tikz{\hex[terrain={image=wargame.woods}](r=0,c=0)} % & Woods -% & \texttt{\{image=woods\}}\\ -% \tikz{\hex[terrain={image=rough}](r=0,c=0) } +% & \texttt{\{image=wargame.woods\}}\\ +% \tikz{\hex[terrain={image=wargame.rough}](r=0,c=0) } % & Rough -% & \texttt{\{image=rough\}} -% & \tikz{\hex[terrain={image=swamp}](r=0,c=0) } +% & \texttt{\{image=wargame.rough\}} +% & \tikz{\hex[terrain={image=wargame.swamp}](r=0,c=0) } % & Swamp -% & \texttt{\{image=swamp\}}\\ -% \tikz{\hex[terrain={image=mountains}](r=0,c=0) } +% & \texttt{\{image=wargame.swamp\}}\\ +% \tikz{\hex[terrain={image=wargame.mountains}](r=0,c=0) } % & Mountains -% & \texttt{\{image=mountains\}} +% & \texttt{\{image=wargame.mountains\}} % & \tikz{\hex[fill=blue!40!white](r=0,c=0) } % & Sea -% & \texttt{\{image=sea\}}\\ +% & \texttt{\{image=wargame.sea\}}\\ % \hline % \end{tabular} % \caption{Terrains specified via tile images} diff --git a/macros/latex/contrib/wargame/source/wargame.ins b/macros/latex/contrib/wargame/source/wargame.ins index 0ab9ec5a74..23ec10e251 100644 --- a/macros/latex/contrib/wargame/source/wargame.ins +++ b/macros/latex/contrib/wargame/source/wargame.ins @@ -130,15 +130,15 @@ End: \from{chit/elements.dtx}{chit} \from{chit/misc.dtx} {chit}} % - \file{beach.tex} {\from{hex/tile.dtx}{tile,beach}} - \file{city.tex} {\from{hex/tile.dtx}{tile,city}} - \file{light_woods.tex}{\from{hex/tile.dtx}{tile,lightwoods}} - \file{mountains.tex} {\from{hex/tile.dtx}{tile,mountains}} - \file{rough.tex} {\from{hex/tile.dtx}{tile,rough}} - \file{swamp.tex} {\from{hex/tile.dtx}{tile,swamp}} - \file{town.tex} {\from{hex/tile.dtx}{tile,town}} - \file{village.tex} {\from{hex/tile.dtx}{tile,village}} - \file{woods.tex} {\from{hex/tile.dtx}{tile,woods}} + \file{wargame.beach.tex} {\from{hex/tile.dtx}{tile,beach}} + \file{wargame.city.tex} {\from{hex/tile.dtx}{tile,city}} + \file{wargame.light_woods.tex}{\from{hex/tile.dtx}{tile,lightwoods}} + \file{wargame.mountains.tex} {\from{hex/tile.dtx}{tile,mountains}} + \file{wargame.rough.tex} {\from{hex/tile.dtx}{tile,rough}} + \file{wargame.swamp.tex} {\from{hex/tile.dtx}{tile,swamp}} + \file{wargame.town.tex} {\from{hex/tile.dtx}{tile,town}} + \file{wargame.village.tex} {\from{hex/tile.dtx}{tile,village}} + \file{wargame.woods.tex} {\from{hex/tile.dtx}{tile,woods}} % \file{testmap.tex} {\from{tests/map.dtx}{testmap}} \file{testchits.tex} {\from{tests/chits.dtx}{testchits}} |