Skip to content

Commit 890db6e

Browse files
committed
0.4.0
1 parent 3743c99 commit 890db6e

13 files changed

Lines changed: 291 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
> Dictionary
99
> (P) - A premium version of that animation is available.
1010
11-
## [0.3.4] - Unreleased
11+
## [0.4.1] - Unreleased
12+
13+
## [0.4.0] - 2024-08-10
1214

1315
### Added
1416

1517
- `atLocation`, `radius`, `constrainedByWalls`, `volume`, and `duration` support for sound effects.
1618
- `equipment:[state]` roll options for `toggle` animations. Use them wisely.
1719
- `templateAsOrigin` preset option for `ranged` animations. Allows to have the template to be the source of the animation, as opposed to the owner token. Allows for template animations detached from token location.
20+
- User Animation Menu (#3)
1821

1922
### Changed
2023

2124
- The Sounds Database to use a two-digit indexes (01, 02, 03, etc.)
2225
- Inner Radiance Torrent (P) to use `templateAsOrigin`.
26+
- Updated dependencies.
2327

2428
### Fixed
2529

@@ -158,7 +162,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
158162
- Moved internal structure
159163
- Pre-release versions to be semver compliant
160164

161-
[Unreleased]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.3...HEAD
165+
[Unreleased]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.4.0...HEAD
166+
[0.4.0]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.3...v0.4.0
162167
[0.3.3]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.2...v0.3.3
163168
[0.3.2]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.1...v0.3.2
164169
[0.3.1]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.0...v0.3.1

lang/en.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"pf2e-graphics": {
3-
"support": "Donate",
3+
"support": {
4+
"1": "Donate!",
5+
"2": "Support Me!",
6+
"3": "Help the Author"
7+
},
48
"modifyItem": "Modify Item Animations",
59
"modifyActor": "Manage Actor Animations",
10+
"modifyUser": "Manage User Animations",
611
"cancel": "Cancel",
712
"easingTooltip": "Learn more about various easing functions here.",
813
"featText": "This feat contains PF2e Graphics-managed Rule Elements, primarily of the TokenImage variety. Opening the Rules tab on this feat may lag your game if the actor contains a lot of forms (ex. Druid).",
@@ -32,6 +37,11 @@
3237
"dev": {
3338
"name": "Developer Mode",
3439
"hint": "Posts to various information to the console. Helpful when you are trying to make your own animations."
40+
},
41+
"userMenu": {
42+
"name": "User Animations",
43+
"hint": "Customize your own personal animations or see others.",
44+
"label": "Open Menu"
3545
}
3646
},
3747
"tooltip": {
@@ -45,6 +55,15 @@
4555
},
4656
"openSheet": "Open Sheet"
4757
},
58+
"userAnimation": {
59+
"tabs": {
60+
"all-animations": "All Animations",
61+
"user-animations": "User Animations",
62+
"tokenimage-manager": "Token Image Manager"
63+
},
64+
"toggle": "Toggle Predicates on and off, allowing you to preview the token change.",
65+
"switch": "See the Effect the rule is predicated onto, or the predicate data itself."
66+
},
4867
"actorAnimation": {
4968
"openFeat": "Open",
5069
"displayFeat": "Display Feat on Character Sheet",
@@ -76,4 +95,4 @@
7695
"self-effect": "'Use' Effect"
7796
}
7897
}
79-
}
98+
}

module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"id": "sequencer",
3737
"type": "module",
3838
"compatibility": {
39-
"minimum": "3.2.12"
39+
"minimum": "3.2.14"
4040
}
4141
}
4242
],
@@ -67,4 +67,4 @@
6767
"changelog": "https://github.com/MrVauxs/pf2e-graphics/blob/main/CHANGELOG.md",
6868
"manifest": "https://raw.githubusercontent.com/MrVauxs/pf2e-graphics/main/module.json",
6969
"download": "https://github.com/MrVauxs/pf2e-graphics/archive/refs/heads/main.zip"
70-
}
70+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/settings.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import UserAnimationsShim from './view/UserAnimations'
12
import { TJSGameSettings, TJSLiveGameSettings } from '#runtime/svelte/store/fvtt/settings'
23

34
const gameSettings = new TJSGameSettings('pf2e-graphics')
@@ -81,4 +82,13 @@ Hooks.on('init', () => {
8182
gameSettings.registerAll(settingsData, true)
8283

8384
settings = new TJSLiveGameSettings(gameSettings) as typeof settings
85+
86+
game.settings.registerMenu('pf2e-graphics', 'userAnimations', {
87+
name: 'pf2e-graphics.settings.userMenu.name',
88+
hint: 'pf2e-graphics.settings.userMenu.hint',
89+
label: 'pf2e-graphics.settings.userMenu.label',
90+
icon: 'fas fa-user',
91+
type: UserAnimationsShim,
92+
restricted: false,
93+
})
8494
})

src/storage/presets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export const presets = {
272272
helpers.parseOffsetEmbedded(options?.atLocation, source, target),
273273
)
274274

