Skip to content

Commit

Permalink
Location name changes cascade to tokens (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Nov 2, 2022
1 parent 2a90ab2 commit 971981c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix a visual bug with sliding transition groups, e.g. marking a vow as complete ([#521](https://github.com/ben/foundry-ironsworn/pull/521))
- "Battered" and "Cursed" no longer cascade across actor sheets, but those sheets will get highlights suggesting other actors that have them set ([#523](https://github.com/ben/foundry-ironsworn/pull/523))
- Location sheet name change triggers token names to change (again)

## 1.18.11

Expand Down
12 changes: 7 additions & 5 deletions src/module/vue/sf-locationsheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
:nameClass="{
highlighted: data.firstLookHighlight && canRandomizeName,
}"
@change="nameChange"
>
<btn-isicon
v-if="canRandomizeName"
Expand Down Expand Up @@ -164,13 +165,10 @@ label {

<script setup lang="ts">
import SheetHeaderBasic from './sheet-header-basic.vue'
import { capitalize, flatten, sample, throttle } from 'lodash'
import { provide, computed, reactive, inject } from 'vue'
import { IronswornActor } from '../actor/actor'
import { capitalize, flatten, sample } from 'lodash'
import { provide, computed, reactive, inject, watch } from 'vue'
import { $ActorKey, ActorKey } from './provisions'
import BtnIsicon from './components/buttons/btn-isicon.vue'
import DocumentImg from './components/document-img.vue'
import DocumentName from './components/document-name.vue'
import BtnIcon from './components/buttons/btn-icon.vue'
import MceEditor from './components/mce-editor.vue'
import { OracleRollMessage } from '../rolls'
Expand Down Expand Up @@ -670,6 +668,10 @@ async function rollOracle(oracle) {
await $actor?.update({ data: { description: parts.join('') } })
}
function nameChange() {
updateAllTokens({ name: props.actor.name })
}
async function updateAllTokens(data) {
// Prototype token
await $actor?.data.token.update(data)
Expand Down

0 comments on commit 971981c

Please sign in to comment.