光标修改api
This commit is contained in:
parent
1db2345494
commit
30fb75ec85
File diff suppressed because one or more lines are too long
@ -1233,5 +1233,11 @@ main.floors.Caimhome=
|
|||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
|
],
|
||||||
|
"bg2map": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fg2map": [
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8864,5 +8864,25 @@ core.plugin.animate = {
|
|||||||
CGUI.style.zIndex = 10000
|
CGUI.style.zIndex = 10000
|
||||||
main.core.ui.CG.update()
|
main.core.ui.CG.update()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"光标设置": function () {
|
||||||
|
// 在此增加新插件
|
||||||
|
this.mouse = function (image) {
|
||||||
|
const canvas = document.createElement('canvas'); //CGui画布设置
|
||||||
|
canvas.width = 32
|
||||||
|
canvas.height = 32
|
||||||
|
const ctx = canvas.getContext("2d")
|
||||||
|
let info = core.getBlockInfo(image);
|
||||||
|
if (!info) {
|
||||||
|
// 检查状态栏图标
|
||||||
|
if (core.statusBar.icons[image] instanceof Image)
|
||||||
|
info = { image: core.statusBar.icons[image], posX: 0, posY: 0, height: 32 };
|
||||||
|
else return;
|
||||||
|
}
|
||||||
|
|
||||||
|
core.drawIcon(ctx, image, 0, 0, 32, 32)
|
||||||
|
const data = canvas.toDataURL("image/png")
|
||||||
|
core.dom.gameGroup.style.cursor = `url(${data}),auto`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 810 KiB |
Loading…
Reference in New Issue
Block a user