275-
if (options?.sound) {
275+
if (options?.sound?.file) {
276276
const sound = seq.sound()
277277
helpers.genericSoundFunction(sound, item, target, options.sound)
278278
}
@@ -308,7 +308,7 @@ export const presets = {
308308

309309
helpers.genericSequencerFunctions(section, item, target, options)
310310

311-
if (options?.sound) {
311+
if (options?.sound?.file) {
312312
const sound = seq.sound()
313313
helpers.genericSoundFunction(sound, item, target, options.sound)
314314
}
@@ -344,7 +344,7 @@ export const presets = {
344344

345345
helpers.genericSequencerFunctions(result, item, affectedToken, options)
346346

347-
if (options?.sound) {
347+
if (options?.sound?.file) {
348348
const sound = seq.sound()
349349
helpers.genericSoundFunction(sound, item, affectedToken, options.sound)
350350
}
@@ -365,7 +365,7 @@ export const presets = {
365365

366366
helpers.genericSequencerFunctions(section, item, target, options)
367367

368-
if (options?.sound) {
368+
if (options?.sound?.file) {
369369
const sound = seq.sound()
370370
helpers.genericSoundFunction(sound, item, target, options.sound)
371371
}

src/utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,15 @@ export function mergeObjectsConcatArrays<T extends MergeableObject, U extends Me
113113

114114
return result as T & U
115115
}
116+
117+
export function kofiButton(buttons: any[]) {
118+
buttons.unshift({
119+
icon: 'fas fa-mug-hot ko-fi',
120+
class: 'hover:underline',
121+
label: `pf2e-graphics.support.${Sequencer.Helpers.random_int_between(1, 4)}`,
122+
onclick: () => {
123+
window.open('https://ko-fi.com/mrvauxs', '_blank')
124+
},
125+
})
126+
return buttons
127+
}

src/view/ActorAnimations/ActorAnimationsApp.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'
22

33
import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
4+
import { kofiButton } from 'src/utils'
45
import BasicAppShell from './ActorAnimationsShell.svelte'
56

67
interface actorAnimationsOptions {
@@ -40,14 +41,7 @@ export default class actorAnimationsApp extends SvelteApplication {
4041

4142
override _getHeaderButtons() {
4243
const buttons = super._getHeaderButtons()
43-
buttons.unshift({
44-
icon: 'fas fa-mug-hot ko-fi',
45-
class: '',
46-
label: 'pf2e-graphics.support',
47-
onclick: () => {
48-
window.open('https://ko-fi.com/mrvauxs', '_blank')
49-
},
50-
})
44+
kofiButton(buttons)
5145
return buttons
5246
}
5347
}

src/view/ItemAnimations/ItemAnimationsApp.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'
2-
31
import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
2+
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'
3+
import { kofiButton } from 'src/utils'
44
import BasicAppShell from './ItemAnimationsShell.svelte'
55

66
interface ItemAnimationsOptions {
@@ -40,14 +40,7 @@ export default class ItemAnimationsApp extends SvelteApplication {
4040

4141
override _getHeaderButtons() {
4242
const buttons = super._getHeaderButtons()
43-
buttons.unshift({
44-
icon: 'fas fa-mug-hot ko-fi',
45-
class: '',
46-
label: 'pf2e-graphics.support',
47-
onclick: () => {
48-
window.open('https://ko-fi.com/mrvauxs', '_blank')
49-
},
50-
})
43+
kofiButton(buttons)
5144
return buttons
5245
}
5346
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'
2+
3+
import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
4+
import { kofiButton } from 'src/utils'
5+
import BasicAppShell from './UserAnimationsShell.svelte'
6+
7+
interface UserAnimationsOptions {
8+
data: {
9+
user: UserPF2e | null
10+
}
11+
}
12+
13+
export default class UserAnimationsApp extends SvelteApplication {
14+
constructor(options: ConstructorApplicationOptions & UserAnimationsOptions) {
15+
super()
16+
17+
if (options.data) {
18+
foundry.utils.mergeObject(this.options, { svelte: { props: options.data } })
19+
}
20+
}
21+
22+
static override get defaultOptions(): CombinedSvelteApplicationOptions {
23+
return foundry.utils.mergeObject(super.defaultOptions, {
24+
...super.defaultOptions,
25+
title: 'pf2e-graphics.modifyUser', // Automatically localized from `lang/en.json`.
26+
width: 800,
27+
height: 600,
28+
classes: ['pf2e-g'],
29+
id: 'pf2e-graphics-modify-user',
30+
resizable: true,
31+
32+
svelte: {
33+
class: BasicAppShell,
34+
target: document.body,
35+
intro: true,
36+
props: {
37+
user: null,
38+
},
39+
},
40+
})
41+
}
42+
43+
override _getHeaderButtons() {
44+
const buttons = super._getHeaderButtons()
45+
kofiButton(buttons)
46+
return buttons
47+
}
48+
}

0 commit comments

Comments
 (0)