Skip to content

Commit d2c45ae

Browse files
committed
Input fix for One Button when clicking on line
1 parent 64a07eb commit d2c45ae

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

src/variety/kaidan.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,13 @@
239239
decIC_edamame: function(cell) {
240240
var current = cell.qsub > 0 ? cell.qsub + 1 : cell.qans;
241241
var next = this.btn === "left" ? current + 1 : current - 1;
242-
this.inputData = (next + 4) % 4;
242+
next = (next + 4) % 4;
243+
244+
if (cell.lcnt > 0 && next === 3) {
245+
next = this.btn === "left" ? 0 : 2;
246+
}
247+
248+
this.inputData = next;
243249
},
244250
inputcell: function() {
245251
var cell = this.getcell();
@@ -835,14 +841,20 @@
835841
}
836842
},
837843
"Graphic@wittgen#2": {
838-
qsubcolor1: "rgb(224, 224, 255)",
844+
qsubcolor1: "rgb(224, 224, 255)"
845+
},
846+
"Graphic@wittgen,edamame#3": {
839847
getBGCellColor: function(cell) {
840848
if (cell.error === 1 || cell.qinfo === 1) {
841849
return this.errbcolor1;
842850
}
843-
if (cell.qsub === 1) {
851+
if (
852+
(this.pid === "wittgen" && cell.qsub === 1) ||
853+
(this.pid === "edamame" && cell.qans === 1)
854+
) {
844855
return this.qsubcolor1;
845856
}
857+
846858
if (cell.lcnt === 0) {
847859
return null;
848860
}
@@ -864,6 +876,7 @@
864876
circleratio: [0.25, 0.2],
865877
doubleLineWidth: 0.7,
866878
qanscolor: "black",
879+
qsubcolor1: "rgba(200, 255, 200, 0.68)",
867880
circlestrokecolor: "rgb(0, 160, 0)",
868881

869882
getQuesNumberColor: function(cell) {

test/script/edamame.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ ui.debug.addDebugData("edamame", {
9797
input: ["playmode,objblank", "mouse,left,3,1,3,3", "mouse,left,5,1,3,1"],
9898
result:
9999
"pzprv3/edamame/2/3/. . . /. . . /1 0 0 /1 16 4 /0 0 /0 0 /0 0 0 /"
100+
},
101+
{
102+
input: ["playmode,auto", "mouse,left,1,1,5,1", "mouse,leftx2,3,1"],
103+
result:
104+
"pzprv3/edamame/2/3/. . . /. . . /1 4 0 /1 16 4 /1 1 /0 0 /0 0 0 /"
105+
},
106+
{
107+
input: ["mouse,left,3,1"],
108+
result:
109+
"pzprv3/edamame/2/3/. . . /. . . /1 0 0 /1 16 4 /1 1 /0 0 /0 0 0 /"
110+
},
111+
{
112+
input: ["mouse,right,3,1"],
113+
result:
114+
"pzprv3/edamame/2/3/. . . /. . . /1 4 0 /1 16 4 /1 1 /0 0 /0 0 0 /"
100115
}
101116
]
102117
});

0 commit comments

Comments
 (0)