aboutsummaryrefslogtreecommitdiff
path: root/PuzzleApplet.java (follow)
Commit message (Collapse)AuthorAge
* Rework the preset menu system to permit submenus.Simon Tatham2017-04-26
| | | | | | | | | | | | | | | | | | | | To do this, I've completely replaced the API between mid-end and front end, so any downstream front end maintainers will have to do some rewriting of their own (sorry). I've done the necessary work in all five of the front ends I keep in-tree here - Windows, GTK, OS X, Javascript/Emscripten, and Java/NestedVM - and I've done it in various different styles (as each front end found most convenient), so that should provide a variety of sample code to show downstreams how, if they should need it. I've left in the old puzzle back-end API function to return a flat list of presets, so for the moment, all the puzzle backends are unchanged apart from an extra null pointer appearing in their top-level game structure. In a future commit I'll actually use the new feature in a puzzle; perhaps in the further future it might make sense to migrate all the puzzles to the new API and stop providing back ends with two alternative ways of doing things, but this seemed like enough upheaval for one day.
* Remove a stray diagnostic.Simon Tatham2011-04-05
| | | | [originally from svn r9147]
* Fix an amusing cut-and-paste error in the Java drawing code which wasSimon Tatham2011-04-05
| | | | | | | causing complete mis-draws - but only when the window was exactly the right size! [originally from svn r9146]
* Also, it's ugly to blank out pieces of the applet window in black.Simon Tatham2010-11-06
| | | | | | | | | Use the puzzle background colour, like the GTK front end does. (I know that renders the effect of the previous commit invisible, but it's the principle of the thing! :-) [originally from svn r9023]
* In the Java front end, don't try to guess the puzzle rectangle'sSimon Tatham2010-11-06
| | | | | | | | | | | | | | width and height by assuming mirror symmetry within the containing applet area. Instead, use the proper width and height as given back by the C sizing function. (In particular, this fixes a bug where the non-blanked puzzle area appeared too tall by the height of the menu bar, probably as a result of confusing PuzzleApplet.getHeight() with PuzzlePanel.getHeight(). But the mirroring approach was conceptually wrong anyway.) [originally from svn r9022]
* Introduce, and implement as usefully as I can in all front ends, aSimon Tatham2009-12-27
| | | | | | | | | | new function in the drawing API which permits the display of text from outside basic ASCII. A fallback mechanism is provided so that puzzles can give a list of strings they'd like to display in order of preference and the system will return the best one it can manage; puzzles are required to cope with ASCII-only front ends. [originally from svn r8793]
* Fix the Java front end's vertical text positioning whenSimon Tatham2009-02-22
| | | | | | | | | | ALIGN_VNORMAL is in use: ALIGN_VNORMAL indicates that the supplied y-coordinate denotes the _baseline_ of the text, not its top, so adding on 'asc' to convert to the baseline is wrong. This only affects Tents, at present. [originally from svn r8452]
* Cut-and-paste error which was preventing any drop-down list in theSimon Tatham2008-09-19
| | | | | | custom game configuration code from working in the Java applets. [originally from svn r8192]
* Remove rogue diagnostic.Simon Tatham2008-07-05
| | | | [originally from svn r8106]
* Handle a <param name="game_id"> by passing it in to the C side asSimon Tatham2008-06-26
| | | | | | | | | argv[1], which in turn feeds it into the midend as a game ID. This can of course take any of the forms supported by the native C puzzles: a pure game parameter string, a params:description specific game ID, or a params#seed random game ID. [originally from svn r8095]
* The Java console keeps showing up error reports due to being askedSimon Tatham2008-06-26
| | | | | | | | | | to resize the puzzle to zero size. Ignore all such requests, in the assumption that a more sensible resize will be along soon enough (which does seem to happen, though I haven't debugged the NestedVM front end hard enough to figure out why the bogus resizes happen in the first place). [originally from svn r8094]
* Michael Schierl's patch to compile the puzzles as Java applets usingSimon Tatham2008-06-10
NestedVM. Wow! [originally from svn r8064]