diff --git a/README.md b/README.md index 6176f427..d2dc08ae 100644 --- a/README.md +++ b/README.md @@ -720,6 +720,6 @@ HTML5魔塔交流群群号: `539113091` [@tocque](https://github.com/tocque) 鹿神:装备栏、动态创建图层等多项功能的编写者。同时也参与了多种辅助小工具的开发。 -[@AutumnOrange51](https://github.com/AutumnOrange51) 秋橙:样板的QA(质量监管人员),提出了大量需求,同时也编写了全新的文档。 +[@AutumnOrange](https://space.bilibili.com/399329257) 秋橙:样板的QA(质量监管人员),提出了大量需求,同时也编写了全新的文档。 以及H5魔塔交流群`539113091`,HTML5造塔技术交流群`959329661`的诸位魔塔爱好者们对本样板的大力支持! diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index c6db59e4..cfcf7b5e 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -1162,3 +1162,21 @@ Blockly.BlockSvg.prototype.generateContextMenu = function() { if (this.customContextMenu) this.customContextMenu(menuOptions); return menuOptions; }; + +Blockly.FieldDropdown.prototype.doClassValidation_ = function (opt_newValue) { + return opt_newValue; +} + +Blockly.FieldDropdown.prototype.doValueUpdate_ = function (newValue) { + Blockly.FieldDropdown.superClass_.doValueUpdate_.call(this, newValue); + var options = this.getOptions(true); + for (var i = 0, option; (option = options[i]); i++) { + if (option[1] == this.value_) { + this.selectedOption_ = option; + } + } + if (this.selectedOption_[1] != this.value_) { + options.push([this.value_, this.value_]); + this.selectedOption_ = options[options.length - 1]; + } +}; \ No newline at end of file