mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-23 02:17:40 -07:00
fix(client): Fix bug that cannot set custom texture
This commit is contained in:
parent
6cee6c1043
commit
cd330fa135
2 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,7 @@
|
||||||
<div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k">
|
<div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k">
|
||||||
<p>{{ k }}</p>
|
<p>{{ k }}</p>
|
||||||
<template v-if="selectedFurnitureInfo.props[k] === 'image'">
|
<template v-if="selectedFurnitureInfo.props[k] === 'image'">
|
||||||
<mk-button @click="chooseImage(k)">{{ $t('_rooms.chooseImage') }}</mk-button>
|
<mk-button @click="chooseImage(k, $event)">{{ $t('_rooms.chooseImage') }}</mk-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="selectedFurnitureInfo.props[k] === 'color'">
|
<template v-else-if="selectedFurnitureInfo.props[k] === 'color'">
|
||||||
<input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/>
|
<input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/>
|
||||||
|
@ -69,6 +69,7 @@ import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons';
|
||||||
import { query as urlQuery } from '../../../prelude/url';
|
import { query as urlQuery } from '../../../prelude/url';
|
||||||
import MkButton from '../../components/ui/button.vue';
|
import MkButton from '../../components/ui/button.vue';
|
||||||
import MkSelect from '../../components/ui/select.vue';
|
import MkSelect from '../../components/ui/select.vue';
|
||||||
|
import { selectFile } from '../../scripts/select-file';
|
||||||
|
|
||||||
let room: Room;
|
let room: Room;
|
||||||
|
|
||||||
|
@ -224,10 +225,8 @@ export default Vue.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseImage(key) {
|
chooseImage(key, e) {
|
||||||
this.$chooseDriveFile({
|
selectFile(this, e.currentTarget || e.target, null, false).then(file => {
|
||||||
multiple: false
|
|
||||||
}).then(file => {
|
|
||||||
room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`);
|
room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`);
|
||||||
this.$refs.preview.selected(room.getSelectedObject());
|
this.$refs.preview.selected(room.getSelectedObject());
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
|
|
|
@ -51,6 +51,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO
|
||||||
const chooseFileFromUrl = () => {
|
const chooseFileFromUrl = () => {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue