Skip to content

Commit

Permalink
Add mouse inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep committed Feb 2, 2025
1 parent c4f3d5d commit 336db69
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/variety/nagenawa.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,23 @@
} else {
this.common.mouseinput.call(this);
}
},
getNewNumber: function(cell, val) {
if (this.btn === "left" && val === -1) {
return -3;
} else if (this.btn === "left" && val === -2) {
return 0;
} else if (this.btn === "left" && val === cell.getmaxnum()) {
return -1;
} else if (this.btn === "right" && val === 0) {
return -2;
} else if (this.btn === "right" && val === -1) {
return cell.getmaxnum();
}

val += this.btn === "left" ? 1 : -1;
return val < -3 ? -1 : val;
}
// TODO cycle white and black circles
},
MouseEvent: {
mouseinput_auto: function() {
Expand Down Expand Up @@ -111,6 +126,17 @@
noLP: function(dir) {
return this.isNum();
},
getNum: function() {
return this.ice() ? -3 : this.qnum;
},
setNum: function(val) {
if (val === -3) {
this.setQues(6);
} else {
this.setQues(0);
this.setQnum(val);
}
},
posthook: {
qnum: function(val) {
if (val !== -1 && this.ques === 6) {
Expand Down

0 comments on commit 336db69

Please sign in to comment.