-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte accuracy/difficulty dialog #287
Merged
Merged
Conversation
This file contains 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
the only practical upshot of this collapse is that sometimes tech attacks wouldn't expand to show some of the attack rolls. I've adjusted it to match the regular attack rolls
+ take the opportunity to de-serialise operations a tiny bit
subtasks: * separate out {{std-cover-input}} and {{accdiff-total-display}} * rejigger accdiff's data model (again) (we use get total() functions now) * messy UI work for the multi-target section of the acc_diff form
if/when we choose to extend lancer-actor-sheet's EncodedMacroHandler to the whole app, we will be _ready_
we have basic checkbox UI for plugins, but not in the multi-target version of accdiff yet
Eranziel
reviewed
Aug 30, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't finish now, so might as well submit these comments.
and breaks this tippy
* spotter needs to look at lancerActor * we need to do _some_ work to get a valid lancerActor on basic attacks
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.
This branch is a rewrite of (and descendant from) #248.
The main user-facing elements of this branch are the new multi-targetting UI in
acc_diff/
andslidinghud
, and the reroll button on the top right of attack rolls. The main dev-facing element of the branch is the use of svelte for its components.The branch still has an unused
ReactiveForm
in it — an abstract class that can handle reactive handlebars updates on arbitrary javascript data. But, Svelte broadly allows us to develop reactive UI, with components, without having to work around handlebars limitations.The branch also has an unused
SvelteApplication
class in it as well — earlier versions of this branch used it, but now everything in this branch lives in the sliding HUD zone, which we mount directly without using a foundry class intermediary. Still, I can vouch for the pattern captured in that class; it should be useful and usable in the future, to add svelte to different leaf areas of the application.Svelte needs to be informed whenever the backing data changes. The normal approach is to compute your dependent data within the svelte component; in which case the change notifications get fed through automatically. In the accdiff modal's case, since the backing data computes its own dependencies, we need to tell svelte about these dependency arrows:
Svelte also scopes css by default. That is, a css rule
.foo { ... }
means that svelte will output.foo.[autogeneratedid] { ... }
and add that autogenerated class to every element in the same component it knows to havefoo
. The intent is that you can write per-component css without worrying about whether these class names are reused across the application. However, there are cases where you want to disable this behaviour. In our application, that means either adding those rules tolancer.scss
, or using svelte's:global(...)
selector — there's a few examples of the latter in this branch.Svelte transitions are very slick, but there's some things to be aware of.
{#key}
block to destroy and recreate it..grid-enforcement
class in this branch is a first pass at that.crossfade
. Crossfade is very powerful and a lot of patterns are very easy to animate with it, but like all powerful tools, it may behave in ways you don't expect if you don't fully understand it.@pyoner/svelte-types
unfortunately exports the same type for both the class and the instance of a svelte component. Be careful about that.We use
vite-plugin-checker
to provide typescript checking in a nice little window during the vite devserver, but it doesn't supportsvelte-check
. I've included a personal copy ofvite-plugin-checker
that does (upstream PR at fi3ework/vite-plugin-checker#73), but it definitely has bugs. To disable it, comment outplugins.checker.svelte
invite.config.ts
.svelte-language-server
is included in this PR and is what backs bothnpx svelte-check
and the above checker plugin. You may wish to investigate integrating it with your IDE.There's a few other things, but the Svelte API docs are comprehensive and excellent.
Miscellaneous other stuff that ended up getting stuffed into this branch
runEncodedMacro
to remember selections in the form for the reroll.chat-button
handler forrunEncodedMacro
logic such that the entire target can be clickedrunEncodedMacro
to use a whitelist of allowed macros, instead ofeval
Oh, and the AccDiff form now has a serializable plugin system, which in theory would allow third-parties to implement their own extensions to the window. Invisibility and Spotter are implemented using this system.