|
92 | 92 | }, |
93 | 93 | "Cell@narrow": { |
94 | 94 | maxnum: 4, |
95 | | - disInputHatena: true |
| 95 | + qcmp1: 0, |
| 96 | + qcmp2: 0, |
| 97 | + |
| 98 | + disInputHatena: true, |
| 99 | + displayNum: function() { |
| 100 | + var qcmp = this.qcmp1 || this.qcmp2; |
| 101 | + if (this.puzzle.execConfig("autoerr") && this.qnum === -1 && qcmp) { |
| 102 | + return qcmp; |
| 103 | + } |
| 104 | + return this.qnum; |
| 105 | + } |
96 | 106 | }, |
97 | 107 | "Cell@subomino": { |
98 | 108 | maxnum: function() { |
|
180 | 190 | } |
181 | 191 | }, |
182 | 192 |
|
| 193 | + "Board@narrow": { |
| 194 | + addExtraInfo: function() { |
| 195 | + this.eqblkgraph = this.addInfoList(this.klass.AreaEqualNumberGraph); |
| 196 | + } |
| 197 | + }, |
| 198 | + |
183 | 199 | AreaRoomGraph: { |
184 | 200 | enabled: true |
185 | 201 | }, |
|
192 | 208 | } |
193 | 209 | }, |
194 | 210 | "AreaRoomGraph@narrow": { |
| 211 | + numprop: "qcmp1", |
195 | 212 | setExtraData: function(component) { |
| 213 | + var prop = this.numprop; |
196 | 214 | var clist = (component.clist = new this.klass.CellList( |
197 | 215 | component.getnodeobjs() |
198 | 216 | )); |
199 | 217 | var numlist = clist.filter(function(cell) { |
200 | 218 | return cell.isNum(); |
201 | 219 | }); |
202 | | - component.num = numlist.length === 1 ? numlist[0].getNum() : -1; |
| 220 | + component.num = numlist.length === 1 ? numlist[0].getNum() : 0; |
| 221 | + |
| 222 | + clist.each(function(cell) { |
| 223 | + if (cell[prop] !== component.num) { |
| 224 | + cell[prop] = component.num; |
| 225 | + cell.draw(); |
| 226 | + } |
| 227 | + }); |
| 228 | + } |
| 229 | + }, |
| 230 | + "AreaEqualNumberGraph:AreaRoomGraph@narrow": { |
| 231 | + numprop: "qcmp2", |
| 232 | + enabled: true, |
| 233 | + relation: { |
| 234 | + "cell.ques": "node", |
| 235 | + "border.qsub": "separator", |
| 236 | + "border.qnum": "separator", |
| 237 | + "border.qans": "separator" |
| 238 | + }, |
| 239 | + |
| 240 | + setComponentRefs: function(obj, component) { |
| 241 | + obj.eqblk = component; |
| 242 | + }, |
| 243 | + getObjNodeList: function(nodeobj) { |
| 244 | + return nodeobj.eqblknodes; |
| 245 | + }, |
| 246 | + resetObjNodeList: function(nodeobj) { |
| 247 | + nodeobj.eqblknodes = []; |
| 248 | + }, |
| 249 | + isedgevalidbylinkobj: function(border) { |
| 250 | + return !border.isBorder() && border.qsub; |
203 | 251 | } |
204 | 252 | }, |
205 | 253 |
|
|
281 | 329 | }, |
282 | 330 |
|
283 | 331 | "Graphic@narrow": { |
| 332 | + getQuesNumberColor: function(cell) { |
| 333 | + if (cell.qnum === -1) { |
| 334 | + return this.qcmpcolor; |
| 335 | + } |
| 336 | + if ((cell.error || cell.qinfo) === 1) { |
| 337 | + return this.errcolor1; |
| 338 | + } |
| 339 | + return this.quescolor; |
| 340 | + }, |
| 341 | + |
284 | 342 | drawQuesNumbers: function() { |
285 | 343 | var g = this.vinc("cell_mark", "auto"); |
286 | 344 |
|
|
294 | 352 | g.strokeStyle = this.getQuesNumberColor(cell); |
295 | 353 | var px = cell.bx * this.bw, |
296 | 354 | py = cell.by * this.bh; |
297 | | - switch (cell.getNum()) { |
| 355 | + switch (cell.displayNum()) { |
298 | 356 | case 1: |
299 | 357 | g.strokeCircle(px, py, rsize); |
300 | 358 | break; |
|
0 commit comments