diff --git a/_server/config.json b/_server/config.json index fe6a45a9..9c9888dc 100644 --- a/_server/config.json +++ b/_server/config.json @@ -1 +1 @@ -{"lastUsed":[],"foldPerCol":50,"folded":false,"editorLastFloorId":null,"disableBlocklyReplace":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0}} \ No newline at end of file +{"lastUsed":[],"foldPerCol":50,"folded":false,"editorLastFloorId":"sample0","disableBlocklyReplace":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0}} \ No newline at end of file diff --git a/_server/css/editor_mode.css b/_server/css/editor_mode.css index 33f1a9bd..19de890b 100644 --- a/_server/css/editor_mode.css +++ b/_server/css/editor_mode.css @@ -210,11 +210,7 @@ div.etableInputDiv { border: none; } -.etableInputDiv input[type="text"] { - -} - -.etableInputDiv input[type="checkbox"] { +.etableInputDiv .checkbox { width: 16px; height: 16px; position: absolute; @@ -224,8 +220,10 @@ div.etableInputDiv { margin-top: -8px; } -.etableInputDiv select { - +.etableInputDiv .cannotInOutCheckbox { + width: 16px; + height: 16px; + display: inline; } .etableInputDiv textarea { diff --git a/_server/editor_table.js b/_server/editor_table.js index c21220fd..8d699188 100644 --- a/_server/editor_table.js +++ b/_server/editor_table.js @@ -21,11 +21,18 @@ editor_table_wrapper = function (editor) { return /* html */`\n` } editor_table.prototype.checkbox = function (value) { - return /* html */`\n` + return /* html */`\n` } editor_table.prototype.textarea = function (value, indent) { return /* html */`\n` } + editor_table.prototype.cannotInOutCheckbox = function (value) { + if (!(value instanceof Array)) value = []; + return /* html */`上:=0 ? 'checked ' : ''} /> +  下:=0 ? 'checked ' : ''} />
+ 左:=0 ? 'checked ' : ''} /> +  右:=0 ? 'checked ' : ''} />
`; + } editor_table.prototype.editGrid = function (showComment) { var html = ""; if (showComment) html += "
"; @@ -220,16 +227,15 @@ editor_table_wrapper = function (editor) { editor_table.prototype.objToTd = function (obj, commentObj, field, cfield, vobj, cobj) { var thiseval = vobj; - if (cobj._select) { - var values = cobj._select.values; - return editor.table.select(thiseval, values); - } else if (cobj._input) { - return editor.table.text(thiseval); - } else if (cobj._bool) { - return editor.table.checkbox(thiseval); - } else { - var indent = 0; - return editor.table.textarea(thiseval, indent); + switch (cobj._type) { + case 'select': + return editor.table.select(thiseval, cobj._select.values); + case 'checkbox': + return editor.table.checkbox(thiseval); + case 'cannotInOutCheckbox': + return editor.table.cannotInOutCheckbox(thiseval); + default: + return editor.table.textarea(thiseval, cobj.indent || 0); } } @@ -263,6 +269,7 @@ editor_table_wrapper = function (editor) { // >td[title=comment,cobj=cobj:json] // >td>div>input[value=thiseval] var thisTr = document.getElementById(guid); + var inputs = thisTr.children[2].children[0].children; var input = thisTr.children[2].children[0].children[0]; var field = thisTr.children[0].getAttribute('title'); var cobj = JSON.parse(thisTr.children[1].getAttribute('cobj')); @@ -270,8 +277,17 @@ editor_table_wrapper = function (editor) { while (!editor_mode._ids.hasOwnProperty(modeNode.getAttribute('id'))) { modeNode = modeNode.parentNode; } - input.onchange = function () { - editor.table.onchange(guid, obj, commentObj, thisTr, input, field, cobj, modeNode) + for (var i in inputs) { + var input = inputs[i]; + if (input.nodeName == 'INPUT' || input.nodeName == 'SELECT' || input.nodeName == 'TEXTAREA') { + input.onchange = function () { + if (cobj._type == 'cannotInOutCheckbox') { + editor.table.onCannotInOutChange(guid, obj, commentObj, thisTr, inputs, field, cobj, modeNode); + } else { + editor.table.onchange(guid, obj, commentObj, thisTr, input, field, cobj, modeNode); + } + } + } } // 用检测两次单击的方式来实现双击(以支持手机端的双击) var doubleClickCheck = [0]; @@ -307,6 +323,31 @@ editor_table_wrapper = function (editor) { } } + /** + * 当“cannotOut / cannotIn”的表格值变化时 + */ + editor_table.prototype.onCannotInOutChange = function (guid, obj, commentObj, thisTr, inputs, field, cobj, modeNode) { + editor_mode.onmode(editor_mode._ids[modeNode.getAttribute('id')]); + var value = []; + var directions = ['up', 'down', 'left', 'right']; + var index = 0; + for (var i in inputs) { + if (inputs[i].nodeName == 'INPUT') { + if (inputs[i].checked) value.push(directions[index]); + index++; + } + } + if (value.length == 0) thiseval = null; + else thiseval = value; + if (editor.table.checkRange(cobj, thiseval)) { + editor_mode.addAction(['change', field, thiseval]); + editor_mode.onmode('save');//自动保存 删掉此行的话点保存按钮才会保存 + } else { + printe(field + ' : 输入的值不合要求,请鼠标放置在注释上查看说明'); + } + + } + /** * 当"显示完整注释"被按下时 */ diff --git a/_server/table/comment.js b/_server/table/comment.js index 304ee4e2..b1dfc5f3 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -48,7 +48,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "hideInReplay": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否回放时绘制道具栏。\n如果此项为true,则在回放录像时使用本道具将不会绘制道具栏页面,而是直接使用。\n此项建议在会频繁连续多次使用的道具开启(如开启技能,或者《镜子》那样的镜像切换等等)" } } @@ -159,7 +158,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "zoneSquare": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "领域怪是否九宫格伤害" }, "range": { @@ -171,7 +169,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "notBomb": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该怪物不可被炸" }, "n": { @@ -183,7 +180,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "add": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "吸血后是否加到自身;光环是否叠加" }, "atkValue": { @@ -273,20 +269,17 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { }, "cannotOut": { "_leaf": true, - "_type": "textarea", - "_range": "thiseval==null||(thiseval instanceof Array)", + "_type": "cannotInOutCheckbox", "_data": "该图块的不可出方向\n可以在这里定义在该图块时不能前往哪个方向,可以达到悬崖之类的效果\n例如 [\"up\", \"left\"] 代表在该图块时不能往上和左走\n此值对背景层、事件层、前景层上的图块均有效" }, "cannotIn": { "_leaf": true, - "_type": "textarea", - "_range": "thiseval==null||(thiseval instanceof Array)", + "_type": "cannotInOutCheckbox", "_data": "该图块的不可入方向\n可以在这里定义不能朝哪个方向进入该图块,可以达到悬崖之类的效果\n例如 [\"down\"] 代表不能从该图块的上方点朝向下进入此图块\n此值对背景层、事件层、前景层上的图块均有效" }, "canBreak": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该图块是否可被破墙或地震" }, "animate": { @@ -347,25 +340,21 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "canFlyTo": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器)" }, "canUseQuickShop": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该层是否允许使用快捷商店" }, "cannotViewMap": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该层是否不允许被浏览地图看到;如果勾上则浏览地图会跳过该层" }, "cannotMoveDirectly": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "该层是否不允许瞬间移动;如果勾上则不可在此层进行瞬移" }, "firstArrive": { @@ -436,7 +425,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "underGround": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否是地下层;如果该项为true则同层传送将传送至上楼梯" } } diff --git a/_server/table/data.comment.js b/_server/table/data.comment.js index 9ad923d6..99f7893f 100644 --- a/_server/table/data.comment.js +++ b/_server/table/data.comment.js @@ -436,205 +436,171 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "enableFloor": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示当前楼层" }, "enableName": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示勇士名字" }, "enableLv": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示当前等级" }, "enableHPMax": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否是否启用生命上限" }, "enableMana": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否开启魔力值" }, "enableMDef": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏及战斗界面显示魔防(护盾)" }, "enableMoney": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏、怪物手册及战斗界面显示金币" }, "enableExperience": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏、怪物手册及战斗界面显示经验" }, "enableLevelUp": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false" }, "levelUpLeftMode": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "进阶使用扣除模式,即在状态栏显示距离下个等级所需要的经验值;只有enableExperience和enableLevelUp均开启时才有效。" }, "enableKeys": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示三色钥匙数量" }, "enablePZF": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示破炸飞数量" }, "enableDebuff": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在状态栏显示毒衰咒" }, "enableSkill": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否启用技能栏" }, "flyNearStair": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "传送器是否需要在楼梯边使用;如果flyRecordPosition开启,则此项对箭头也有效。" }, "flyRecordPosition": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "传送器平面塔模式;此模式下楼层传送器将飞到上次离开该楼层的位置。" }, "pickaxeFourDirections": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁" }, "bombFourDirections": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价)" }, "snowFourDirections": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "使用冰冻徽章是否四个方向都会消除熔岩;如果false则只消除面前的熔岩" }, "bigKeyIsBox": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙" }, "steelDoorWithoutKey": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "铁门是否不需要钥匙开启。如果此项为true,则无需钥匙也可以开铁门。" }, "itemFirstText": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "首次获得道具是否提示" }, "equipment": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "剑和盾是否作为装备。如果此项为true,则作为装备,需要在装备栏使用,否则将直接加属性。" }, "equipboxButton": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "状态栏的装备按钮。若此项为true则将状态栏中的楼层转换器按钮换为装备栏按钮" }, "iconInEquipbox": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "在装备栏中的属性变化,是否绘制图标;如果此项开启,则会绘制图标而不是文字" }, "enableAddPoint": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否支持加点" }, "enableNegativeDamage": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否支持负伤害(回血)" }, "hatredDecrease": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在和仇恨怪战斗后减一半的仇恨值,此项为false则和仇恨怪不会扣减仇恨值。" }, "betweenAttackCeil": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "夹击上整还是下整。如果此项为true则夹击伤害值向上取整,为false则为向下取整" }, "betweenAttackMax": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "夹击伤害是否不超过怪物伤害值。" }, "useLoop": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否循环计算临界;如果此项为true则使用循环法(而不是回合数计算法)来算临界\n从V2.5.3开始,对于大数据的循环法将改为使用二分法进行计算" }, "startUsingCanvas": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否开始菜单canvas化;如果此项为true,则将使用canvas来绘制开始菜单" }, "startDirectly": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面" }, "statusCanvas": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否状态栏canvas化,即手动自定义绘制状态栏。\n如果此项开启,则可在脚本编辑的drawStatusBar中自定义绘制菜单栏。" }, "statusCanvasRowsOnMobile": { @@ -646,73 +612,61 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "displayEnemyDamage": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否地图怪物显伤;用户可以手动在菜单栏中开关" }, "displayCritical": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否地图显示临界;用户可以手动在菜单栏中开关" }, "displayExtraDamage": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关" }, "enableGentleClick": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否允许轻触(获得面前物品)" }, "potionWhileRouting": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶" }, "ignoreChangeFloor": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "经过楼梯、传送门时是否能“穿透”。\n穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件" }, "canGoDeadZone": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否允许走到将死的领域上。如果此项为true,则可以走到将死的领域上" }, "enableMoveDirectly": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否允许瞬间移动" }, "enableDisabledShop": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否允许查看未开启状态的快捷商店内容;如果此项为真,则对于未开启状态的商店允许查看其内容(但不能购买)" }, "disableShopOnDamage": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否在经过领域/夹击/路障等伤害后禁用快捷商店。" }, "blurFg": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否虚化前景层;如果此项开启,则在游戏中事件层有东西(如宝石等)时虚化前景层。" }, "checkConsole": { "_leaf": true, "_type": "checkbox", - "_bool": "bool", "_data": "是否检查控制台的开启情况。" } } diff --git a/libs/maps.js b/libs/maps.js index 9405f0bc..96b76efd 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -515,6 +515,7 @@ maps.prototype._canMoveHero_checkCannotInOut = function (number, name, direction } return false; } + if (name == 'cannotIn') direction = core.reverseDirection(direction); return core.inArray((this.getBlockByNumber(number).event || {})[name], direction); } diff --git a/project/maps.js b/project/maps.js index 238da295..fe258890 100644 --- a/project/maps.js +++ b/project/maps.js @@ -105,10 +105,10 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "151": {"cls":"autotile","id":"autotile1","noPass":true}, "152": {"cls":"autotile","id":"autotile2","noPass":true}, "153": {"cls":"autotile","id":"autotile3","noPass":true}, - "161": {"cls":"terrains","id":"arrowUp","noPass":false,"cannotOut":["left","right","down"],"cannotIn":["down"]}, - "162": {"cls":"terrains","id":"arrowDown","noPass":false,"cannotOut":["left","right","up"],"cannotIn":["up"]}, - "163": {"cls":"terrains","id":"arrowLeft","noPass":false,"cannotOut":["up","down","right"],"cannotIn":["right"]}, - "164": {"cls":"terrains","id":"arrowRight","noPass":false,"cannotOut":["up","down","left"],"cannotIn":["left"]}, + "161": {"cls":"terrains","id":"arrowUp","noPass":false,"cannotOut":["left","right","down"],"cannotIn":["up"]}, + "162": {"cls":"terrains","id":"arrowDown","noPass":false,"cannotOut":["left","right","up"],"cannotIn":["down"]}, + "163": {"cls":"terrains","id":"arrowLeft","noPass":false,"cannotOut":["up","down","right"],"cannotIn":["left"]}, + "164": {"cls":"terrains","id":"arrowRight","noPass":false,"cannotOut":["up","down","left"],"cannotIn":["right"]}, "165": {"cls":"terrains","id":"light","trigger":"changeLight","noPass":false}, "166": {"cls":"terrains","id":"darkLight","noPass":true}, "167": {"cls":"terrains","id":"ski","trigger":"ski","noPass":false},