diff --git a/vasl_templates/webapp/static/help/index.html b/vasl_templates/webapp/static/help/index.html index 8351967..4956a67 100644 --- a/vasl_templates/webapp/static/help/index.html +++ b/vasl_templates/webapp/static/help/index.html @@ -39,20 +39,39 @@
-

VASL Templates is a web application that runs in a browser, but since it hasn't been set up as a web site on the public internet, you will need to run the web server yourself. -

As a convenience, a program is provided that bundles the web server together with an embedded browser, so that it runs as if it were a normal desktop application. - - -

Installing on Windows

+ +

Running on Windows

If you're using Windows, you should get the pre-built version from Github, unpack it somewhere, then run vasl-templates.exe. Note that it can be a bit slow to start, so please give it a few seconds.

If the program won't start because a DLL is missing from your computer, install the VC2015 runtime (get the 32-bit version, vc_redist.x86.exe, even if you are running 64-bit Windows).

If you don't see anything in the main window, check the notes below about configuring OpenGL. + +

Running a Docker container

+ +

Note that config files installed into the container are taken from their normal location ($/vasl_templates/webapp/config/), but are overridden with Docker-specific versions in $/docker/config/.
+If you have Docker installed, the webapp can be run in a container e.g. +
+./run-container.sh \ + --port 5010 \ + --vassal ~/vassal-3.5.5/ \ + --vasl ~/vasl/vasl-6.6.2.vmod \ + --vasl-extensions ~/vasl/extensions/ \ + --boards ~/vasl/boards/ \ + --chapter-h ~/vasl/chapter-h/ \ + --user-files ~/vasl/user-files/ +
+ +

Then open a browser and connect to the webapp at http://localhost:5010. + +

If you have SElinux enabled, it may prevent the container from accessing files on the host. Access can be allowed like this: +
chcon -Rt svirt_sandbox_file_t /home/pacman-ghost/vasl/
+
+

Running from source

-

If you're on a Mac or Linux, you can run the program directly from the source code. Get a copy from Github in the usual way, by git clone'ing it, or downloading a ZIP and unpacking it somewhere. +

You can also run the program directly from the source code. Get a copy from Github in the usual way, by git clone'ing it, or downloading a ZIP and unpacking it somewhere.

The web server was written and tested using Python 3.8.7, but it doesn't do anything particularly funky, so any recent version of Python should work. @@ -61,58 +80,42 @@ pip install .[gui]

-

Running the desktop application

- -

If you're on Windows, the Qt runtime will have been installed as part of PyQt5 (when you did the pip install above), but if you're in a virtual environment and you're getting "DLL load failed" errors, this is due to a problem with the way Python sets up the virtualenv. In the virtualenv's scripts/ sub-directory, there should be two Python DLL's, so if you're missing python3.dll, copy it over from the Python installation the virtualenv was created from, and you should be good to go. - -

If you're on Linux, you may need to install Qt 5.15.4. On Fedora 33, running the "gui" install above should install everything you need. +

Running the web server

-

Then, just run the vasl-templates command. - -

Running just the web server

- -

The simpler option is to just run the web server: +

The simplest option is to run the web server:

python vasl_templates/webapp/run_server.py
and then connect to it in a browser at http://localhost:5010. - -

Running a Docker container

+

Running the desktop application

-

If you have Docker installed, the webapp can be run in a container e.g. -

-./run-container.sh \ - --port 5010 \ - --vassal ~/vassal-3.5.5/ \ - --vasl ~/vasl/vasl-6.6.2.vmod \ - --vasl-extensions ~/vasl/extensions/ \ - --boards ~/vasl/boards/ \ - --chapter-h ~/vasl/chapter-h/ \ - --user-files ~/vasl/user-files/ -
+

If you want to run the desktop application, you will need to have the Qt runtime installed. -

Then open a browser and connect to the webapp at http://localhost:5010. +

If you're on Linux, you may need to install Qt 5.15.4. On Fedora 35, running the "gui" install above should install everything you need. -

If you have SElinux enabled, it may prevent the container from accessing files on the host. Access can be allowed like this: -
chcon -Rt svirt_sandbox_file_t /home/pacman-ghost/vasl/
-
+

If you're on Windows, the Qt runtime will have been installed as part of PyQt5 (when you did the pip install above), but if you're in a virtual environment and you're getting "DLL load failed" errors, this is due to a problem with the way Python sets up the virtualenv. In the virtualenv's scripts/ sub-directory, there should be two Python DLL's, so if you're missing python3.dll, copy it over from the Python installation the virtualenv was created from, and you should be good to go. -

Note that config files installed into the container are taken from their normal location ($/vasl_templates/webapp/config/), but are overridden with Docker-specific versions in $/docker/config/.
+

