Repository navigation
hmp-ui sliders and live input, hmp-houses client shim, optional gamemodes pack - #14
Merged
Merged
Conversation
Input dialogs gain a range field (min, max, step, unit) rendered as a slider. input() takes an onChange handler that hears number, range, checkbox and select edits while the dialog is open, each validated against its field on the server, so tuning screens can apply values live and restore them on cancel.
The Framework applies one resource-dependency graph to server and client, so a client-bearing resource cannot depend on a server-only one. Like hmp-mysql, hmp-houses now ships an empty client entry, so resources with a client of their own, such as gamemodes built on house membership, can depend on it.
Complete games built on Foundations get their own home in gamemodes/resources/. They release with the core pack, on its version, as a separate hmp-gamemodes archive, so servers add only the ones they want. The release check covers both roots and refuses a core resource that depends on a gamemode; with no gamemodes yet, no gamemodes pack is built.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Groundwork for shipping complete games on Foundations, starting with Quidditch in a follow-up PR. That needs three things the stack doesn't have yet: sliders that apply live while you drag them (for tuning screens), a way for a client-bearing resource to depend on
hmp-houses, and somewhere optional for gamemodes to live so not every server has to load them.Change
hmp-ui: range fields and live input changes
rangefield: a slider with its value beside it, bounded byminandmax, with an optionalstep(now honoured bynumberfields too) and a shortunitlabel.input(player, dialog, { onChange })reportsnumber,range,checkboxandselectedits while the dialog is still open. A dragged slider reports at most every 100 ms, and its final value is always sent. Text fields still report only on submit.nullon cancel, which is where a tuning screen puts its original values back.onChange, validated on the client.hmp-houses: client dependency shim
The Framework applies one dependency graph to server and client, and
release:checkrefuses a client-bearing resource that depends on a server-only one. Likehmp-mysql,hmp-housesnow ships an empty client entry so such resources can depend on it.Gamemodes: an optional pack
gamemodes/resources/hmp-<name>, as workspaces like any core resource.gamemodes/README.mdcovers what they are, how to install one, and how to add one.hmp-gamemodes-v<version>.zip, with agamemodes.jsonnaming the Foundations version it needs. The container image stays core-only.release:checkcovers both roots: same version, dependencies and priorities, the client-dependency rule, the lockfile and the Dockerfile. A core resource depending on a gamemode is an error, so the core pack always stands alone.Testing
?dev=inputpreview: rendering, throttled drags with the final value sent, checkbox and select changes, and the submitted values.npm run verifypasses: all 28 resources' tests, typecheck, build, smoke and package, withrelease:checkreporting 28 resources and 0 gamemodes.npm ciaccepts the updated lockfile.