aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* mosaic: Don't bother initialising fields in decode_ui()Ben Harris2022-12-05
| | | | | | The game_ui is guaranteed to have been freshly generated by new_ui(), so there's no need to set fields to values that new_ui() has already set.
* Devel docs: make it clear that decode_ui() gets a new game_uiBen Harris2022-12-05
| | | | | | At least one puzzle does no actual decoding in decode_ui, but does re-initialise some fields. This is unnecessary because the mid-end only calls decode_ui() with a game_ui it just allocated using new_ui().
* lightup: Remove tests for keystrokes canonicalised by mid-endBen Harris2022-12-05
| | | | | Specifically, the mid-end will never pass ' ', '\r', or '\n' to the back-end, so it's pointless for the back-end to look for them.
* js: Bypass our own dialogue box when loadingBen Harris2022-12-05
| | | | | | | | By constructing the <input type=file> off screen and activating it from JavaScript, we can jump straight to the browser's upload dialogue box without interposing our own one. This gives a smoother experience, and also avoids the difficult-to-handle <input type=file> ever being visible.
* js: Remove align=center from main <div> and make it a <main>Ben Harris2022-12-05
| | | | | | | Instead of an align=center HTML attribute, we now centre its contents using CSS. Also, this element contains all the important contents of the page, so it seems appropriate to us the HTML5 <main> element for this.
* js: Remove a layer of <div> from the HTML pageBen Harris2022-12-05
| | | | | It wasn't doing anything useful, and I was getting fed up with having to expand it in the inspector.
* js: Specify a font for the puzzle canvas in CSSBen Harris2022-12-05
| | | | | I'd like to use this, but (a) I need it in the HTML for a little while first, and (b) I think my current implementation may be a bit fragile.
* js: Correct a comment describing timer_callbackBen Harris2022-12-03
|
* js: Simplify drawing context managementBen Harris2022-12-03
| | | | | | | | | | | | | There's not much point in re-requesting the drawing context from the offscreen canvas at the start of each drawing operation. The canvas keeps the context around and returns it on every call to getContext(), so we may as well just keep our reference to it too. This does mean that the front-end won't detect puzzles drawing outside of a redraw operation, but I think it's the mid-end's job to assert things like that. Rumours that I'm doing this because I had a mysterious bug whereby ctx was unexpectedly null are entirely true.
* js: Switch to using the resize handle in the HTMLBen Harris2022-12-02
|
* js: Don't bother resizing offscreen canvas at startupBen Harris2022-12-02
| | | | | It will get its size set soon enough once we know the size of the puzzle anyway.
* js: Improve comment explaining same-origin policy for file:Ben Harris2022-12-02
| | | | Also a way around it, at least in Firefox.
* js: Add an SVG resize handle to the HTMLBen Harris2022-12-02
| | | | | | | | | | This is more compact than carefully drawing it on a canvas in JavaScript. More importantly, the SVG resize handle scales nicely as the page is zoomed, or on high-DPI screens. At the moment, the nice SVG resize handle is removed by JavaScript, but we need to wait a little while for everyone to get the new HTML cached before changing that.
* js: Remove a JavaScript construct that confused emcc -O3Ben Harris2022-12-02
|
* Document how Enter and Space are handled in the mid-endBen Harris2022-11-30
| | | | | They've been canonicalised to CURSOR_SELECT and CURSOR_SELECT2 since 2008.
* js: Allow for putting a resize handle in HTMLBen Harris2022-11-29
|
* Developer doc correction: list.c is not generated by Perl any moreBen Harris2022-11-29
|
* js: Remove support for creating the status bar in JavaScriptBen Harris2022-11-28
| | | | Now we depend on its being in the HTML.
* js: Don't word-wrap the status barBen Harris2022-11-28
| | | | | | | | | With word-wrapping disabled, long status-bar texts fall off the right-hand end rather than wrapping onto an invisible second line. This is less confusing because it makes the overflow more obvious. I've also turned on "text-overflow: ellipsis" for extra obviousness. Finally, this also the need to explicitly set the height of the status bar, not that that was doing any harm.
* Update current-as-of commit ID in developer docsBen Harris2022-11-27
| | | | I think I've made all the updates necessary already.
* js: Remove "width" and "height" attributes from HTML <canvas>Ben Harris2022-11-27
| | | | | | | | They were set to "1px", which isn't a valid value since they're meant to be integers. Since they weren't valid, they were ignored. This doesn't seem to have caused any trouble, so they may as well be removed. In any case, the canvas is invisible until after its size has been set by JavaScript.
* js: Hide menus and resize handle when printingBen Harris2022-11-26
|
* js: Remove alpha channel from almost all our canvasesBen Harris2022-11-25
| | | | | | | | | | Specifying the { alpha: false } option when creating a rendering context tells the browser that we won't use transparency, and the standard puzzle canvases, along with blitters, are all opaque. No obvious effect, but the MDN suggests that this should reduce CPU usage. The one exception here is the resize handle, which actually is transparent.
* js: Correct co-ordinate-mapping function for what CSS actually doesBen Harris2022-11-25
| | | | | | | | | By default, CSS uses "object-fit: fill", which means that an object is independently scaled in both dimensions to fit its containing box. This is simpler than what I'd assumed (which was "object-fill: contain"). Obviously, the HTML could be changed to use a different object-fit, in which case this code would have to detect it, but for now following the CSS default is more correct than not.
* flip: Set a lower bound on the size of little diagramsBen Harris2022-11-25
| | | | This ensures that they don't vanish entirely and small tile sizes.
* mines: Ensure highlights don't vanish at small tile sizesBen Harris2022-11-25
| | | | | | The highlights for covered squares now have a minimum width of 1 pixel, which means that Mines is comfortably playabale down to about 8 pixel tilesize, below which the numbers become unreadable.
* js: Subtle extra padding for menusBen Harris2022-11-24
| | | | | | | Each menu item has a -0.5px margin so that the borders of adjacent menu items overlap, but we don't actually want the menu items to protrude beyond the containing <ul>. Adding 0.5px of padding to the <ul> achieves that.
* js: If the HTML contains a dialogue-box form, delete itBen Harris2022-11-24
| | | | | | This is so that (given time for caches to expire) I can switch to having a persistent dialogue box in HTML rather than fabricating it from scratch in JavaScript each time it's used.
* js: Disable menu keyboard controls when dialogue box is activeBen Harris2022-11-24
| | | | | I think this is broadly the wrong approach, but it's an improvement until I implement the right one.
* js: More conventional marking of menu item typesBen Harris2022-11-24
| | | | | | | | | | Menu items that open dialogue boxes are now marked with ellipses, while menu items that lead to submenus have pointing triangles. The triangles are implemented as SVG files embedded in data: URLs in the CSS, which is kind of silly but also works really well. There are suitable characters in Unicode, but some of my test systems don't have fonts containing them, so maybe the SVG is better.
* js: Replace status-bar holder in HTML with status bar itselfBen Harris2022-11-23
| | | | This makes the HTML simpler, and will allow for simplifying the JS too.
* js: Add actions for more keys in menusBen Harris2022-11-23
| | | | | | I expect Escape to exit the menu, and SoftRight should do that as well for KaiOS. Backspace goes up one level through the menus, again because that's conventional on KaiOS and not too confusing elsewhere.
* js: Move global keyboard handler to capturing phaseBen Harris2022-11-23
| | | | | | | In the bubbling phase it managed to catch the "Enter" keypress that opened a dialogue box from the menu and use it to close the dialogue box again. I think it's probably reasonable to have it run earlier and just permanently steal any keypresses it wants.
* js: Move focus-tracking to entirely "focus" eventsBen Harris2022-11-23
| | | | | | | | | When we disable a button, it loses focus but doesn't generate a "blur" event. This means our "focus-within" class goes wrong. Instead of relying on "blur" events to remove the class, remove it from any inappropriate elements in the "focus" handler. This requires attaching the handler to the root element of the document, but I've got plans that need that anyway.
* js: Replace :focus-within with JS-maintained .focus-withinBen Harris2022-11-23
| | | | | | | Old browsers (like KaiOS 2.5) don't have :focus-within, but it's pretty easy to replace the pseudo-class with a real .focus-within class maintained by JavaScript event handlers. This is made only marginally fiddlier by the odd fact that "focus" and "blur" events don't bubble.
* js: Add keyboard navigation for menusBen Harris2022-11-23
| | | | | | | Once the input focus is in the menu system (for instance by Shift+Tab from the puzzle), you can move left and right through the menu bar and up and down within each menu. Enter selects a menu item. The current menu item is tracked by giving it the input focus.
* Mid-move icon for CubeBen Harris2022-11-23
|
* Add missing dependency of screenshots on their save filesBen Harris2022-11-23
|
* nullgame: Don't bother blanking the puzzle windowBen Harris2022-11-22
| | | | This is now centralised in the mid-end.
* gtk: Fix a missing "const" qualifier when building with GTK 2Ben Harris2022-11-22
|
* Fix mid-move iconsBen Harris2022-11-22
| | | | | They've been broken since the move to CMake, which had an incorrect variable substitution in the --redo argument.
* js: When removing the status bar, null out its variableBen Harris2022-11-21
| | | | It seems polite to allow it to be garbage-collected.
* js: Tiny comment fixBen Harris2022-11-21
|
* js: Allow status bar to be present in the HTMLBen Harris2022-11-20
| | | | | | | I'm generally in favour of putting HTML in HTML rather the constructing it in JavaScript, and this will allow for simplifying the code eventually. This only changes the JavaScript to make sure that's in people's caches before I change the HTML itself.
* Palisade: scale line thickness unboundedly with tile size.Simon Tatham2022-11-18
| | | | | | | | | | The previous expression for WIDTH defined it, curiously, as (1 + (TILESIZE >= 16) + (TILESIZE >= 32) + (TILESIZE >= 64)) which is roughly logarithmic in tile size, but bounded above by a maximum of 4 pixels. On high-DPI displays this isn't really good enough any more. Now I've set the line thickness to a constant fraction of the tile size (but still bounded below by 1), so it's much easier to see the lines when the puzzle is expanded to extra large size.
* pearl: Return NULL when Backspace or Escape does nothingBen Harris2022-11-18
| | | | | | When there's no drag in progress, cancelling the drag has no effect. Returning NULL lets the front-end know this, which in particular means the Backspace key can leave the app in KaiOS.
* mines: Grammar fix in instructionsBen Harris2022-11-18
|
* Document new new undo/redo keysBen Harris2022-11-16
|
* Extra key mappings: '*' to undo and '#' to redoBen Harris2022-11-15
| | | | | This is what I keep expecting on my phone. Implemented in the mid-end since no backend currently uses those keys.
* js: Create the puzzle resize handle only if the puzzle is resizableBen Harris2022-11-15
| | | | | If there's no resizable div to attach it to, there's not much point in creating the handle and the doing nothing with it.