simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Nov 13 14:27:19 GMT 2022


TL;DR:
  a90bb4a js: Better handling of games without presets and/or solve

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2022-11-13 14:27:19

commit a90bb4a4ef9fac5c6185b763aa2cafba9d7c6b12
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=a90bb4a4ef9fac5c6185b763aa2cafba9d7c6b12;hp=5a225bf585ba302dbae1eca567b2070c67ea2981
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sun Nov 13 14:05:55 2022 +0000

    js: Better handling of games without presets and/or solve
    
    Games with neither presets nor configuration (which may only be the Null
    Game) have been slightly broken since the introduction of hierarchical
    preset menus, in that the code to remove the "Type..." menu stopped
    being called then.  My switch to using radio buttons in menus then broke
    them utterly because it's not possible to set the value of an empty
    radio group, causing a crash at startup.
    
    Fix this by detected when there's no preset menu, removing the item from
    the menu bar, and setting the variable that's meant to indicate this has
    been done.
    
    The solve button problem was more subtle, in that only the <button> was
    being hidden and not the <li> containing it, which led to the right border of the menu bar being two pixels thick.  Switch to fully removing
    the <li> from the DOM, like we now do with the presets menu, since that
    also makes my keyboard handler (in another branch) simpler.

 emcc.c     | 17 ++++++++++-------
 emcclib.js | 10 ++++++++--
 2 files changed, 18 insertions(+), 9 deletions(-)



More information about the tartarus-commits mailing list