diff --git a/.gitignore b/.gitignore index 94816db6..928ab591 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .vscode *ce5eec52_2fa1_447b_8dad_764e267a7fab* -**/.DS_Store +.DS_Store # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 403d19d9..ab728be1 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -927,15 +927,16 @@ return code; */; setVolume_s - : '设置音量' Int Newline + : '设置音量' Int '渐变时间' Int? Newline /* setVolume_s tooltip : setVolume: 设置音量 helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setvolume%EF%BC%9A%E8%AE%BE%E7%BD%AE%E9%9F%B3%E9%87%8F -default : [90] +default : [90, 500] colour : this.soundColor -var code = '{"type": "setVolume", "value": '+Int_0+'},\n'; +Int_1 = Int_1?(', "time": '+Int_1):"" +var code = '{"type": "setVolume", "value": '+Int_0+Int_1+'},\n'; return code; */; @@ -1641,7 +1642,7 @@ ActionParser.prototype.parseAction = function() { break case "setVolume": this.next = MotaActionBlocks['setVolume_s'].xmlText([ - data.value, this.next]); + data.value, data.time, this.next]); break case "setValue": this.next = MotaActionBlocks['setValue_s'].xmlText([ diff --git a/_server/css/editor_mobile.css b/_server/css/editor_mobile.css index db75764b..80f3b9d5 100644 --- a/_server/css/editor_mobile.css +++ b/_server/css/editor_mobile.css @@ -63,14 +63,6 @@ body { overflow: auto; } -#editTip { - position: absolute; - width: 100%; - margin-bottom: 120px; - bottom: 0; - left: 10px; -} - #editArea p { margin: 10px; display: block; @@ -117,14 +109,19 @@ body { #tip { float: right; width: 50%; - height: 95%; + /* height: 95%; */ + min-height: 9rem; padding: 5px 10px 10px 10px; margin-right: 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 2px; - font-size: 15px; - line-height: 14px; + font-size: 1rem; + line-height: 0.93rem; +} + +#tip p{ + margin: 0.5rem } .files { @@ -251,8 +248,8 @@ body { line-height: 1.2em; } -table, td { - border: 1px solid #fff; +td { + border: 0.230vmin solid #fff; color: #fff; cursor: crosshair; } @@ -290,14 +287,17 @@ table.col td { #mapColMark td { - width: 29px; + width: 7.15vmin; + padding: 0; + border-bottom-width: 0px; + border-top-width: 0px; } #mapColMark td:hover .colBlock { position: absolute; top: 4vmin; height: 96vmin; - width: 7.38vmin; + width: 7.15vmin; z-index: 100; background-color: rgba(38, 166, 154, .5); } @@ -330,13 +330,16 @@ table.row td { } #mapRowMark td { - height: 29px; + height: 7.15vmin; + padding: 0; + border-left-width: 0px; + border-right-width: 0px; } #mapRowMark td:hover .rowBlock { position: absolute; left: 4vmin; - height: 7.38vmin; + height: 7.15vmin; width: 96vmin; z-index: 100; background-color: rgba(76, 34, 27, .5); diff --git a/_server/css/editor_mode_mobile.css b/_server/css/editor_mode_mobile.css index c8e9fc4c..f13b61c3 100644 --- a/_server/css/editor_mode_mobile.css +++ b/_server/css/editor_mode_mobile.css @@ -59,15 +59,15 @@ overflow: hidden; } #left6 h3{ - font-size: 3vmax; - margin: 2vmax 0; + font-size: 3.5vh; + margin: 1vh 0; } #left6 #blocklyArea { width: 100vmin; - height: 55vmax; + height: 60vh; } #left6 #blocklyDiv { @@ -77,7 +77,7 @@ #left6 .CodeMirror { border: 1px solid #eee; - height: 27vmax; + height: 21vh; width: 100%; } diff --git a/_server/editor_mode.js b/_server/editor_mode.js index c35d9cd1..3cca8ba4 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -122,9 +122,9 @@ editor_mode = function (editor) { 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; - } + // thisTr.onclick = function(){ + // editor.lastClickId=guid; + // } }); } return {"HTML": outstr.join(''), "guids": guids, "listen": listen}; diff --git a/_server/vm.js b/_server/vm.js index 82b3139d..4e70722b 100644 --- a/_server/vm.js +++ b/_server/vm.js @@ -1,9 +1,21 @@ // vue 相关处理 document.body.onmousedown = function (e) { //console.log(e); - var clickpath = []; - e.path.forEach(function (node) { + var getpath=function(e) { + var path = []; + var currentElem = e.target; + while (currentElem) { + path.push(currentElem); + currentElem = currentElem.parentElement; + } + if (path.indexOf(window) === -1 && path.indexOf(document) === -1) + path.push(document); + if (path.indexOf(window) === -1) + path.push(window); + return path; + } + getpath(e).forEach(function (node) { if (!node.getAttribute) return; var id_ = node.getAttribute('id'); if (id_) { @@ -32,7 +44,7 @@ document.body.onmousedown = function (e) { if (e.button!=2 && !editor.isMobile){ editor.hideMidMenu(); } - if (clickpath.indexOf('down') !== -1 && editor.isMobile){ + if (clickpath.indexOf('down') !== -1 && editor.isMobile && clickpath.indexOf('midMenu') === -1){ editor.hideMidMenu(); } if(clickpath.length>=2 && clickpath[0].indexOf('id_')===0){editor.lastClickId=clickpath[0]} diff --git a/docs/element.md b/docs/element.md index 1a9bbf28..a82be0ec 100644 --- a/docs/element.md +++ b/docs/element.md @@ -193,6 +193,8 @@ floorId指定的是目标楼层的唯一标识符(ID)。 导出动画时可能会进行一些压缩以节省流量,因此清晰度可能不如原版。 +从2.3.2开始,动画可以同时导出所用的音效。**如果导出音效,请确保将所用到的音效复制到了`sounds`目录下,并且在全塔属性中注册过。** + 动画播放时,是按照每秒20帧的速度(即50ms/帧)。 定义完毕后,我们可以调用`animate`事件来播放该动画,有关事件的详细介绍请参见[事件](event)。 diff --git a/docs/event.md b/docs/event.md index 3e83793f..1bf94a19 100644 --- a/docs/event.md +++ b/docs/event.md @@ -939,10 +939,12 @@ time选项为该跳跃所需要用到的时间。 使用setVolume可以设置音量大小。 -使用方法: `{"type": "setVolume", "value": 90}` +使用方法: `{"type": "setVolume", "value": 90, "time": 500}` value为音量大小,在0到100之间,默认为100。设置后,BGM和SE都将使用该音量进行播放。 +可以设置time为音量渐变时间。 + ### win:获得胜利 `{"type": "win", "reason": "xxx"}` 将会直接调用events.js中的win函数,并将reason作为结局传入。 diff --git a/editor-mobile.html b/editor-mobile.html index 6f945a90..0c76d385 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -22,13 +22,13 @@
{{ errors[error-1] }}
-