Inconsistent help

Steps:

  • open Module Editor
  • navigate to game piece definition, right-click piece and select “Properties”
  • at the bottom of the piece properties window, click “Help”
  • observe system default browser opening the help html page
  • back in the piece properties window, select any available trait on the left side, click “Help” underneath the list of available traits
  • observe system default browser opening the help html page
  • back in the piece properties window, select any available trait, click “Add ->” in the center
  • in the trait properties window that opens after clicking Add, click “Help”

Expected:
Help html opens in system browser

Actual:
Help html opens in a new window that does not belong to the system browser, possibly a html rendering Java Swing element

Thanks, I was setting up some help the other day and the manual said it will open in browser and I thought to myself I am sure I have seen it open in a window before…

I actually prefer it to open in a dedicated window (as i want to present the rules in a narrow scrolling format so that they can be open without overly obscuring game).

Help html opens in a new window that does not belong to the system browser, possibly a html rendering Java Swing element

This is done for the Help files in the Player because the source files reside inside the module zip archive and can not easily be displayed in an external browser. The Help Window is just a JFrame or JDialog with a HyperLinkListener and uses Swing components’ inbuilt HTML support. Very basic, but does the job fine.

In the Module Editor, there is some inconsistency, most Help files are displayed in the external browser, but the individual trait Help pages are displaying in the same internal window used by the Editor. The reference manual files are installed in the Vassal install directory so are available to an external browser.

Personally, I quite like the internal browser window style as well. Low overhead.

The minimum that needs to be done is that the Module Editor is made consistent and the trait help pages are opened in the same place as the other Module editor help pages.

Possibly we need a Global Preference ‘Display Module Editor Help pages in external browser?’, but it is probably not really required as long as the Module Editor is consistent.

Thus spake Brent Easton:

Personally, I quite like the internal browser window style as well. Low
overhead.

I’ve always disliked the internal browser because it’s so ugly. :slight_smile:

There has to be a way to ship out data from a module to a browser. A
data URL would work if nothing else would.


J.

Come on don’t roll your own html renderer or bring this not-maintained-anymore Swing html renderer in 2020 :slight_smile:

Either use the system browser where the user can decide for himself whether to open links in a new window or a tab, or bring a proper rendering engine with out-of-the-box hardware acceleration, something like WebKit.

I’d just use the system browser, a neat side-effect of this is the fewer JFrames and JPanels and JWhatevers are used the easier it’s going to be to move away from Swing some day.

Using the system browser is fine for the Module Editor and we should extend it’s use right across the Editor, I don’t see this working for module based html help files unless you extract them from the module and store them somewhere outside the module.

While you could theoretically use data uris to serve up the pages (with inline data uris to include the images) to a browser, how do you support the hyperlinks?

The help files in html format that come with Vassal, those are the ones I meant, they should display in a consistent way.

Did not even know that the modules can bring their own html files, this sounds like a whole other problem. You are probably right and it’s best to just display them inside Vassal, instead of extracting them then having to clean up etc.

Thus spake Brent Easton:

While you could theoretically use data uris to serve up the pages (with
inline data uris to include the images) to a browser, how do you support
the hyperlinks?

Hmm. That’s a good point—internal hyperlinks wouldn’t work with data
URLs.

Can browsers understand archive URLs? If not, maybe we should export
such files to our temp directory, so browsers can get them via file://
URLs?


J.

Wait wait wait, we have a Java application and we want to serve html pages? Other than DB access, what is the other thing that Java is really good at?

We could embed a webserver like Jetty and have it pick up the html pages from inside the modules and serve them.

Sounds like a good idea. (Not that I would know.) However I have to ask how would that handle pdfs (especially on obscure platforms)?

Yes, worth noting that “put a PDF of the rulebook on the screen” is one of my primary & most important uses of HTML windows.

Firefox can render pdf’s out of the box, does anyone have experience with other browsers? Worst case, the browser will offer to open the pdf with the default application, or to download it.

Oh now I see what you’re suggesting - the embedded webserver would serve up the html (and pdfs and whatever) to the default browser and/or application.

So long as the browser only handles .html (or similar such as .htm and whatever) I have no objection.

An example is the frontend of the H2 DB, whoever is interested and has some time to spare, look at this h2database.com/h2-2019-10-14.zip

It’s a jar file that starts up and opens the address localhost:8082 (or so) in the default browser, and inside it is a full fledged web application.