This commit is contained in:
syuilo 2019-08-18 19:08:33 +09:00
parent 58d0dc1795
commit 46fa26426d

View file

@ -25,7 +25,8 @@
<ui-button @click="remove()"><fa :icon="faTrashAlt"/> {{ $t('remove') }}</ui-button> <ui-button @click="remove()"><fa :icon="faTrashAlt"/> {{ $t('remove') }}</ui-button>
</section> </section>
</div> </div>
<div class="menu">
<div class="menu" v-if="isMyRoom">
<section> <section>
<ui-button @click="add()"><fa :icon="faBoxOpen"/> {{ $t('add-furniture') }}</ui-button> <ui-button @click="add()"><fa :icon="faBoxOpen"/> {{ $t('add-furniture') }}</ui-button>
</section> </section>
@ -83,6 +84,7 @@ export default Vue.extend({
carpetColor: null, carpetColor: null,
isTranslateMode: false, isTranslateMode: false,
isRotateMode: false, isRotateMode: false,
isMyRoom: false,
faBoxOpen, faSave, faTrashAlt, faUndo, faArrowsAlt, faBan, faBoxOpen, faSave, faTrashAlt, faUndo, faArrowsAlt, faBan,
}; };
}, },
@ -92,6 +94,8 @@ export default Vue.extend({
...parseAcct(this.acct) ...parseAcct(this.acct)
}); });
this.isMyRoom = this.$store.getters.isSignedIn && this.$store.state.i.id === user.id;
const roomInfo = await this.$root.api('room/show', { const roomInfo = await this.$root.api('room/show', {
userId: user.id userId: user.id
}); });
@ -99,7 +103,7 @@ export default Vue.extend({
this.roomType = roomInfo.roomType; this.roomType = roomInfo.roomType;
this.carpetColor = roomInfo.carpetColor; this.carpetColor = roomInfo.carpetColor;
room = new Room(user, this.$store.getters.isSignedIn && this.$store.state.i.id === user.id, roomInfo, this.$el, { room = new Room(user, this.isMyRoom, roomInfo, this.$el, {
graphicsQuality: this.$store.state.device.roomGraphicsQuality, graphicsQuality: this.$store.state.device.roomGraphicsQuality,
onChangeSelect: obj => { onChangeSelect: obj => {
this.objectSelected = obj != null; this.objectSelected = obj != null;