@lrplrplrp/dsh-live2d 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cordis.patch.yml +2 -2
- package/lib/client.js +13 -7
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/cordis.patch.yml
CHANGED
package/lib/client.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
//
|
|
12
12
|
// 移除了原项目的:对话框、小飞机游戏、关闭/关于/GitHub 按钮。
|
|
13
13
|
|
|
14
|
-
window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
|
|
14
|
+
window.__ModuleLoader__.load({ id: '@lrplrplrp/dsh-live2d', factory: (require) => {
|
|
15
15
|
var module = { exports: {} }
|
|
16
16
|
var exports = module.exports
|
|
17
17
|
|
|
@@ -27,6 +27,9 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
|
|
|
27
27
|
const POSITION_KEY = 'dsh-live2d.position'
|
|
28
28
|
const ACTIVE_MODEL_KEY = 'dsh-live2d.activeModel'
|
|
29
29
|
|
|
30
|
+
// 容器默认屏幕位置(无本地存档时使用),对应 position:fixed 的 left/top
|
|
31
|
+
const DEFAULT_POSITION = { x: 1240, y: 330 }
|
|
32
|
+
|
|
30
33
|
// 本地文件路由前缀(由 host 端 index.js 注册)
|
|
31
34
|
const LIB_BASE = '/plugins/dsh-live2d/lib/'
|
|
32
35
|
const ASSETS_BASE = '/plugins/dsh-live2d/assets/'
|
|
@@ -69,13 +72,13 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
|
|
|
69
72
|
url: ASSETS_BASE + 'deepseek_l2d/deepseek.model3.json',
|
|
70
73
|
canvasWidth: 300,
|
|
71
74
|
canvasHeight: 400,
|
|
72
|
-
config: { x:
|
|
75
|
+
config: { x: 0, y: 0, scaleX: 1.5, scaleY: 1.5 },
|
|
73
76
|
animations: {
|
|
74
77
|
IDLE: { motion: { group: 'Idle', index: 0 }, loop: false },
|
|
75
|
-
THINKING: { motion: { group: 'Anima', index: 2 }, loop:
|
|
78
|
+
THINKING: { motion: { group: 'Anima', index: 2 }, loop: true },
|
|
76
79
|
THINK_END: { motion: { group: 'Anima', index: 1 }, loop: false },
|
|
77
|
-
WORKING: {
|
|
78
|
-
SPEAKING: { motion: { group: 'Anima', index: 0 }, loop:
|
|
80
|
+
WORKING: { expression: 'puzzled' },
|
|
81
|
+
SPEAKING: { motion: { group: 'Anima', index: 0 }, loop: true },
|
|
79
82
|
SUCCESS: { expression: 'happy' },
|
|
80
83
|
ERROR: { expression: 'unhappy' },
|
|
81
84
|
},
|
|
@@ -204,8 +207,8 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
|
|
|
204
207
|
const LIVE2D_CSS = [
|
|
205
208
|
'#dsh-live2d-container {',
|
|
206
209
|
' position: fixed;',
|
|
207
|
-
' top:
|
|
208
|
-
' left:
|
|
210
|
+
' top: 330px;',
|
|
211
|
+
' left: 1240px;',
|
|
209
212
|
' bottom: auto;',
|
|
210
213
|
' z-index: 9999;',
|
|
211
214
|
// 容器本身不拦截指针事件,画布区域点击完全穿透到页面,不影响输入;
|
|
@@ -733,6 +736,9 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
|
|
|
733
736
|
const saved = getPosition()
|
|
734
737
|
if (saved && Number.isFinite(saved.x) && Number.isFinite(saved.y)) {
|
|
735
738
|
place(containerEl, saved.x, saved.y)
|
|
739
|
+
} else {
|
|
740
|
+
// 无本地存档时使用默认位置
|
|
741
|
+
place(containerEl, DEFAULT_POSITION.x, DEFAULT_POSITION.y)
|
|
736
742
|
}
|
|
737
743
|
|
|
738
744
|
const finish = () => {
|
package/lib/index.js
CHANGED
|
@@ -37,7 +37,7 @@ const PLUGIN_ROOT = resolvedDir ? join(resolvedDir, '..') : null
|
|
|
37
37
|
const LIB_DIR = PLUGIN_ROOT ? join(PLUGIN_ROOT, 'lib') : null
|
|
38
38
|
const ASSETS_DIR = PLUGIN_ROOT ? join(PLUGIN_ROOT, 'assets') : null
|
|
39
39
|
|
|
40
|
-
export const name = 'dsh-live2d'
|
|
40
|
+
export const name = '@lrplrplrp/dsh-live2d'
|
|
41
41
|
|
|
42
42
|
const STATE_ENDPOINT = '/plugins/dsh-live2d/state'
|
|
43
43
|
const CONFIG_ENDPOINT = '/plugins/dsh-live2d/config'
|