diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 296d8a1..5096061 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -958,6 +958,8 @@ action | removeMouse_s | drawWarning_s | addPop_s + | setq_s + | setcgs_s | animationDrawable_s | over_s | overlist_s @@ -2596,6 +2598,35 @@ var code = '{"type": "rotateImage", "code": '+NInt_0+loc+', "angle": '+NInt_1+Mo return code; */; +setq_s + : '设置任务目标楼层'IdString?'不填为清空当前任务指引' Newline + +/* setq_s +tooltip : setq:设置任务目标楼层(显示在小地图) +helpUrl : /_docs/#/instruction +default : [""] +allFloorIds : ['IdString_0'] +colour : this.soundColor +IdString_0 = IdString_0 ? (', "id": "'+IdString_0+'"') : ''; +var code = '{"type": "setq"'+IdString_0+'},\n'; +return code; +*/; + + +setcgs_s + : 'cg回廊获取cg 文件名'EvalString?'不填为清空cg获取记录' Newline + +/* setcgs_s +tooltip : setcgs:cg回廊中的cg获取 +helpUrl : /_docs/#/instruction +default : [""] +allImages : ['EvalString_0'] +colour : this.imageColor +EvalString_0 = EvalString_0 ? (', "img": "'+EvalString_0+'"') : ''; +var code = '{"type": "setcgs"'+EvalString_0+'},\n'; +return code; +*/; + scaleImage_s : '图片放缩' '图片编号' NInt '中心点像素' 'x' PosString? 'y' PosString? '移动方式' MoveMode_List BGNL? '放缩比例' Number '动画时间' Int '不等待执行完毕' Bool Newline @@ -2615,6 +2646,7 @@ var code = '{"type": "scaleImage", "code": '+NInt_0+loc+', "scale": '+Number_0+M return code; */; + animationDrawable_s : '帧动画' '总显示帧数' IntString '底色' ColorString? Colour '底色不透明度' IntString? BGNL?Newline '图片序列(同一帧后面覆盖先前的,默认起始帧为0,结束帧为最后一帧)'BGNL?Newline diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index 68e1d9c..829580d 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -614,6 +614,12 @@ MotaActionParser = function () { this.next, ]); break; + case "setq": + this.next = MotaActionBlocks["setq_s"].xmlText([data.id, this.next]); + break; + case "setcgs": + this.next = MotaActionBlocks["setcgs_s"].xmlText([data.img, this.next]); + break; case "comment": // 注释 this.next = MotaActionBlocks["comment_s"].xmlText([ this.EvalString_Multi(data.text), @@ -645,6 +651,7 @@ MotaActionParser = function () { this.next, ]); break; + case "addPop": this.next = MotaActionBlocks["addPop_s"].xmlText([ data.value, @@ -840,6 +847,7 @@ MotaActionParser = function () { this.next, ]); break; + case "tip": this.next = MotaActionBlocks["tip_s"].xmlText([ data.text, diff --git a/_server/config.json b/_server/config.json index ff54a28..dd8cc79 100644 --- a/_server/config.json +++ b/_server/config.json @@ -1 +1 @@ -{"viewportLoc":[0,0],"editorLastFloorId":"KTV","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006","images":"C2.png","x":6,"y":0,"isTile":true,"recent":1735398082894,"frequent":3},{"idnum":130011,"id":"X130011","images":"C2.png","x":3,"y":1,"isTile":true,"recent":1735398078792,"frequent":2},{"idnum":71817,"id":"X71817","images":"11.png","x":1,"y":227,"isTile":true,"recent":1735398027294,"frequent":3},{"idnum":71837,"id":"X71837","images":"11.png","x":5,"y":229,"isTile":true,"recent":1735398013126,"frequent":1},{"idnum":71829,"id":"X71829","images":"11.png","x":5,"y":228,"isTile":true,"recent":1735398008166,"frequent":1},{"idnum":71821,"id":"X71821","images":"11.png","x":5,"y":227,"isTile":true,"recent":1735398005430,"frequent":1},{"idnum":71836,"id":"X71836","images":"11.png","x":4,"y":229,"isTile":true,"recent":1735397997622,"frequent":1},{"idnum":71828,"id":"X71828","images":"11.png","x":4,"y":228,"isTile":true,"recent":1735397993455,"frequent":1},{"idnum":71820,"id":"X71820","images":"11.png","x":4,"y":227,"isTile":true,"recent":1735397989903,"frequent":1},{"idnum":30217,"id":"X30217","images":"4.png","x":1,"y":27,"isTile":true,"recent":1735397944838,"frequent":3},{"idnum":110012,"id":"X110012","images":"C4.png","x":4,"y":1,"isTile":true,"recent":1735397929366,"frequent":2},{"idnum":100485,"id":"X100485","images":"Outside_B.png","x":5,"y":20,"isTile":true,"recent":1735397919927,"frequent":2},{"idnum":100436,"id":"X100436","images":"Outside_B.png","x":4,"y":18,"isTile":true,"recent":1735397880486,"frequent":1},{"idnum":100437,"id":"X100437","images":"Outside_B.png","x":5,"y":18,"isTile":true,"recent":1735397877086,"frequent":1},{"idnum":100461,"id":"X100461","images":"Outside_B.png","x":5,"y":19,"isTile":true,"recent":1735397868606,"frequent":1},{"idnum":100460,"id":"X100460","images":"Outside_B.png","x":4,"y":19,"isTile":true,"recent":1735397843448,"frequent":2},{"idnum":100484,"id":"X100484","images":"Outside_B.png","x":4,"y":20,"isTile":true,"recent":1735397840545,"frequent":2},{"idnum":40136,"id":"X40136","images":"3.png","x":0,"y":17,"isTile":true,"recent":1735397799150,"frequent":1},{"idnum":40144,"id":"X40144","images":"3.png","x":0,"y":18,"isTile":true,"recent":1735397796038,"frequent":2},{"idnum":30227,"id":"X30227","images":"4.png","x":3,"y":28,"isTile":true,"recent":1735397775591,"frequent":2},{"idnum":30214,"id":"X30214","images":"4.png","x":6,"y":26,"isTile":true,"recent":1735397768303,"frequent":1},{"idnum":30218,"id":"X30218","images":"4.png","x":2,"y":27,"isTile":true,"recent":1735397761062,"frequent":1},{"idnum":120041,"id":"X120041","images":"C3.png","x":1,"y":5,"isTile":true,"recent":1735397710494,"frequent":1},{"idnum":120042,"id":"X120042","images":"C3.png","x":2,"y":5,"isTile":true,"recent":1735397702167,"frequent":2},{"idnum":120006,"id":"X120006","images":"C3.png","x":6,"y":0,"isTile":true,"recent":1735397659951,"frequent":5},{"idnum":120014,"id":"X120014","images":"C3.png","x":6,"y":1,"isTile":true,"recent":1735397644591,"frequent":4},{"idnum":120090,"id":"X120090","images":"C3.png","x":2,"y":11,"isTile":true,"recent":1735397629759,"frequent":3},{"idnum":120150,"id":"X120150","images":"C3.png","x":6,"y":18,"isTile":true,"recent":1735397613207,"frequent":3},{"idnum":120166,"id":"X120166","images":"C3.png","x":6,"y":20,"isTile":true,"recent":1735397574639,"frequent":1},{"idnum":140170,"id":"X140170","images":"C1.png","x":2,"y":21,"isTile":true,"recent":1735397516295,"frequent":1},{"idnum":110119,"id":"X110119","images":"C4.png","x":7,"y":14,"isTile":true,"recent":1735397434752,"frequent":3},{"idnum":80083,"id":"X80083","images":"6.png","x":3,"y":10,"isTile":true,"recent":1735397403120,"frequent":6},{"idnum":80082,"id":"X80082","images":"6.png","x":2,"y":10,"isTile":true,"recent":1735397393215,"frequent":2},{"idnum":71824,"id":"X71824","images":"11.png","x":0,"y":228,"isTile":true,"recent":1735397302354,"frequent":1},{"idnum":71816,"id":"X71816","images":"11.png","x":0,"y":227,"isTile":true,"recent":1735397300089,"frequent":1},{"idnum":71825,"id":"X71825","images":"11.png","x":1,"y":228,"isTile":true,"recent":1735397296728,"frequent":1},{"idnum":71841,"id":"X71841","images":"11.png","x":1,"y":230,"isTile":true,"recent":1735397274905,"frequent":1},{"idnum":71840,"id":"X71840","images":"11.png","x":0,"y":230,"isTile":true,"recent":1735397272160,"frequent":1},{"idnum":71833,"id":"X71833","images":"11.png","x":1,"y":229,"isTile":true,"recent":1735397269433,"frequent":1},{"idnum":71832,"id":"X71832","images":"11.png","x":0,"y":229,"isTile":true,"recent":1735397266704,"frequent":1},{"idnum":71815,"id":"X71815","images":"11.png","x":7,"y":226,"isTile":true,"recent":1735397232288,"frequent":1},{"idnum":71807,"id":"X71807","images":"11.png","x":7,"y":225,"isTile":true,"recent":1735397229624,"frequent":1},{"idnum":71827,"id":"X71827","images":"11.png","x":3,"y":228,"isTile":true,"recent":1735397220728,"frequent":1},{"idnum":71819,"id":"X71819","images":"11.png","x":3,"y":227,"isTile":true,"recent":1735397218496,"frequent":1},{"idnum":120173,"id":"X120173","images":"C3.png","x":5,"y":21,"isTile":true,"recent":1735397183385,"frequent":3},{"idnum":120174,"id":"X120174","images":"C3.png","x":6,"y":21,"isTile":true,"recent":1735397125953,"frequent":6},{"idnum":120134,"id":"X120134","images":"C3.png","x":6,"y":16,"isTile":true,"recent":1735396971049,"frequent":1},{"idnum":130173,"id":"X130173","images":"C2.png","x":5,"y":21,"isTile":true,"recent":1735396958897,"frequent":1},{"idnum":120109,"id":"X120109","images":"C3.png","x":5,"y":13,"isTile":true,"recent":1735396928298,"frequent":2},{"idnum":120117,"id":"X120117","images":"C3.png","x":5,"y":14,"isTile":true,"recent":1735396877690,"frequent":1},{"idnum":120125,"id":"X120125","images":"C3.png","x":5,"y":15,"isTile":true,"recent":1735396864194,"frequent":6},{"idnum":70169,"id":"X70169","images":"11.png","x":1,"y":21,"isTile":true,"recent":1735396825666,"frequent":3},{"idnum":70161,"id":"X70161","images":"11.png","x":1,"y":20,"isTile":true,"recent":1735396814418,"frequent":3},{"idnum":70145,"id":"X70145","images":"11.png","x":1,"y":18,"isTile":true,"recent":1735396802466,"frequent":14},{"idnum":70146,"id":"X70146","images":"11.png","x":2,"y":18,"isTile":true,"recent":1735396788810,"frequent":1},{"idnum":70144,"id":"X70144","images":"11.png","x":0,"y":18,"isTile":true,"recent":1735396782475,"frequent":4},{"idnum":100386,"id":"X100386","images":"Outside_B.png","x":2,"y":16,"isTile":true,"recent":1735396757386,"frequent":1},{"idnum":100362,"id":"X100362","images":"Outside_B.png","x":2,"y":15,"isTile":true,"recent":1735396754546,"frequent":1},{"idnum":100385,"id":"X100385","images":"Outside_B.png","x":1,"y":16,"isTile":true,"recent":1735396751066,"frequent":1},{"idnum":100384,"id":"X100384","images":"Outside_B.png","x":0,"y":16,"isTile":true,"recent":1735396747826,"frequent":1},{"idnum":100361,"id":"X100361","images":"Outside_B.png","x":1,"y":15,"isTile":true,"recent":1735396745106,"frequent":2},{"idnum":100360,"id":"X100360","images":"Outside_B.png","x":0,"y":15,"isTile":true,"recent":1735396742682,"frequent":3},{"idnum":90196,"id":"X90196","images":"12.png","x":4,"y":24,"isTile":true,"recent":1735396698234,"frequent":1},{"idnum":90195,"id":"X90195","images":"12.png","x":3,"y":24,"isTile":true,"recent":1735396695530,"frequent":1},{"idnum":90194,"id":"X90194","images":"12.png","x":2,"y":24,"isTile":true,"recent":1735396691098,"frequent":1},{"idnum":90187,"id":"X90187","images":"12.png","x":3,"y":23,"isTile":true,"recent":1735396687866,"frequent":3},{"idnum":90186,"id":"X90186","images":"12.png","x":2,"y":23,"isTile":true,"recent":1735396672410,"frequent":1},{"idnum":31,"id":"redPotion","images":"items","y":20,"recent":1735396611866,"frequent":7},{"idnum":221,"id":"yellowGateKeeper","images":"enemys","y":20,"recent":1735396537794,"frequent":4},{"idnum":222,"id":"blueGateKeeper","images":"enemys","y":21,"recent":1735396534626,"frequent":3},{"idnum":226,"id":"yellowKnight","images":"enemys","y":25,"recent":1735396460524,"frequent":1},{"idnum":225,"id":"soldier","images":"enemys","y":24,"recent":1735396456036,"frequent":1},{"idnum":326,"id":"tulipFairy","images":"enemys","y":72,"recent":1735396229196,"frequent":1},{"idnum":141,"id":"autotile8","images":"autotile","y":0,"recent":1735391328901,"frequent":2},{"idnum":30,"id":"yellowGem","images":"items","y":19,"recent":1735391294213,"frequent":1},{"idnum":44,"id":"shield5","images":"items","y":59,"recent":1735391193096,"frequent":1},{"idnum":138,"id":"blueTrader","images":"npcs","y":13,"recent":1735391190680,"frequent":1},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1735391188576,"frequent":1}]} \ No newline at end of file +{"viewportLoc":[0,0],"editorLastFloorId":"jiedao","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006","images":"C2.png","x":6,"y":0,"isTile":true,"recent":1735398082894,"frequent":3},{"idnum":130011,"id":"X130011","images":"C2.png","x":3,"y":1,"isTile":true,"recent":1735398078792,"frequent":2},{"idnum":71817,"id":"X71817","images":"11.png","x":1,"y":227,"isTile":true,"recent":1735398027294,"frequent":3},{"idnum":71837,"id":"X71837","images":"11.png","x":5,"y":229,"isTile":true,"recent":1735398013126,"frequent":1},{"idnum":71829,"id":"X71829","images":"11.png","x":5,"y":228,"isTile":true,"recent":1735398008166,"frequent":1},{"idnum":71821,"id":"X71821","images":"11.png","x":5,"y":227,"isTile":true,"recent":1735398005430,"frequent":1},{"idnum":71836,"id":"X71836","images":"11.png","x":4,"y":229,"isTile":true,"recent":1735397997622,"frequent":1},{"idnum":71828,"id":"X71828","images":"11.png","x":4,"y":228,"isTile":true,"recent":1735397993455,"frequent":1},{"idnum":71820,"id":"X71820","images":"11.png","x":4,"y":227,"isTile":true,"recent":1735397989903,"frequent":1},{"idnum":30217,"id":"X30217","images":"4.png","x":1,"y":27,"isTile":true,"recent":1735397944838,"frequent":3},{"idnum":110012,"id":"X110012","images":"C4.png","x":4,"y":1,"isTile":true,"recent":1735397929366,"frequent":2},{"idnum":100485,"id":"X100485","images":"Outside_B.png","x":5,"y":20,"isTile":true,"recent":1735397919927,"frequent":2},{"idnum":100436,"id":"X100436","images":"Outside_B.png","x":4,"y":18,"isTile":true,"recent":1735397880486,"frequent":1},{"idnum":100437,"id":"X100437","images":"Outside_B.png","x":5,"y":18,"isTile":true,"recent":1735397877086,"frequent":1},{"idnum":100461,"id":"X100461","images":"Outside_B.png","x":5,"y":19,"isTile":true,"recent":1735397868606,"frequent":1},{"idnum":100460,"id":"X100460","images":"Outside_B.png","x":4,"y":19,"isTile":true,"recent":1735397843448,"frequent":2},{"idnum":100484,"id":"X100484","images":"Outside_B.png","x":4,"y":20,"isTile":true,"recent":1735397840545,"frequent":2},{"idnum":40136,"id":"X40136","images":"3.png","x":0,"y":17,"isTile":true,"recent":1735397799150,"frequent":1},{"idnum":40144,"id":"X40144","images":"3.png","x":0,"y":18,"isTile":true,"recent":1735397796038,"frequent":2},{"idnum":30227,"id":"X30227","images":"4.png","x":3,"y":28,"isTile":true,"recent":1735397775591,"frequent":2},{"idnum":30214,"id":"X30214","images":"4.png","x":6,"y":26,"isTile":true,"recent":1735397768303,"frequent":1},{"idnum":30218,"id":"X30218","images":"4.png","x":2,"y":27,"isTile":true,"recent":1735397761062,"frequent":1},{"idnum":120041,"id":"X120041","images":"C3.png","x":1,"y":5,"isTile":true,"recent":1735397710494,"frequent":1},{"idnum":120042,"id":"X120042","images":"C3.png","x":2,"y":5,"isTile":true,"recent":1735397702167,"frequent":2},{"idnum":120006,"id":"X120006","images":"C3.png","x":6,"y":0,"isTile":true,"recent":1735397659951,"frequent":5},{"idnum":120014,"id":"X120014","images":"C3.png","x":6,"y":1,"isTile":true,"recent":1735397644591,"frequent":4},{"idnum":120090,"id":"X120090","images":"C3.png","x":2,"y":11,"isTile":true,"recent":1735397629759,"frequent":3},{"idnum":120150,"id":"X120150","images":"C3.png","x":6,"y":18,"isTile":true,"recent":1735397613207,"frequent":3},{"idnum":120166,"id":"X120166","images":"C3.png","x":6,"y":20,"isTile":true,"recent":1735397574639,"frequent":1},{"idnum":140170,"id":"X140170","images":"C1.png","x":2,"y":21,"isTile":true,"recent":1735397516295,"frequent":1},{"idnum":110119,"id":"X110119","images":"C4.png","x":7,"y":14,"isTile":true,"recent":1735397434752,"frequent":3},{"idnum":80083,"id":"X80083","images":"6.png","x":3,"y":10,"isTile":true,"recent":1735397403120,"frequent":6},{"idnum":80082,"id":"X80082","images":"6.png","x":2,"y":10,"isTile":true,"recent":1735397393215,"frequent":2},{"idnum":71824,"id":"X71824","images":"11.png","x":0,"y":228,"isTile":true,"recent":1735397302354,"frequent":1},{"idnum":71816,"id":"X71816","images":"11.png","x":0,"y":227,"isTile":true,"recent":1735397300089,"frequent":1},{"idnum":71825,"id":"X71825","images":"11.png","x":1,"y":228,"isTile":true,"recent":1735397296728,"frequent":1},{"idnum":71841,"id":"X71841","images":"11.png","x":1,"y":230,"isTile":true,"recent":1735397274905,"frequent":1},{"idnum":71840,"id":"X71840","images":"11.png","x":0,"y":230,"isTile":true,"recent":1735397272160,"frequent":1},{"idnum":71833,"id":"X71833","images":"11.png","x":1,"y":229,"isTile":true,"recent":1735397269433,"frequent":1},{"idnum":71832,"id":"X71832","images":"11.png","x":0,"y":229,"isTile":true,"recent":1735397266704,"frequent":1},{"idnum":71815,"id":"X71815","images":"11.png","x":7,"y":226,"isTile":true,"recent":1735397232288,"frequent":1},{"idnum":71807,"id":"X71807","images":"11.png","x":7,"y":225,"isTile":true,"recent":1735397229624,"frequent":1},{"idnum":71827,"id":"X71827","images":"11.png","x":3,"y":228,"isTile":true,"recent":1735397220728,"frequent":1},{"idnum":71819,"id":"X71819","images":"11.png","x":3,"y":227,"isTile":true,"recent":1735397218496,"frequent":1},{"idnum":120173,"id":"X120173","images":"C3.png","x":5,"y":21,"isTile":true,"recent":1735397183385,"frequent":3},{"idnum":120174,"id":"X120174","images":"C3.png","x":6,"y":21,"isTile":true,"recent":1735397125953,"frequent":6},{"idnum":120134,"id":"X120134","images":"C3.png","x":6,"y":16,"isTile":true,"recent":1735396971049,"frequent":1},{"idnum":130173,"id":"X130173","images":"C2.png","x":5,"y":21,"isTile":true,"recent":1735396958897,"frequent":1},{"idnum":120109,"id":"X120109","images":"C3.png","x":5,"y":13,"isTile":true,"recent":1735396928298,"frequent":2},{"idnum":120117,"id":"X120117","images":"C3.png","x":5,"y":14,"isTile":true,"recent":1735396877690,"frequent":1},{"idnum":120125,"id":"X120125","images":"C3.png","x":5,"y":15,"isTile":true,"recent":1735396864194,"frequent":6},{"idnum":70169,"id":"X70169","images":"11.png","x":1,"y":21,"isTile":true,"recent":1735396825666,"frequent":3},{"idnum":70161,"id":"X70161","images":"11.png","x":1,"y":20,"isTile":true,"recent":1735396814418,"frequent":3},{"idnum":70145,"id":"X70145","images":"11.png","x":1,"y":18,"isTile":true,"recent":1735396802466,"frequent":14},{"idnum":70146,"id":"X70146","images":"11.png","x":2,"y":18,"isTile":true,"recent":1735396788810,"frequent":1},{"idnum":70144,"id":"X70144","images":"11.png","x":0,"y":18,"isTile":true,"recent":1735396782475,"frequent":4},{"idnum":100386,"id":"X100386","images":"Outside_B.png","x":2,"y":16,"isTile":true,"recent":1735396757386,"frequent":1},{"idnum":100362,"id":"X100362","images":"Outside_B.png","x":2,"y":15,"isTile":true,"recent":1735396754546,"frequent":1},{"idnum":100385,"id":"X100385","images":"Outside_B.png","x":1,"y":16,"isTile":true,"recent":1735396751066,"frequent":1},{"idnum":100384,"id":"X100384","images":"Outside_B.png","x":0,"y":16,"isTile":true,"recent":1735396747826,"frequent":1},{"idnum":100361,"id":"X100361","images":"Outside_B.png","x":1,"y":15,"isTile":true,"recent":1735396745106,"frequent":2},{"idnum":100360,"id":"X100360","images":"Outside_B.png","x":0,"y":15,"isTile":true,"recent":1735396742682,"frequent":3},{"idnum":90196,"id":"X90196","images":"12.png","x":4,"y":24,"isTile":true,"recent":1735396698234,"frequent":1},{"idnum":90195,"id":"X90195","images":"12.png","x":3,"y":24,"isTile":true,"recent":1735396695530,"frequent":1},{"idnum":90194,"id":"X90194","images":"12.png","x":2,"y":24,"isTile":true,"recent":1735396691098,"frequent":1},{"idnum":90187,"id":"X90187","images":"12.png","x":3,"y":23,"isTile":true,"recent":1735396687866,"frequent":3},{"idnum":90186,"id":"X90186","images":"12.png","x":2,"y":23,"isTile":true,"recent":1735396672410,"frequent":1},{"idnum":31,"id":"redPotion","images":"items","y":20,"recent":1735396611866,"frequent":7},{"idnum":221,"id":"yellowGateKeeper","images":"enemys","y":20,"recent":1735396537794,"frequent":4},{"idnum":222,"id":"blueGateKeeper","images":"enemys","y":21,"recent":1735396534626,"frequent":3},{"idnum":226,"id":"yellowKnight","images":"enemys","y":25,"recent":1735396460524,"frequent":1},{"idnum":225,"id":"soldier","images":"enemys","y":24,"recent":1735396456036,"frequent":1},{"idnum":326,"id":"tulipFairy","images":"enemys","y":72,"recent":1735396229196,"frequent":1},{"idnum":141,"id":"autotile8","images":"autotile","y":0,"recent":1735391328901,"frequent":2},{"idnum":30,"id":"yellowGem","images":"items","y":19,"recent":1735391294213,"frequent":1},{"idnum":44,"id":"shield5","images":"items","y":59,"recent":1735391193096,"frequent":1},{"idnum":138,"id":"blueTrader","images":"npcs","y":13,"recent":1735391190680,"frequent":1},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1735391188576,"frequent":1}]} \ No newline at end of file diff --git a/project/plugins.js b/project/plugins.js index ed47f69..fb47511 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -188,6 +188,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.doAction(); } }); + core.registerEvent("setcgs", function (data) { + core.setcgs(data.img) + core.doAction() + }) + core.registerEvent("setq", function (data) { + core.setq(data.id) + core.doAction() + }) core.registerEvent("cgtext", function (data) { if (!main.replayChecking && !core.isReplaying()) { core.ui.cgText.image = data.bg; @@ -9423,6 +9431,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ], 特效表现: [ MotaActionBlocks["sleep_s"].xmlText(), + MotaActionBlocks["setq_s"].xmlText(), MotaActionBlocks["changebg_s"].xmlText(), MotaActionFunctions.actionParser.parseList({ type: "wait", @@ -9492,10 +9501,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ], 音像处理: [ MotaActionBlocks["animationDrawable_s"].xmlText(), - MotaActionBlocks["setanimate_s"].xmlText(), - MotaActionBlocks["deleteanimate_s"].xmlText(), - MotaActionBlocks["playanimate_s"].xmlText(), - MotaActionBlocks["clearanimate_s"].xmlText(), + MotaActionBlocks["setcgs_s"].xmlText(), MotaActionBlocks["showImage_s"].xmlText(), MotaActionBlocks["showImage_1_s"].xmlText(), MotaActionBlocks["hideImage_s"].xmlText(), @@ -10269,420 +10275,424 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; }, "小地图": function () { - // 在此增加新插件 - // ----- 不可自定义 杂七杂八的变量 - /** @type {{[x: string]: BFSResult}} */ - let mapCache = {}; // 地图缓存 - let drawCache = {}; // 绘制信息缓存 - let status = "none"; // 当前的绘制状态 - /** @type {{[x: string]: Sprite}} */ - let sprites = {}; // 当前所有的sprite - /** @type {{[x: string]: Sprite}} */ - let canDrag = {}; // 可以拖拽的sprite - /** @type {{[x: string]: Button}} */ - let areaSprite = {}; // 区域列表对应的sprite - let clicking = false; // 是否正在点击,用于拖拽判定 - let drawingMap = ""; // 正在绘制的中心楼层 - let nowScale = 0; // 当前绘制的放缩比例 - let lastTouch = {}; // 上一次的单点点击信息 - let lastLength = 0; // 手机端缩放时上一次的两指间距离 - let nowDepth = 0; // 当前的遍历深度 - let drawedThumbnail = {}; // 已经绘制过的缩略图 - let moved = false; // 鼠标按下后是否移动了 - let noBorder = false; // 是否是无边框拼接模式 - let lastScale = 0; // 上一次缩放,用于优化缩略图绘制 - let areaPage = 0; // 区域显示的当前页数 - let nowArea = 0; // 当前区域index - let selecting = ""; // 选择时当前正在选择的地图 + // 在此增加新插件 + // ----- 不可自定义 杂七杂八的变量 + /** @type {{[x: string]: BFSResult}} */ + let mapCache = {}; // 地图缓存 + let drawCache = {}; // 绘制信息缓存 + let status = "none"; // 当前的绘制状态 + /** @type {{[x: string]: Sprite}} */ + let sprites = {}; // 当前所有的sprite + /** @type {{[x: string]: Sprite}} */ + let canDrag = {}; // 可以拖拽的sprite + /** @type {{[x: string]: Button}} */ + let areaSprite = {}; // 区域列表对应的sprite + let clicking = false; // 是否正在点击,用于拖拽判定 + let drawingMap = ""; // 正在绘制的中心楼层 + let nowScale = 0; // 当前绘制的放缩比例 + let lastTouch = {}; // 上一次的单点点击信息 + let lastLength = 0; // 手机端缩放时上一次的两指间距离 + let nowDepth = 0; // 当前的遍历深度 + let drawedThumbnail = {}; // 已经绘制过的缩略图 + let moved = false; // 鼠标按下后是否移动了 + let noBorder = false; // 是否是无边框拼接模式 + let lastScale = 0; // 上一次缩放,用于优化缩略图绘制 + let areaPage = 0; // 区域显示的当前页数 + let nowArea = 0; // 当前区域index + let selecting = ""; // 选择时当前正在选择的地图 - // ---- 不可自定义,常量 - /** @type {Area} */ - let areas = []; // 区域信息 - const perPage = Math.floor((core._PY_ - 60) / 30); // 区域的每页显示数量 + // ---- 不可自定义,常量 + /** @type {Area} */ + let areas = []; // 区域信息 + const perPage = Math.floor((core._PY_ - 60) / 30); // 区域的每页显示数量 - // ---- 可自定义,默认的切换地图的图块id - const defaultChange = { - left: "leftPortal", // 左箭头 - up: "upPortal", // 上箭头 - right: "rightPortal", // 右箭头 - down: "downPortal", // 下箭头 - upFloor: "upFloor", // 上楼 - downFloor: "downFloor", // 下楼 - }; - // ---- 可自定义,默认数值 - const defaultValue = { - font: "Verdana", // 默认字体 - scale: 60, // 默认地图缩放比例 - depth: Infinity, // 默认的遍历深度 - }; + // ---- 可自定义,默认的切换地图的图块id + const defaultChange = { + left: "leftPortal", // 左箭头 + up: "upPortal", // 上箭头 + right: "rightPortal", // 右箭头 + down: "downPortal", // 下箭头 + upFloor: "upFloor", // 上楼 + downFloor: "downFloor", // 下楼 + }; + // ---- 可自定义,默认数值 + const defaultValue = { + font: "Verdana", // 默认字体 + scale: 60, // 默认地图缩放比例 + depth: Infinity, // 默认的遍历深度 + }; - // ---- 不可自定义,计算数据 - const dirData = { - up: [1, 0], - down: [-1, 0], - left: [0, 1], - right: [0, -1], - upFloor: [0, 0], - downFloor: [0, 0], - }; - let ignoreEnemies = (this.ignoreEnemies = []); + // ---- 不可自定义,计算数据 + const dirData = { + up: [1, 0], + down: [-1, 0], + left: [0, 1], + right: [0, -1], + upFloor: [0, 0], + downFloor: [0, 0], + }; + let ignoreEnemies = (this.ignoreEnemies = []); - let allChangeEntries = Object.entries(defaultChange); + let allChangeEntries = Object.entries(defaultChange); - const reset = core.events.resetGame; - this.bfs = function () { - areas = []; - // 获取所有分区,使用异步函数,保证不会卡顿 - // 原理是用bfs扫,将所有连在一起的地图合并成一个区域 - (async function () { - let all = core.floorIds.slice(); - const scanned = { - [all[0]]: true, - }; - while (all.length > 0) { - let now = all.shift(); - if (core.status.maps[now].deleted) continue; - if (!now) return; - await new Promise((res) => { - const result = core.plugin.bfsSearch(now, Infinity, true); - mapCache[`${now}_Infinity_false`] = result; - areas.push({ name: core.floors[now].areas, maps: result.order }); - for (const map of result.order) { - scanned[map] = true; - all = all.filter((v) => !result.order.includes(v)); - } - res("success"); - }).then(() => { - core.setFlag("areas", areas); - }); - } - })(); - }; - core.events.resetGame = function () { - reset.apply(core.events, arguments); - core.plugin.bfs(); - }; - /** - * 广度优先搜索搜索地图路径 - * @param {string} center 中心地图的id - * @param {number} depth 搜索深度 - * @param {boolean} noCache 是否不使用缓存 - * @returns {BFSResult} 格式:floorId_x_y_dir: floorId_x_y - */ - this.bfsSearch = function bfsSearch(center, depth, noCache) { - // 检查缓存 - const id = `${center}_${depth}_${noBorder}`; - if (mapCache[id] && !noCache) return mapCache[id]; - const used = { - [center]: true, - }; // 搜索过的楼层 - let queue = []; - let stack = [center]; // 当前栈 - let nowDepth = -1; - const mapOrder = [center]; // 遍历顺序,顺便还能记录遍历了哪些楼层 + this.setq = function (floorId) { + core.setFlag("任务地点", floorId) + } - const res = {}; // 输出结果,格式:floorId_x_y_dir: floorId_x_y - const enemies = {}; - const upOrDown = {}; - const mapdir = {}; - // 开始循环搜索 - while (nowDepth < depth && stack.length > 0) { - const now = stack.shift(); // 当前id - if (core.status.maps[now].deleted) continue; - mapdir[now] = mapdir[now] ?? []; - const blocks = core.getMapBlocksObj(now); // 获取当前地图的每点的事件 - enemies[now] = {}; - // 遍历,获取可以传送的点,只检测绿点事件,因此可用红点事件进行传送来实现分区功能 - for (const i in blocks) { - const block = blocks[i]; - // 整合漏怪检测,所以要检测怪物 - if (block.event.trigger === "battle") { - const id = block.event.id; - if (ignoreEnemies.includes(id)) continue; - else enemies[now][i] = block.event.id; - continue; - } - // 检测触发器是否为切换楼层,不是则直接跳过 - if (block.event.trigger !== "changeFloor") continue; - const dirEntries = allChangeEntries.find( - (v) => v[1] === block.event.id - ); - // 如果不是那六种传送门,直接忽略 - if (!dirEntries) continue; - const data = block.event.data; - const dir = dirEntries[0]; - const route = now + "_" + i.replace(",", "_") + "_" + dir; - const target = data.floorId + "_" + data.loc.join("_"); + const reset = core.events.resetGame; + this.bfs = function () { + areas = []; + // 获取所有分区,使用异步函数,保证不会卡顿 + // 原理是用bfs扫,将所有连在一起的地图合并成一个区域 + (async function () { + let all = core.floorIds.slice(); + const scanned = { + [all[0]]: true, + }; + while (all.length > 0) { + let now = all.shift(); + if (core.status.maps[now].deleted) continue; + if (!now) return; + await new Promise((res) => { + const result = core.plugin.bfsSearch(now, Infinity, true); + mapCache[`${now}_Infinity_false`] = result; + areas.push({ name: core.floors[now].areas, maps: result.order }); + for (const map of result.order) { + scanned[map] = true; + all = all.filter((v) => !result.order.includes(v)); + } + res("success"); + }).then(() => { + core.setFlag("areas", areas); + }); + } + })(); + }; + core.events.resetGame = function () { + reset.apply(core.events, arguments); + core.plugin.bfs(); + }; + /** + * 广度优先搜索搜索地图路径 + * @param {string} center 中心地图的id + * @param {number} depth 搜索深度 + * @param {boolean} noCache 是否不使用缓存 + * @returns {BFSResult} 格式:floorId_x_y_dir: floorId_x_y + */ + this.bfsSearch = function bfsSearch(center, depth, noCache) { + // 检查缓存 + const id = `${center}_${depth}_${noBorder}`; + if (mapCache[id] && !noCache) return mapCache[id]; + const used = { + [center]: true, + }; // 搜索过的楼层 + let queue = []; + let stack = [center]; // 当前栈 + let nowDepth = -1; + const mapOrder = [center]; // 遍历顺序,顺便还能记录遍历了哪些楼层 - mapdir[now].push(dir); - if (!used[data.floorId]) { - if (dir === "upFloor" || dir === "downFloor") { - upOrDown[now] = upOrDown[id] ?? []; - upOrDown[now].push(dir); - } + const res = {}; // 输出结果,格式:floorId_x_y_dir: floorId_x_y + const enemies = {}; + const upOrDown = {}; + const mapdir = {}; + // 开始循环搜索 + while (nowDepth < depth && stack.length > 0) { + const now = stack.shift(); // 当前id + if (core.status.maps[now].deleted) continue; + mapdir[now] = mapdir[now] ?? []; + const blocks = core.getMapBlocksObj(now); // 获取当前地图的每点的事件 + enemies[now] = {}; + // 遍历,获取可以传送的点,只检测绿点事件,因此可用红点事件进行传送来实现分区功能 + for (const i in blocks) { + const block = blocks[i]; + // 整合漏怪检测,所以要检测怪物 + if (block.event.trigger === "battle") { + const id = block.event.id; + if (ignoreEnemies.includes(id)) continue; + else enemies[now][i] = block.event.id; + continue; + } + // 检测触发器是否为切换楼层,不是则直接跳过 + if (block.event.trigger !== "changeFloor") continue; + const dirEntries = allChangeEntries.find( + (v) => v[1] === block.event.id + ); + // 如果不是那六种传送门,直接忽略 + if (!dirEntries) continue; + const data = block.event.data; + const dir = dirEntries[0]; + const route = now + "_" + i.replace(",", "_") + "_" + dir; + const target = data.floorId + "_" + data.loc.join("_"); - queue.push(data.floorId); // 没有搜索过,则加入栈中 - mapOrder.push(data.floorId); - used[data.floorId] = true; - } - res[route] = target; - } - if (stack.length === 0) { - stack = queue; - queue = []; - nowDepth++; - } - if (stack.length === 0 && queue.length === 0) break; - } - return { res, order: mapOrder, enemies, upOrDown, mapdir }; - }; - /** - * 获取绘制信息 - * @param {string?} center 中心地图id - * @param {number?} depth 搜索深度 - * @param {boolean?} noCache 是否不使用缓存 - * @returns {MapDrawInfo} - */ - this.getMapDrawInfo = function ( - center = core.status.floorId, - depth = defaultValue.depth, - noCache = false - ) { - nowDepth = depth; - drawingMap = center; - const id = `${center}_${depth}_${noBorder}`; - // 检查缓存 - if (drawCache[id] && !noCache) return drawCache[id]; - const map = core.plugin.bfsSearch(center, depth, noCache); - mapCache[id] = map; - const res = getDrawInfo(map.res, center, map.order); - res.upOrDown = map.upOrDown; - res.mapdir = map.mapdir; - drawCache[id] = res; - return res; - }; - /** - * 提供地图的绘制信息 - * @param {{[x: string]: string}} map 要绘制的地图,格式:floorId_x_y_dir: floorId_x_y - * @param {string} center 中心地图的id - * @param {string[]} order 遍历顺序 - * @returns {MapDrawInfo} 地图的绘制信息 - */ + mapdir[now].push(dir); + if (!used[data.floorId]) { + if (dir === "upFloor" || dir === "downFloor") { + upOrDown[now] = upOrDown[id] ?? []; + upOrDown[now].push(dir); + } - function getDrawInfo(map, center, order) { - // 先根据地图id分类,从而确定每个地图连接哪些地图,同时方便处理 - const links = {}; - for (const i in map) { - const splitted = i.split("_"); - const id = splitted[0]; - if (!links[id]) links[id] = {}; - links[id][i] = map[i]; - } + queue.push(data.floorId); // 没有搜索过,则加入栈中 + mapOrder.push(data.floorId); + used[data.floorId] = true; + } + res[route] = target; + } + if (stack.length === 0) { + stack = queue; + queue = []; + nowDepth++; + } + if (stack.length === 0 && queue.length === 0) break; + } + return { res, order: mapOrder, enemies, upOrDown, mapdir }; + }; + /** + * 获取绘制信息 + * @param {string?} center 中心地图id + * @param {number?} depth 搜索深度 + * @param {boolean?} noCache 是否不使用缓存 + * @returns {MapDrawInfo} + */ + this.getMapDrawInfo = function ( + center = core.status.floorId, + depth = defaultValue.depth, + noCache = false + ) { + nowDepth = depth; + drawingMap = center; + const id = `${center}_${depth}_${noBorder}`; + // 检查缓存 + if (drawCache[id] && !noCache) return drawCache[id]; + const map = core.plugin.bfsSearch(center, depth, noCache); + mapCache[id] = map; + const res = getDrawInfo(map.res, center, map.order); + res.upOrDown = map.upOrDown; + res.mapdir = map.mapdir; + drawCache[id] = res; + return res; + }; + /** + * 提供地图的绘制信息 + * @param {{[x: string]: string}} map 要绘制的地图,格式:floorId_x_y_dir: floorId_x_y + * @param {string} center 中心地图的id + * @param {string[]} order 遍历顺序 + * @returns {MapDrawInfo} 地图的绘制信息 + */ - // 分类完毕,然后根据连接点先计算出各个地图的坐标,然后再进行判断 - const centerFloor = core.status.maps[center]; - const visitedCenter = core.hasVisitedFloor(center); - const locs = { - // 格式:[中心x, 中心y, 宽, 高, 是否到达过] - [center]: [2, 2, 1, 1, visitedCenter], - }; - // 可以上楼下楼的地图 - const upOrDown = {}; - for (const id of order) { - const now = links[id]; - // 遍历每一个地图的连接情况 - for (const from in now) { - const to = now[from]; - // 先根据from to计算物理位置 - const fromData = from.split("_"), - toData = to.split("_"); - const dir = fromData[3]; - if (dir === "upFloor" || dir === "downFloor") continue; - if (!defaultChange[dir]) continue; - const v = dirData[dir][1], // 竖直数值 - h = dirData[dir][0], // 水平数值 - ha = Math.abs(h), - va = Math.abs(v); - const ff = id, // fromFloorId - tf = toData[0]; // toFloorId - const fromFloor = core.status.maps[ff], - toFloor = core.status.maps[tf]; - const fhw = Math.floor(fromFloor.width / 2), // fromFloorHalfWidth - fhh = Math.floor(fromFloor.height / 2), - thw = Math.floor(toFloor.width / 2), - thh = Math.floor(toFloor.height / 2); - const fLoc = locs[id] ?? [0, 0]; - if (!locs[ff]) continue; - let x, y; - if (locs && locs[tf]) { - x = locs[tf][0]; - y = locs[tf][1]; - } else { - // 计算坐标,公式可以通过画图推断出 - x = fLoc[0] - v; - y = fLoc[1] - h; - } - locs[tf] = locs[tf] ?? [x, y, 1, 1, core.hasVisitedFloor(tf)]; - } - } - // 获取地图绘制需要的长宽 - let width = 0, - height = 0; - let left, right, up, down; - for (const id in locs) { - const [x, y, w, h] = locs[id]; - if (left === void 0) { - left = right = x; - up = down = y; - } - left = Math.min(x - 1, left); - right = Math.max(x + 1, right); - up = Math.min(y - 1, up); - down = Math.max(y + 1, down); - } - width = right - left; - height = down - up; + function getDrawInfo(map, center, order) { + // 先根据地图id分类,从而确定每个地图连接哪些地图,同时方便处理 + const links = {}; + for (const i in map) { + const splitted = i.split("_"); + const id = splitted[0]; + if (!links[id]) links[id] = {}; + links[id][i] = map[i]; + } - return { locs, width, height, layer: upOrDown }; - } + // 分类完毕,然后根据连接点先计算出各个地图的坐标,然后再进行判断 + const centerFloor = core.status.maps[center]; + const visitedCenter = core.hasVisitedFloor(center); + const locs = { + // 格式:[中心x, 中心y, 宽, 高, 是否到达过] + [center]: [2, 2, 1, 1, visitedCenter], + }; + // 可以上楼下楼的地图 + const upOrDown = {}; + for (const id of order) { + const now = links[id]; + // 遍历每一个地图的连接情况 + for (const from in now) { + const to = now[from]; + // 先根据from to计算物理位置 + const fromData = from.split("_"), + toData = to.split("_"); + const dir = fromData[3]; + if (dir === "upFloor" || dir === "downFloor") continue; + if (!defaultChange[dir]) continue; + const v = dirData[dir][1], // 竖直数值 + h = dirData[dir][0], // 水平数值 + ha = Math.abs(h), + va = Math.abs(v); + const ff = id, // fromFloorId + tf = toData[0]; // toFloorId + const fromFloor = core.status.maps[ff], + toFloor = core.status.maps[tf]; + const fhw = Math.floor(fromFloor.width / 2), // fromFloorHalfWidth + fhh = Math.floor(fromFloor.height / 2), + thw = Math.floor(toFloor.width / 2), + thh = Math.floor(toFloor.height / 2); + const fLoc = locs[id] ?? [0, 0]; + if (!locs[ff]) continue; + let x, y; + if (locs && locs[tf]) { + x = locs[tf][0]; + y = locs[tf][1]; + } else { + // 计算坐标,公式可以通过画图推断出 + x = fLoc[0] - v; + y = fLoc[1] - h; + } + locs[tf] = locs[tf] ?? [x, y, 1, 1, core.hasVisitedFloor(tf)]; + } + } + // 获取地图绘制需要的长宽 + let width = 0, + height = 0; + let left, right, up, down; + for (const id in locs) { + const [x, y, w, h] = locs[id]; + if (left === void 0) { + left = right = x; + up = down = y; + } + left = Math.min(x - 1, left); + right = Math.max(x + 1, right); + up = Math.min(y - 1, up); + down = Math.max(y + 1, down); + } + width = right - left; + height = down - up; - function mapblock(mapdir) { - let mb = ""; - if (mapdir.includes("up")) mb += "u"; - if (mapdir.includes("down")) mb += "d"; - if (mapdir.includes("left")) mb += "l"; - if (mapdir.includes("right")) mb += "r"; - return mb ? mb + ".webp" : "null.webp"; - } - core.animateFrame.globalAlphaFloor = 0; - core.animateFrame.globalAlphaFloorStatus = 1; + return { locs, width, height, layer: upOrDown }; + } - const tesk = document.createElement("canvas"); - tesk.width = 300; - tesk.height = 300; - const teskctx = tesk.getContext("2d"); + function mapblock(mapdir) { + let mb = ""; + if (mapdir.includes("up")) mb += "u"; + if (mapdir.includes("down")) mb += "d"; + if (mapdir.includes("left")) mb += "l"; + if (mapdir.includes("right")) mb += "r"; + return mb ? mb + ".webp" : "null.webp"; + } + core.animateFrame.globalAlphaFloor = 0; + core.animateFrame.globalAlphaFloorStatus = 1; - let line = 50; - teskctx.strokeStyle = "green"; - teskctx.fillStyle = "green"; - let now = 0; - core.registerAnimationFrame("tesk", true, function (timestamp) { - if (timestamp - now > 1000 / 60) { - now = timestamp; - core.clearMap(teskctx); - teskctx.lineWidth = 150 - line; + const tesk = document.createElement("canvas"); + tesk.width = 300; + tesk.height = 300; + const teskctx = tesk.getContext("2d"); - if (line <= 150) { - teskctx.beginPath(); - teskctx.arc(150, 150, line, 0, Math.PI * 2); - line += 2; - teskctx.stroke(); - } else { - teskctx.beginPath(); - teskctx.arc(150, 150, line - 150, 0, Math.PI * 2); - line += 2; - teskctx.fill(); - if (line >= 250) line = 50; - } - } - }); + let line = 50; + teskctx.strokeStyle = "green"; + teskctx.fillStyle = "green"; + let now = 0; + core.registerAnimationFrame("tesk", true, function (timestamp) { + if (timestamp - now > 1000 / 60) { + now = timestamp; + core.clearMap(teskctx); + teskctx.lineWidth = 150 - line; - /** - * 绘制小地图 - * @param {MapDrawInfo} info 地图绘制信息 - * @param {number} scale 地图的绘制比例 - */ - this.drawSmallMap = function ( - ctx, - info, - center, - sx, - sy, - sw, - sh, - scale = defaultValue.scale - ) { - core.clearMap(ctx, sx, sy, sw + 40, sh + 60); - if (core.domStyle.isVertical) { - sy += 50; - sx += 15; - } else { - sy += 60; - sx += 30; - } - core.fillRect(ctx, sx, sy, sw, sh, "#000"); - core.strokeRect(ctx, sx, sy, sw, sh, "#fff", 5); - core.setTextAlign("outerUI", "center"); - core.fillBoldText1( - ctx, - core.status.maps[center].areas, - sx + sw / 2, - sy - 10, - "#FFFFFF", - "#000000", - 6, - "bold 42px Verdana" - ); - const locs = info.locs; - for (const id in locs) { - const loc = locs[id]; - let color = "#000"; - if (!loc[4]) color = "#f0f"; - const [x, y, w, h] = loc.map((v) => typeof v === "number" && v * scale); - const fx = x + sx, - fy = y + sy; - const mapdir = info.mapdir[id]; - const img = mapblock(mapdir); - if (x < 0 || x > 4 * scale || y < 0 || y > 4 * scale) continue; - core.drawImage(ctx, img, 0, 0, 60, 60, fx, fy, w, h); - const layer = info.upOrDown[id]; - const min = Math.min(w, h); - if (core.getFlag("任务地点") && core.getFlag("任务地点") === id) - ctx.drawImage(tesk, fx + min / 4, fy + min / 4, min / 2, min / 2); - if (layer?.includes("upFloor")) - core.drawIcon( - ctx, - defaultChange.upFloor, - fx + min / 4, - fy + min / 4, - min / 2, - min / 2 - ); - if (layer?.includes("downFloor")) - core.drawIcon( - ctx, - defaultChange.downFloor, - fx + min / 4, - fy + min / 4, - min / 2, - min / 2 - ); + if (line <= 150) { + teskctx.beginPath(); + teskctx.arc(150, 150, line, 0, Math.PI * 2); + line += 2; + teskctx.stroke(); + } else { + teskctx.beginPath(); + teskctx.arc(150, 150, line - 150, 0, Math.PI * 2); + line += 2; + teskctx.fill(); + if (line >= 250) line = 50; + } + } + }); - // 显示漏怪数量 - if (core.getFlag("showEnemy")) { - ctx.textAlign = "center"; - ctx.textBaseline = "middle"; - const c = drawingMap + "_" + nowDepth + "_" + noBorder; - const n = Object.keys(mapCache[c].enemies[id]).length; - color = "#fff"; - if (n > 10) color = "#fc3"; - if (n > 20) color = "#f22"; - ctx.shadowBlur = 0.6 * nowScale; - ctx.shadowColor = "#000"; - if (n > 0) - core.fillText( - ctx, - n, - fx + (w * 3) / 10, - fy + (h * 7) / 10, - color, - 22 + "px normal" - ); - ctx.shadowBlur = 0; - } - } - }; - }, + /** + * 绘制小地图 + * @param {MapDrawInfo} info 地图绘制信息 + * @param {number} scale 地图的绘制比例 + */ + this.drawSmallMap = function ( + ctx, + info, + center, + sx, + sy, + sw, + sh, + scale = defaultValue.scale + ) { + core.clearMap(ctx, sx, sy, sw + 40, sh + 60); + if (core.domStyle.isVertical) { + sy += 50; + sx += 15; + } else { + sy += 60; + sx += 30; + } + core.fillRect(ctx, sx, sy, sw, sh, "#000"); + core.strokeRect(ctx, sx, sy, sw, sh, "#fff", 5); + core.setTextAlign("outerUI", "center"); + core.fillBoldText1( + ctx, + core.status.maps[center].areas, + sx + sw / 2, + sy - 10, + "#FFFFFF", + "#000000", + 6, + "bold 42px Verdana" + ); + const locs = info.locs; + for (const id in locs) { + const loc = locs[id]; + let color = "#000"; + if (!loc[4]) color = "#f0f"; + const [x, y, w, h] = loc.map((v) => typeof v === "number" && v * scale); + const fx = x + sx, + fy = y + sy; + const mapdir = info.mapdir[id]; + const img = mapblock(mapdir); + if (x < 0 || x > 4 * scale || y < 0 || y > 4 * scale) continue; + core.drawImage(ctx, img, 0, 0, 60, 60, fx, fy, w, h); + const layer = info.upOrDown[id]; + const min = Math.min(w, h); + if (core.getFlag("任务地点") && core.getFlag("任务地点") === id) + ctx.drawImage(tesk, fx + min / 4, fy + min / 4, min / 2, min / 2); + if (layer?.includes("upFloor")) + core.drawIcon( + ctx, + defaultChange.upFloor, + fx + min / 4, + fy + min / 4, + min / 2, + min / 2 + ); + if (layer?.includes("downFloor")) + core.drawIcon( + ctx, + defaultChange.downFloor, + fx + min / 4, + fy + min / 4, + min / 2, + min / 2 + ); + + // 显示漏怪数量 + if (core.getFlag("showEnemy")) { + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + const c = drawingMap + "_" + nowDepth + "_" + noBorder; + const n = Object.keys(mapCache[c].enemies[id]).length; + color = "#fff"; + if (n > 10) color = "#fc3"; + if (n > 20) color = "#f22"; + ctx.shadowBlur = 0.6 * nowScale; + ctx.shadowColor = "#000"; + if (n > 0) + core.fillText( + ctx, + n, + fx + (w * 3) / 10, + fy + (h * 7) / 10, + color, + 22 + "px normal" + ); + ctx.shadowBlur = 0; + } + } + }; +}, "楼传": function () { // 在此增加新插件 @@ -11822,6 +11832,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = class CG { constructor() { + this.cgs //cg列表 this.UIMx = [ //空位用‘none’填充,当前ui至多4列6行 @@ -11882,6 +11893,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } onclick(px, py) { //点击 + if (show) { show = !show; core.clearMap(ctx); @@ -11935,64 +11947,76 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = this.update(); } } else if (inRect(pos, imagebox0)) { - const img = core.material.images.images[this.UIMx[page][0][0]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][0][0])) { + const img = core.material.images.images[this.UIMx[page][0][0]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } else if (inRect(pos, imagebox1)) { - const img = core.material.images.images[this.UIMx[page][0][1]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][0][1])) { + const img = core.material.images.images[this.UIMx[page][0][1]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } else if (inRect(pos, imagebox2)) { - const img = core.material.images.images[this.UIMx[page][0][2]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][0][2])) { + const img = core.material.images.images[this.UIMx[page][0][2]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } else if (inRect(pos, imagebox3)) { - const img = core.material.images.images[this.UIMx[page][1][0]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][1][0])) { + const img = core.material.images.images[this.UIMx[page][1][0]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } else if (inRect(pos, imagebox4)) { - const img = core.material.images.images[this.UIMx[page][1][1]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][1][1])) { + const img = core.material.images.images[this.UIMx[page][1][1]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } else if (inRect(pos, imagebox5)) { - const img = core.material.images.images[this.UIMx[page][1][2]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; + if (this.cgs.includes(this.UIMx[page][1][2])) { + const img = core.material.images.images[this.UIMx[page][1][2]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } } } } else { @@ -12017,40 +12041,52 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = this.update(); } } else if (inRect(pos, imagebox0)) { - const img = core.material.images.images[this.UIMx[page][0][0]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][0][0])) { + const img = core.material.images.images[this.UIMx[page][0][0]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } else if (inRect(pos, imagebox1)) { - const img = core.material.images.images[this.UIMx[page][0][1]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][0][1])) { + const img = core.material.images.images[this.UIMx[page][0][1]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } else if (inRect(pos, imagebox2)) { - const img = core.material.images.images[this.UIMx[page][0][2]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][0][2])) { + const img = core.material.images.images[this.UIMx[page][0][2]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } else if (inRect(pos, imagebox3)) { - const img = core.material.images.images[this.UIMx[page][1][0]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][1][0])) { + const img = core.material.images.images[this.UIMx[page][1][0]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } else if (inRect(pos, imagebox4)) { - const img = core.material.images.images[this.UIMx[page][1][1]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][1][1])) { + const img = core.material.images.images[this.UIMx[page][1][1]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } else if (inRect(pos, imagebox5)) { - const img = core.material.images.images[this.UIMx[page][1][2]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; + if (this.cgs.includes(this.UIMx[page][1][2])) { + const img = core.material.images.images[this.UIMx[page][1][2]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } } } } @@ -12060,6 +12096,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.clearMap(CGUI); const bgVertical = core.material.images.images["bg_2010.webp"]; //竖屏背景 const bg = core.material.images.images["bg_5043.webp"]; //横屏背景 + if (core.domStyle.isVertical) { //竖屏 @@ -12129,14 +12166,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "#444444", 5 ); - if (img) - ctx.drawImage( - img, - 50 + j * 600 + 15, + if (this.cgs.includes(this.UIMx[page][j][i])) { + if (img) + ctx.drawImage( + img, + 50 + j * 600 + 15, + 200 + i * 550 + 15, + 560 - 30, + 420 - 30 + ); + } else { + ctx.fillStyle = "#000000" + ctx.fillRect(50 + j * 600 + 15, 200 + i * 550 + 15, 560 - 30, - 420 - 30 - ); + 420 - 30) + } } } } else { @@ -12203,25 +12248,41 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "#444444", 2 ); - const img = core.material.images.images[this.UIMx[page][i][j]]; - if (img) - ctx.drawImage( - img, - 75 + j * 650 + 15, + if (this.cgs.includes(this.UIMx[page][i][j])) { + const img = core.material.images.images[this.UIMx[page][i][j]]; + if (img) + ctx.drawImage( + img, + 75 + j * 650 + 15, + 150 + i * 500 + 15, + 600 - 30, + 450 - 30 + ); + } else { + ctx.fillStyle = "#000000" + ctx.fillRect(75 + j * 650 + 15, 150 + i * 500 + 15, 600 - 30, - 450 - 30 - ); + 450 - 30) + } } } } } } + this.setcgs = function (img) { + const a = core.getLocalStorage('cgs', []) + if (img) { + if (!a.includes(img)) a.push(img) + core.setLocalStorage('cgs', a) + } else(core.setLocalStorage('cgs')) + } core.ui.CG = new CG(); main.dom.CGMode.onclick = function () { //点击开始页面的CG MODE进入cg回廊 main.core.control.checkBgm(); page = 0; + main.core.ui.CG.cgs = core.getLocalStorage('cgs', []) CGUI.style.display = "block"; main.core.ui.CG.update(); };