Skip to content

Commit

Permalink
0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs committed Aug 10, 2024
1 parent 3743c99 commit 890db6e
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 30 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> Dictionary
> (P) - A premium version of that animation is available.
## [0.3.4] - Unreleased
## [0.4.1] - Unreleased

## [0.4.0] - 2024-08-10

### Added

- `atLocation`, `radius`, `constrainedByWalls`, `volume`, and `duration` support for sound effects.
- `equipment:[state]` roll options for `toggle` animations. Use them wisely.
- `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.
- User Animation Menu (#3)

### Changed

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

### Fixed

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

[Unreleased]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.3...HEAD
[Unreleased]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.3...v0.4.0
[0.3.3]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/MrVauxs/pf2e-graphics/compare/v0.3.0...v0.3.1
Expand Down
23 changes: 21 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"pf2e-graphics": {
"support": "Donate",
"support": {
"1": "Donate!",
"2": "Support Me!",
"3": "Help the Author"
},
"modifyItem": "Modify Item Animations",
"modifyActor": "Manage Actor Animations",
"modifyUser": "Manage User Animations",
"cancel": "Cancel",
"easingTooltip": "Learn more about various easing functions here.",
"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).",
Expand Down Expand Up @@ -32,6 +37,11 @@
"dev": {
"name": "Developer Mode",
"hint": "Posts to various information to the console. Helpful when you are trying to make your own animations."
},
"userMenu": {
"name": "User Animations",
"hint": "Customize your own personal animations or see others.",
"label": "Open Menu"
}
},
"tooltip": {
Expand All @@ -45,6 +55,15 @@
},
"openSheet": "Open Sheet"
},
"userAnimation": {
"tabs": {
"all-animations": "All Animations",
"user-animations": "User Animations",
"tokenimage-manager": "Token Image Manager"
},
"toggle": "Toggle Predicates on and off, allowing you to preview the token change.",
"switch": "See the Effect the rule is predicated onto, or the predicate data itself."
},
"actorAnimation": {
"openFeat": "Open",
"displayFeat": "Display Feat on Character Sheet",
Expand Down Expand Up @@ -76,4 +95,4 @@
"self-effect": "'Use' Effect"
}
}
}
}

Check failure on line 98 in lang/en.json

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

Check failure on line 98 in lang/en.json

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"id": "sequencer",
"type": "module",
"compatibility": {
"minimum": "3.2.12"
"minimum": "3.2.14"
}
}
],
Expand Down Expand Up @@ -67,4 +67,4 @@
"changelog": "https://github.com/MrVauxs/pf2e-graphics/blob/main/CHANGELOG.md",
"manifest": "https://raw.githubusercontent.com/MrVauxs/pf2e-graphics/main/module.json",
"download": "https://github.com/MrVauxs/pf2e-graphics/archive/refs/heads/main.zip"
}
}

Check failure on line 70 in module.json

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

Check failure on line 70 in module.json

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found
4 changes: 2 additions & 2 deletions package-lock.json

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

10 changes: 10 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import UserAnimationsShim from './view/UserAnimations'
import { TJSGameSettings, TJSLiveGameSettings } from '#runtime/svelte/store/fvtt/settings'

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

settings = new TJSLiveGameSettings(gameSettings) as typeof settings

game.settings.registerMenu('pf2e-graphics', 'userAnimations', {
name: 'pf2e-graphics.settings.userMenu.name',
hint: 'pf2e-graphics.settings.userMenu.hint',
label: 'pf2e-graphics.settings.userMenu.label',
icon: 'fas fa-user',
type: UserAnimationsShim,
restricted: false,
})
})
8 changes: 4 additions & 4 deletions src/storage/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export const presets = {
helpers.parseOffsetEmbedded(options?.atLocation, source, target),
)

if (options?.sound) {
if (options?.sound?.file) {
const sound = seq.sound()
helpers.genericSoundFunction(sound, item, target, options.sound)
}
Expand Down Expand Up @@ -308,7 +308,7 @@ export const presets = {

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

if (options?.sound) {
if (options?.sound?.file) {
const sound = seq.sound()
helpers.genericSoundFunction(sound, item, target, options.sound)
}
Expand Down Expand Up @@ -344,7 +344,7 @@ export const presets = {

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

if (options?.sound) {
if (options?.sound?.file) {
const sound = seq.sound()
helpers.genericSoundFunction(sound, item, affectedToken, options.sound)
}
Expand All @@ -365,7 +365,7 @@ export const presets = {

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

if (options?.sound) {
if (options?.sound?.file) {
const sound = seq.sound()
helpers.genericSoundFunction(sound, item, target, options.sound)
}
Expand Down
12 changes: 12 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,15 @@ export function mergeObjectsConcatArrays<T extends MergeableObject, U extends Me

return result as T & U
}

export function kofiButton(buttons: any[]) {
buttons.unshift({
icon: 'fas fa-mug-hot ko-fi',
class: 'hover:underline',
label: `pf2e-graphics.support.${Sequencer.Helpers.random_int_between(1, 4)}`,
onclick: () => {
window.open('https://ko-fi.com/mrvauxs', '_blank')
},
})
return buttons
}
10 changes: 2 additions & 8 deletions src/view/ActorAnimations/ActorAnimationsApp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'

import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
import { kofiButton } from 'src/utils'
import BasicAppShell from './ActorAnimationsShell.svelte'

interface actorAnimationsOptions {
Expand Down Expand Up @@ -40,14 +41,7 @@ export default class actorAnimationsApp extends SvelteApplication {

override _getHeaderButtons() {
const buttons = super._getHeaderButtons()
buttons.unshift({
icon: 'fas fa-mug-hot ko-fi',
class: '',
label: 'pf2e-graphics.support',
onclick: () => {
window.open('https://ko-fi.com/mrvauxs', '_blank')
},
})
kofiButton(buttons)
return buttons
}
}
13 changes: 3 additions & 10 deletions src/view/ItemAnimations/ItemAnimationsApp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'

import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'
import { kofiButton } from 'src/utils'
import BasicAppShell from './ItemAnimationsShell.svelte'

interface ItemAnimationsOptions {
Expand Down Expand Up @@ -40,14 +40,7 @@ export default class ItemAnimationsApp extends SvelteApplication {

override _getHeaderButtons() {
const buttons = super._getHeaderButtons()
buttons.unshift({
icon: 'fas fa-mug-hot ko-fi',
class: '',
label: 'pf2e-graphics.support',
onclick: () => {
window.open('https://ko-fi.com/mrvauxs', '_blank')
},
})
kofiButton(buttons)
return buttons
}
}
48 changes: 48 additions & 0 deletions src/view/UserAnimations/UserAnimationsApp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { SvelteApplication } from '@typhonjs-fvtt/runtime/svelte/application'

import type { CombinedSvelteApplicationOptions, ConstructorApplicationOptions } from 'src/extensions'
import { kofiButton } from 'src/utils'
import BasicAppShell from './UserAnimationsShell.svelte'

interface UserAnimationsOptions {
data: {
user: UserPF2e | null
}
}

export default class UserAnimationsApp extends SvelteApplication {
constructor(options: ConstructorApplicationOptions & UserAnimationsOptions) {
super()

if (options.data) {
foundry.utils.mergeObject(this.options, { svelte: { props: options.data } })
}
}

static override get defaultOptions(): CombinedSvelteApplicationOptions {
return foundry.utils.mergeObject(super.defaultOptions, {
...super.defaultOptions,
title: 'pf2e-graphics.modifyUser', // Automatically localized from `lang/en.json`.
width: 800,
height: 600,
classes: ['pf2e-g'],
id: 'pf2e-graphics-modify-user',
resizable: true,

svelte: {
class: BasicAppShell,
target: document.body,
intro: true,
props: {
user: null,
},
},
})
}

override _getHeaderButtons() {
const buttons = super._getHeaderButtons()
kofiButton(buttons)
return buttons
}
}
Loading

0 comments on commit 890db6e

Please sign in to comment.