This commit is contained in:
@@ -381,11 +381,13 @@ export default class HeritiersActorSheet extends HandlebarsApplicationMixin(foun
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
static async #onEditImage(event, target) {
|
static async #onEditImage(event, target) {
|
||||||
|
const attr = target.dataset.edit || "img"
|
||||||
|
const current = foundry.utils.getProperty(this.actor, attr) ?? this.actor.img
|
||||||
const fp = new FilePicker({
|
const fp = new FilePicker({
|
||||||
type: "image",
|
type: "image",
|
||||||
current: this.actor.img,
|
current,
|
||||||
callback: (path) => {
|
callback: (path) => {
|
||||||
this.actor.update({ img: path })
|
this.actor.update({ [attr]: path })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return fp.browse()
|
return fp.browse()
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<div class="header-fields background-sheet-header">
|
<div class="header-fields background-sheet-header">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<img class="profile-img" src="{{actor.img}}" data-action="editImage" title="{{actor.name}}" />
|
<img class="profile-img" src="{{actor.img}}" data-action="editImage" data-edit="img" title="{{actor.name}}" />
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<div class="header-fields background-sheet-header">
|
<div class="header-fields background-sheet-header">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<img class="profile-img" src="{{actor.img}}" data-action="editImage" title="{{actor.name}}" />
|
<img class="profile-img" src="{{actor.img}}" data-action="editImage" data-edit="img" title="{{actor.name}}" />
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
|
|||||||
Reference in New Issue
Block a user