修复高清画布缩放问题

This commit is contained in:
strawberry 2025-10-13 14:14:30 +08:00
parent 95c269d829
commit aaad507cc3
4 changed files with 15 additions and 15 deletions

View File

@ -54,7 +54,7 @@ colour : this.tasksColor
allFloorIds : ['IdString_0','IdString_1']
default :["任务描述",1,"MT1","1,1","MT1,MT2","MT1","1,1","yellowKey:1,redGem:3"]
EvalString_Multi_0=EvalString_Multi_0?(',"text": "'+EvalString_Multi_0+'"'): '';
var code = '{"type":"taskEvent"'+EvalString_Multi_0+',"n":'+Int_0+',"info":['+tasksList_0+'\n]'+',"setFloor":"'+IdString_0+'","setxy":['+EvalString_0.split(",")+'],"tarFloor":"'+EvalString_1+'","mitFloor":"'+IdString_1+'","mitxy":['+EvalString_2.split(",")+'], "beforeAction": [\n' + action_0 +'],"reward":"'+EvalString_1+'", "action": [\n' + action_1 + ']}\n'
var code = '{"type":"taskEvent"'+EvalString_Multi_0+',"n":'+Int_0+',"info":['+tasksList_0+'\n]'+',"setFloor":"'+IdString_0+'","setxy":['+EvalString_0.split(",")+'],"tarFloor":"'+EvalString_1+'","mitFloor":"'+IdString_1+'","mitxy":['+EvalString_2.split(",")+'], "beforeAction": [\n' + action_0 +'],"reward":"'+EvalString_3+'", "action": [\n' + action_1 + ']}\n'
return code;
*/;

View File

@ -37,7 +37,7 @@ maps.prototype._resetFloorImages = function () {
maps.prototype._setHDCanvasSize = function (ctx, width, height) {
if(main.replyChecking)return
ctx.setTransform(1, 0, 0, 1, 0, 0);
var ratio = core.domStyle.scale;
var ratio = core.domStyle.ratio;
ratio *= devicePixelRatio;
if (width != null) ctx.canvas.width = width * ratio;
if (height != null) ctx.canvas.height = height * ratio;
@ -1294,7 +1294,6 @@ maps.prototype.drawEvents = function (floorId, blocks, config) {
}
var toDrawCtx = core.getContextByName(config.ctx);
if (!toDrawCtx) return;
var cacheCtx = toDrawCtx;
if (config.onMap) {
cacheCtx = core.bigmap.cacheCanvas;
@ -1332,6 +1331,7 @@ maps.prototype.drawEvents = function (floorId, blocks, config) {
core.drawImage(toDrawCtx, cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
cacheCtx.translate(0, 0);
}
}
////// 绘制前景层 //////
@ -1773,7 +1773,6 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (floorId, blocks, option
flags = core.status.hero.flags;
core.status.hero.flags = options.flags;
}
this._drawThumbnail_realDrawTempCanvas(floorId, blocks, options);
// --- 恢复 flags

View File

@ -12893,7 +12893,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
1
],
"beforeAction": [],
"reward": "yellowKey:1,redGem:3",
"reward": "yellowKey:2,redGem:3",
"action": []
}
}

View File

@ -2,6 +2,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{
"init": function () {
this._afterLoadResources = function () {
core.canvas.event.canvas.style.filter = "drop-shadow(5px 5px 5px black)"
core.setTaskFloor = {}
core.mitTaskFloor = {}
core.tarTaskFloor = {}
@ -11927,24 +11928,24 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"text": "任务描述",
"n": 1,
"info": [
{ "type": "checkItem", "checkItem": "yellowKey", "operator": ">=", "count": 0 },
{ "type": "checkStatus", "checkStatus": "atk", "operator": ">=", "count": 10 },
{ "type": "checkItem", "checkItem": "yellowKey", "operator": ">=", "count": 0 },
{ "type": "checkStatus", "checkStatus": "atk", "operator": ">=", "count": 10 },
{ "type": "checkFlag", "checkFlag": "flag1", "operator": "=", "count": "\"value\"" },
{ "type": "checkBlock", "checkBlock": "bat", "floorId": ["MT1", "MT2"], "operator": "<=", "count": 0 },
{ "type": "kill", "operator": ">=", "count": 0 },
{ "type": "checkBlock", "checkBlock": "bat", "floorId": ["MT1", "MT2"], "operator": "&lt;=", "count": 0 },
{ "type": "kill", "operator": "&gt;=", "count": 0 },
{
"type": "killLocs",
"loc": [
[1, 1]
],
"floorId": "MT1",
"operator": ">=",
"operator": "&gt;=",
"count": 1
},
{ "type": "killSpecial", "killSpecial": "61", "floorId": ["MT1", "MT2"], "operator": ">=", "count": 1 },
{ "type": "killSpecial", "killSpecial": "61", "floorId": ["MT1", "MT2"], "operator": "&gt;=", "count": 1 },
{ "type": "killAll", "floorId": ["MT1"] },
{ "type": "specialBlock", "floorId": ["MT1"], "specialBlock": "血网伤害", "operator": "<", "count": 1 },
{ "type": "gosthFloor", "floorId": ["MT1"], "operator": "<", "count": 1 },
{ "type": "specialBlock", "floorId": ["MT1"], "specialBlock": "血网伤害", "operator": "&lt;", "count": 1 },
{ "type": "gosthFloor", "floorId": ["MT1"], "operator": "&lt;", "count": 1 },
{ "type": "arrival", "floorId": "MT1" },
],
"setFloor": "MT1",
@ -28394,7 +28395,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.has = info.has ?? core.getRealStatus(this.checkStatus)
} else if (info.type === "checkFlag") {
this.checkFlag = info.checkFlag
this.count = info.count
this.count = core.calValue(info.count)
this.operator = info.operator
this.has = info.has ?? core.getFlag(this.checkFlag)
} else if (info.type === "checkBlock") { //剩余图块
@ -28422,7 +28423,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.has = info.has ?? 0
this.operator = info.operator
} else if (info.type === "killAll") {
this.floorId = info.floorId //楼层数组
this.floorId = core.calValue(info.floorId) //楼层数组
this.has = info.has ?? core.searchBlockWithFilter(block => block.event.cls.startsWith("enemy"), this.floorId).length
} else if (info.type === "specialBlock") { //踩雷
this.floorId = info.floorId //楼层数组,不填为任意楼层