This commit is contained in:
unamed 2022-02-02 16:53:40 +08:00
parent d383a743a7
commit bb327082a6
8 changed files with 32 additions and 10 deletions

View File

@ -1 +1 @@
{"lastUsed":[{"idnum":261,"id":"angel","images":"enemy48","y":0,"recent":1643777643176,"frequent":1}],"foldPerCol":50,"folded":false,"editorLastFloorId":"sample0","disableBlocklyReplace":false,"disableBlocklyExpandCompare":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0},"viewportLoc":[0,0]}
{"lastUsed":[{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1643780397979,"frequent":1},{"idnum":261,"id":"angel","images":"enemy48","y":0,"recent":1643777643176,"frequent":1}],"foldPerCol":50,"folded":false,"editorLastFloorId":"sample1","disableBlocklyReplace":false,"disableBlocklyExpandCompare":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0},"viewportLoc":[0,0]}

View File

@ -3369,7 +3369,7 @@ control.prototype._resize_canvas = function (obj) {
var ctx = core.dom.gameCanvas[i].getContext('2d');
// core.maps._setHDCanvasSize(ctx);
core.resizeCanvas(ctx, core.__PIXELS__, core.__PIXELS__);
if (core.status && core.status.maps) {
if (core.status && core.status.maps && core.status.floorId && core.status.maps[core.status.floorId]) {
core.redrawMap();
core.drawHero();
core.setWeather(core.animateFrame.weather.type, core.animateFrame.weather.level);

View File

@ -2961,6 +2961,10 @@ maps.prototype.drawBoxAnimate = function () {
var bigImageInfo = core.maps._getBigImageInfo(obj.bigImage, obj.face, core.status.globalAnimateStatus % 4);
var sx = bigImageInfo.sx, sy = bigImageInfo.sy, per_width = bigImageInfo.per_width, per_height = bigImageInfo.per_height;
var actual_width = Math.min(per_width, obj.max_width || per_width), actual_height = per_height * actual_width / per_width;
var x = obj.centerX - actual_width / 2, y = obj.centerY - actual_height / 2;
core.clearMap(ctx, x, y, actual_width, actual_height);
core.fillRect(ctx, x, y, actual_width, actual_height, core.material.groundPattern);
core.strokeRect(ctx, x, y, actual_width, actual_height, 'gold', 2);
core.drawImage(ctx, obj.bigImage, sx, sy, per_width, per_height,
obj.centerX - actual_width / 2, obj.centerY - actual_height / 2, actual_width, actual_height);
} else {

View File

@ -1060,7 +1060,7 @@ ui.prototype._getDrawableIconInfo = function (id) {
}
id = core.getIdOfThis(id);
var image = null, icon = null;
["terrains", "animates", "items", "npcs", "enemys"].forEach(function (v) {
["terrains", "animates", "items", "npcs", "enemys", 'enemy48', 'npc48'].forEach(function (v) {
if (core.material.icons[v][id] != null) {
image = core.material.images[v];
icon = core.material.icons[v][id];
@ -1357,6 +1357,7 @@ ui.prototype._drawTextContent_drawIcon = function (tempCtx, content, config) {
// 绘制一个 \i 效果
var index = config.index, index2;
if (content.charAt(config.index + 1) == '[' && ((index2 = content.indexOf(']', index + 1)) >= 0)) {
console.log(1);
var str = core.replaceText(content.substring(index + 2, index2));
// --- 获得图标
var cls = core.getClsFromId(str);
@ -1372,7 +1373,7 @@ ui.prototype._drawTextContent_drawIcon = function (tempCtx, content, config) {
// 绘制到画布上
var height = 32;
if (cls.endsWith('48')) height = 48;
core.drawImage(tempCtx, image, 0, height * icon, 32, height, left, top, width, width);
core.drawImage(tempCtx, image, 0, height * icon, 32, height, left, top, width, height === 48 ? width * 1.5 : width);
config.blocks.push({
left: left, top: config.offsetY,

View File

@ -99,9 +99,6 @@ main.floors.sample0=
"type": "hide",
"time": 500
}
],
"7,9": [
"\\i[angel]"
]
},
"changeFloor": {

View File

@ -44,7 +44,24 @@ main.floors.sample2=
"events": {
"12,12": [
"234"
]
],
"10,11": {
"trigger": "action",
"enable": true,
"noPass": null,
"displayDamage": true,
"opacity": 1,
"filter": {
"blur": 0,
"hue": 0,
"grayscale": 0,
"invert": false,
"shadow": 0
},
"data": [
"\t[小妖精,bearRight]欢迎使用事件编辑器(双击方块可直接预览)"
]
}
},
"changeFloor": {
"6,10": {

View File

@ -809,8 +809,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 可以在这里任意增加或编辑每个按键的行为
// 如果处于正在行走状态,则不处理
if (core.isMoving())
return;
if (core.isMoving()) return;
// 商店长按时忽略
if (core.status.onShopLongDown) return core.status.onShopLongDown = false;
// Alt+0~9快捷换上套装
if (altKey && keyCode >= 48 && keyCode <= 57) {

View File

@ -249,6 +249,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.registerAction('keyDown', 'shops', function (keycode) {
if (!core.status.lockControl || !core.hasFlag("@temp@shop") || core.status.event.id != 'action') return false;
if (core.status.event.data.type != 'choices') return false;
core.status.onShopLongDown = true;
var data = core.status.event.data.current;
var choices = data.choices;
var topIndex = core.actions._getChoicesTopIndex(choices.length);