Skip to content
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 95 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
0be56ca
rewrite accdiff dialog as a FormApplication, so it has a data model
SohumB Jul 13, 2021
28ca3a2
not sure why this collapse was there before
SohumB Jul 13, 2021
0542ac8
factor out common code between tech and weapon attacks
SohumB Jul 13, 2021
f46b876
implement multi-target acc/diff and cover in the acc_diff form
SohumB Jul 13, 2021
914676e
split out the reactive form logic into an abstract class
SohumB Jul 13, 2021
591ac37
simplify a bit of promise logic
SohumB Jul 13, 2021
29b5f86
restructure attack macros to allow reroll accdiff data
SohumB Jul 13, 2021
77c26bb
give the accdiff code the tokens, rather than just the actors
SohumB Jul 14, 2021
0d1d909
restructure AccDiffData to have a coherent serialization story
SohumB Jul 14, 2021
0d79b68
encode a reroll macro into attack chat cards
SohumB Jul 14, 2021
14f88e1
ev.target is the innermost clicked element, not the .chat-button
SohumB Jul 14, 2021
42cadb1
maybe a small animation to let people know it's clickable?
SohumB Jul 14, 2021
d543c06
three columns for the multitarget row
SohumB Jul 14, 2021
ed73099
rewrite encoded macros to be restricted to a whitelist
SohumB Jul 14, 2021
99800d4
bugfix: structure damage macro was broken
SohumB Jul 14, 2021
a6db06e
the 1-target case looks nicer without the duplicated UI
SohumB Jul 14, 2021
fd66eff
woops — drop handler also depends on the old LancerMacroData defn
SohumB Jul 14, 2021
5dfcdd3
marking this as lancer-macro does nothing right now, but in prep
SohumB Jul 14, 2021
6c21fc1
restructure accdiff datamodel: separate weapon & default base target
SohumB Jul 14, 2021
998b7c2
let's be more explicit on the one-target window, using it as a teach
SohumB Jul 14, 2021
53dd2bb
bugfix: target is a LancerTokenDocument here, not a LancerToken
SohumB Jul 14, 2021
c9a4b5f
consume lockon on the data model/rolling side, w/ 1-target UI
SohumB Jul 14, 2021
04ebc7c
simplify {{std-cover-input}} a bit
SohumB Jul 14, 2021
7400b7b
kill some of the duplication in acc_diff.hbs with an inline partial
SohumB Jul 14, 2021
24b082a
UI for lockon on the multi-target accdiff modal
SohumB Jul 15, 2021
13a9522
hey let's actually load in persisted `consumeLockOn`s, huh?
SohumB Jul 15, 2021
1bcc5de
move to io-ts serialization, in preparation for plugins
SohumB Jul 16, 2021
1cb4658
plugin framework, and Invisibility as a plugin
SohumB Jul 16, 2021
afe309f
some comments and cleanup in invisibility / the plugin interface
SohumB Jul 16, 2021
16391f2
making it the default export is nicer
SohumB Jul 16, 2021
a024931
let plugins see the item that started the roll
SohumB Jul 16, 2021
a78b39c
allow plugins to have no ui
SohumB Jul 16, 2021
682e3df
basic Spotter plugin with no ui and a hacky adjacency calculation
SohumB Jul 16, 2021
aed6c72
nicer roll rendering: {roll} doesn't collapse the roll, (roll) does
SohumB Jul 17, 2021
6913f2d
add spaces to the bonus for consistency
SohumB Jul 17, 2021
a0a9b4c
did you know foundry just has special syntax for coins
SohumB Jul 18, 2021
85253fa
some css fixes for the accdiff window
SohumB Jul 23, 2021
03dd7dd
dropdown for plugin UIs in the multi-target dialog
SohumB Jul 23, 2021
86d7f6a
use non-breaking spaces inside labels
SohumB Jul 23, 2021
5947e10
give spotter a UI (though no override)
SohumB Jul 23, 2021
b0665d1
use opacity to mark disabled, instead of color
SohumB Jul 23, 2021
0272746
implement impaired in the core (not as a plugin)
SohumB Jul 23, 2021
dbb52bc
implement rerolls for tech attacks
SohumB Jul 23, 2021
02013f9
Merge branch 'dev-1.0' into acc-diff-updates
SohumB Aug 6, 2021
5ff4141
Merge branch 'dev-1.0' into acc-diff-updates
SohumB Aug 10, 2021
eb13d5e
Merge branch 'dev-1.0' into acc-diff-updates
SohumB Aug 11, 2021
8badeb8
Merge branches 'acc-diff-updates' and 'vite-build' into svelte-accdiff
SohumB Aug 17, 2021
62fa8c6
dynamically import everything under accdiff as needed
SohumB Aug 5, 2021
78c23d5
add svelte to the build
SohumB Aug 4, 2021
7569acb
rewrite accdiff as a svelte component
SohumB Aug 4, 2021
5afbf3e
move css into the svelte components, to scope them as possible
SohumB Aug 5, 2021
e829003
remove the now-extraneous handlebars helpers/templates
SohumB Aug 5, 2021
8804d64
unnecessarily fancy transitions
SohumB Aug 11, 2021
2e00a8c
bugfix: actually allow id to be sent in as props
SohumB Aug 23, 2021
f4180bb
bugfix: just in case this is a promise
SohumB Aug 23, 2021
443fc20
typefix: this is a bit messy, but Component is still better than any
SohumB Aug 23, 2021
1c0aff3
bugfix: actually this is what svelte understands as dependency arrows
SohumB Aug 24, 2021
97d5f0c
typefix: t.InputOf is just unknown
SohumB Aug 25, 2021
f6b6c86
make hydrate slightly more coherent
SohumB Aug 25, 2021
2af87e8
add AccDiffTarget.fromParams
SohumB Aug 25, 2021
f4d1686
clean up svelte-application, provide useful promise methods, support …
SohumB Aug 25, 2021
8fffdac
Merge branch 'dev-1.0' into svelte-accdiff
SohumB Aug 27, 2021
bbcc834
use my version of vite-plugin-checker that supports svelte-check
SohumB Aug 27, 2021
361f555
first pass at a persistent accdiff sliding window
SohumB Aug 25, 2021
2ba6746
split index.ts into data.ts and form.ts
SohumB Aug 27, 2021
9d1225b
sliding hud windows for accdiff
SohumB Aug 28, 2021
879691b
make the window popup way way less aggressive
SohumB Aug 29, 2021
267448e
this function should be three separate functions
SohumB Aug 30, 2021
8712c1b
bugfix: this esc handler was very wrong
SohumB Aug 30, 2021
460b542
bugfix: data should be able to flow in and out of these components
SohumB Aug 30, 2021
ab62420
Merge branch 'dev-1.0' into svelte-accdiff-sliding
SohumB Aug 30, 2021
3a1ddea
Merge branch 'dev-1.0' into svelte-accdiff
SohumB Aug 30, 2021
58347a1
tweak the transitions some
SohumB Aug 30, 2021
d636d60
support cub in findEffect
SohumB Aug 30, 2021
786cb28
preserve target-specific data as targets are refreshed
SohumB Aug 30, 2021
c256065
fade out hudzone on drag/drop
SohumB Aug 30, 2021
4db2efd
pull sliding hud to the top, give it a nice drop shadow
SohumB Aug 30, 2021
1afdbd3
track impaired even when we don't have a weapon (hase rolls)
SohumB Aug 30, 2021
e4b64b3
unused import
SohumB Aug 30, 2021
9f5891f
make the +acc/+diff buttons look nice both under emu and normal
SohumB Aug 30, 2021
3ae7b41
fix total's transitions, and apply a nice little shadow to the card
SohumB Aug 30, 2021
b224ef1
situate the target boxes with a box-shadow
SohumB Aug 30, 2021
7c12cfe
style cover nicely with a moving cover selection arrow
SohumB Aug 30, 2021
c57a4af
remove overflow: hidden from grid-enforcement; it seems unnecessary
SohumB Aug 30, 2021
53ba4ef
handle basic attack rerolls initiated by `refreshTargeting`
SohumB Aug 30, 2021
85184a1
the grid rows in accdiff targets needed a larger gap
SohumB Aug 30, 2021
4cdda1a
add plugin classes, for styling
SohumB Aug 30, 2021
2cc70d6
invisibility animation
SohumB Aug 30, 2021
f701c2e
enable spotter on basic attacks
SohumB Aug 31, 2021
9d33819
fix spotter crashing on adjacent npcs
SohumB Aug 31, 2021
b81c989
swap to mdi-shields for cover iconography
SohumB Aug 31, 2021
8262e59
move prepareStructureSecondaryRollMacro into macros.ts
SohumB Aug 31, 2021
893380a
nope, sorry, I'm changing my mind, 12px is the right amount of px
SohumB Aug 31, 2021
313dea9
bugfix: weapon.plugins is an object, not an array
SohumB Aug 31, 2021
639f18e
removing css-loader and @mdi/font, both now unused
SohumB Aug 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
"license": "",
"devDependencies": {
"@league-of-foundry-developers/foundry-vtt-types": "^0.8.9-2",
"@pyoner/svelte-types": "^3.4.4-2",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.15",
"@tsconfig/svelte": "^2.0.1",
"archiver": "^3.1.1",
"chalk": "^3.0.0",
"css-loader": "^5.2.4",
"fs-extra": "^9.1.0",
"gulp": "^4.0.2",
"gulp-git": "^2.10.1",
Expand All @@ -32,17 +34,22 @@
"prettier": "2.0.5",
"rollup-plugin-visualizer": "^5.5.2",
"sass": "^1.35.2",
"svelte": "^3.41.0",
"svelte-check": "^2.2.4",
"svelte-language-server": "^0.14.5",
"svelte-preprocess": "^4.7.4",
"tslib": "^1.14.1",
"typescript": "^4.3.2",
"vite": "^2.5.1",
"vite-plugin-checker": "^0.3.4",
"vite-plugin-checker": "https://github.com/SohumB/vite-plugin-checker/releases/download/vite-plugin-checker%400.3.5/vite-plugin-checker-0.3.5.tgz",
"yargs": "^15.4.1"
},
"dependencies": {
"@mdi/font": "^5.9.55",
"@types/marked": "^1.2.1",
"aws-amplify": "^4.0.3",
"compare-versions": "^3.6.0",
"fp-ts": "^2.10.5",
"io-ts": "^2.2.16",
"machine-mind": "0.2.0-beta.123",
"marked": "^2.0.3",
"tippy.js": "^6.3.1"
Expand Down
3 changes: 3 additions & 0 deletions public/templates/chat/attack-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<div class="lancer-header mech_weapon medium">
<i class="cci cci-weapon i--m i--light"> </i>
<span>{{ title }}</span>
<a class="chat-button roll-attack lancer-macro" data-macro="{{rerollMacroData}}" title="Reroll this attack">
<i class="fas fa-dice-d20 i--m i--light"></i>
</a>
</div>
<div class="card clipped">
<div class="lancer-mini-header collapse-trigger" data-collapse-id="{{_uuid}}-attacks">{{localize "lancer.chat-card.title.attack"}}</div>
Expand Down
11 changes: 7 additions & 4 deletions public/templates/chat/tech-attack-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
<div class="lancer-header tech medium">
<i class="cci cci-tech-quick i--m i--light"> </i>
<span>TECH ATK{{#if title}} :: {{title}}{{/if}}</span>
<a class="chat-button roll-attack lancer-macro" data-macro="{{rerollMacroData}}" title="Reroll this attack">
<i class="fas fa-dice-d20 i--m i--light"></i>
</a>
</div>
<div class="card clipped">
<div class="lancer-mini-header collapse-trigger" data-collapse-id="{{_uuid}}-attacks">
{{localize "lancer.chat-card.title.attack"}}
</div>
{{#each attacks as |attack key|}}
<div
class="dice-roll lancer-dice-roll collapse"
data-collapse-id="{{../_uuid}}-attacks"
>
<div
class="dice-roll lancer-dice-roll collapse"
data-collapse-id="{{../_uuid}}-attacks"
>
<div class="dice-result">
<div class="dice-formula lancer-dice-formula flexrow">
<span style="text-align: left; margin-left: 5px;">{{ attack.roll.formula }}</span>
Expand Down
107 changes: 0 additions & 107 deletions public/templates/window/acc_diff.hbs

This file was deleted.

6 changes: 6 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ declare global {
game: never;
}

interface FlagConfig {
ActiveEffect: {
core?: { statusId?: string };
};
}

namespace Game {
interface SystemData<T> {
id: "lancer";
Expand Down
118 changes: 30 additions & 88 deletions src/lancer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ button {

.lancer-hit-thumb {
width: 50px;
min-width: 50px;
margin-right: 4px;
border-right: none;
border-left: none;
Expand Down Expand Up @@ -2026,94 +2027,6 @@ a.action {
}
}




// Acc_Diff
.accdiff-grid {
display: flex;
justify-content: space-between;

.container {
display: flex;
position: relative;
padding-left: 30px;
margin-top: 12px;
margin-bottom: 4px;
font-size: 0.9em;
user-select: none;
align-items: center;
}

/* Hide the browser's default checkbox */
.container input {
position: absolute;
opacity: 0 !important;
height: 0;
width: 0;
}

.checkmark {
position: absolute;
left: 5px;
height: 20px;
width: 20px;
background-color: #a9a9a9;
cursor: pointer;
}

input[disabled] ~ .checkmark {
background-color: #313131;
cursor: unset;
}

.container:hover input:not([disabled]) ~ .checkmark {
background-color: #757575;
}

.container input:checked:not([disabled]) ~ .checkmark {
background-color: var(--main-theme-color, fuchsia);
}

.checkmark:after {
content: "";
position: absolute;
display: none;
}
.container input:checked ~ .checkmark:after {
display: block;
}

.card.clipped {
display: flex;
flex-direction: row;
align-items: center;
padding: 8px 8px 8px 16px;
background-color: var(--main-theme-color, fuchsia);
color: white;
width: fit-content;
}
}

.accdiff-other-grid {
width: 100%;
padding-left: 5px;
display: flex;
justify-content: center;
}

.accdiff-weight {
justify-content: center;
font-weight: bold;
}

.accdiff-footer {
padding-top: 8px;
padding-bottom: 4px;
margin-top: 12px;
border-top: 1px solid #782e22;
}

// V-IMPORTS
.white--text {
color: #fff !important;
Expand Down Expand Up @@ -2198,6 +2111,24 @@ div[data-tab="system"] > .settings-list > div:nth-last-child(-n + 4) {
align-self: center;
}

// needed to override a builtin that removes all shadows from the sidebar
#sidebar a.chat-button:hover {
text-shadow: 0 0 8px red;
}

#sidebar a.chat-button {
animation: pulse 1200ms ease 1s 8 alternate;
}

@keyframes pulse {
0% {
text-shadow: none;
}
100% {
text-shadow: 0 0 8px red;
}
}

/*
We will add the "dragging-_____" class to the document root whenever we're dragging a type.
.For instance, dragging-mech_weapon
Expand Down Expand Up @@ -2247,3 +2178,14 @@ Here, this means we want to allow for drag stuff etc to show contextually if:
text-transform: uppercase;
font-family: Roboto,sans-serif !important;
}

/* this forces all its children to share the same space,
which is useful for svelte transitions */
.grid-enforcement {
display: grid;
}

.grid-enforcement > * {
grid-column: 1/2;
grid-row: 1/2;
}
Loading