From fc5623514b06e8c84f995018465232dd5bf7c4af Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 24 May 2020 18:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=8F=8D=E5=A4=8D=E5=BC=B9?= =?UTF-8?q?=E7=AA=97;=E4=B8=8A=E4=B8=8B=E6=A5=BC=E9=80=89=E7=82=B9;?= =?UTF-8?q?=E6=94=BE=E7=BC=A9dom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_listen.js | 16 +++++++-------- _server/editor_mappanel.js | 33 ++++++++++++++++++++--------- _server/editor_mode.js | 15 +++++++++++++- _server/editor_table.js | 41 ++++++++++++++++++++++++++++++++++--- _server/table/comment.js | 6 +++--- libs/control.js | 3 +++ libs/core.js | 4 +++- libs/events.js | 2 +- project/fonts/number.ttf | Bin 0 -> 4312 bytes styles.css | 16 +++++++-------- v2.x-final更新.txt | 2 +- 11 files changed, 102 insertions(+), 36 deletions(-) create mode 100644 project/fonts/number.ttf diff --git a/_server/editor_listen.js b/_server/editor_listen.js index ebbf0369..0707ec28 100644 --- a/_server/editor_listen.js +++ b/_server/editor_listen.js @@ -28,15 +28,15 @@ editor_listen_wrapper = function (editor) { editor.dom.iconLib.onmouseup = editor.uifunctions.material_onup editor.dom.iconLib.oncontextmenu = function (e) { e.preventDefault() } - editor.dom.extraEvent.onmousedown = editor.uifunctions.extraEvent_click - editor.dom.chooseThis.onmousedown = editor.uifunctions.chooseThis_click - editor.dom.chooseInRight.onmousedown = editor.uifunctions.chooseInRight_click - editor.dom.copyLoc.onmousedown = editor.uifunctions.copyLoc_click - editor.dom.pasteLoc.onmousedown = editor.uifunctions.pasteLoc_click - editor.dom.clearEvent.onmousedown = editor.uifunctions.clearEvent_click - editor.dom.clearLoc.onmousedown = editor.uifunctions.clearLoc_click + editor.dom.extraEvent.onmouseup = editor.uifunctions.extraEvent_click + editor.dom.chooseThis.onmouseup = editor.uifunctions.chooseThis_click + editor.dom.chooseInRight.onmouseup = editor.uifunctions.chooseInRight_click + editor.dom.copyLoc.onmouseup = editor.uifunctions.copyLoc_click + editor.dom.pasteLoc.onmouseup = editor.uifunctions.pasteLoc_click + editor.dom.clearEvent.onmouseup = editor.uifunctions.clearEvent_click + editor.dom.clearLoc.onmouseup = editor.uifunctions.clearLoc_click - editor.dom.lastUsed.onmousedown = editor.uifunctions.lastUsed_click; + editor.dom.lastUsed.onmouseup = editor.uifunctions.lastUsed_click; editor.dom.lastUsed.oncontextmenu = function (e) { e.preventDefault(); } editor.dom.clearLastUsedBtn.onclick = editor.uifunctions.clearLastUsedBtn_click; editor.dom.lockMode.onchange = editor.uifunctions.lockMode_onchange; diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js index 4c95c61d..8237d950 100644 --- a/_server/editor_mappanel.js +++ b/_server/editor_mappanel.js @@ -436,13 +436,9 @@ editor_mappanel_wrapper = function (editor) { * 隐藏右键菜单 */ editor.uifunctions.hideMidMenu = function () { - if (editor.isMobile) { - setTimeout(function () { - editor.dom.midMenu.style = 'display:none'; - }, 200) - } else { + setTimeout(function () { editor.dom.midMenu.style = 'display:none'; - } + }, 100) } /** @@ -582,6 +578,8 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.chooseThis_click = function (e) { editor.uifunctions.hideMidMenu(); e.stopPropagation(); + e.stopImmediatePropagation(); + e.preventDefault(); selectBox.isSelected(false); editor_mode.onmode('nextChange'); @@ -589,6 +587,7 @@ editor_mappanel_wrapper = function (editor) { //editor_mode.loc(); //tip.whichShow(1); if (editor.isMobile) editor.showdataarea(false); + return false; } /** @@ -598,8 +597,11 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.chooseInRight_click = function (e) { editor.uifunctions.hideMidMenu(); e.stopPropagation(); + e.stopImmediatePropagation(); + e.preventDefault(); var thisevent = editor[editor.layerMod][editor.pos.y][editor.pos.x]; editor.setSelectBoxFromInfo(thisevent, true); + return false; } /** @@ -609,11 +611,12 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.copyLoc_click = function (e) { editor.uifunctions.hideMidMenu(); e.stopPropagation(); + e.stopImmediatePropagation(); e.preventDefault(); editor_mode.onmode(''); editor.uivalues.copyedInfo = editor.copyFromPos(); printf('该点事件已复制'); - return; + return false; } /** @@ -623,10 +626,11 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.pasteLoc_click = function (e) { editor.uifunctions.hideMidMenu(); e.stopPropagation(); + e.stopImmediatePropagation(); e.preventDefault(); if (!editor.uivalues.copyedInfo) { printe("没有复制的事件"); - return; + return false; } editor.savePreMap(); editor_mode.onmode(''); @@ -641,7 +645,7 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.unhighlightSaveFloorButton(); editor.drawPosSelection(); }); - return; + return false; } /** @@ -650,8 +654,11 @@ editor_mappanel_wrapper = function (editor) { */ editor.uifunctions.clearEvent_click = function (e) { e.stopPropagation(); + e.stopImmediatePropagation(); + e.preventDefault(); editor.clearPos(false); editor.uifunctions.unhighlightSaveFloorButton(); + return false; } /** @@ -660,8 +667,11 @@ editor_mappanel_wrapper = function (editor) { */ editor.uifunctions.clearLoc_click = function (e) { e.stopPropagation(); + e.stopImmediatePropagation(); + e.preventDefault(); editor.clearPos(true); editor.uifunctions.unhighlightSaveFloorButton(); + return false; } /** @@ -845,7 +855,10 @@ editor_mappanel_wrapper = function (editor) { } editor.uifunctions.lastUsed_click = function (e) { - if (editor.isMobile) return; + e.preventDefault(); + e.stopImmediatePropagation(); + e.stopPropagation(); + if (editor.isMobile) return false; var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft var scrollTop = document.documentElement.scrollTop || document.body.scrollTop diff --git a/_server/editor_mode.js b/_server/editor_mode.js index d7b8e728..7ebc5b95 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -57,7 +57,20 @@ editor_mode = function (editor) { printe(objs_.slice(-1)[0]); throw (objs_.slice(-1)[0]) } - ; printf('修改成功' + (data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.name == 'template' ? '\n\n请注意:全塔属性的name尚未修改,请及时予以设置' : '')); + ; + var str = '修改成功!'; + if (data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.name == 'template') + str += '\n请注意:全塔属性的name尚未修改,请及时予以设置。'; + if (mode == 'enemyitem') { + if (editor.info && editor.info.idnum) { + var block = editor.core.maps.blocksInfo[editor.info.idnum]; + if (block.doorInfo != null && block.doorInfo.keys != null && Object.keys(block.doorInfo.keys).length > 0 + && block.trigger != 'openDoor') { + str += "\n你修改了门信息,但触发器未改成openDoor,请修改否则无法撞击开门。" + } + } + } + printf(str); if (callback) callback(); } switch (mode) { diff --git a/_server/editor_table.js b/_server/editor_table.js index ddf31798..6e792a48 100644 --- a/_server/editor_table.js +++ b/_server/editor_table.js @@ -49,10 +49,11 @@ editor_table_wrapper = function (editor) { editor_table.prototype.checkboxSetMember = function (value,key,prefixString) { return /* html */`${prefixString}\n`; } - editor_table.prototype.editGrid = function (showComment, showEdit) { + editor_table.prototype.editGrid = function (showComment, showEdit, showCopy) { var list = []; if (showComment) list.push(""); - if (showEdit) list.push(""); + if (showEdit) list.push(""); + if (showCopy) list.push(""); return list.join(' '); } @@ -79,7 +80,7 @@ editor_table_wrapper = function (editor) { ${shortField} ${shortComment || commentHTMLescape}
${tdstr}
- ${editor.table.editGrid(shortComment, type != 'select' && type != 'checkbox' && type != 'checkboxSet' && type != 'disable')} + ${editor.table.editGrid(shortComment, type != 'select' && type != 'checkbox' && type != 'checkboxSet' && type != 'disable', type == 'disable')} \n` } @@ -416,6 +417,22 @@ editor_table_wrapper = function (editor) { if (cobj._type === 'textarea') editor_multi.import(guid, { lint: cobj._lint, string: cobj._string }); if (cobj._type === 'material') editor.table.selectMaterial(input, cobj); if (cobj._type === 'color') editor.table.selectColor(input); + if (cobj._type === 'point') editor.table.selectPoint(input); + } + + editor_table.prototype.onCopyBtnClick = function (button) { + var tr = button.parentNode.parentNode; + var input = tr.children[2].children[0].children[0]; + var value = JSON.parse(input.value); + if (value == null) { + printe('没有赋值的内容'); + return; + } + if (core.copy(value.toString())) { + printf('复制成功!'); + } else { + printe('无法复制此内容,请手动选择复制'); + } } /** @@ -431,6 +448,7 @@ editor_table_wrapper = function (editor) { if (cobj._type === 'textarea') editor_multi.import(guid, { lint: cobj._lint, string: cobj._string }); if (cobj._type === 'material') editor.table.selectMaterial(input, cobj); if (cobj._type === 'color') editor.table.selectColor(input); + if (cobj._type === 'point') editor.table.selectPoint(input); } else if (editor_mode.doubleClickMode === 'add') { editor_mode.doubleClickMode = 'change'; editor.table.addfunc(guid, obj, commentObj, thisTr, input, field, cobj, modeNode) @@ -466,6 +484,23 @@ editor_table_wrapper = function (editor) { }) } + editor_table.prototype.selectPoint = function (input) { + var x = 0, y = 0, value = input.value; + if (value != null) { + try { + var loc = JSON.parse(value); + if (loc instanceof Array && loc.length == 2) { + x = loc[0]; + y = loc[1]; + } + } catch (e) {} + } + editor.uievent.selectPoint(editor.currentFloorId, x, y, true, function (floorId, x, y) { + input.value = '['+x+','+y+']'; + input.onchange(); + }) + } + /** * 删除表格项 */ diff --git a/_server/table/comment.js b/_server/table/comment.js index 698cf390..14a709e0 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -282,7 +282,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_type": "select", "_select": { "values": [ - "null", + null, "openDoor", "pushBox", "ski", @@ -446,14 +446,14 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { }, "upFloor": { "_leaf": true, - "_type": "textarea", + "_type": "point", "_range": "thiseval==null||((thiseval instanceof Array) && thiseval.length==2)", "_docs": "上楼点", "_data": "该层上楼点,如[2,3]。\n如果此项不为null,则楼层转换时的stair:upFloor,以及楼传器的落点会被替换成该点而不是该层的上楼梯。" }, "downFloor": { "_leaf": true, - "_type": "textarea", + "_type": "point", "_range": "thiseval==null||((thiseval instanceof Array) && thiseval.length==2)", "_docs": "下楼点", "_data": "该层下楼点,如[2,3]。\n如果此项不为null,则楼层转换时的stair:downFloor,以及楼传器的落点会被替换成该点而不是该层的下楼梯。" diff --git a/libs/control.js b/libs/control.js index 93d8f5fd..f099f45b 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2721,6 +2721,9 @@ control.prototype._resize_gameGroup = function (obj) { floorMsgGroup.style = obj.globalAttribute.floorChangingStyle; floorMsgGroup.style.width = obj.outerSize - 2 * obj.BORDER + "px"; floorMsgGroup.style.height = totalHeight - 2 * obj.BORDER + "px"; + floorMsgGroup.style.fontSize = 16 * core.domStyle.scale + "px"; + // startPanel + core.dom.startPanel.style.fontSize = 16 * core.domStyle.scale + "px"; // musicBtn if (core.domStyle.isVertical || core.domStyle.scale < 1) { core.dom.musicBtn.style.right = core.dom.musicBtn.style.bottom = "3px"; diff --git a/libs/core.js b/libs/core.js index 0da652b7..bb01d112 100644 --- a/libs/core.js +++ b/libs/core.js @@ -230,7 +230,9 @@ core.prototype.init = function (coreData, callback) { core.extensions._load(function () { core._afterLoadResources(callback); }); - }); + }); + core.dom.musicBtn.style.display = 'block'; + core.setMusicBtn(); } core.prototype._init_flags = function () { diff --git a/libs/events.js b/libs/events.js index bb455bc6..509e5092 100644 --- a/libs/events.js +++ b/libs/events.js @@ -2972,7 +2972,7 @@ events.prototype.checkLvUp = function () { } events.prototype._checkLvUp_check = function () { - if (core.flags.statusBarItems.indexOf('enableLevelUp')>=0 || !core.firstData.levelUp + if (core.flags.statusBarItems.indexOf('enableLevelUp')<0 || !core.firstData.levelUp || core.status.hero.lv >= core.firstData.levelUp.length) return null; // 计算下一个所需要的数值 var next = (core.firstData.levelUp[core.status.hero.lv] || {}); diff --git a/project/fonts/number.ttf b/project/fonts/number.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bcf90fae15a92f26dae9f2bf31c86319c458ea77 GIT binary patch literal 4312 zcmchbe@xZa6~NE;fjr>B;{iSp0ePZ8iwKAg;Tzn-ox35h$nw*Tgm^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