Skip to content

Commit 3d9c31a

Browse files
committed
narrow: Add symbol copying display
1 parent e35c8d6 commit 3d9c31a

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

src-ui/p.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ <h2 id="title2">読み込み中です...</h2>
264264
<input type="checkbox">
265265
<span data-disp-pid="hitori">__autoerr.tool.hitori__</span>
266266
<span data-disp-pid="gokigen">__autoerr.tool.gokigen__</span>
267-
<span data-disp-pid="ubahn">__autoerr.tool.ubahn__</span>
267+
<span data-disp-pid="ubahn,narrow">__autoerr.tool.ubahn__</span>
268268
<span data-disp-pid="wagiri">__autoerr.tool.wagiri__</span>
269269
</label>
270270
</div>

src/puzzle/Config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@
442442
pid === "hitori" ||
443443
pid === "gokigen" ||
444444
pid === "wagiri" ||
445+
pid === "narrow" ||
445446
pid === "ubahn";
446447
break;
447448
case "singlenum":

src/variety/nawabari.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@
9292
},
9393
"Cell@narrow": {
9494
maxnum: 4,
95-
disInputHatena: true
95+
disInputHatena: true,
96+
displayNum: function() {
97+
if (this.puzzle.execConfig("autoerr") && this.qnum === -1 && this.qcmp) {
98+
return this.qcmp;
99+
}
100+
return this.qnum;
101+
}
96102
},
97103
"Cell@subomino": {
98104
maxnum: function() {
@@ -199,7 +205,14 @@
199205
var numlist = clist.filter(function(cell) {
200206
return cell.isNum();
201207
});
202-
component.num = numlist.length === 1 ? numlist[0].getNum() : -1;
208+
component.num = numlist.length === 1 ? numlist[0].getNum() : 0;
209+
210+
clist.each(function(cell) {
211+
if (cell.qcmp !== component.num) {
212+
cell.qcmp = component.num;
213+
cell.draw();
214+
}
215+
});
203216
}
204217
},
205218

@@ -281,6 +294,16 @@
281294
},
282295

283296
"Graphic@narrow": {
297+
getQuesNumberColor: function(cell) {
298+
if (cell.qnum === -1) {
299+
return cell.qcmp ? this.qcmpcolor : null;
300+
}
301+
if ((cell.error || cell.qinfo) === 1) {
302+
return this.errcolor1;
303+
}
304+
return this.quescolor;
305+
},
306+
284307
drawQuesNumbers: function() {
285308
var g = this.vinc("cell_mark", "auto");
286309

@@ -294,7 +317,7 @@
294317
g.strokeStyle = this.getQuesNumberColor(cell);
295318
var px = cell.bx * this.bw,
296319
py = cell.by * this.bh;
297-
switch (cell.getNum()) {
320+
switch (cell.displayNum()) {
298321
case 1:
299322
g.strokeCircle(px, py, rsize);
300323
break;

0 commit comments

Comments
 (0)