From e11532ed3c247328a8c10f57a4d10388a0a0ee87 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Fri, 12 Jun 2020 14:54:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7=E5=95=86=E5=BA=97=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BB=8F=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/MotaAction.g4 | 3 ++- _server/MotaActionParser.js | 2 +- _server/css/editor_color.css | 14 -------------- project/plugins.js | 19 ++++++++++++------- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index bd3b302e..53b249a9 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -173,7 +173,7 @@ return code; */; shopitem - : '道具商店 id' IdString '快捷名称' EvalString '未开启不显示' Bool BGNL? Newline shopItemChoices+ BEND + : '道具商店 id' IdString '快捷名称' EvalString '使用' ShopUse_List '未开启不显示' Bool BGNL? Newline shopItemChoices+ BEND /* shopitem @@ -184,6 +184,7 @@ var code = { 'id': IdString_0, 'item': true, 'textInList': EvalString_0, + 'use': ShopUse_List_0 || 'money', 'mustEnable': Bool_0, 'choices': 'choices_aqwedsa' } diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index 5db4c9f0..b068a776 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -144,7 +144,7 @@ ActionParser.prototype.parse = function (obj,type) { ]); } return MotaActionBlocks['shopitem'].xmlText([ - obj.id,obj.textInList,obj.mustEnable,text_choices,next + obj.id,obj.textInList,obj.use||'money',obj.mustEnable,text_choices,next ]); } var next=null; diff --git a/_server/css/editor_color.css b/_server/css/editor_color.css index a26ce989..1ee188c9 100644 --- a/_server/css/editor_color.css +++ b/_server/css/editor_color.css @@ -7,14 +7,6 @@ body { background-color: #F5F5F5; } -input { - color: inherit; -} - -button { - color: inherit; -} - /** 可自行仿照添加更多的全局属性...... */ /** 颜色选择器 */ @@ -195,17 +187,11 @@ textarea[disabled] { } /** 保存地图的按钮颜色 */ -#saveFloor { - background-color: inherit; -} #saveFloor.highlight { background-color: #ffd700; } /** 解析按钮颜色 */ -#blocklyParse { - background-color: inherit; -} #blocklyParse.highlight { background-color: #ffd700; } diff --git a/project/plugins.js b/project/plugins.js index 894df491..03f95f04 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -563,6 +563,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = var list = []; var shopInfo = null; // 商店信息 var choices = []; // 商店选项 + var use = 'money'; + var useText = '金币'; var bigFont = core.ui._buildFont(20, false), middleFont = core.ui._buildFont(18, false); @@ -587,9 +589,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.fillText("uievent", "购买", 32, 74, 'white', bigFont); core.fillText("uievent", "卖出", 132, 74); core.fillText("uievent", "离开", 232, 74); - core.fillText("uievent", "当前金币", 324, 66, null, middleFont); + core.fillText("uievent", "当前" + useText, 324, 66, null, middleFont); core.setTextAlign("uievent", "right"); - core.fillText("uievent", core.formatBigNumber(core.status.hero.money), 405, 89); + core.fillText("uievent", core.formatBigNumber(core.status.hero[use]), 405, 89); core.setTextAlign("uievent", "left"); core.ui._uievent_drawSelector({ "type": "drawSelector", @@ -638,7 +640,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.setTextAlign('uievent', 'left'); core.fillText('uievent', core.material.items[item.id].name, 50, 132 + i * 40, null, bigFont); core.setTextAlign('uievent', 'right'); - core.fillText('uievent', (type == 0 ? core.calValue(item.money) : core.calValue(item.sell)) + "金币/个", 300, 133 + i * 40, null, middleFont); + core.fillText('uievent', (type == 0 ? core.calValue(item.money) : core.calValue(item.sell)) + useText + "/个", 300, 133 + i * 40, null, middleFont); core.setTextAlign("uievent", "left"); if (curr == selectItem) { // 绘制描述,文字自动放缩 @@ -664,7 +666,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.fillText("uievent", core.itemCount(item.id), 406, 132, null, null, 40); } core.setTextAlign("uievent", "left"); - core.fillText("uievent", "预计金额", 324, 250); + core.fillText("uievent", "预计" + useText, 324, 250); core.setTextAlign("uievent", "right"); totalMoney = selectCount * (type == 0 ? core.calValue(item.money) : core.calValue(item.sell)); core.fillText("uievent", core.formatBigNumber(totalMoney), 405, 280); @@ -684,7 +686,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (item == null) return; selectCount = core.clamp( selectCount + delta, 0, - Math.min(type == 0 ? Math.floor(core.status.hero.money / core.calValue(item.money)) : core.itemCount(item.id), + Math.min(type == 0 ? Math.floor(core.status.hero[use] / core.calValue(item.money)) : core.itemCount(item.id), type == 0 && item.number != null ? item.number : Number.MAX_SAFE_INTEGER) ); } @@ -692,12 +694,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = var _confirm = function (item) { if (item == null || selectCount == 0) return; if (type == 0) { - core.status.hero.money -= totalMoney; + core.status.hero[use] -= totalMoney; core.getItem(item.id, selectCount); if (item.number != null) item.number -= selectCount; item.money_count = (item.money_count || 0) + selectCount; } else { - core.status.hero.money += totalMoney; + core.status.hero[use] += totalMoney; core.removeItem(item.id, selectCount); core.drawTip("成功卖出" + selectCount + "个" + core.material.items[item.id].name, item.id); if (item.number != null) item.number += selectCount; @@ -836,6 +838,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = shopInfo = flags.__shops__[shopId]; if (shopInfo.choices == null) shopInfo.choices = core.clone(core.status.shops[shopId].choices); choices = shopInfo.choices; + use = core.status.shops[shopId].use; + if (use != 'exp') use = 'money'; + useText = use == 'money' ? '金币' : '经验'; core.insertAction([{ "type": "while",