Update defaultGround for any ID
This commit is contained in:
parent
22fca8d25f
commit
d0367b40a3
@ -401,11 +401,8 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
||||
},
|
||||
"defaultGround": {
|
||||
"_leaf": true,
|
||||
"_type": "select",
|
||||
"_select": {
|
||||
"values": Object.keys(editor.core.icons.icons.terrains)
|
||||
},
|
||||
"_data": "默认地面的图块ID,此项修改后需要刷新才能看到效果。"
|
||||
"_type": "textarea",
|
||||
"_data": "默认地面的图块ID,此项修改后需要刷新才能看到效果。不填则默认是ground"
|
||||
},
|
||||
"images": {
|
||||
"_leaf": true,
|
||||
|
||||
10
libs/maps.js
10
libs/maps.js
@ -750,8 +750,10 @@ maps.prototype._drawBlockInfo_bgfg = function (blockInfo, name, x, y) {
|
||||
maps.prototype.generateGroundPattern = function (floorId) {
|
||||
// 生成floorId层的groundPattern(盒子内的怪物动画)
|
||||
var groundId = ((core.status.maps || core.floors)[floorId || core.status.floorId] || {}).defaultGround || "ground";
|
||||
var groundInfo = core.getBlockInfo(groundId);
|
||||
if (groundInfo == null) return;
|
||||
core.material.groundCanvas.clearRect(0, 0, 32, 32);
|
||||
core.material.groundCanvas.drawImage(core.material.images.terrains, 0, 32 * core.material.icons.terrains[groundId], 32, 32, 0, 0, 32, 32);
|
||||
core.material.groundCanvas.drawImage(groundInfo.image, 32 * groundInfo.posX, groundInfo.height * groundInfo.posY, 32, 32, 0, 0, 32, 32);
|
||||
core.material.groundPattern = core.material.groundCanvas.createPattern(core.material.groundCanvas.canvas, 'repeat');
|
||||
// 如果需要用纯色可以直接将下面代码改成改成
|
||||
// core.material.groundPattern = '#000000';
|
||||
@ -820,11 +822,11 @@ maps.prototype.drawBg = function (floorId, ctx) {
|
||||
maps.prototype._drawBg_drawBackground = function (floorId, ctx) {
|
||||
var width = core.floors[floorId].width, height = core.floors[floorId].height;
|
||||
var groundId = (core.status.maps || core.floors)[floorId].defaultGround || "ground";
|
||||
var yOffset = core.material.icons.terrains[groundId];
|
||||
if (yOffset != null) {
|
||||
var groundInfo = core.getBlockInfo(groundId);
|
||||
if (groundInfo != null) {
|
||||
for (var i = 0; i < width; i++) {
|
||||
for (var j = 0; j < height; j++) {
|
||||
ctx.drawImage(core.material.images.terrains, 0, yOffset * 32, 32, 32, i * 32, j * 32, 32, 32);
|
||||
ctx.drawImage(groundInfo.image, 32 * groundInfo.posX, groundInfo.height * groundInfo.posY, 32, 32, i * 32, j * 32, 32, 32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 42 KiB |
@ -194,5 +194,24 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
|
||||
"261": {"cls":"enemy48","id":"angel"},
|
||||
"262": {"cls":"enemy48","id":"elemental"},
|
||||
"263": {"cls":"enemy48","id":"steelGuard"},
|
||||
"264": {"cls":"enemy48","id":"evilBat"}
|
||||
"264": {"cls":"enemy48","id":"evilBat"},
|
||||
"300": {"cls":"terrains","id":"ground"},
|
||||
"301": {"cls":"terrains","id":"grass"},
|
||||
"302": {"cls":"terrains","id":"grass2"},
|
||||
"303": {"cls":"terrains","id":"snowGround"},
|
||||
"304": {"cls":"terrains","id":"ground2"},
|
||||
"305": {"cls":"terrains","id":"ground3"},
|
||||
"306": {"cls":"terrains","id":"ground4"},
|
||||
"307": {"cls":"terrains","id":"sand"},
|
||||
"308": {"cls":"terrains","id":"ground5"},
|
||||
"309": {"cls":"terrains","id":"yellowWall2"},
|
||||
"310": {"cls":"terrains","id":"whiteWall2"},
|
||||
"311": {"cls":"terrains","id":"blueWall2"},
|
||||
"312": {"cls":"terrains","id":"blockWall"},
|
||||
"313": {"cls":"terrains","id":"grayWall"},
|
||||
"314": {"cls":"terrains","id":"white"},
|
||||
"315": {"cls":"terrains","id":"ground6"},
|
||||
"316": {"cls":"terrains","id":"soil"},
|
||||
"317": {"cls":"terrains","id":"ground7"},
|
||||
"318": {"cls":"terrains","id":"ground8"}
|
||||
}
|
||||
@ -21,10 +21,7 @@
|
||||
20. 很多事件对应的脚本有默认参数,但在事件中省略参数却会变成0,建议修复
|
||||
|
||||
图块属性的nopass倒真可以改成勾选框,因为null一定表示不可通行(道具根本没有nopass)
|
||||
对话框淡入淡出
|
||||
|
||||
|
||||
|
||||
defaultGround全局可用
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user