From ba954e27d86ca2b830047fbf9dd786f2a483bc88 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 9 Jul 2018 00:40:27 +0800 Subject: [PATCH 1/9] Update mobile ui --- _server/css/editor_mode_mobile.css | 7 +++++++ _server/editor.js | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/_server/css/editor_mode_mobile.css b/_server/css/editor_mode_mobile.css index f13b61c3..29f66d6e 100644 --- a/_server/css/editor_mode_mobile.css +++ b/_server/css/editor_mode_mobile.css @@ -87,6 +87,13 @@ overflow: y; /* resize:none; */ } +#left6 #blocklyDiv .blocklyToolboxDiv{ + width:6vmin; +} +#left6 #blocklyDiv .blocklyTreeLabel{ + margin-left:-4vmin; +} + #left7 { /* height: 440px; width: 375px;float:left; */ left: 0; diff --git a/_server/editor.js b/_server/editor.js index 9485a60a..b1edf819 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -681,7 +681,15 @@ editor.prototype.listen = function () { moveLoc.children[0].innerHTML='交换事件'+locStr+'与此事件的位置'; midMenu.style='top:'+(y+scrollTop)+'px;left:'+(x+scrollLeft)+'px;'; } - editor.hideMidMenu=function(){midMenu.style='display:none';} + editor.hideMidMenu=function(){ + if(editor.isMobile){ + setTimeout(function(){ + midMenu.style='display:none'; + },200) + } else { + midMenu.style='display:none'; + } + } var chooseThis = document.getElementById('chooseThis'); chooseThis.onmousedown = function(e){ From 0d39289df906e8eff11273be62ed7f05ba078471 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 9 Jul 2018 13:10:10 +0800 Subject: [PATCH 2/9] start game button --- editor-mobile.html | 1 + 1 file changed, 1 insertion(+) diff --git a/editor-mobile.html b/editor-mobile.html index 0c76d385..b17f12d2 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -271,6 +271,7 @@ + -
+
From 338323c748e359f1d50b53a04028b47b99406d5f Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 9 Jul 2018 22:30:43 +0800 Subject: [PATCH 6/9] drag --- _server/editor.js | 9 +++++---- editor-mobile.html | 12 +++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/_server/editor.js b/_server/editor.js index a15e98dd..0e0cb653 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -388,7 +388,7 @@ editor.prototype.HTMLescape = function (str_) { } editor.prototype.listen = function () { - + var eui=document.getElementById('eui'); var uc = eui.getContext('2d'); function fillPos(pos) { @@ -399,9 +399,11 @@ editor.prototype.listen = function () { function eToLoc(e) { var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft var scrollTop = document.documentElement.scrollTop || document.body.scrollTop + var xx=e.clientX,yy=e.clientY + if(editor.isMobile){xx=e.touches[0].clientX,yy=e.touches[0].clientY} editor.loc = { - 'x': scrollLeft + e.clientX - mid.offsetLeft - mapEdit.offsetLeft, - 'y': scrollTop + e.clientY - mid.offsetTop - mapEdit.offsetTop, + 'x': scrollLeft + xx - mid.offsetLeft - mapEdit.offsetLeft, + 'y': scrollTop + yy - mid.offsetTop - mapEdit.offsetTop, 'size': editor.isMobile?(32*innerWidth*0.96/416):32 }; return editor.loc; @@ -499,7 +501,6 @@ editor.prototype.listen = function () { } holdingPath = 0; e.stopPropagation(); - var loc = eToLoc(e); if (stepPostfix && stepPostfix.length) { preMapData = JSON.parse(JSON.stringify(editor.map)); currDrawData.pos = JSON.parse(JSON.stringify(stepPostfix)); diff --git a/editor-mobile.html b/editor-mobile.html index c7e5832b..954e81e1 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -503,10 +503,20 @@ var editor_mobile_listen=function(){ printf(info[0].children[1].getAttribute('title')) } + //===== + document.body.ontouchstart=document.body.onmousedown; document.body.onmousedown=null; - //===== + + var eui=document.getElementById('eui'); + eui.ontouchstart=eui.onmousedown + eui.onmousedown=null + eui.ontouchmove=eui.onmousemove + eui.onmousemove=null + eui.ontouchend=eui.onmouseup + eui.onmouseup=null + var chooseThis = document.getElementById('chooseThis'); chooseThis.ontouchstart=chooseThis.onmousedown From 08e0e70acd192ad2581ef81542aa4f5e603e4c00 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 9 Jul 2018 22:48:45 +0800 Subject: [PATCH 7/9] ondblclick --- _server/editor_mode.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/_server/editor_mode.js b/_server/editor_mode.js index 5ee13bf4..04dfcdcb 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -118,13 +118,20 @@ editor_mode = function (editor) { printe(field + ' : 输入的值不合要求,请鼠标放置在注释上查看说明'); } } - input.ondblclick = function () { + var dblclickfunc=function () { if (cobj._type === 'event') editor_blockly.import(guid, {type: cobj._event}); if (cobj._type === 'textarea') editor_multi.import(guid, {lint: cobj._lint, string: cobj._string}); } - // thisTr.onclick = function(){ - // editor.lastClickId=guid; - // } + input.ondblclick = dblclickfunc + var doubleClickCheck=[0]; + thisTr.onclick = function(){ + var newClick = new Date().getTime(); + var lastClick = doubleClickCheck.shift(); + doubleClickCheck.push(newClick); + if(newClick-lastClick<500){ + dblclickfunc() + } + } }); } return {"HTML": outstr.join(''), "guids": guids, "listen": listen}; From 951b26fad5398c7df54b77d273fe0e736124c4ba Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 9 Jul 2018 22:59:18 +0800 Subject: [PATCH 8/9] V2.3.2 --- README.md | 16 ++++++++++++++++ main.js | 2 +- project/data.js | 2 +- 更新说明.txt | 21 +++++++++++---------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 646ba1e8..e2436be6 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏! │ └─ 伤害和临界值计算器.exe # 一个能帮助计算怪物的伤害和临界值的小工具。 http://github.com/ckcz123/magic-tower-calculator/ ├── /启动服务(mac版).app/ # 启动服务的mac版本。 ├── editor.html # 可视化地图编辑工具 +├── editor-mobile.html # 可视化地图编辑工具(手机版) ├── index.html # 主程序,游戏的入口 ├── main.js # JS程序的入口,将动态对所需JS进行加载 ├── style.css # 游戏所需要用到的样式表 @@ -58,6 +59,21 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏! ## 更新说明 +### 2018.7.9 V2.3.3 + +适配手机端的造塔页面 +启动服务的多开版本 +事件:跟随效果 +怪物数据导出器 +RM动画导出器也能导出音效 +gif播放可随着分辨率自动放缩 +状态栏可随文字长度自动调整放缩 +也可以用status:exp来代替经验值的写法 +V键也可以打开快捷商店 +破炸在周围只有一个目标时无需转向面对它 +道具效果中,无需再将null改成""才能双击编辑了 +各个已知Bug的修复,部分细节优化 + ### 2018.6.16 V2.3.1 * [x] 存档采用高比率压缩,单个大小是原来的1/10! diff --git a/main.js b/main.js index 5f19aee0..20ccef09 100644 --- a/main.js +++ b/main.js @@ -2,7 +2,7 @@ function main() { //------------------------ 用户修改内容 ------------------------// - this.version = "2.3.1"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。 + this.version = "2.3.2"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。 this.useCompress = false; // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 diff --git a/project/data.js b/project/data.js index 2a1ca82d..1600b72c 100644 --- a/project/data.js +++ b/project/data.js @@ -26,7 +26,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "firstData" : { "title": "魔塔样板", "name": "template", - "version": "Ver 2.3.1", + "version": "Ver 2.3.2", "floorId": "sample0", "hero": { "name": "阳光", diff --git a/更新说明.txt b/更新说明.txt index 43aa8145..692c6410 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -1,16 +1,17 @@ HTML5魔塔样板V2.3.2 -启动服务的多开版本 √ -跟随效果 √ +适配手机端的造塔页面 +启动服务的多开版本 +事件:跟随效果 怪物数据导出器 -RM动画导出器也能导出音效 √ -gif播放可随着分辨率自动放缩 √ -状态栏可随文字长度自动调整放缩 √ -也可以用status:exp来代替经验值的写法 √ -V键也可以打开快捷商店 √ -破炸在周围只有一个目标时无需转向面对它 √ -道具效果中,无需再将null改成""才能双击编辑了 √ -各个已知Bug的修复,部分细节优化 √ +RM动画导出器也能导出音效 +gif播放可随着分辨率自动放缩 +状态栏可随文字长度自动调整放缩 +也可以用status:exp来代替经验值的写法 +V键也可以打开快捷商店 +破炸在周围只有一个目标时无需转向面对它 +道具效果中,无需再将null改成""才能双击编辑了 +各个已知Bug的修复,部分细节优化 ----------------------------------------------------------------------- From 735545e0aaf77c766a271acdada84fc0e2bbc82b Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 9 Jul 2018 23:00:21 +0800 Subject: [PATCH 9/9] V2.3.2 --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e2436be6..66eeffb1 100644 --- a/README.md +++ b/README.md @@ -61,18 +61,18 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏! ### 2018.7.9 V2.3.3 -适配手机端的造塔页面 -启动服务的多开版本 -事件:跟随效果 -怪物数据导出器 -RM动画导出器也能导出音效 -gif播放可随着分辨率自动放缩 -状态栏可随文字长度自动调整放缩 -也可以用status:exp来代替经验值的写法 -V键也可以打开快捷商店 -破炸在周围只有一个目标时无需转向面对它 -道具效果中,无需再将null改成""才能双击编辑了 -各个已知Bug的修复,部分细节优化 +* [x] 适配手机端的造塔页面 +* [x] 启动服务的多开版本 +* [x] 新增事件:跟随效果 +* [x] 怪物数据导出器 +* [x] RM动画导出器也能导出音效 +* [x] gif播放可随着分辨率自动放缩 +* [x] 状态栏可随文字长度自动调整放缩 +* [x] 也可以用status:exp来代替经验值的写法 +* [x] V键也可以打开快捷商店 +* [x] 破炸在周围只有一个目标时无需转向面对它 +* [x] 道具效果中,无需再将null改成""才能双击编辑了 +* [x] 各个已知Bug的修复,部分细节优化 ### 2018.6.16 V2.3.1