mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
bolt
This commit is contained in:
parent
2bc10ccc34
commit
961d611cd4
10 changed files with 87 additions and 0 deletions
|
|
@ -3604,6 +3604,9 @@ _miWorld:
|
|||
bodyMat: "コップの素材"
|
||||
liquidMat: "液体の素材"
|
||||
mikan: "みかん"
|
||||
bolt: "ボルト"
|
||||
_bolt:
|
||||
mat: "素材"
|
||||
|
||||
_miRoom:
|
||||
snapToGrid: "グリッドにスナップ"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core/pure.js';
|
||||
import { bolt_schema } from 'misskey-world/src/avatars/accessories/bolt.schema.js';
|
||||
import { defineAccessory } from '../accessory.js';
|
||||
|
||||
export const bolt = defineAccessory(bolt_schema, {
|
||||
createInstance: ({ model, options }) => {
|
||||
const material = model.findMaterial('__X_BOLT__');
|
||||
|
||||
const applyMat = () => {
|
||||
material.albedoColor = new BABYLON.Color3(options.mat.color[0], options.mat.color[1], options.mat.color[2]);
|
||||
material.roughness = options.mat.roughness;
|
||||
material.metallic = options.mat.metallic;
|
||||
};
|
||||
|
||||
applyMat();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'mat': applyMat(); break;
|
||||
}
|
||||
},
|
||||
dispose: () => {
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -5,11 +5,13 @@
|
|||
|
||||
import { mug } from './accessories/mug.js';
|
||||
import { mikan } from './accessories/mikan.js';
|
||||
import { bolt } from './accessories/bolt.js';
|
||||
import type { AvatarAccessoryDef } from './accessory.js';
|
||||
|
||||
export const AVATAR_ACCESSORY_DEFS = [
|
||||
mug,
|
||||
mikan,
|
||||
bolt,
|
||||
] as AvatarAccessoryDef[];
|
||||
|
||||
export function getAccessoryDef(type: string): AvatarAccessoryDef {
|
||||
|
|
|
|||
BIN
packages/frontend/assets/world/objects/bolt/bolt.blend
Normal file
BIN
packages/frontend/assets/world/objects/bolt/bolt.blend
Normal file
Binary file not shown.
BIN
packages/frontend/assets/world/objects/bolt/bolt.glb
Normal file
BIN
packages/frontend/assets/world/objects/bolt/bolt.glb
Normal file
Binary file not shown.
17
packages/frontend/src/world/avatars/accessories/bolt.ui.ts
Normal file
17
packages/frontend/src/world/avatars/accessories/bolt.ui.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineAccessoryUi } from '../defineAccessoryUi.js';
|
||||
import type { bolt_schema } from 'misskey-world/src/avatars/accessories/bolt.schema.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
export const bolt_ui = defineAccessoryUi<typeof bolt_schema>({
|
||||
name: i18n.ts._miWorld._avatarAccessories.bolt,
|
||||
options: {
|
||||
mat: {
|
||||
label: i18n.ts._miWorld._avatarAccessories._bolt.mat,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -5,11 +5,13 @@
|
|||
|
||||
import { mug_ui } from './accessories/mug.ui.js';
|
||||
import { mikan_ui } from './accessories/mikan.ui.js';
|
||||
import { bolt_ui } from './accessories/bolt.ui.js';
|
||||
import type { AccessoryUiDef } from './defineAccessoryUi.js';
|
||||
|
||||
export const AVATAR_ACCESSORY_UI_DEFS = {
|
||||
mug: mug_ui,
|
||||
mikan: mikan_ui,
|
||||
bolt: bolt_ui,
|
||||
} as Record<string, AccessoryUiDef>;
|
||||
|
||||
export function getAccessoryUiDef(type: string): AccessoryUiDef {
|
||||
|
|
|
|||
|
|
@ -13438,6 +13438,16 @@ export interface Locale extends ILocale {
|
|||
* みかん
|
||||
*/
|
||||
"mikan": string;
|
||||
/**
|
||||
* ボルト
|
||||
*/
|
||||
"bolt": string;
|
||||
"_bolt": {
|
||||
/**
|
||||
* 素材
|
||||
*/
|
||||
"mat": string;
|
||||
};
|
||||
};
|
||||
};
|
||||
"_miRoom": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineAccessorySchema } from '../accessory.js';
|
||||
export const bolt_schema = defineAccessorySchema({
|
||||
id: 'bolt',
|
||||
options: {
|
||||
schema: {
|
||||
mat: {
|
||||
type: 'material',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
mat: { color: [0.8, 0.8, 0.8], roughness: 0.3, metallic: 1 },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -5,11 +5,13 @@
|
|||
|
||||
import { mug_schema } from './accessories/mug.schema.js';
|
||||
import { mikan_schema } from './accessories/mikan.schema.js';
|
||||
import { bolt_schema } from './accessories/bolt.schema.js';
|
||||
import type { AccessorySchemaDef } from './accessory.js';
|
||||
|
||||
export const ACCESSORY_SCHEMA_DEFS = {
|
||||
mug: mug_schema,
|
||||
mikan: mikan_schema,
|
||||
bolt: bolt_schema,
|
||||
} as Record<string, AccessorySchemaDef<any>>;
|
||||
|
||||
export function getAccessorySchemaDef(type: string): AccessorySchemaDef {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue