mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
duplicateSelectedObject
This commit is contained in:
parent
9ae6a9f426
commit
e0382cdf86
3 changed files with 18 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkButton v-if="controller.grabbing.value" iconOnly @click="controller.changeGrabbingDistance(10)"><i class="ti ti-arrows-maximize"></i></MkButton>
|
||||
<MkButton v-if="controller.grabbing.value" iconOnly @click="controller.changeGrabbingDistance(-10)"><i class="ti ti-arrows-minimize"></i></MkButton>
|
||||
|
||||
<MkButton v-if="!controller.grabbing.value && controller.selected.value != null" @click="duplicateSelectedObject"><i class="ti ti-copy"></i></MkButton>
|
||||
<MkButton v-if="!controller.grabbing.value && controller.selected.value != null" @click="removeSelectedObject"><i class="ti ti-trash"></i> (X)</MkButton>
|
||||
</template>
|
||||
<MkButton v-if="controller.isSitting.value" @click="controller.standUp()">降りる (Q)</MkButton>
|
||||
|
|
@ -417,6 +418,11 @@ function changeEnvType(type: RoomState['env']['type']) {
|
|||
refresh();
|
||||
}
|
||||
|
||||
function duplicateSelectedObject() {
|
||||
controller.duplicateSelectedObject();
|
||||
canvas.value!.focus();
|
||||
}
|
||||
|
||||
function removeSelectedObject() {
|
||||
controller.removeSelectedObject();
|
||||
canvas.value!.focus();
|
||||
|
|
|
|||
|
|
@ -158,6 +158,10 @@ export class RoomController extends EngineControllerBase<RoomEngine> {
|
|||
this.call('beginSelectedInstalledObjectGrabbing');
|
||||
}
|
||||
|
||||
public duplicateSelectedObject() {
|
||||
this.call('duplicateSelectedObject');
|
||||
}
|
||||
|
||||
public removeSelectedObject() {
|
||||
this.call('removeSelectedObject');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1673,6 +1673,14 @@ export class RoomEngine extends EventEmitter {
|
|||
*/
|
||||
}
|
||||
|
||||
public duplicateSelectedObject() {
|
||||
if (this.selected == null) return;
|
||||
|
||||
const objectState = this.selected.objectState;
|
||||
|
||||
this.addObject(objectState.type, deepClone(objectState.options));
|
||||
}
|
||||
|
||||
public removeSelectedObject() {
|
||||
if (this.selected == null) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue