提交秽翼的尤斯蒂娅所有文件

This commit is contained in:
strawberry42271 committed 2024-11-29 13:01:40 +08:00
1 parent f393512caa
commit 33ad4c1903
174 files changed
+46643

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

+797
View File
@@ -0,0 +1,797 @@
/*
* 表格配置项。
* 在这里可以对表格中的各项显示进行配置,包括表格项、提示内容等内容。具体写法照葫芦画瓢即可。
* 本配置项包括:道具、怪物、图块属性、楼层属性等内容。
* 相关文档 _docs/editor.md ~ http://127.0.0.1:1055/_docs/#/editor?id=修改表格
*/
var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "object",
"_data": {
// --------------------------- 【道具】相关的表格配置 --------------------------- //
"items": {
"_type": "object",
"_data": {
"id": {
"_leaf": true,
"_type": "disable",
"_docs": "道具ID",
"_data": "道具ID,可于页面底部修改"
},
"cls": {
"_leaf": true,
"_type": "select",
"_select": {
"values": [
"items",
"constants",
"tools",
"equips"
]
},
"_docs": "道具类别",
"_data": "items(宝石、血瓶) constants(永久物品) tools(消耗道具) equips(装备)"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_data": "道具名称"
},
"text": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "道具描述",
"_data": "道具在道具栏中显示的描述"
},
"hideInToolbox": {
"_leaf": true,
"_type": "checkbox",
"_docs": "不显示在道具栏",
},
"equip": {
"_leaf": true,
"_type": "event",
"_event": "equip",
"_docs": "道具的装备属性"
},
"hideInReplay": {
"_leaf": true,
"_type": "checkbox",
"_docs": "回放不绘制道具栏",
"_data": "此项建议在会频繁连续多次使用的道具开启(如开启技能,或者《镜子》那样的镜像切换等等)"
},
"itemEffect": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "即捡即用效果",
"_data": "即捡即用类物品的效果,仅对cls为items有效。"
},
"itemEffectTip": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "即捡即用提示",
"_data": "即捡即用类物品在获得时提示的文字,仅对cls为items有效。"
},
"useItemEvent": {
"_leaf": true,
"_type": "event",
"_event": "item",
"_docs": "碰触或使用事件",
"_data": "碰触或使用本道具所执行的事件,对所有cls有效"
},
"useItemEffect": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "使用效果",
"_data": "道具效果,仅对cls为tools或constants有效。"
},
"canUseItemEffect": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "能否使用或装备",
"_data": "当前能否使用或装备该道具,仅对cls不为items有效。null表示始终不可使用但可装备"
}
}
},
"items_template": { 'cls': 'items', 'name': '新物品', 'canUseItemEffect': 'true' },
// --------------------------- 【怪物】相关的表格配置 --------------------------- //
"enemys": {
"_type": "object",
"_data": {
"id": {
"_leaf": true,
"_type": "disable",
"_docs": "怪物ID",
"_data": "怪物ID,可于页面底部修改"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_data": "名称"
},
"description": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "怪物描述",
"_data": "可在怪物详细信息页面写的怪物描述,支持颜色、字体大小和样式、粗体斜体等转义方式。"
},
"displayIdInBook": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "手册ID",
"_data": "在怪物手册中映射到的怪物ID。如果此项不为null,则在怪物手册中,将用目标ID来替换该怪物原本的ID。常被运用在同一个怪物的多朝向上。"
},
"faceIds": {
"_leaf": true,
"_type": "event",
"_event": "faceIds",
"_docs": "行走朝向",
"_data": "行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。"
},
"bigImage": {
"_leaf": true,
"_type": "material",
"_directory": "./project/images/:images",
"_transform": (function (one) {
if (one.endsWith('.png')) return one;
return null;
}).toString(),
"_onconfirm": (function (previous, current) {
if (current.length == 0) return null;
return current[0];
}).toString(),
"_docs": "绑定贴图",
"_data": "该怪物绑定的怪物贴图,用法详见文档"
},
"hp": {
"_leaf": true,
"_type": "textarea",
"_data": "生命值"
},
"atk": {
"_leaf": true,
"_type": "textarea",
"_data": "攻击力"
},
"def": {
"_leaf": true,
"_type": "textarea",
"_data": "防御力"
},
"money": {
"_leaf": true,
"_type": "textarea",
"_data": "金币"
},
"exp": {
"_leaf": true,
"_type": "textarea",
"_data": "经验"
},
"point": {
"_leaf": true,
"_type": "textarea",
"_data": "加点"
},
"special": {
"_leaf": true,
"_type": "popCheckboxSet",
"_checkboxSet": function () {
var array = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.enemys.getSpecials()
var b = [],
c = [];
for (var index = 0; index < array.length; index++) {
b.push(array[index][0])
var name = array[index][1];
if (name instanceof Function) name = name({});
c.push(name + "(" + array[index][0] + ")")
}
return {
"prefix": c,
"key": b
}
},
"_data": "特殊属性"
},
"value": {
"_leaf": true,
"_type": "textarea",
"_docs": "特殊属性数值",
"_data": "特殊属性的数值\n如:领域/阻激/激光怪的伤害值;光环怪增加生命的比例"
},
"zone": {
"_leaf": true,
"_type": "textarea",
"_docs": "领域伤害",
"_data": "领域怪的伤害值"
},
"repulse": {
"_leaf": true,
"_type": "textarea",
"_docs": "阻击伤害",
"_data": "阻击怪的伤害值"
},
"laser": {
"_leaf": true,
"_type": "textarea",
"_docs": "激光伤害",
"_data": "激光怪的伤害值"
},
"breakArmor": {
"_leaf": true,
"_type": "textarea",
"_docs": "破甲比例",
"_data": "破甲百分比"
},
"counterAttack": {
"_leaf": true,
"_type": "textarea",
"_docs": "反击比例",
"_data": "反击百分比"
},
"vampire": {
"_leaf": true,
"_type": "textarea",
"_docs": "吸血比例",
"_data": "吸血怪的吸血百分比"
},
"hpBuff": {
"_leaf": true,
"_type": "textarea",
"_docs": "光环加血",
"_data": "光环怪增加生命的比例"
},
"atkBuff": {
"_leaf": true,
"_type": "textarea",
"_docs": "光环加攻",
"_data": "光环怪增加攻击的比例"
},
"defBuff": {
"_leaf": true,
"_type": "textarea",
"_docs": "光环加防",
"_data": "光环怪增加防御的比例"
},
"zoneSquare": {
"_leaf": true,
"_type": "checkbox",
"_docs": "九宫格",
"_data": "领域、阻击或捕捉怪是否九宫格"
},
"haloSquare": {
"_leaf": true,
"_type": "checkbox",
"_docs": "九宫格",
"_data": "光环怪是否九宫格"
},
"range": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "领域范围",
"_data": "领域的范围;不加默认为1"
},
"haloRange": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "光环范围",
"_data": "光环的范围;不加为全图效果"
},
"notBomb": {
"_leaf": true,
"_type": "checkbox",
"_docs": "不可炸",
"_data": "该怪物不可被炸"
},
"n": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "连击数",
"_data": "多连击的连击数,净化怪的净化倍率"
},
"purify": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "净化倍率",
"_data": "净化百分比"
},
"add": {
"_leaf": true,
"_type": "checkbox",
"_docs": "吸血加到自身",
"_data": "吸血后是否加到自身"
},
"haloAdd": {
"_leaf": true,
"_type": "checkbox",
"_docs": "光环是否叠加",
"_data": "光环是否叠加"
},
"atkValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣攻",
"_data": "退化时勇士下降的攻击力点数"
},
"defValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣防",
"_data": "退化时勇士下降的防御力点数"
},
"damage": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "固伤",
"_data": "战前扣血的点数"
},
"beforeBattle": {
"_leaf": true,
"_type": "event",
"_event": "beforeBattle",
"_docs": "战前事件",
"_data": "和该怪物战斗前触发的事件列表"
},
"afterBattle": {
"_leaf": true,
"_type": "event",
"_event": "afterBattle",
"_docs": "战后事件",
"_data": "和该怪物战斗后触发的事件列表"
}
}
},
"enemys_template": { 'name': '新敌人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'exp': 0, 'point': 0, 'special': [] },
// --------------------------- 【图块属性】相关的表格配置 --------------------------- //
"maps": {
"_type": "object",
"_data": {
"id": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_docs": "图块ID",
"_data": "图块唯一ID,可在页面底部修改"
},
"idnum": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_data": "图块数字"
},
"cls": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_data": "图块类别"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_data": "图块名称"
},
"trigger": {
"_leaf": true,
"_type": "select",
"_select": {
"values": [
null,
"openDoor",
"pushBox",
"ski",
"custom"
]
},
"_docs": "触发器",
"_data": "该图块的默认触发器"
},
"canPass": {
"_leaf": true,
"_type": "checkbox",
"_docs": "可通行性",
},
"script": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "碰触脚本",
"_data": "触碰到该图块时自动执行的脚本内容;此脚本会在该点的触发器执行前执行"
},
"event": {
"_leaf": true,
"_type": "event",
"_event": "item",
"_docs": "碰触事件",
"_data": "触碰到该图块时自动执行的事件内容;如果存在本事件则不会执行默认触发器"
},
"cannotOut": {
"_leaf": true,
"_type": "checkboxSet",
"_checkboxSet": {
"prefix": ["上: ", "下: ", "<br>左: ", "右: "],
"key": ["up", "down", "left", "right"]
},
"_docs": "不可出方向",
"_data": "该图块的不可出方向\n对背景层、事件层、前景层上的图块均有效"
},
"cannotIn": {
"_leaf": true,
"_type": "checkboxSet",
"_checkboxSet": {
"prefix": ["上: ", "下: ", "<br>左: ", "右: "],
"key": ["up", "down", "left", "right"]
},
"_docs": "不可入方向",
"_data": "该图块的不可入方向\n对背景层、事件层、前景层上的图块均有效"
},
"canBreak": {
"_leaf": true,
"_type": "checkbox",
"_docs": "可破震",
"_data": "该图块是否可被破墙或地震"
},
"animate": {
"_leaf": true,
"_type": "select",
"_select": {
"values": [null, 1, 2, 3, 4],
},
"_docs": "动画帧数",
"_data": "null代表素材默认帧数"
},
"doorInfo": {
"_leaf": true,
"_type": "event",
"_event": "doorInfo",
"_docs": "门信息",
"_data": "该图块的门信息,仅对animates和npc48生效。"
},
"faceIds": {
"_leaf": true,
"_type": "event",
"_event": "faceIds",
"_docs": "行走图朝向",
"_data": "行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。"
},
"bigImage": {
"_leaf": true,
"_type": "material",
"_directory": "./project/images/:images",
"_transform": (function (one) {
if (one.endsWith('.png')) return one;
return null;
}).toString(),
"_onconfirm": (function (previous, current) {
if (current.length == 0) return null;
return current[0];
}).toString(),
"_docs": "绑定贴图",
"_data": "该图块绑定的贴图,用法详见文档"
}
}
},
// --------------------------- 【楼层属性】相关的表格配置 --------------------------- //
"floors": {
"_type": "object",
"_data": {
"floor": {
"_type": "object",
"_data": {
"floorId": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_docs": "楼层ID",
"_data": "文件名和floorId需要保持完全一致,可在页面底部修改"
},
"title": {
"_leaf": true,
"_type": "textarea",
"_docs": "楼层名",
"_data": "楼层中文名,将在切换楼层和浏览地图时显示"
},
"areas": {
"_leaf": true,
"_type": "textarea",
"_docs": "区域名",
"_data": "小地图及楼传区域显示"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_docs": "状态栏显示",
"_data": "显示在状态栏中的层数"
},
"width": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_docs": "宽度",
"_data": "地图x方向大小,请在表格最下方修改"
},
"height": {
"_leaf": true,
"_type": "disable",
"_range": "false",
"_docs": "高度",
"_data": "地图y方向大小,请在表格最下方修改"
},
"canFlyTo": {
"_leaf": true,
"_type": "checkbox",
"_docs": "可楼传飞到",
"_data": "该楼能否被楼传器飞到"
},
"canFlyFrom": {
"_leaf": true,
"_type": "checkbox",
"_docs": "可楼传飞出",
"_data": "该楼能否用楼传器飞出"
},
"canUseQuickShop": {
"_leaf": true,
"_type": "checkbox",
"_docs": "快捷商店",
"_data": "该层是否允许使用快捷商店"
},
"cannotViewMap": {
"_leaf": true,
"_type": "checkbox",
"_docs": "不可浏览",
"_data": "该层是否不允许被浏览地图看到;如果勾上则浏览地图会跳过该层"
},
"cannotMoveDirectly": {
"_leaf": true,
"_type": "checkbox",
"_docs": "不可瞬移",
"_data": "该层是否不允许瞬间移动;如果勾上则不可在此层进行瞬移"
},
"underGround": {
"_leaf": true,
"_type": "checkbox",
"_docs": "地下层",
"_data": "是否是地下层;如果该项为true则同层传送将传送至上楼梯"
},
"firstArrive": {
"_leaf": true,
"_type": "event",
"_event": "firstArrive",
"_docs": "首次到达事件",
"_data": "第一次到该楼层触发的事件,可以双击进入事件编辑器。"
},
"eachArrive": {
"_leaf": true,
"_type": "event",
"_event": "eachArrive",
"_docs": "每次到达事件",
"_data": "每次到该楼层触发的事件,可以双击进入事件编辑器;该事件会在firstArrive执行后再执行。"
},
"parallelDo": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_template": "(function (timestamp) {\\n\\t// 在这里写楼层并行脚本,大约每16.6ms执行一次\\n\\t// timestamp: 从游戏开始到当前所经过的毫秒数。\\n\\t\\n})(timestamp);",
"_docs": "并行处理脚本",
"_data": "在该层楼时执行的并行脚本处理。\n可以在这里写上任意需要自动执行的脚本,比如打怪自动开门等。\n详见文档-事件-并行事件处理。"
},
"upFloor": {
"_leaf": true,
"_type": "point",
"_range": "thiseval==null||((thiseval instanceof Array) && thiseval.length==2)",
"_docs": "上楼点",
"_data": "该层上楼点,如[2,3]。\n如果此项不为null,则楼层转换时的stair:upFloor,以及楼传器的落点会被替换成该点而不是该层的上楼梯。"
},
"downFloor": {
"_leaf": true,
"_type": "point",
"_range": "thiseval==null||((thiseval instanceof Array) && thiseval.length==2)",
"_docs": "下楼点",
"_data": "该层下楼点,如[2,3]。\n如果此项不为null,则楼层转换时的stair:downFloor,以及楼传器的落点会被替换成该点而不是该层的下楼梯。"
},
"flyPoint": {
"_leaf": true,
"_type": "point",
"_range": "thiseval==null||((thiseval instanceof Array) && thiseval.length==2)",
"_docs": "楼传落点",
"_data": "该层楼传落点,如[2,3]。\n如果此项不为null,则楼层飞行器强行落到此点,无视上下楼或平面塔属性。"
},
"defaultGround": {
"_leaf": true,
"_type": "textarea",
"_docs": "地面图块",
"_data": "默认地面的图块ID,此项修改后需要刷新才能看到效果。不填则默认是ground"
},
"images": {
"_leaf": true,
"_type": "event",
"_event": "floorImage",
"_docs": "楼层贴图"
},
"color": {
"_leaf": true,
"_type": "color",
"_docs": "色调",
"_data": "该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组如[255,0,0,0.3]"
},
"weather": {
"_leaf": true,
"_type": "textarea",
"_docs": "天气",
"_data": "该层的默认天气。本项可忽略表示晴天,如果写则第一项为\"rain\",\"snow\", \"sun\", \"fog\", \"cloud\“代表对应的天气,第二项为1-10之间的数代表强度。\n如[\"rain\", 8]代表8级雨天。"
},
"bgm": {
"_leaf": true,
"_type": "material",
"_directory": "./project/bgms/",
"_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac'))
return one;
return null;
}).toString(),
"_onconfirm": (function (previous, current) {
if (current.length == 0) return null;
if (current.length == 1) return current[0];
return current;
}).toString(),
"_docs": "背景音乐",
"_data": "到达该层后默认播放的BGM"
},
"ratio": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval <= Number.MAX_SAFE_INTEGER && thiseval>=0",
"_docs": "宝石血瓶效果",
"_data": "每一层的宝石/血瓶效果,即获得宝石和血瓶时框内\"ratio\"的值。"
}
}
},
"loc": {
"_type": "object",
"_data": {
"events": {
"_leaf": true,
"_type": "event",
"_event": "event",
"_docs": "普通事件",
"_data": "该点的可能事件列表,可以双击进入事件编辑器。"
},
"autoEvent": {
"_type": "object",
"_leaf": false,
"_action": function (args) {
args.vobj = args.vobj || {};
for (var ii = 0; ii < 2; ii++) {
args.vobj[ii] = args.vobj[ii] || null;
}
},
"_data": function (key) {
return {
"_leaf": true,
"_type": "event",
"_event": "autoEvent",
"_data": "自动事件"
}
}
},
"changeFloor": {
"_leaf": true,
"_type": "event",
"_event": "changeFloor",
"_docs": "楼层转换",
"_data": "该点楼层转换事件;该事件不能和上面的events同时出现,否则会被覆盖"
},
"beforeBattle": {
"_leaf": true,
"_type": "event",
"_event": "beforeBattle",
"_docs": "战前事件",
"_data": "该点战斗前可能触发的事件列表,可以双击进入事件编辑器。"
},
"afterBattle": {
"_leaf": true,
"_type": "event",
"_event": "afterBattle",
"_docs": "战后事件",
"_data": "该点战斗后可能触发的事件列表,可以双击进入事件编辑器。"
},
"afterGetItem": {
"_leaf": true,
"_type": "event",
"_event": "afterGetItem",
"_docs": "道具后事件",
"_data": "该点获得道具后可能触发的事件列表,可以双击进入事件编辑器。"
},
"afterOpenDoor": {
"_leaf": true,
"_type": "event",
"_event": "afterOpenDoor",
"_docs": "开门后事件",
"_data": "该点开完门后可能触发的事件列表,可以双击进入事件编辑器。"
},
"cannotMove": {
"_leaf": true,
"_type": "checkboxSet",
"_checkboxSet": {
"prefix": ["上: ", "下: ", "<br>左: ", "右: "],
"key": ["up", "down", "left", "right"]
},
"_docs": "不可出方向",
"_data": "该点不可通行出的方向 \n 可以在这里定义该点不能前往哪个方向,可以达到悬崖之类的效果"
},
"cannotMoveIn": {
"_leaf": true,
"_type": "checkboxSet",
"_checkboxSet": {
"prefix": ["上: ", "下: ", "<br>左: ", "右: "],
"key": ["up", "down", "left", "right"]
},
"_docs": "不可入方向",
"_data": "该点不可通行入的方向 \n 可以在这里定义从哪个方向前往该点,可以达到悬崖之类的效果"
},
}
}
}
},
"floors_template": {
"floorId": "to be covered",
"title": "new floor",
"name": "new floor",
"width": 13,
"height": 13,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"cannotViewMap": false,
"cannotMoveDirectly": false,
"images": [],
"ratio": 1,
"defaultGround": "ground",
"bgm": null,
"upFloor": null,
"downFloor": null,
"color": null,
"weather": null,
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {}
}
}
}
+684
View File
@@ -0,0 +1,684 @@
/*
* 表格配置项。
* 在这里可以对表格中的各项显示进行配置,包括表格项、提示内容等内容。具体写法照葫芦画瓢即可。
* 本配置项包括:全塔属性的配置项。
* 相关文档 _docs/editor.md ~ http://127.0.0.1:1055/_docs/#/editor?id=修改表格
*/
var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "object",
"_data": {
"main": {
"_type": "object",
"_data": {
"floorIds": {
"_leaf": true,
"_type": "textarea",
"_range": "editor.mode.checkFloorIds(thiseval)",
"_docs": "楼层列表",
"_data": "在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器、浏览地图和上/下楼器的顺序"
},
"floorPartitions": {
"_leaf": true,
"_type": "event",
"_event": "floorPartition",
"_docs": "分区指定",
"_data": "可以在这里指定楼层分区;主要适用于不可返回的高层塔;进入新分区后将自动调用砍层插件以减少空间消耗;未在任何分区的楼层将被视为公共区域"
},
"images": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkImages(thiseval, './project/images/')",
"_directory": "./project/images/",
"_transform": (function (one) {
if (one.endsWith('.png') || one.endsWith('.jpg') || one.endsWith('.jpeg') || one.endsWith('.gif'))
return one;
return null;
}).toString(),
"_docs": "使用图片",
"_data": "在此存放所有可能使用的图片(tilesets除外) \n图片可以被作为背景图(的一部分),也可以直接用自定义事件进行显示。 \n 图片名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好 \n 建议对于较大的图片,在网上使用在线的“图片压缩工具(http://compresspng.com/zh/)”来进行压缩,以节省流量 \n 依次向后添加",
},
"splitImages": {
"_leaf": true,
"_type": "event",
"_event": "splitImages",
"_docs": "图片切分",
"_data": "可以在这里对使用到的图片进行按照一定宽高切分,生成若干新的小图供使用"
},
"tilesets": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkImages(thiseval, './project/tilesets/')",
"_directory": "./project/tilesets/",
"_transform": (function (one) {
if (one.endsWith('.png'))
return one;
return null;
}).toString(),
"_onconfirm": (function (previous, current) {
// 额外素材是有序的,因此根据之前的内容进行排序,然后在之后追加新的
previous = previous || [];
current = current.sort(function (a, b) {
var i = previous.indexOf(a);
var j = previous.indexOf(b);
if (i >= 0 && j >= 0) return i - j;
return j >= 0 ? 1 : -1;
});
return core.subarray(current, previous) == null &&
!confirm("您修改了现有额外素材的内容或顺序,这可能导致已经使用的额外素材无法正确显示。确定要修改么?") ?
previous : current;
}).toString(),
"_docs": "额外素材",
"_data": "在此存放额外素材的图片名, \n可以自定导入任意张素材图片,无需PS,无需注册,即可直接在游戏中使用 \n 形式如[\"1.png\", \"2.png\"] ,将需要的素材图片放在images目录下 \n 素材的宽高必须都是32的倍数,且图片上的总图块数不超过1000(即最多有1000个32*32的图块在该图片上)"
},
"animates": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/animates/",
"_transform": (function (one) {
if (one.endsWith(".animate")) return one.substring(0, one.lastIndexOf('.'));
return null;
}).toString(),
"_docs": "使用动画",
"_data": "在此存放所有可能使用的动画,必须是animate格式,在这里不写后缀名 \n动画必须放在animates目录下;文件名不能使用中文,不能带空格或特殊字符 \n \"jianji\", \"thunder\" 根据需求自行添加"
},
"bgms": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/bgms/",
"_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac'))
return one;
return null;
}).toString(),
"_docs": "使用音乐",
"_data": "在此存放所有的bgm,和文件名一致。 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
},
"sounds": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/sounds/",
"_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac'))
return one;
return null;
}).toString(),
"_docs": "使用音效",
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
},
"fonts": {
"_leaf": true,
"_type": "material",
"_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/fonts/",
"_transform": (function (one) {
if (one.endsWith(".ttf")) return one.substring(0, one.lastIndexOf('.'));
return null;
}).toString(),
"_docs": "使用字体",
"_data": "在此存放所有可能使用的字体 \n 字体名不能使用中文,不能带空格或特殊字符"
},
"nameMap": {
"_leaf": true,
"_type": "event",
"_event": "nameMap",
"_docs": "文件别名",
"_data": "文件别名设置,目前仅对images, animates, bgms, sounds有效。"
},
"levelChoose": {
"_leaf": true,
"_type": "event",
"_event": "levelChoose",
"_docs": "难度分歧",
"_data": "难度分歧定义和对应的事件;此处留空数组表示将直接开始游戏"
},
"equipName": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval instanceof Array)||thiseval==null",
"_docs": "装备孔",
"_data": "装备位名称,为一个数组,此项的顺序与equiptype数值关联;例如可写[\"武器\",\"防具\",\"首饰\"]等等。"
},
"startBgm": {
"_leaf": true,
"_type": "material",
"_directory": "./project/bgms/",
"_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav') || one.endsWith('.m4a') || one.endsWith('.flac'))
return one;
return null;
}).toString(),
"_onconfirm": (function (previous, current) {
if (current.length == 0) return null;
return current[0];
}).toString(),
"_docs": "标题音乐",
"_data": "在标题界面应该播放的bgm内容"
},
"styles": {
"_leaf": true,
"_type": "event",
"_event": "mainStyle",
"_docs": "主样式",
"_data": "主要样式设置,包括标题、按钮、状态栏等的背景色等"
}
}
},
"firstData": {
"_type": "object",
"_data": {
"title": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "游戏名",
"_data": "游戏名,将显示在标题页面以及切换楼层的界面中"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_range": "/^[a-zA-Z0-9_]{1,30}$/.test(thiseval)",
"_docs": "唯一英文标识符",
"_data": "游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过30个字符。\n此项必须修改,其将直接影响到存档的定位!"
},
"version": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "游戏版本",
"_data": "当前游戏版本;版本不一致的存档不能通用。"
},
"floorId": {
"_leaf": true,
"_type": "select",
"_select": {
"values": data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.floorIds
},
"_range": "data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.floorIds.indexOf(thiseval)!==-1",
"_docs": "初始楼层",
"_data": "初始楼层的ID"
},
"hero": {
"_type": "object",
"_data": {
"image": {
"_leaf": true,
"_type": "select",
"_select": {
"values": [null].concat(Object.keys(editor.core.material.images.images).filter(function (name) {
return name.endsWith('.png');
}))
},
"_data": "行走图"
},
"animate": {
"_leaf": true,
"_type": "checkbox",
"_docs": "帧动画",
"_data": "是否开启停止状态和对话框的帧动画"
},
"name": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_data": "勇士名"
},
"lv": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval &&thiseval>0",
"_data": "初始等级"
},
"hpmax": {
"_leaf": true,
"_type": "textarea",
"_data": "生命上限"
},
"hp": {
"_leaf": true,
"_type": "textarea",
"_data": "初始生命"
},
"manamax": {
"_leaf": true,
"_type": "textarea",
"_docs": "魔力上限",
"_data": "魔力上限;此项非负才会生效(null或小于0都不会生效)"
},
"mana": {
"_leaf": true,
"_type": "textarea",
"_data": "初始魔力"
},
"atk": {
"_leaf": true,
"_type": "textarea",
"_data": "初始攻击"
},
"def": {
"_leaf": true,
"_type": "textarea",
"_data": "初始防御"
},
"mdef": {
"_leaf": true,
"_type": "textarea",
"_data": "初始护盾"
},
"money": {
"_leaf": true,
"_type": "textarea",
"_data": "初始金币"
},
"exp": {
"_leaf": true,
"_type": "textarea",
"_data": "初始经验"
},
"equipment": {
"_leaf": true,
"_type": "textarea",
"_hide": true,
"_range": "thiseval instanceof Array",
"_data": "初始装备"
},
"items": {
"_type": "object",
"_hide": true,
"_data": {
"constants": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_docs": "永久道具",
"_data": "初始永久道具个数,例如初始送手册可以写 {\"book\": 1}"
},
"tools": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_docs": "消耗道具",
"_data": "初始消耗道具个数,例如初始有两破可以写 {\"pickaxe\": 2}"
},
"equips": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_docs": "初始拥有装备个数",
"_data": "初始装备个数,例如初始送铁剑可以写 {\"sword1\": 1}"
}
}
},
"loc": {
"_type": "object",
"_data": {
"direction": {
"_leaf": true,
"_type": "select",
"_data": "初始朝向",
"_select": {
"values": [
"up",
"down",
"left",
"right"
]
},
},
"x": {
"_leaf": true,
"_type": "textarea",
"_data": "横坐标"
},
"y": {
"_leaf": true,
"_type": "textarea",
"_data": "纵坐标"
}
}
},
"flags": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_data": "游戏变量"
},
"followers": {
"_leaf": true,
"_type": "disable",
"_hide": true,
"_data": "跟随者"
},
"steps": {
"_leaf": true,
"_type": "disable",
"_hide": true,
"_data": "行走步数"
}
}
},
"startCanvas": {
"_leaf": true,
"_type": "event",
"_event": "firstArrive",
"_range": "thiseval==null || thiseval instanceof Array",
"_docs": "标题事件",
"_data": "标题界面事件化,可以使用事件流的形式来绘制开始界面等。\n需要开启startUsingCanvas这个开关。\n详见文档-个性化-标题界面事件化。"
},
"startText": {
"_leaf": true,
"_type": "event",
"_event": "firstArrive",
"_range": "thiseval==null || thiseval instanceof Array",
"_docs": "开场剧情",
"_data": "游戏开始前剧情,可以执行任意自定义事件。\n双击进入事件编辑器。\n如果无剧情直接留一个空数组即可。"
},
"shops": {
"_leaf": true,
"_type": "event",
"_event": "shop",
"_range": "thiseval instanceof Array",
"_docs": "全局商店",
"_data": "全局商店,是一个数组,可以双击进入事件编辑器。"
},
"levelUp": {
"_leaf": true,
"_type": "event",
"_event": "level",
"_range": "thiseval==null || thiseval instanceof Array",
"_docs": "等级提升",
"_data": "经验升级所需要的数值,是一个数组,可以双击进行编辑。 \n 第一项为初始等级,仅title生效 \n 每一个里面可以含有三个参数 need, title, action \n need为所需要的经验数值,可以是个表达式。请确保need依次递增 \n title为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 \n action为本次升级所执行的事件,可由若干项组成"
}
}
},
"values": {
"_type": "object",
"_data": {
"lavaDamage": {
"_leaf": true,
"_type": "textarea",
"_data": "血网伤害"
},
"poisonDamage": {
"_leaf": true,
"_type": "textarea",
"_data": "中毒伤害"
},
"weakValue": {
"_leaf": true,
"_type": "textarea",
"_docs": "衰弱效果",
"_data": "衰弱状态下攻防减少的数值\n如果此项不小于1,则作为实际下降的数值(比如10就是攻防各下降10)\n如果在0到1之间则为下降的比例(比如0.3就是下降30%的攻防)"
},
"redGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "红宝石值",
},
"blueGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "蓝宝石值",
},
"greenGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "绿宝石值",
},
"redPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "红血瓶值",
},
"bluePotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "蓝血瓶值",
},
"yellowPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "黄血瓶值",
},
"greenPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "绿血瓶值",
},
"breakArmor": {
"_leaf": true,
"_type": "textarea",
"_docs": "破甲比例",
"_data": "破甲的比例(战斗前,怪物附加角色防御的x倍作为伤害);可以用怪物的 defValue 覆盖此值。"
},
"counterAttack": {
"_leaf": true,
"_type": "textarea",
"_docs": "反击比例",
"_data": "反击的比例(战斗时,怪物每回合附加角色攻击的x倍作为伤害,无视角色防御);可以用怪物的 atkValue 覆盖此值。"
},
"purify": {
"_leaf": true,
"_type": "textarea",
"_docs": "净化比例",
"_data": "净化的比例(战斗前,怪物附加勇士护盾的x倍作为伤害);可以用怪物的 n 覆盖此值。"
},
"hatred": {
"_leaf": true,
"_type": "textarea",
"_docs": "仇恨增值",
"_data": "仇恨属性中,每杀死一个怪物获得的仇恨值"
},
"animateSpeed": {
"_leaf": true,
"_type": "textarea",
"_docs": "全局帧动画时间",
"_data": "全局帧动画时间,即怪物振动频率,一般300比较合适"
},
"moveSpeed": {
"_leaf": true,
"_type": "textarea",
"_docs": "勇士移速",
"_data": "勇士每一格的移速,默认是100;此项可被用户修改覆盖"
},
"statusCanvasRowsOnMobile": {
"_leaf": true,
"_type": "select",
"_select": {
"values": [1, 2, 3, 4, 5]
},
"_docs": "竖状态栏自绘行数",
"_data": "竖屏模式下,顶端状态栏canvas化后的行数。\n此项将决定竖屏的状态栏高度,如果设置则不小于1且不大于5。\n仅在statusCanvas开启时才有效"
},
"floorChangeTime": {
"_leaf": true,
"_type": "textarea",
"_docs": "楼层切换时间",
"_data": "默认楼层切换时间;当楼层切换没有显式设置时间时将用此值;可以被用户在系统设置内手动修改"
}
}
},
"flags": {
"_type": "object",
"_data": {
"statusBarItems": {
"_leaf": true,
"_type": "checkboxSet",
"_checkboxSet": {
"prefix": [
"楼层",
"名字",
"<br>等级",
"血限",
"<br>生命",
"魔力",
"<br>攻击",
"防御",
"<br>护盾",
"金币",
"<br>经验",
"升级",
"<br>升级扣除模式",
"<br>钥匙",
"绿钥",
"<br>破炸",
"负面",
"<br>技能"
],
"key": [
"enableFloor",
"enableName",
"enableLv",
"enableHPMax",
"enableHP",
"enableMana",
"enableAtk",
"enableDef",
"enableMDef",
"enableMoney",
"enableExp",
"enableLevelUp",
"levelUpLeftMode",
"enableKeys",
"enableGreenKey",
"enablePZF",
"enableDebuff",
"enableSkill"
]
},
"_data": "状态栏显示项"
},
"autoScale": {
"_leaf": true,
"_type": "checkbox",
"_docs": "自动缩放",
"_data": "是否自动缩放至合适值"
},
"extendToolbar": {
"_leaf": true,
"_type": "checkbox",
"_docs": "画面下方道具栏",
"_data": "开启后道具栏会被挪动至游戏画面的下方"
},
"hideLeftStatusBar": {
"_leaf": true,
"_type": "checkbox",
"_docs": "隐藏左侧状态栏",
"_data": "是否隐藏左侧状态栏,开启后强制开启画面下方道具栏"
},
"flyNearStair": {
"_leaf": true,
"_type": "checkbox",
"_docs": "楼传需在楼梯边",
"_data": "传送器是否需要在楼梯边使用;如果flyRecordPosition开启,则此项对箭头也有效。"
},
"flyRecordPosition": {
"_leaf": true,
"_type": "checkbox",
"_docs": "楼传开平面模式",
"_data": "传送器平面塔模式;此模式下楼层传送器将飞到上次离开该楼层的位置。"
},
"itemFirstText": {
"_leaf": true,
"_type": "checkbox",
"_docs": "首次道具进行提示",
"_data": "首次获得道具是否提示"
},
"equipboxButton": {
"_leaf": true,
"_type": "checkbox",
"_docs": "状态栏装备按钮",
"_data": "状态栏的装备按钮。若此项为true则将状态栏中的楼层转换器按钮换为装备栏按钮"
},
"enableAddPoint": {
"_leaf": true,
"_type": "checkbox",
"_docs": "开启加点",
"_data": "是否支持加点"
},
"enableNegativeDamage": {
"_leaf": true,
"_type": "checkbox",
"_docs": "开启负伤",
"_data": "是否支持负伤害(回血)"
},
"betweenAttackMax": {
"_leaf": true,
"_type": "checkbox",
"_docs": "夹击不超伤害值",
"_data": "夹击伤害是否不超过怪物伤害值。"
},
"useLoop": {
"_leaf": true,
"_type": "checkbox",
"_docs": "二分临界",
"_data": "是否循环计算临界;如果此项为true则使用循环法(而不是回合数计算法)来算临界\n从V2.5.3开始,对于大数据的循环法将改为使用二分法进行计算"
},
"startUsingCanvas": {
"_leaf": true,
"_type": "checkbox",
"_docs": "标题开启事件化",
"_data": "是否开始菜单canvas化;如果此项为true,则将使用canvas来绘制开始菜单"
},
"statusCanvas": {
"_leaf": true,
"_type": "checkbox",
"_docs": "开启自绘状态栏",
"_data": "是否状态栏canvas化,即手动自定义绘制状态栏。\n如果此项开启,则可在脚本编辑的drawStatusBar中自定义绘制菜单栏。"
},
"enableEnemyPoint": {
"_leaf": true,
"_type": "checkbox",
"_docs": "定点怪显",
"_data": "是否开启怪物的定点显示功能,即属性不同的怪物会在怪物手册单列;用户可以手动在菜单栏中开关"
},
"enableGentleClick": {
"_leaf": true,
"_type": "checkbox",
"_docs": "允许轻按",
"_data": "是否允许轻触(获得面前物品)"
},
"ignoreChangeFloor": {
"_leaf": true,
"_type": "checkbox",
"_docs": "允许穿透楼梯",
"_data": "经过楼梯、传送门时是否能“穿透”。\n穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件"
},
"canGoDeadZone": {
"_leaf": true,
"_type": "checkbox",
"_docs": "允许将死领域",
"_data": "是否允许走到将死的领域上。如果此项为true,则可以走到将死的领域上"
},
"enableMoveDirectly": {
"_leaf": true,
"_type": "checkbox",
"_docs": "允许瞬移",
"_data": "是否允许瞬间移动"
},
"enableRouteFolding": {
"_leaf": true,
"_type": "checkbox",
"_docs": "录像折叠",
"_data": "是否开启录像折叠功能。\n此功能将尽可能的通过优化无损耗反复走的方式来缩短录像,但在某些情况下(尤其是创新向塔中)可能会存在副作用影响录像的正确性。"
},
"disableShopOnDamage": {
"_leaf": true,
"_type": "checkbox",
"_docs": "伤害禁用商店",
"_data": "是否在经过领域/夹击/路障等伤害后禁用快捷商店。"
},
"blurFg": {
"_leaf": true,
"_type": "checkbox",
"_docs": "虚化前景层",
"_data": "是否虚化前景层;如果此项开启,则在游戏中事件层有东西(如宝石等)时虚化前景层。"
}
}
}
}
}
+39
View File
@@ -0,0 +1,39 @@
/*
* 表格配置项。
* 在这里可以对表格中的各项显示进行配置,包括表格项、提示内容等内容。具体写法照葫芦画瓢即可。
* 本配置项包括:公共事件。
* 相关文档 _docs/editor.md ~ http://127.0.0.1:1055/_docs/#/editor?id=修改表格
*/
var events_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "object",
"_data": {
"commonEvent": {
"_type": "object",
"_data": function (key) {
var obj = {
"加点事件": {
"_leaf": true,
"_type": "event",
"_range": "thiseval instanceof Array",
"_event": "commonEvent",
"_data": "加点事件"
},
"回收钥匙商店": {
"_leaf": true,
"_type": "event",
"_event": "commonEvent",
"_data": "回收钥匙商店"
},
}
if (obj[key]) return obj[key];
return {
"_leaf": true,
"_type": "event",
"_event": "commonEvent",
"_data": "公共事件"
}
}
}
}
}
+213
View File
@@ -0,0 +1,213 @@
/*
* 表格配置项。
* 在这里可以对表格中的各项显示进行配置,包括表格项、提示内容等内容。具体写法照葫芦画瓢即可。
* 本配置项包括:脚本编辑。
* 相关文档 _docs/editor.md ~ http://127.0.0.1:1055/_docs/#/editor?id=修改表格
*/
var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "object",
"_data": {
"events": {
"_type": "object",
"_data": {
"resetGame": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "重置游戏"
},
"win": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "游戏获胜"
},
"lose": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "游戏失败"
},
"changingFloor": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "切换楼层中"
},
"afterChangeFloor": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "切换楼层后"
},
"flyTo": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "楼层飞行"
},
"beforeBattle": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "战前判定"
},
"afterBattle": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "战后脚本"
},
"afterOpenDoor": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "开门后脚本"
},
"afterGetItem": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "道具后脚本"
},
"afterPushBox": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "推箱子后"
}
}
},
"enemys": {
"_type": "object",
"_data": {
"getSpecials": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "怪物特殊属性"
},
"getEnemyInfo": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "怪物真实属性"
},
"getDamageInfo": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "战斗伤害信息"
}
}
},
"actions": {
"_type": "object",
"_data": {
"onKeyUp": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "按键处理"
},
"onStatusBarClick": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_docs": "点击状态栏",
"_data": "状态栏点击事件,仅在开启自绘状态栏时生效"
}
}
},
"control": {
"_type": "object",
"_data": {
"saveData": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "存档操作"
},
"loadData": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "读档操作"
},
"getStatusLabel": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "状态名定义"
},
"triggerDebuff": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "毒衰咒处理"
},
"updateStatusBar": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "更新状态栏"
},
"updateCheckBlock": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "阻激夹域伤害"
},
"moveOneStep": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "每步后操作"
},
"moveDirectly": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "瞬间移动"
},
"parallelDo": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "并行脚本"
}
}
},
"ui": {
"_type": "object",
"_data": {
"getToolboxItems": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "道具栏显示项"
},
"drawStatusBar": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_preview": "statusBar",
"_data": "自绘状态栏"
},
"drawStatistics": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "数据统计"
},
"drawAbout": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "关于界面"
}
}
}
}
}
+124
View File
@@ -0,0 +1,124 @@
/*
* 表格配置项。
* 在这里可以对表格中的各项显示进行配置,包括表格项、提示内容等内容。具体写法照葫芦画瓢即可。
* 本配置项包括:插件编写。
* 相关文档 _docs/editor.md ~ http://127.0.0.1:1055/_docs/#/editor?id=修改表格
*/
var plugins_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "object",
"_data": function (key) {
var obj = {
"init": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string'",
"_data": "初始化"
},
"shop": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string'",
"_data": "全局商店"
},
"drawLight": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "灯光效果"
},
"removeMap": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "砍层插件"
},
"fiveLayers": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "五图层(背景前景2)"
},
"itemShop": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "道具商店"
},
"enemyLevel": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "手册显示怪物境界"
},
"multiHeros": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "多角色"
},
"heroFourFrames": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "勇士四帧行走动画"
},
"routeFixing": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "录像精修"
},
"numpad": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "整数输入面板美化"
},
"sprite": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "基于canvas的sprite化"
},
"hotReload": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "热重载"
},
"statusBar": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "自定义状态栏"
},
"override": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "函数复写"
},
"animate": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "高级动画"
},
"func": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "实用函数集"
}
}
if (obj[key]) return obj[key];
return {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_template": "function () {\\n\\t// 在此增加新插件\\n\\t\\n}",
"_data": "自定义插件"
}
}
}
+60
View File
@@ -0,0 +1,60 @@
/* jsColor */
The MIT License (MIT)
Copyright (c) 2014 Peter Dematté
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
/* awesomplete */
The MIT License (MIT)
Copyright (c) 2015 Lea Verou
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
/* caret-position */
The MIT License (MIT)
Copyright (c) 2015 Jonathan Ong me@jongleberry.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+75
View File
@@ -0,0 +1,75 @@
.awesomplete [hidden] {
display: none;
}
.awesomplete .visually-hidden {
position: absolute;
clip: rect(0, 0, 0, 0);
}
.awesomplete {
display: inline-block;
position: relative;
}
.awesomplete > input {
display: block;
}
.awesomplete > ul {
position: absolute;
left: 0;
z-index: 1;
box-sizing: border-box;
list-style: none;
padding: 0;
margin: 0;
white-space: nowrap;
}
.awesomplete > ul:empty {
display: none;
}
.awesomplete > ul {
border-radius: .3em;
margin: .8em 0 0;
text-shadow: none;
}
@supports (transform: scale(0)) {
.awesomplete > ul {
transition: .3s cubic-bezier(.4,.2,.5,1.4);
transform-origin: 1.43em -.43em;
}
.awesomplete > ul[hidden],
.awesomplete > ul:empty {
opacity: 0;
transform: scale(0);
display: block;
transition-timing-function: ease;
}
}
/* Pointer */
.awesomplete > ul:before {
content: "";
position: absolute;
top: -.43em;
left: 1em;
width: 0; height: 0;
padding: .4em;
border: inherit;
border-right: 0;
border-bottom: 0;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.awesomplete > ul > li {
position: relative;
padding: .2em .5em;
cursor: pointer;
word-break: keep-all;
}
+2
View File
@@ -0,0 +1,2 @@
// Awesomplete - Lea Verou - MIT license
!function(){function t(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}function e(t,e,i){for(var n in e){var s=e[n],r=t.input.getAttribute("data-"+n.toLowerCase());"number"==typeof s?t[n]=parseInt(r):!1===s?t[n]=null!==r:s instanceof Function?t[n]=null:t[n]=r,t[n]||0===t[n]||(t[n]=n in i?i[n]:s)}}function i(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function n(t,e){return o.call((e||document).querySelectorAll(t))}function s(){n("input.awesomplete").forEach(function(t){new r(t)})}var r=function(t,n){var s=this;r.count=(r.count||0)+1,this.count=r.count,this.isOpened=!1,this.input=i(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=n=n||{},e(this,{minChars:2,maxItems:10,autoFirst:!1,data:r.DATA,filter:r.FILTER_CONTAINS,sort:!1!==n.sort&&r.SORT_BYLENGTH,container:r.CONTAINER,item:r.ITEM,replace:r.REPLACE,tabSelect:!1},n),this.index=-1,this.container=this.container(t),this.ul=i.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container}),this.status=i.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:0!=this.minChars?"Type "+this.minChars+" or more characters for results.":"Begin typing for results."}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;s.opened&&(13===e&&s.selected?(t.preventDefault(),s.select()):9===e&&s.selected&&s.tabSelect?s.select():27===e?s.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),s[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),s.select(e,t.target))}}}},i.bind(this.input,this._events.input),i.bind(this.input.form,this._events.form),i.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||n.list||[],r.all.push(this)};r.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=i(t))&&t.children){var e=[];o.apply(t.children).forEach(function(t){if(!t.disabled){var i=t.textContent.trim(),n=t.value||i,s=t.label||i;""!==n&&e.push({label:s,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),i.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),i.fire(this.input,"awesomplete-open")},destroy:function(){if(i.unbind(this.input,this._events.input),i.unbind(this.input.form,this._events.form),!this.options.container){var t=this.container.parentNode;t.insertBefore(this.input,this.container),t.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var e=r.all.indexOf(this);-1!==e&&r.all.splice(e,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent+", list item "+(t+1)+" of "+e.length,this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,i.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=i.siblingIndex(t):t=this.ul.children[this.index],t){var n=this.suggestions[this.index];i.fire(this.input,"awesomplete-select",{text:n,origin:e||t})&&(this.replace(n),this.close({reason:"select"}),i.fire(this.input,"awesomplete-selectcomplete",{text:n}))}},evaluate:function(){var e=this,i=this.input.value;i.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new t(e.data(n,i))}).filter(function(t){return e.filter(t,i)}),!1!==tLine truncated
+158
View File
@@ -0,0 +1,158 @@
/* jshint browser: true */
(function () {
// We'll copy the properties below into the mirror div.
// Note that some browsers, such as Firefox, do not concatenate properties
// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),
// so we have to list every single property explicitly.
var properties = [
'direction', // RTL support
'boxSizing',
'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does
'height',
'overflowX',
'overflowY', // copy the scrollbar for IE
'borderTopWidth',
'borderRightWidth',
'borderBottomWidth',
'borderLeftWidth',
'borderStyle',
'paddingTop',
'paddingRight',
'paddingBottom',
'paddingLeft',
// https://developer.mozilla.org/en-US/docs/Web/CSS/font
'fontStyle',
'fontVariant',
'fontWeight',
'fontStretch',
'fontSize',
'fontSizeAdjust',
'lineHeight',
'fontFamily',
'textAlign',
'textTransform',
'textIndent',
'textDecoration', // might not make a difference, but better be safe
'letterSpacing',
'wordSpacing',
'tabSize',
'MozTabSize'
];
var isBrowser = (typeof window !== 'undefined');
var isFirefox = (isBrowser && window.mozInnerScreenX != null);
function getCaretCoordinates(element, position, options) {
if (!isBrowser) {
throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');
}
var debug = options && options.debug || false;
if (debug) {
var el = document.querySelector('#input-textarea-caret-position-mirror-div');
if (el) el.parentNode.removeChild(el);
}
// The mirror div will replicate the textarea's style
var div = document.createElement('div');
div.id = 'input-textarea-caret-position-mirror-div';
document.body.appendChild(div);
var style = div.style;
var computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9
var isInput = element.nodeName === 'INPUT';
// Default textarea styles
style.whiteSpace = 'nowrap';
style.zIndex = 2000;
if (!isInput)
style.wordWrap = 'break-word'; // only for textarea-s
// Position off-screen
style.position = 'absolute'; // required to return coordinates properly
if (!debug)
style.visibility = 'hidden'; // not 'display: none' because we want rendering
// Transfer the element's properties to the div
properties.forEach(function (prop) {
if (isInput && prop === 'lineHeight') {
// Special case for <input>s because text is rendered centered and line height may be != height
if (computed.boxSizing === "border-box") {
var height = parseInt(computed.height);
var outerHeight =
parseInt(computed.paddingTop) +
parseInt(computed.paddingBottom) +
parseInt(computed.borderTopWidth) +
parseInt(computed.borderBottomWidth);
var targetHeight = outerHeight + parseInt(computed.lineHeight);
if (height > targetHeight) {
style.lineHeight = height - outerHeight + "px";
} else if (height === targetHeight) {
style.lineHeight = computed.lineHeight;
} else {
style.lineHeight = 0;
}
} else {
style.lineHeight = computed.height;
}
} else {
style[prop] = computed[prop];
}
});
if (!isInput)
style.whiteSpace = 'pre-wrap';
if (isFirefox) {
// Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275
if (element.scrollHeight > parseInt(computed.height))
style.overflowY = 'scroll';
} else {
style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'
}
div.textContent = element.value.substring(0, position);
// The second special handling for input type="text" vs textarea:
// spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037
if (isInput)
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
var span = document.createElement('span');
// Wrapping must be replicated *exactly*, including when a long word gets
// onto the next line, with whitespace at the end of the line before (#7).
// The *only* reliable way to do that is to copy the *entire* rest of the
// textarea's content into the <span> created at the caret position.
// For inputs, just '.' would be enough, but no need to bother.
span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all
div.appendChild(span);
var coordinates = {
top: span.offsetTop + parseInt(computed['borderTopWidth']),
left: span.offsetLeft + parseInt(computed['borderLeftWidth']),
height: parseInt(computed['lineHeight'])
};
if (debug) {
span.style.backgroundColor = '#aaa';
} else {
document.body.removeChild(div);
}
return coordinates;
}
if (typeof module != 'undefined' && typeof module.exports != 'undefined') {
module.exports = getCaretCoordinates;
} else if(isBrowser) {
window.getCaretCoordinates = getCaretCoordinates;
}
}());
+4
View File
@@ -0,0 +1,4 @@
/*! colorPicker - v1.0.0 2016-05-18 */
!function(a,b){"use strict";function c(a,c,d,f,g){if("string"==typeof c){var c=v.txt2color(c);d=c.type,n[d]=c[d],g=g!==b?g:c.alpha}else if(c)for(var h in c)a[d][h]="Lab"===d?k(c[h],l[d][h][0],l[d][h][1]):k(c[h]/l[d][h][1],0,1);return g!==b&&(a.alpha=k(+g,0,1)),e(d,f?a:b)}function d(a,b,c){var d=m.options.grey,e={};return e.RGB={r:a.r,g:a.g,b:a.b},e.rgb={r:b.r,g:b.g,b:b.b},e.alpha=c,e.equivalentGrey=r.round(d.r*a.r+d.g*a.g+d.b*a.b),e.rgbaMixBlack=i(b,{r:0,g:0,b:0},c,1),e.rgbaMixWhite=i(b,{r:1,g:1,b:1},c,1),e.rgbaMixBlack.luminance=h(e.rgbaMixBlack,!0),e.rgbaMixWhite.luminance=h(e.rgbaMixWhite,!0),m.options.customBG&&(e.rgbaMixCustom=i(b,m.options.customBG,c,1),e.rgbaMixCustom.luminance=h(e.rgbaMixCustom,!0),m.options.customBG.luminance=h(m.options.customBG,!0)),e}function e(a,b){var c,e,k,o=r,p=b||n,q=v,s=m.options,t=l,u=p.RND,w="",x="",y={hsl:"hsv",cmyk:"cmy",rgb:a},z=u.rgb;if("alpha"!==a){for(var A in t)if(!t[A][A]){a!==A&&"XYZ"!==A&&(x=y[A]||"rgb",p[A]=q[x+"2"+A](p[x])),u[A]||(u[A]={}),c=p[A];for(w in c)u[A][w]=o.round(c[w]*("Lab"===A?1:t[A][w][1]))}"Lab"!==a&&delete p._rgb,z=u.rgb,p.HEX=q.RGB2HEX(z),p.equivalentGrey=s.grey.r*p.rgb.r+s.grey.g*p.rgb.g+s.grey.b*p.rgb.b,p.webSave=e=f(z,51),p.webSmart=k=f(z,17),p.saveColor=z.r===e.r&&z.g===e.g&&z.b===e.b?"web save":z.r===k.r&&z.g===k.g&&z.b===k.b?"web smart":"",p.hueRGB=q.hue2RGB(p.hsv.h),b&&(p.background=d(z,p.rgb,p.alpha))}var B,C,D,E,F,G,H,I=p.rgb,J=p.alpha,K="luminance",L=p.background,M=i,N=h,O=j,P=g;return B=M(I,{r:0,g:0,b:0},J,1),B[K]=N(B,!0),p.rgbaMixBlack=B,C=M(I,{r:1,g:1,b:1},J,1),C[K]=N(C,!0),p.rgbaMixWhite=C,s.allMixDetails&&(B.WCAG2Ratio=O(B[K],0),C.WCAG2Ratio=O(C[K],1),s.customBG&&(D=M(I,s.customBG,J,1),D[K]=N(D,!0),D.WCAG2Ratio=O(D[K],s.customBG[K]),p.rgbaMixCustom=D),E=M(I,L.rgb,J,L.alpha),E[K]=N(E,!0),p.rgbaMixBG=E,F=M(I,L.rgbaMixBlack,J,1),F[K]=N(F,!0),F.WCAG2Ratio=O(F[K],L.rgbaMixBlack[K]),F.luminanceDelta=o.abs(F[K]-L.rgbaMixBlack[K]),F.hueDelta=P(L.rgbaMixBlack,F,!0),p.rgbaMixBGMixBlack=F,G=M(I,L.rgbaMixWhite,J,1),G[K]=N(G,!0),G.WCAG2Ratio=O(G[K],L.rgbaMixWhite[K]),G.luminanceDelta=o.abs(G[K]-L.rgbaMixWhite[K]),G.hueDelta=P(L.rgbaMixWhite,G,!0),p.rgbaMixBGMixWhite=G),s.customBG&&(H=M(I,L.rgbaMixCustom,J,1),H[K]=N(H,!0),H.WCAG2Ratio=O(H[K],L.rgbaMixCustom[K]),p.rgbaMixBGMixCustom=H,H.luminanceDelta=o.abs(H[K]-L.rgbaMixCustom[K]),H.hueDelta=P(L.rgbaMixCustom,H,!0)),p.RGBLuminance=N(z),p.HUELuminance=N(p.hueRGB),s.convertCallback&&s.convertCallback(p,a),p}function f(a,b){var c={},d=0,e=b/2;for(var f in a)d=a[f]%b,c[f]=a[f]+(d>e?b-d:-d);return c}function g(a,b,c){var d=r;return(d.max(a.r-b.r,b.r-a.r)+d.max(a.g-b.g,b.g-a.g)+d.max(a.b-b.b,b.b-a.b))*(c?255:1)/765}function h(a,b){for(var c=b?1:255,d=[a.r/c,a.g/c,a.b/c],e=m.options.luminance,f=d.length;f--;)d[f]=d[f]<=.03928?d[f]/12.92:r.pow((d[f]+.055)/1.055,2.4);return e.r*d[0]+e.g*d[1]+e.b*d[2]}function i(a,c,d,e){var f={},g=d!==b?d:1,h=e!==b?e:1,i=g+h*(1-g);for(var j in a)f[j]=(a[j]*g+c[j]*h*(1-g))/i;return f.a=i,f}function j(a,b){var c=1;return c=a>=b?(a+.05)/(b+.05):(b+.05)/(a+.05),r.round(100*c)/100}function k(a,b,c){return a>c?c:b>a?b:a}var l={rgb:{r:[0,255],g:[0,255],b:[0,255]},hsv:{h:[0,360],s:[0,100],v:[0,100]},hsl:{h:[0,360],s:[0,100],l:[0,100]},cmy:{c:[0,100],m:[0,100],y:[0,100]},cmyk:{c:[0,100],m:[0,100],y:[0,100],k:[0,100]},Lab:{L:[0,100],a:[-128,127],b:[-128,127]},XYZ:{X:[0,100],Y:[0,100],Z:[0,100]},alpha:{alpha:[0,1]},HEX:{HEX:[0,16777215]}},m={},n={},o={X:[.4124564,.3575761,.1804375],Y:[.2126729,.7151522,.072175],Z:[.0193339,.119192,.9503041],R:[3.2404542,-1.5371385,-.4985314],G:[-.969266,1.8760108,.041556],B:[.0556434,-.2040259,1.0572252]},p={r:.298954,g:.586434,b:.114612},q={r:.2126,g:.7152,b:.0722},r=a.Math,s=(a.parseInt,a.Colors=function(a){this.colors={RND:{}},this.options={color:"rgba(204, 82, 37, 0.8)",XYZMatrix:o,grey:p,luminance:q,valueRanges:l},t(this,a||{})}),t=function(a,d){var e,f,g=a.options;u(a);for(var h in d)d[h]!==b&&(g[h]=d[h]);e=g.XYZMatrix,d.XYZReference||(g.XYZReference={X:e.X[0]+e.X[1]+e.X[2],Y:e.Y[0]+e.Y[1]+e.Y[2],Z:e.Z[0]+e.Z[1]+e.Z[2]}),f=g.customBG,g.customBG="string"==typeof f?v.txt2color(f).rgb:f,n=c(a.colors,g.color,b,!0)},u=function(a){m!==a&&(m=a,n=a.colors)};s.prototype.setColor=function(a,d,f){return u(this),a?c(this.colors,a,d,b,f):(f!==b&&(this.colors.alpha=k(f,0,1)),e(d))},s.prototype.getColor=function(a){var c=this.colors,d=0;if(a){for(a=a.split(".");c[a[d]];)c=c[a[d++]];a.length!==d&&(c=b)}return c},s.prototype.setCustomBackground=function(a){return u(this),this.options.customBG="string"==typeof a?v.txt2color(a).rgb:a,c(this.colors,b,"rgb")},s.prototype.saveAsBackground=function(){return u(this),c(this.colors,b,"rgb",!0)},s.prototype.convertColor=function(a,b){var c=v,d=l,e=b.split("2"),f=e[0],g=e[1],h=/(?:RG|HS|CM|LA)/,i=h.test(f),j=h.test(g),k={LAB:"Lab"},m=function(a,b,c){var e={},f="Lab"===b?1:0;for(var g in a)e[g]=c?r.round(a[g]*(f||d[b][g][1])):a[g]/(f||d[b][g][1]);return e};return f=d[f]?f:k[f]||f.toLowerCase(),g=d[g]?g:k[g]||g.toLoweLine truncated
}function n(c){var d,e=c||a.event,f=e.which||e.keyCode,g=String.fromCharCode(f),h=document.activeElement,j=h.className.replace(bb.CSSPrefix,"").split("-"),k=j[0],l=j[1],m="alpha"===k,n="HEX"===k,o={k40:-1,k38:1,k34:-10,k33:10}["k"+f]/(m?100:1),p={HEX:/[0-9a-fA-F]/,Lab:/[\-0-9]/,alpha:/[\.0-9]/}[k]||/[0-9]/,q=S[k][k]||S[k][l],r=h.firstChild,s=H(h),u=r.data,w="0"!==u||n?u.split(""):[];return/^(?:27|13)$/.test(f)?(B(e),h.blur()):"keydown"===e.type?(o?d=z(db.round(1e6*(+u+o))/1e6,q[0],q[1]):/^(?:8|46)$/.test(f)&&(s.range||(s.range++,s.start-=8===f?1:0),w.splice(s.start,s.range),d=w.join("")||"0"),d!==b&&B(e,!0)):"keypress"===e.type&&(/^(?:37|39|8|46|9)$/.test(f)||B(e,!0),p.test(g)&&(w.splice(s.start,s.range,g),d=w.join("")),s.start++),13===f&&n?r.data.length%3===0||"0"===r.data?M.setColor("0"===r.data?"000":r.data,"rgb",ab.alpha,!0):(B(e,!0),h.focus()):(n&&d!==b&&(d=/^0+/.test(d)?d:parseInt(""+d,16)||0),void(d!==b&&""!==d&&+d>=q[0]&&+d<=q[1]&&(n&&(d=d.toString(16).toUpperCase()||"0"),m?ab[k]=+d:n||(ab[k][l]=+d/("Lab"===k?1:q[1])),t(m?"alpha":k),v(ab),I=!0,i(c,e.type),r.data=d,H(h,db.min(h.firstChild.data.length,s.start<0?0:s.start)))))}function o(c){var d,e,f=c||a.event,g=f.target||f.srcElement,h=g.className,j=g.parentNode,k=bb,l=ab.RND.rgb,m=bb.mode,n="",o=k.CSSPrefix,p=/(?:hs|rgb)/.test(j.className)&&/^[HSBLRG]$/.test(g.firstChild?g.firstChild.data:""),q=/dblc/.test(f.type),r="";if(!q||p){if(-1!==h.indexOf("-labl "+o+"labl"))C(cb[h.split("-")[0]],o+"hide",""),C(cb[j.className.split("-")[1]],o+"hide");else if(-1!==h.indexOf(o+"butt"))if(p)q&&2===bb.scale&&(n=/hs/.test(m.type)?"rgb":/hide/.test(cb.hsl.className)?"hsv":"hsl",n=n+"-"+n[m.type.indexOf(m.z)]),M.setMode(n?n:h.replace("-butt","").split(" ")[0]),r="modeChange";else if(/^[rgb]/.test(h))n=h.split("-")[1],C(cb.colorPicker,"no-rgb-"+n,(k["noRGB"+n]=!k["noRGB"+n])?b:""),r="noRGB"+n;else if(g===cb.alpha_labl)d=k.customBG,e=k.alphaBG,C(cb.colorPicker,"alpha-bg-"+e,"alpha-bg-"+(e=k.alphaBG=c.data||("w"===e?d?"c":"b":"c"===e?"b":"w"))),g.firstChild.data=e.toUpperCase(),cb.ctrl.style.backgroundColor=cb.memo.style.backgroundColor="c"!==e?"":"rgb("+db.round(255*d.r)+", "+db.round(255*d.g)+", "+db.round(255*d.b)+")",cb.raster.style.cssText=cb.raster_bg.previousSibling.style.cssText="c"!==e?"":A(d.luminance<.22?.5:.4),r="alphaBackground";else if(g===cb.alpha_butt)C(cb.colorPicker,"mute-alpha",(k.muteAlpha=!k.muteAlpha)?b:""),r="alphaState";else if(g===cb.HEX_butt)C(cb.colorPicker,"no-HEX",(k.HEXState=!k.HEXState)?b:""),r="HEXState";else if(g===cb.HEX_labl){var s="web save"===ab.saveColor;"web smart"===ab.saveColor||s?s?M.setColor(k.webUnsave,"rgb"):(k.webUnsave||(k.webUnsave=x(l)),M.setColor(ab.webSave,"rgb")):(k.webUnsave=x(l),M.setColor(ab.webSmart,"rgb")),r="webColorState"}else/Lab-x-labl/.test(h)&&(C(cb.colorPicker,"cmy-only",(k.cmyOnly=!k.cmyOnly)?b:""),r="cmykState");else if(g===cb.bsav)u(),r="saveAsBackground";else if(g===cb.bres){var w=x(l),y=ab.alpha;M.setColor(k.color),u(),M.setColor(w,"rgb",y),r="resetColor"}else if(j===cb.col1)ab.hsv.h-=ab.hsv.h>.5?.5:-.5,t("hsv"),r="shiftColor";else if(j===cb.col2)M.setColor(g.style.backgroundColor,"rgb",ab.background.alpha),r="setSavedColor";else if(j===cb.memo){var z=function(){cb.memos.blinker&&(cb.memos.blinker.style.cssText=cb.memos.cssText)},B=function(b){cb.memos.blinker=b,b.style.cssText="background-color:"+(ab.RGBLuminance>.22?"#333":"#DDD"),a.setTimeout(z,200)};if(g===cb.memo_cursor){z(),cb.memos.blinker=b,cb.testNode.style.cssText=cb.memo_store.style.cssText,cb.memos.cssText=cb.testNode.style.cssText;for(var D=cb.memos.length-1;D--;)if(cb.memos.cssText===cb.memos[D].style.cssText){B(cb.memos[D]);break}if(!cb.memos.blinker){for(var D=cb.memos.length-1;D--;)cb.memos[D+1].style.cssText=cb.memos[D].style.cssText;cb.memos[0].style.cssText=cb.memo_store.style.cssText}r="toMemory"}else z(),M.setColor(g.style.backgroundColor,"rgb",g.style.opacity||1),cb.memos.cssText=g.style.cssText,B(g),I=1,r="fromMemory"}r&&(v(ab),I=I||!0,i(c,r))}}function p(c,d){var e,f=c||a.event,g=f?E(f):{},h=d!==b,i=h?d:g.X-X.left+8,j=h?d:g.Y-X.top+8,k=[" S XS XXS"," S XS"," S",""],l=bb.sizes,m=h?d:j<l.XXS[1]+25?0:i<l.XS[0]+25?1:i<l.S[0]+25||j<l.S[1]+25?2:3,n=k[m],o=!1,p="";$.resizer!==n&&(o=/XX/.test(n),e=bb.mode,!o||/hs/.test(e.type)&&"h"!==e.z?e.original&&M.setMode(e.original):(p=e.type+"-"+e.z,M.setMode(/hs/.test(e.type)?e.type+"-s":"hsv-s"),bb.mode.original=p),cb.colorPicker.className=cb.colorPicker.className.replace(/\s+(?:S|XS|XXS)/g,"")+n,bb.scale=o?4:/S/.test(n)?2:1,bb.currentSize=m,$.resizer=n,Y=!0,w(),s()),cb.resizer.style.cssText="display: block;width: "+(i>10?i:10)+"px;height: "+(j>10?j:10)+"px;"}function q(a){var b={rgb_r:{x:"b",y:"g"},rgb_g:{x:"b",y:"r"},rgb_b:{x:"r",y:"g"},hsv_h:{x:"s",y:"v"},hsv_s:{x:"h",y:"v"},hsv_v:{x:"h",y:"s"},hsl_h:{x:"s",y:"l"},hsl_s:{x:"h",y:"l"},hsl_l:{x:"h",y:"s"}},c=a.replace("-","_"),d="\\b(?:rg|hs)\\w\\-\\w\\b";return C(cb.panel,d,a),C(cb.slds,d,a),a=a.split("-"),bb.mode={type:a[0],x:b[c].x,y:b[c]Line truncated
+305
View File
@@ -0,0 +1,305 @@
// ------ ColorPicker ------ //
(function (window) {
window.jsColorPicker = function(selectors, config) {
var renderCallback = function(colors, mode) {
var options = this,
input = options.input,
patch = options.patch,
RGB = colors.RND.rgb,
HSL = colors.RND.hsl,
AHEX = options.isIE8 ? (colors.alpha < 0.16 ? '0' : '') +
(Math.round(colors.alpha * 100)).toString(16).toUpperCase() + colors.HEX : '',
RGBInnerText = RGB.r + ',' + RGB.g + ',' + RGB.b,
RGBAText = RGBInnerText + ',' + colors.alpha,
isAlpha = colors.alpha !== 1 && !options.isIE8,
colorMode = input.getAttribute('data-colorMode');
patch.style.cssText =
'color:' + (colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd') + ';' + // Black...???
'background-color: rgba(' + RGBAText + ');' +
'filter:' + (options.isIE8 ? 'progid:DXImageTransform.Microsoft.gradient(' + // IE<9
'startColorstr=#' + AHEX + ',' + 'endColorstr=#' + AHEX + ')' : '');
input.value = RGBAText;
if (options.displayCallback) {
options.displayCallback(colors, mode, options);
}
},
extractValue = function(elm) {
var val = elm.value || elm.getAttribute('value') || elm.style.backgroundColor || "0,0,0,1";
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+$/.test(val)) return "rgba("+val+")";
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+$/.test(val)) return "rgba("+val+",1)";
return null;
},
actionCallback = function(event, action) {
var options = this,
colorPicker = colorPickers.current;
if (action === 'toMemory') {
var memos = colorPicker.nodes.memos,
backgroundColor = '',
opacity = 0,
cookieTXT = [];
for (var n = 0, m = memos.length; n < m; n++) {
backgroundColor = memos[n].style.backgroundColor;
opacity = memos[n].style.opacity;
opacity = Math.round((opacity === '' ? 1 : opacity) * 100) / 100;
cookieTXT.push(backgroundColor.
replace(/, /g, ',').
replace('rgb(', 'rgba(').
replace(')', ',' + opacity + ')')
);
}
cookieTXT = '\'' + cookieTXT.join('\',\'') + '\'';
ColorPicker.docCookies('colorPickerMemos' + (options.noAlpha ? 'NoAlpha' : ''), cookieTXT);
} else if (action === 'resizeApp') {
ColorPicker.docCookies('colorPickerSize', colorPicker.color.options.currentSize);
} else if (action === 'modeChange') {
var mode = colorPicker.color.options.mode;
ColorPicker.docCookies('colorPickerMode', mode.type + '-' + mode.z);
}
},
createInstance = function(elm, config) {
var initConfig = {
klass: window.ColorPicker,
input: elm,
patch: elm,
isIE8: !!document.all && !document.addEventListener, // Opera???
// *** animationSpeed: 200,
// *** draggable: true,
margin: {left: -1, top: 2},
customBG: '#FFFFFF',
// displayCallback: displayCallback,
/* --- regular colorPicker options from this point --- */
color: extractValue(elm),
initStyle: 'display: none',
mode: ColorPicker.docCookies('colorPickerMode') || 'hsv-h',
// memoryColors: (function(colors, config) {
// return config.noAlpha ?
// colors.replace(/\,\d*\.*\d*\)/g, ',1)') : colors;
// })($.docCookies('colorPickerMemos'), config || {}),
memoryColors: ColorPicker.docCookies('colorPickerMemos' +
((config || {}).noAlpha ? 'NoAlpha' : '')),
size: ColorPicker.docCookies('colorPickerSize') || 1,
renderCallback: renderCallback,
actionCallback: actionCallback
};
for (var n in config) {
initConfig[n] = config[n];
}
return new initConfig.klass(initConfig);
},
doEventListeners = function(elm, multiple, off) {
var onOff = off ? 'removeEventListener' : 'addEventListener',
inputListener = function(e) {
var index = multiple ? Array.prototype.indexOf.call(elms, this) : 0,
colorPicker = colorPickers[index] ||
(colorPickers[index] = createInstance(this, config)),
options = colorPicker.color.options;
options.color = extractValue(elm); // brings color to default on reset
//检查颜色合法性
if (options.color != null && options.color == options.color.match(/rgba\([0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+\)/)[0]) {
var chec = options.color.match(/[0-9.]+/g);
if (chec.length != 4)
return;
for (var i = 0; i < 3; i++) {
if (chec[i] != chec[i].match(/\d+/)[0] || +chec[i] < 0 || +chec[i] > 255)
return;
}
if (chec[3] != chec[3].match(/\d+(\.\d+)?/)[0] || parseFloat(chec[3]) > 1 || parseFloat(chec[3] < 0))
return;
if (!multiple) {
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
colorPicker.saveAsBackground();
}
colorPickers.current = colorPickers[index];
}
},
createListener = function() {
elm = document.getElementById("colorPicker");
var input = elm,
position = window.ColorPicker.getOrigin(input),
index = multiple ? Array.prototype.indexOf.call(elms, elm) : 0,
colorPicker = colorPickers[index] ||
(colorPickers[index] = createInstance(elm, config)),
options = colorPicker.color.options,
colorPickerUI = colorPicker.nodes.colorPicker,
appendTo = (options.appendTo || document.body),
isStatic = /static/.test(window.getComputedStyle(appendTo).position),
atrect = isStatic ? {left: 0, top: 0} : appendTo.getBoundingClientRect(),
waitTimer = 0;
options.color = extractValue(elm); // brings color to default on reset
colorPickerUI.style.cssText =
'position: absolute;' + (!colorPickers[index].cssIsReady ? 'display: none;' : '') +
'left:' + (position.left + options.margin.left - atrect.left) + 'px;' +
'top:' + (position.top + +input.offsetHeight + options.margin.top - atrect.top) + 'px;';
if (!multiple) {
options.input = elm;
options.patch = elm; // check again???
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
colorPicker.saveAsBackground();
}
colorPickers.current = colorPickers[index];
appendTo.appendChild(colorPickerUI);
waitTimer = setInterval(function() { // compensating late style on onload in colorPicker
if (colorPickers.current.cssIsReady) {
waitTimer = clearInterval(waitTimer);
colorPickerUI.style.display = 'block';
}
}, 10);
},
hideListener = function(e) {
var colorPicker = colorPickers.current,
colorPickerUI = (colorPicker ? colorPicker.nodes.colorPicker : undefined),
animationSpeed = colorPicker ? colorPicker.color.options.animationSpeed : 0,
isColorPicker = colorPicker && (function(elm) {
while (elm) {
if ((elm.className || '').indexOf('cpPanel') !== -1) return elm;
elm = elm.parentNode;
}
return false;
})(e.target),
inputIndex = Array.prototype.indexOf.call(elms, e.target);
if (isColorPicker && Array.prototype.indexOf.call(colorPickers, isColorPicker)) {
if (e.target === colorPicker.nodes.exit) {
colorPickerUI.parentNode.style.display = 'none';
document.activeElement.blur();
} else {
// ...
}
} else if (inputIndex !== -1) {
// ...
} else if (colorPickerUI) {
colorPickerUI.parentNode.style.display = 'none';
}
};
elm[onOff]('input', inputListener);
window.jsColorPicker.create = createListener;
},
// this is a way to prevent data binding on HTMLElements
colorPickers = window.jsColorPicker.colorPickers || [],
elms = document.querySelectorAll(selectors),
testColors = new window.Colors({customBG: config.customBG, allMixDetails: true});
window.jsColorPicker.colorPickers = colorPickers;
for (var n = 0, m = elms.length; n < m; n++) {
var elm = elms[n];
if (config === 'destroy') {
doEventListeners(elm, (config && config.multipleInstances), true);
if (colorPickers[n]) {
colorPickers[n].destroyAll();
}
} else {
var color = extractValue(elm);
var value = color.split('(');
testColors.setColor(color);
if (config && config.init) {
config.init(elm, testColors.colors);
}
elm.setAttribute('data-colorMode', value[1] ? value[0].substr(0, 3) : 'HEX');
doEventListeners(elm, (config && config.multipleInstances), false);
if (config && config.readOnly) {
elm.readOnly = true;
}
}
};
return window.jsColorPicker.colorPickers;
};
window.ColorPicker.docCookies = function(key, val, options) {
var encode = encodeURIComponent, decode = decodeURIComponent,
cookies, n, tmp, cache = {},
days;
if (val === undefined) { // all about reading cookies
cookies = document.cookie.split(/;\s*/) || [];
for (n = cookies.length; n--; ) {
tmp = cookies[n].split('=');
if (tmp[0]) cache[decode(tmp.shift())] = decode(tmp.join('=')); // there might be '='s in the value...
}
if (!key) return cache; // return Json for easy access to all cookies
else return cache[key]; // easy access to cookies from here
} else { // write/delete cookie
options = options || {};
if (val === '' || options.expires < 0) { // prepare deleteing the cookie
options.expires = -1;
// options.path = options.domain = options.secure = undefined; // to make shure the cookie gets deleted...
}
if (options.expires !== undefined) { // prepare date if any
days = new Date();
days.setDate(days.getDate() + options.expires);
}
document.cookie = encode(key) + '=' + encode(val) +
(days ? '; expires=' + days.toUTCString() : '') +
(options.path ? '; path=' + options.path : '') +
(options.domain ? '; domain=' + options.domain : '') +
(options.secure ? '; secure' : '');
}
};
})(this);
// Added
jsColorPicker('input.color', {
customBG: '#222',
readOnly: false,
// patch: false,
init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
elm.style.backgroundColor = elm.value;
elm.style.color = colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd';
},
appendTo: document.getElementById("colorPanel"),
size: 1,
});
function openColorPicker(px, py, callback) {
window.jsColorPicker.confirm = callback;
var colorPanel = document.getElementById('colorPanel');
if (colorPanel.style.display=='none' && px != null && py != null) {
colorPanel.style.display = "inline-block";
colorPanel.style.left = px + 'px';
colorPanel.style.top = py + 'px';
window.jsColorPicker.create();
}
else {
colorPanel.style.display = 'none';
delete window.jsColorPicker.confirm;
}
}
function confirmColor() {
var colorPicker = document.getElementById("colorPicker");
if (window.jsColorPicker.confirm) { /* 存在块 */
// 检测需要是合法数值
var val = colorPicker.value;
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+$/.test(val)) val = "rgba("+val+")";
else if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+$/.test(val)) val = "rgba("+val+",1)";
else val = null;
if (val) window.jsColorPicker.confirm(val);
}
else {
colorPicker.select();
document.execCommand("Copy");
}
colorPanel.style.display = 'none';
delete window.jsColorPicker.confirm;
}
// ------ AutoCompletion ------