mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 03:13:07 +02:00
Resolve #5298
This commit is contained in:
parent
01e692b353
commit
311a4f28b0
3 changed files with 31 additions and 2 deletions
|
@ -2300,6 +2300,8 @@ room:
|
|||
exit: "戻る"
|
||||
remove: "しまう"
|
||||
save: "保存"
|
||||
clear: "片付け"
|
||||
clear-confirm: "全ての家具をしまいますか?"
|
||||
chooseImage: "画像を選択"
|
||||
room-type: "部屋のタイプ"
|
||||
carpet-color: "床の色"
|
||||
|
|
|
@ -696,6 +696,21 @@ export class Room {
|
|||
this.onChangeSelect(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 全ての家具を部屋から削除します
|
||||
*/
|
||||
@autobind
|
||||
public removeAllFurnitures() {
|
||||
this.exitTransformMode();
|
||||
for (const obj of this.objects) {
|
||||
this.scene.remove(obj);
|
||||
}
|
||||
this.objects = [];
|
||||
this.furnitures = [];
|
||||
this.selectedObject = null;
|
||||
this.onChangeSelect(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部屋の床の色を変更します
|
||||
* @param color 色
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
</section>
|
||||
<section>
|
||||
<ui-button primary @click="save()"><fa :icon="faSave"/> {{ $t('save') }}</ui-button>
|
||||
<ui-button primary @click="clear()"><fa :icon="faBroom"/> {{ $t('clear') }}</ui-button>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,7 +56,7 @@ import { Room } from '../../../scripts/room/room';
|
|||
import parseAcct from '../../../../../../misc/acct/parse';
|
||||
import XPreview from './preview.vue';
|
||||
const storeItems = require('../../../scripts/room/furnitures.json5');
|
||||
import { faBoxOpen, faUndo, faArrowsAlt, faBan } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faBoxOpen, faUndo, faArrowsAlt, faBan, faBroom } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons';
|
||||
import { query as urlQuery } from '../../../../../../prelude/url';
|
||||
|
||||
|
@ -86,7 +87,7 @@ export default Vue.extend({
|
|||
isTranslateMode: false,
|
||||
isRotateMode: false,
|
||||
isMyRoom: false,
|
||||
faBoxOpen, faSave, faTrashAlt, faUndo, faArrowsAlt, faBan,
|
||||
faBoxOpen, faSave, faTrashAlt, faUndo, faArrowsAlt, faBan, faBroom,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -156,6 +157,17 @@ export default Vue.extend({
|
|||
});
|
||||
},
|
||||
|
||||
clear() {
|
||||
this.$root.dialog({
|
||||
type: 'warning',
|
||||
text: this.$t('clear-confirm'),
|
||||
showCancelButton: true
|
||||
}).then(({ canceled }) => {
|
||||
if (canceled) return;
|
||||
room.removeAllFurnitures();
|
||||
});
|
||||
},
|
||||
|
||||
chooseImage(key) {
|
||||
this.$chooseDriveFile({
|
||||
multiple: false
|
||||
|
|
Loading…
Reference in a new issue