Skip to content

Commit

Permalink
pre 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
averrin committed Jul 1, 2022
1 parent 979e609 commit cbbc1a7
Show file tree
Hide file tree
Showing 18 changed files with 1,001 additions and 701 deletions.
Binary file modified assets/actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sequencer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/crosshair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"consola": "^2.15.3",
"daisyui": "^2.17.0",
"reflect-metadata": "^0.1.13",
"scoped-eval": "^0.4.2",
"svelte": "^3.46.0",
"svelte-color-picker": "^1.0.7",
"svelte-copy-to-clipboard": "^0.2.5",
"svelte-icons": "^2.1.0",
"svelte-select": "^5.0.0-beta.14",
"svelte-sortable": "^0.1.0",
Expand Down
125 changes: 96 additions & 29 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const SETTINGS = {
RESOLUTION: "resolution",
SEQUENCES: "sequences",
SHOW_SEQUENCER: "show-sequencer",

DEFAULT_TAB: "default-tab",
MANUAL_MODE: "warpgate-mode",
};

export const HOOKS = [
Expand All @@ -26,6 +29,15 @@ export const HOOKS = [
// 'renderTokenActionHUD',
];

export const tabs = [
{ mode: "actions", title: "Actions" },
{ mode: "selection", title: "Selection" },
{
mode: "sequencer",
title: "Sequencer",
badge: "<span class='ui-badge ui-mx-1' style='background-color: indianred'>beta</span>",
}
];

export const actionTypes = [
{ id: 'execute', label: 'Execute trigger', group: 'Active Tiles', require: "matt" },
Expand All @@ -42,6 +54,7 @@ export const stepSpecs = [
{ id: 'sound', label: 'Sound' },
{ id: 'wait', label: 'Wait', args: [{ type: 'int', label: 'ms' }] },
{ id: 'macro', label: 'Macro', args: [{ type: 'macro', label: 'name' }] },
{ id: 'thenDo', label: 'thenDo', args: [{ type: 'code', label: 'func' }] },
];

export const modifierSpecs = [
Expand All @@ -57,59 +70,62 @@ export const modifierSpecs = [

{ id: 'stretchTo', group: 'effect', args: [{ type: 'position', label: 'pos' }], cat: 'Move' },
{ id: 'attachTo', group: 'effect', args: [{ type: 'token', label: 'token' }], cat: 'Move' },
{ id: 'moveTowards', group: 'effect', args: [{ type: 'position', label: 'pos' }], cat: 'Move' },
{ id: 'moveTowards', group: 'effect', args: [{ type: 'position', label: 'pos' }, { type: "ease", label: "ease", option: true }], cat: 'Move' },
{ id: 'moveSpeed', group: 'effect', args: [{ type: 'int', label: 'speed' }], cat: 'Move' },
{ id: 'snapToGrid', group: 'effect', args: [{ type: 'bool', label: 'val' }], cat: 'Move' },

{ id: 'rotateTowards', group: 'effect', args: [{ type: 'position', label: 'pos' }, { type: 'int', label: 'duration', option: true }], cat: 'Rotate' },
{ id: 'rotate', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateIn', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateOut', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInCubic"})
{ id: 'rotateTowards', group: 'effect', args: [{ type: 'position', label: 'pos' }, { type: 'int', label: 'duration', option: true }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' },
{ id: 'rotate', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateIn', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateOut', group: 'effect', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInCubic"})
{ id: 'zeroSpriteRotation', group: 'effect', args: [{ type: 'bool', label: 'val' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' },

{ id: 'fadeIn', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeOut', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' },
{ id: 'fadeIn', group: 'effect', args: [{ type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeOut', group: 'effect', args: [{ type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Fade' },

{ id: 'repeats', group: 'effect', args: [{ type: 'int', label: 'count' }, { type: 'int', label: 'delay min' }, { type: 'int', label: 'delay max' }], cat: 'Generic' },
{ id: 'delay', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'waitUntilFinished', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'async', group: 'effect', args: [], cat: 'Generic' },
{ id: 'duration', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'playIf', group: 'effect', args: [{ type: 'expression', label: 'func' }], cat: 'Generic' },

{ id: 'randomizeMirrorY', group: 'effect', args: [], cat: "Generic" },
{ id: 'belowTokens', group: 'effect', args: [], cat: "Generic" },
{ id: 'locally', group: 'effect', args: [], cat: "Generic" },
{ id: 'noLoop', group: 'effect', args: [{ type: 'bool', label: 'val' }], cat: "Generic" },

{ id: 'randomizeMirrorY', group: 'effect', args: [] },
{ id: 'belowTokens', group: 'effect', args: [] },
{ id: 'locally', group: 'effect', args: [] },
{ id: 'noLoop', group: 'effect', args: [{ type: 'bool', label: 'val' }] },
{ id: 'snapToGrid', group: 'effect', args: [{ type: 'bool', label: 'val' }] },
{ id: 'zeroSpriteRotation', group: 'effect', args: [{ type: 'bool', label: 'val' }] },
{ id: 'persist', group: 'effect', args: [{ type: 'bool', label: 'val' }] },
{ id: 'startTime', group: 'effect', args: [{ type: 'int', label: 'ms' }] },
{ id: 'startTimePerc', group: 'effect', args: [{ type: 'float', label: 'val' }] },
{ id: 'endTime', group: 'effect', args: [{ type: 'int', label: 'ms' }] },
{ id: 'endTimePerc', group: 'effect', args: [{ type: 'float', label: 'val' }] },
{ id: 'extraEndDuration', group: 'effect', args: [{ type: 'int', label: 'ms' }] },
{ id: 'timeRange', group: 'effect', args: [{ type: 'int', label: 'ms' }, { type: 'int', label: 'ms' }] },
{ id: 'persist', group: 'effect', args: [{ type: 'bool', label: 'val' }], cat: "Time" },
{ id: 'startTime', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: "Time" },
{ id: 'startTimePerc', group: 'effect', args: [{ type: 'float', label: 'val' }], cat: "Time" },
{ id: 'endTime', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: "Time" },
{ id: 'endTimePerc', group: 'effect', args: [{ type: 'float', label: 'val' }], cat: "Time" },
{ id: 'extraEndDuration', group: 'effect', args: [{ type: 'int', label: 'ms' }], cat: "Time" },
{ id: 'timeRange', group: 'effect', args: [{ type: 'int', label: 'ms' }, { type: 'int', label: 'ms' }], cat: "Time" },

//Animation
{ id: 'on', group: 'animation', args: [{ type: 'token', label: 'token' }], cat: 'Required' },

{ id: 'repeats', group: 'animation', args: [{ type: 'int', label: 'count' }, { type: 'int', label: 'delay min' }, { type: 'int', label: 'delay max' }] },
{ id: 'repeats', group: 'animation', args: [{ type: 'int', label: 'count' }, { type: 'int', label: 'delay min' }, { type: 'int', label: 'delay max' }], cat: "Generic" },
{ id: 'delay', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'waitUntilFinished', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'async', group: 'animation', args: [], cat: 'Generic' },
{ id: 'duration', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'playIf', group: 'animation', args: [{ type: 'expression', label: 'func' }], cat: 'Generic' },

{ id: 'fade', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeIn', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeOut', group: 'animation', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' },

{ id: 'moveTowards', group: 'animation', args: [{ type: 'position', label: 'pos' }], cat: 'Move' },
{ id: 'moveTowards', group: 'animation', args: [{ type: 'position', label: 'pos' }, { type: "ease", label: "ease", option: true }], cat: 'Move' },
{ id: 'moveSpeed', group: 'animation', args: [{ type: 'int', label: 'speed' }], cat: 'Move' },
{ id: 'snapToGrid', group: 'animation', args: [{ type: 'bool', label: 'val' }], cat: 'Move' },
{ id: 'closestSquare', group: 'animation', args: [{ type: 'bool', label: 'val' }], cat: 'Move' },

{ id: 'rotateTowards', group: 'animation', args: [{ type: 'position', label: 'pos' }, { type: 'int', label: 'duration', option: true }], cat: 'Rotate' },
{ id: 'rotate', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateIn', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateOut', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }], cat: 'Rotate' }, // {ease: "easeInCubic"})
{ id: 'rotateTowards', group: 'animation', args: [{ type: 'position', label: 'pos' }, { type: 'int', label: 'duration', option: true }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' },
{ id: 'rotate', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateIn', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInOutCubic"})
{ id: 'rotateOut', group: 'animation', args: [{ type: 'int', label: 'deg' }, { type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Rotate' }, // {ease: "easeInCubic"})

{ id: 'hide', group: 'animation', args: [{ type: 'bool', label: 'val' }], cat: 'Visibility' },
{ id: 'show', group: 'animation', args: [{ type: 'bool', label: 'val' }], cat: 'Visibility' },
Expand All @@ -120,14 +136,15 @@ export const modifierSpecs = [
{ id: 'file', group: 'sound', args: [{ type: 'sound_file', label: 'file' }], cat: "Required" },
{ id: 'volume', group: 'sound', args: [{ type: 'int', label: 'min' }, { type: 'int', label: 'max' }], cat: "Generic" },

{ id: 'repeats', group: 'sound', args: [{ type: 'int', label: 'count' }, { type: 'int', label: 'delay min' }, { type: 'int', label: 'delay max' }] },
{ id: 'repeats', group: 'sound', args: [{ type: 'int', label: 'count' }, { type: 'int', label: 'delay min' }, { type: 'int', label: 'delay max' }], cat: "Generic" },
{ id: 'delay', group: 'sound', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'waitUntilFinished', group: 'sound', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' },
{ id: 'async', group: 'sound', args: [], cat: 'Generic' },
{ id: 'duration', group: 'sound', args: [{ type: 'int', label: 'ms' }], cat: 'Generic' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'playIf', group: 'sound', args: [{ type: 'expression', label: 'func' }], cat: 'Generic' },

{ id: 'fadeInAudio', group: 'sound', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeOutAudio', group: 'sound', args: [{ type: 'int', label: 'ms' }], cat: 'Fade' },
{ id: 'fadeInAudio', group: 'sound', args: [{ type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Fade' }, //1500, {ease: "easeOutCubic", delay: 500})
{ id: 'fadeOutAudio', group: 'sound', args: [{ type: 'int', label: 'ms' }, { type: "ease", label: "ease", option: true }], cat: 'Fade' },
];

export const argSpecs = [
Expand All @@ -138,6 +155,7 @@ export const argSpecs = [
{ value: "#target.first", label: "First Target" },
{ value: "#target.last", label: "Last Target" },
{ value: "#manual", label: "Manual" },
{ value: [], label: "Tagger" },
]
},
{
Expand All @@ -146,6 +164,18 @@ export const argSpecs = [
{ value: "#controlled.last", label: "Last Controlled" },
{ value: "#target.first", label: "First Target" },
{ value: "#target.last", label: "Last Target" },
{ value: [], label: "Tagger" },
]
},
{
id: "targets", options: [
{ value: "#controlled.all", label: "All Controlled" },
{ value: "#controlled.first", label: "First Controlled" },
{ value: "#controlled.last", label: "Last Controlled" },
{ value: "#target.all", label: "All Targets" },
{ value: "#target.first", label: "First Target" },
{ value: "#target.last", label: "Last Target" },
{ value: [], label: "Tagger" },
]
},
{
Expand All @@ -159,4 +189,41 @@ export const argSpecs = [
{ id: "int" },
{ id: "float" },
{ id: "macro" },
{ id: "code" },
{ id: "expression" },
{
id: "ease", options: [
{ value: "linear", label: "linear" },
{ value: "easeInSine", label: "InSine" },
{ value: "easeOutSine", label: "OutSine" },
{ value: "easeInOutSine", label: "InOutSine" },
{ value: "easeInQuad", label: "InQuad" },
{ value: "easeOutQuad", label: "OutQuad" },
{ value: "easeInOutQuad", label: "InOutQuad" },
{ value: "easeInCubic", label: "InCubic" },
{ value: "easeOutCubic", label: "OutCubic" },
{ value: "easeInOutCubic", label: "InOutCubic" },
{ value: "easeInQuart", label: "InQuart" },
{ value: "easeOutQuart", label: "OutQuart" },
{ value: "easeInOutQuart", label: "InOutQuart" },
{ value: "easeInQuint", label: "InQuint" },
{ value: "easeOutQuint", label: "OutQuint" },
{ value: "easeInOutQuint", label: "InOutQuint" },
{ value: "easeInExpo", label: "InExpo" },
{ value: "easeOutExpo", label: "OutExpo" },
{ value: "easeInOutExpo", label: "InOutExpo" },
{ value: "easeInCirc", label: "InCirc" },
{ value: "easeOutCirc", label: "OutCirc" },
{ value: "easeInOutCirc", label: "InOutCirc" },
{ value: "easeInBack", label: "InBack" },
{ value: "easeOutBack", label: "OutBack" },
{ value: "easeInOutBack", label: "InOutBack" },
{ value: "easeInElastic", label: "InElastic" },
{ value: "easeOutElastic", label: "OutElastic" },
{ value: "easeInOutElastic", label: "InOutElastic" },
{ value: "easeInBounce", label: "InBounce" },
{ value: "easeOutBounce", label: "OutBounce" },
{ value: "easeInOutBounce", label: "InOutBounce" },
]
}
];
29 changes: 29 additions & 0 deletions src/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,33 @@ export function initSettings(app) {
type: Number,
onChange: debouncedReload
});

game.settings.register(moduleId, SETTINGS.DEFAULT_TAB, {
name: "Default tab",
hint: "it will be selected on start",
scope: "client",
config: true,
choices: {
actions: 'Actions',
selection: 'Selection',
sequencer: 'Sequencer'
},
default: 'actions',
type: String,
});

game.settings.register(moduleId, SETTINGS.MANUAL_MODE, {
name: "Position picker snapping mode",
hint: "",
scope: "client",
config: true,
choices: {
'-1': "Grid centers",
'0': "No snapping",
'1': "Intersections",
'2': "Intersections and centers"
},
default: 2,
type: Number,
});
}
23 changes: 20 additions & 3 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,35 @@
}

.svelte-select {
min-width: 200px;
min-width: 150px;
width: fit-content;
max-width: 600px;
border-radius: var(--rounded-btn, 0.5rem) !important;
border-radius: var(--rounded-btn, 0.5rem);
background: #fff !important;

input, .selection {
font-size: 1rem !important;
}
}

.ui-input-group .svelte-select:first-child,
.ui-input-group .svelte-tags-input-layout:first-child {
border-top-left-radius: var(--rounded-btn, 0.5rem);
border-top-right-radius: 0;
border-bottom-left-radius: var(--rounded-btn, 0.5rem);
border-bottom-right-radius: 0;
}

.ui-input-group .svelte-select:last-child,
.ui-input-group .svelte-tags-input-layout:last-child {
border-top-left-radius: 0;
border-top-right-radius: var(--rounded-btn, 0.5rem);
border-bottom-left-radius: 0;
border-bottom-right-radius: var(--rounded-btn, 0.5rem);
}
.ui-input-lg {
border-color: #ddd !important;
height: 40px !important;
height: 42px !important;
}

.ui-text-base {
Expand All @@ -36,6 +52,7 @@

.ui-input {
padding-left: 1rem !important;
/* width: fit-content !important; */
}

.ui-drawer-side ul {
Expand Down
9 changes: 9 additions & 0 deletions src/view/MainApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export default class MainApplication extends SvelteApplication {
}
};

API.findSequence = (name) => {
let seq;
sequences.update(seqs => {
seq = seqs.find(s => s.title == name);
return seqs;
});
return seq;
}

API.playSequence = (name, overrides) => {
let seq;
sequences.update(seqs => {
Expand Down
Loading

0 comments on commit cbbc1a7

Please sign in to comment.