Then, run the vasl-templates command.

Installing a webdriver

-

Some features require a webdriver to be installed. You can use either: +

+
The webdriver is tightly coupled with the browser, so make sure that the webdriver you use supports the version of the browser you have.
+
Since browsers usually automatically update themselves as new versions are released, this means that the webdriver you use will eventually become out-of-date, and may stop working. In this case, simply get a new version of the webdriver that supports the version of the browser you have.
+
+Some features require a webdriver to be installed. You can use either:

Unpack the download ZIP file somewhere (it will contain a single executable file), and configure the location in the Server Settings dialog (or set WEBDRIVER_PATH in site.cfg, if you are running from source). +
-

I'm having problems running the desktop application

+

If you're having problems running the desktop application

The desktop application uses OpenGL for the embedded browser, so if you are getting error messages about OpenGL, or the main window is not displaying properly, you can try configuring OpenGL to work in a different way.

Create a file called debug.cfg in $/config/ (the same directory that contains a file called app.cfg) that looks like this: @@ -152,7 +155,7 @@ Configuring the program VASL extensions: C:\bin\vasl\extensions\ VASL boards: C:\bin\vasl\boards\ Java: C:\Program Files\VASSAL-3.5.5\jre\bin\java.exe -

Leave this field blank to use the Java that comes with VASSAL (Windows only), or on your PATH.
+
Leave this field blank to use the Java that comes with VASSAL (Windows only), or on your PATH.
Web driver: C:\bin\geckodriver.exe For the webdriver, download and unpack one of the following: @@ -175,7 +178,7 @@ We'll set up The Streets Of Stalingrad, and the scenario card tells us In VASL Templates, open the save file for this scenario (The Streets Of Stalingrad (Scenario C).json; you'll find it in the examples/ directory).

Browse through the tabs, and you'll see all the scenario details e.g. Victory Conditions, SSR's, setup instructions.

Click on the info icon in the top-right corner of the Scenario panel to get more detailed information about the scenario. -

This information is provided by the ASL Scenario Archive.
+
This information is provided by the ASL Scenario Archive.


@@ -192,7 +195,7 @@ In particular, note the data tables for the vehicles, which contain useful infor We can pretty-up the labels by including pictures in them. Open the User Settings dialog and turn on the Images in scenarios settings.

Update the VASL scenario again (as above), open it again in VASSAL, and you will see that the labels now include nationality flags, and the vehicle data tables show the counter images:
-

