Skip to content

Commit c11a6f3

Browse files
committed
Rename pin to diamond
1 parent 29c77ce commit c11a6f3

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

src-ui/p.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ <h2 id="title2">読み込み中です...</h2>
163163
<div class="child" data-value="nabe">__inputmode.nabe__</div>
164164
<div class="child" data-value="box">__inputmode.box__</div>
165165
<div class="child" data-value="pin">__inputmode.pin__</div>
166+
<div class="child" data-value="diamond">__inputmode.diamond__</div>
166167
<div class="child" data-value="crossdot">__inputmode.crossdot__</div>
167168
<div class="child" data-value="ineq">__inputmode.ineq__</div>
168169
<div class="child" data-value="move-clue">__inputmode.move-clue__</div>

src-ui/res/p.en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"inputmode.nabe": "Crocks",
114114
"inputmode.box": "Boxes",
115115
"inputmode.pin": "Pins",
116+
"inputmode.diamond": "Diamonds",
116117
"inputmode.crossdot": "Shaded dots",
117118
"inputmode.ineq": "Inequality marks",
118119
"inputmode.move-clue": "Move clue",

src/variety/diamond.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use: true,
1010
inputModes: {
1111
edit: ["number", "clear", "info-blk"],
12-
play: ["pin", "peke", "clear", "info-blk"]
12+
play: ["diamond", "peke", "clear", "info-blk"]
1313
},
1414

1515
mouseinput_auto: function() {
@@ -43,7 +43,7 @@
4343
},
4444

4545
mouseinput_other: function() {
46-
if (this.inputMode === "pin") {
46+
if (this.inputMode === "diamond") {
4747
this.inputdot(1);
4848
}
4949
},
@@ -67,14 +67,14 @@
6767

6868
if (this.inputData === null) {
6969
if (fixed !== undefined) {
70-
this.inputData = cross.getPin() === fixed ? 0 : fixed;
70+
this.inputData = cross.getDiamond() === fixed ? 0 : fixed;
7171
} else if (this.btn === "left") {
72-
this.inputData = { 0: 1, 1: 2, 2: 0 }[cross.getPin()];
72+
this.inputData = { 0: 1, 1: 2, 2: 0 }[cross.getDiamond()];
7373
} else if (this.btn === "right") {
74-
this.inputData = { 0: 2, 1: 0, 2: 1 }[cross.getPin()];
74+
this.inputData = { 0: 2, 1: 0, 2: 1 }[cross.getDiamond()];
7575
}
7676
}
77-
cross.setPin(this.inputData);
77+
cross.setDiamond(this.inputData);
7878
cross.draw();
7979
}
8080
},
@@ -84,7 +84,7 @@
8484
},
8585

8686
Cross: {
87-
getPin: function() {
87+
getDiamond: function() {
8888
return this.qans ? 1 : this.qsub ? 2 : 0;
8989
},
9090
overlapsDiamond: function() {
@@ -107,7 +107,7 @@
107107
return cell.isNum();
108108
});
109109
},
110-
setPin: function(val) {
110+
setDiamond: function(val) {
111111
if (val === 1 && this.overlapsDiamond()) {
112112
return;
113113
}
@@ -301,7 +301,7 @@
301301
py = by * this.bh;
302302

303303
g.vid = "s_dot_" + dot.id;
304-
var outline = this.getPinOutlineColor(dot);
304+
var outline = this.getDiamondColor(dot);
305305
if (dot.qans === 1) {
306306
g.lineWidth = (1 + this.cw / 20) | 0;
307307
g.fillStyle = outline;
@@ -323,7 +323,7 @@
323323
}
324324
},
325325

326-
getPinOutlineColor: function(dot) {
326+
getDiamondColor: function(dot) {
327327
if (dot.trial) {
328328
return this.trialcolor;
329329
}
@@ -335,7 +335,7 @@
335335
? this.errcolor1
336336
: err === -1
337337
? this.noerrcolor
338-
: this.qanscolor;
338+
: this.quescolor;
339339
}
340340
},
341341

@@ -351,14 +351,14 @@
351351
decodeData: function() {
352352
this.decodeCellQnumAns();
353353
this.decodeCross(function(cross, ca) {
354-
cross.setPin(+ca);
354+
cross.setDiamond(+ca);
355355
});
356356
},
357357
encodeData: function() {
358358
this.encodeCellQnumAns();
359359
// TODO remove crosses along edge
360360
this.encodeCross(function(cross) {
361-
return cross.getPin() + " ";
361+
return cross.getDiamond() + " ";
362362
});
363363
}
364364
},

0 commit comments

Comments
 (0)