Skip to content

Commit

Permalink
Merge branch 'main' into foe-drag-and-drop
Browse files Browse the repository at this point in the history
  • Loading branch information
rsek committed May 29, 2023
2 parents 2e539a4 + b429995 commit 55c0cb1
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

## Next Release

## 1.21.7

- The system is now officially compatible with v10 and v11 ([#772](https://github.com/ben/foundry-ironsworn/pull/772))
- Expand Spanish translation to be on par with the English language file ([#749](https://github.com/ben/foundry-ironsworn/pull/749), thanks [@erizocosmico](https://github.com/erizocosmico)!)
- Improved dropdown menu styling for the "Phosphor" colorway
- Fix some warnings and errors when running under v11 ([#772](https://github.com/ben/foundry-ironsworn/pull/772))

## 1.21.6

Expand Down
7 changes: 6 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export interface IronswornConfig {

registerOracleTree: typeof registerOracleTree
getOracleTree: typeof getOracleTree

// Patch for v10 + v11 compat
parseUuid: typeof _parseUuid
}

export const IRONSWORN: IronswornConfig = {
Expand Down Expand Up @@ -90,5 +93,7 @@ export const IRONSWORN: IronswornConfig = {
emitter: Mitt<EmitterEvents>(),

registerOracleTree,
getOracleTree
getOracleTree,

parseUuid: typeof parseUuid === 'function' ? parseUuid : _parseUuid
}
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ declare global {
JournalEntryPage: JournalEntryPageType[]
}
}

// v11 renames this function
function parseUuid(uuid: string, relative?: any): ResolvedUUID
}

Hooks.once('init', async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/module/rolls/ironsworn-roll-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export class IronswornRollMessage {

const r = IronswornRoll.fromJson(json)
r.chatMessageId = messageId
r.roll = msg?.roll ?? undefined
// @ts-expect-error
r.roll = msg?.rolls?.[0] ?? undefined

return new IronswornRollMessage(r)
}
Expand Down
11 changes: 4 additions & 7 deletions src/module/vue/components/buttons/btn-rollstat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<script lang="ts" setup>
import type { DocumentType } from '@league-of-foundry-developers/foundry-vtt-types/src/types/helperTypes.js'
import type { ExtractPropTypes } from 'vue'
import { inject, useSlots } from 'vue'
import type { AssetDataProperties } from '../../../item/itemtypes.js'
import { inject } from 'vue'
import type { AssetDataPropertiesData } from '../../../item/itemtypes.js'
import { IronswornPrerollDialog } from '../../../rolls'
import { $ActorKey, $ItemKey } from '../../provisions'
import IronBtn from './iron-btn.vue'
Expand All @@ -40,11 +40,8 @@ function rollStat(): any {
const name = `${props.statLabel} (${$item?.name})`
// FIXME: this should take `attr` instead to get the value, but there doesn't seem to be a simple way to (de)stringify the path to deeper props like there is with e.g. Actor.update()
// so, for now, we assume that assets are the only Items that we bother to roll with.
return IronswornPrerollDialog.showForStat(
name,
($item?.data as AssetDataProperties).data.track.current,
$actor
)
const value = ($item?.system as AssetDataPropertiesData)?.track?.current
return IronswornPrerollDialog.showForStat(name, value, $actor)
} else if (props.documentType === 'Actor') {
const name = `${props.statLabel} (${$actor?.name})`
Expand Down
2 changes: 1 addition & 1 deletion src/module/vue/components/progress/progress-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function progressCompleted() {
async function applySort(oldI, newI, sortBefore, filterFn) {
const foundryItems = ($actor?.items ?? [])
// @ts-ignore
// @ts-expect-error
.filter(filterFn)
.sort((a, b) => (a.sort || 0) - (b.sort || 0))
const updates = SortingHelpers.performIntegerSort(foundryItems[oldI], {
Expand Down
2 changes: 1 addition & 1 deletion src/module/vue/components/sf-move-category-rows.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function expandAndHighlightMove(targetMoveUuid: string) {
$collapsible.value.expand()
await nextTick()
}
const { documentId } = _parseUuid(targetMoveUuid)
const { documentId } = CONFIG.IRONSWORN.parseUuid(targetMoveUuid)
const move = $children.value.find((child) => child.moveId === documentId)
highlightMove(move?.$collapsible?.$element as HTMLElement)
if (move?.$collapsible?.isExpanded === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/module/vue/components/sf-moverow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const preventOracle = computed(() => {
})
const toggleTooltip = computed(() =>
// @ts-ignore
// @ts-expect-error
enrichMarkdown($item.value.system.Trigger?.Text)
)
Expand Down
2 changes: 1 addition & 1 deletion src/module/vue/components/sf-movesheetmoves.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function collapseMoveCategories() {
CONFIG.IRONSWORN.emitter.on('highlightMove', async (targetMoveUuid) => {
clearSearch()
await nextTick()
const { documentId } = _parseUuid(targetMoveUuid)
const { documentId } = CONFIG.IRONSWORN.parseUuid(targetMoveUuid)
const categoryWithMove = allCategories.value.find((moveCategory) =>
moveCategory.moveItems.has(documentId ?? '')
)
Expand Down
1 change: 0 additions & 1 deletion src/module/vue/components/truth/truth-selectable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import type { TableRow } from '../../../rolls'
import { OracleRollMessage } from '../../../rolls'
const props = defineProps<{
//@ts-ignore
page: IronswornJournalPage
radioGroup: string
}>()
Expand Down
2 changes: 1 addition & 1 deletion src/module/vue/components/with-rolllisteners.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function click(ev: JQuery.ClickEvent) {
return !!$attrs['onMoveclick']
}
// @ts-ignore
// @ts-expect-error
return gameItem?._onClickDocumentLink?.(ev)
}
Expand Down
18 changes: 17 additions & 1 deletion src/styles/inputs.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,24 @@

select {
.inputFieldMixin();

border-style: outset;
::selection {
background: var(--ironsworn-color-clickable-block-bg-hover);
color: var(--ironsworn-color-clickable-block-fg-hover);
}
option,
optgroup {
font-family: inherit;
background: var(--ironsworn-color-input-bg-opaque);
color: var(--ironsworn-color-clickable-block-fg);

&:hover,
&:focus,
&::selection {
background: var(--ironsworn-color-clickable-block-bg-hover);
color: var(--ironsworn-color-clickable-block-fg-hover);
}
}
}

textarea {
Expand Down
17 changes: 17 additions & 0 deletions src/styles/inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ select {

border: var(--ironsworn-border-width-md) outset
var(--ironsworn-color-input-border);
::selection {
background: var(--ironsworn-color-clickable-block-bg-hover);
color: var(--ironsworn-color-clickable-block-fg-hover);
}
option,
optgroup {
font-family: inherit;
background: var(--ironsworn-color-input-bg-opaque);
color: var(--ironsworn-color-clickable-block-fg);

&:hover,
&:focus,
&::selection {
background: var(--ironsworn-color-clickable-block-bg-hover);
color: var(--ironsworn-color-clickable-block-fg-hover);
}
}
}

textarea {
Expand Down
2 changes: 2 additions & 0 deletions src/styles/mixins/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

// INPUT
--#{$prefix}-input-bg: var(--#{$prefix}-#{$fg-type}-10);
--#{$prefix}-input-bg-opaque: var(--#{$prefix}-midtone-10);
--#{$prefix}-input-border: var(--#{$prefix}-#{$fg-type}-10);
--#{$prefix}-input-border-opaque: var(--#{$prefix}-midtone-10);

// CLICKABLE TEXT
--#{$prefix}-clickable-text: inherit;
Expand Down
20 changes: 15 additions & 5 deletions src/styles/utils.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@

.stack {
flex-grow: 0;
flex-direction: column;

.stack-row {
position: relative;
// FIXME refactor as component and encapsulate the relevant css there
flex: 0 0 auto;
z-index: auto;
border: var(--ironsworn-border-width-md) solid var(--ironsworn-color-border);
border-top: none;
border-radius: 0;
border-top-width: 0;
padding: 0;
min-width: var(--ironsworn-vertical-slider-width);
text-align: center;
Expand All @@ -102,13 +104,21 @@
}

&:first-child {
border-top-left-radius: var(--ironsworn-border-radius-lg);
border-top-right-radius: var(--ironsworn-border-radius-lg);
border-top-width: 1px;
border-top-left-radius: var(--ironsworn-border-radius-lg) !important;
border-top-right-radius: var(--ironsworn-border-radius-lg) !important;
}

&:last-child {
border-bottom-left-radius: var(--ironsworn-border-radius-lg);
border-bottom-right-radius: var(--ironsworn-border-radius-lg);
border-bottom-left-radius: var(--ironsworn-border-radius-lg) !important;
border-bottom-right-radius: var(--ironsworn-border-radius-lg) !important;
}

&[aria-checked='true'] {
background-color: var(
--ironsworn-color-clickable-block-bg-selected
) !important;
color: var(--ironsworn-color-clickable-block-fg-selected) !important;
}

input[type='radio'] {
Expand Down
6 changes: 3 additions & 3 deletions system/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"title": "Ironsworn & Starforged",
"description": "An implementation of the Ironsworn and Starforged systems, by Shawn Tomkin.",
"license": "LICENSE.txt",
"version": "1.21.6",
"version": "1.21.7",
"url": "https://github.com/ben/foundry-ironsworn",
"manifest": "https://github.com/ben/foundry-ironsworn/releases/latest/download/system.json",
"download": "https://github.com/ben/foundry-ironsworn/releases/download/1.21.6/ironsworn.zip",
"download": "https://github.com/ben/foundry-ironsworn/releases/download/1.21.7/ironsworn.zip",
"compatibility": {
"minimum": 10,
"verified": 10
"verified": 11
},
"authors": [
{
Expand Down

0 comments on commit 55c0cb1

Please sign in to comment.