Because images can't be stored inside a VASL scenario file, if you turn these options on, you must choose where VASSAL will get the images from: +
Because images can't be stored inside a VASL scenario file, if you turn these options on, you must choose where VASSAL will get the images from:
or a width and/or height parameter to explicitly set the image size (in pixels). -
If you use this feature in your scenarios, the images won't be available if you share the VASL scenario with someone else (since the files are only on your computer). However, if you upload them to a web server on the internet, you can configure the "User files" directory as a URL, and any image URL's that use {{USER_FILES}} will now get them from there.
- -
VASSAL caches images (which can't be turned off), so if you're making changes that don't seem to be having any effect, try restarting VASSAL.
- -
You should avoid having spaces in image URL's, since VASSAL seems to have problems with them.
+

+

If you use this feature in your scenarios, the images won't be available if you share the VASL scenario with someone else (since the files are only on your computer). However, if you upload them to a web server on the internet, you can configure the "User files" directory as a URL, and any image URL's that use {{USER_FILES}} will now get them from there.
+
You should avoid having spaces in image URL's, since VASSAL seems to have problems with them.
+
VASSAL caches images (which can't be turned off), so if you're making changes that don't seem to be having any effect, try restarting VASSAL.
+

Suggested workflow

@@ -327,7 +330,7 @@ or a width and/or height parameter to explicitly set the image

When the scenario has been completed and checked, you can contribute it back to the community by uploading it to the ASL Scenario Archive, where it will be made available to everyone for download.

Just add your VASL scenario file (.vsav), a screenshot will be automatically generated (or you can add your own), then click Upload. -

For copyright reasons, some details will be removed
from the upload e.g. the Victory Conditions and SSR's.
+
For copyright reasons, some details will be removed from the upload e.g. the Victory Conditions and SSR's.

@@ -398,12 +401,12 @@ The report also calculates "hotness", which is a measure of how hot you
<p> MA and CMG (if so equipped) have AA capability - signified by "MA:AA" being printed on the counter.
-
Because Windows has case-insensitive filenames, the convention is that Multi-Applicable Note "A" is stored in a file called a.html, while Multi-Applicable Note "a" is stored in a_.html (with a trailing underscore).
+
Because Windows has case-insensitive filenames, the convention is that Multi-Applicable Note "A" is stored in a file called a.html, while Multi-Applicable Note "a" is stored in a_.html (with a trailing underscore).

The vehicle and ordnance notes themselves are stored as image files, so you need to scan your Chapter H pages, and crop each individual note. For example, an image for the German PSW 234/1 can be seen to the left. Right-click on it, download it, and save it on top of german/vehicles/74.png (because it's note #74).
-

It is also possible to store the vehicle/ordnance notes as HTML, and while it is significantly more work to set things up this way, it gives much better results. Using the placeholder files from the ZIP above, wherever there is a .png file, rename it to have a .html extension, and then put the HTML in there. +
It is also possible to store the vehicle/ordnance notes as HTML, and while it is significantly more work to set things up this way, it gives much better results. Using the placeholder files from the ZIP above, wherever there is a .png file, rename it to have a .html extension, and then put the HTML in there.

Note that the HTML engine used by VASSAL is ancient and doesn't support floating images, which is needed to format this content in the same way as the ASLRB. To work around this, an option is provided (in the User Settings) to show these vehicle/ordnance notes as images. If this is enabled, the vehicle/ordnance notes will be rendered by the VASL Templates program (using a modern browser), and sent to VASSAL as an image, which is slower but gives the expected layout. If you don't use images in your HTML, you can leave this option disabled, and the raw HTML will be inserted into the VASL scenario, where it will be displayed much more quickly by VASSAL.

@@ -421,8 +424,8 @@ The report also calculates "hotness", which is a measure of how hot you

Each individual vehicle and ordnance can also now have its own snippet button. Click on the one for the PSW 234/1, transfer the snippet to your VASL scenario, and you will see the image for Note 74 you set up earlier.

-

Depending on how you scanned the Chapter H pages, the image may not be the right size, so you can set a scaling factor for these images in the Server Settings dialog. As a guide, I scanned my ASLRB at 300dpi, and a scaling factor of 40% produced images that fit in with the rest of the scenario. However, if you have a lot of these images, there will be a noticeable delay when loading the scenario in VASSAL (because the program has to resize all the images), so you will be better off shrinking the images yourself, then setting the scaling factor to 100, so that no resizing needs to be done.
-
VASSAL caches images (which can't be turned off), so if you're making changes that don't seem to be having any effect, try restarting VASSAL.
+
Depending on how you scanned the Chapter H pages, the image may not be the right size, so you can set a scaling factor for these images in the Server Settings dialog. As a guide, I scanned my ASLRB at 300dpi, and a scaling factor of 40% produced images that fit in with the rest of the scenario. However, if you have a lot of these images, there will be a noticeable delay when loading the scenario in VASSAL (because the program has to resize all the images), so you will be better off shrinking the images yourself, then setting the scaling factor to 100, so that no resizing needs to be done.
+
VASSAL caches images (which can't be turned off), so if you're making changes that don't seem to be having any effect, try restarting VASSAL.

Creating a scenario reference sheet

diff --git a/vasl_templates/webapp/static/help/main.css b/vasl_templates/webapp/static/help/main.css index 24127ee..c6a7efd 100644 --- a/vasl_templates/webapp/static/help/main.css +++ b/vasl_templates/webapp/static/help/main.css @@ -41,18 +41,24 @@ table.settings td.val { font-family: monospace ; } /* -------------------------------------------------------------------- */ div.info { - margin: 0.5em ; padding: 0.5em 0.5em 0.5em 30px ; - background: url(images/info.gif) 2px 2px no-repeat ; + display: inline-block ; min-height: 18px ; + border: 1px dotted #444 ; border-radius: 5px ; + padding: 0.5em 0.5em 0.5em 32px ; + background: url(images/info.gif) 0.25em 0.25em no-repeat ; font-size: 80% ; font-style: italic ; } div.hint { - margin: 0.5em ; padding: 0.5em 0.5em 0.5em 30px ; - background: url(images/hint.gif) 2px 2px no-repeat ; + display: inline-block ; min-height: 22px ; + border: 1px dotted #444 ; border-radius: 5px ; + padding: 0.5em 0.5em 0.5em 32px ; + background: url(images/hint.gif) 0.25em 0.25em no-repeat ; font-size: 80% ; font-style: italic ; } div.warning { - margin: 0.5em ; padding: 0.5em 0.5em 0.5em 30px ; - background: url(images/warning.gif) 2px 2px no-repeat ; + display: inline-block ; min-height: 18px ; + border: 1px dotted #444 ; border-radius: 5px ; + padding: 0.5em 0.5em 0.5em 32px ; + background: url(images/warning.gif) 0.25em 0.25em no-repeat ; font-size: 80% ; font-style: italic ; }