projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fa8803
)
A bit more flexibility in boards drawing
author
Benjamin Auder
<benjamin.auder@somewhere>
Sun, 27 Dec 2020 09:45:58 +0000
(10:45 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Sun, 27 Dec 2020 09:45:58 +0000
(10:45 +0100)
TODO
patch
|
blob
|
blame
|
history
client/src/base_rules.js
patch
|
blob
|
blame
|
history
client/src/components/Board.vue
patch
|
blob
|
blame
|
history
client/src/utils/printDiagram.js
patch
|
blob
|
blame
|
history
client/src/variants/Omega.js
patch
|
blob
|
blame
|
history
diff --git
a/TODO
b/TODO
index
cd1d66c
..
bb5989e
100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-1,7
+1,5
@@
Implement Wildebeest castle rules
=> (1, 2, 3 or 4 squares slide; randomized: may be impossible >1, but possible >4...)
Implement Wildebeest castle rules
=> (1, 2, 3 or 4 squares slide; randomized: may be impossible >1, but possible >4...)
-Fix Omega squares' color (queen on its color: need new static customization "getSquareColor()")
-Finish writing Synochess rules.
Embedded rules language not updated when language is set (in Analyse, Game and Problems)
If new live game starts in background, "new game" notify OK but not first move (not too serious however)
Embedded rules language not updated when language is set (in Analyse, Game and Problems)
If new live game starts in background, "new game" notify OK but not first move (not too serious however)
diff --git
a/client/src/base_rules.js
b/client/src/base_rules.js
index
2c2b705
..
aa49f91
100644
(file)
--- a/
client/src/base_rules.js
+++ b/
client/src/base_rules.js
@@
-112,6
+112,11
@@
export const ChessRules = class ChessRules {
return false;
}
return false;
}
+ // Some games are drawn unusually (bottomr right corner is black)
+ static get DarkBottomRight() {
+ return false;
+ }
+
// Some variants require lines drawing
static get Lines() {
if (V.Monochrome) {
// Some variants require lines drawing
static get Lines() {
if (V.Monochrome) {
diff --git
a/client/src/components/Board.vue
b/client/src/components/Board.vue
index
0430c68
..
313564d
100644
(file)
--- a/
client/src/components/Board.vue
+++ b/
client/src/components/Board.vue
@@
-171,7
+171,11
@@
export default {
})
);
}
})
);
}
- const lightSquare = (ci + cj) % 2 == lightSquareMod;
+ const oddity = (ci + cj) % 2;
+ const lightSquare = (
+ (!V.DarkBottomRight && oddity == lightSquareMod) ||
+ (V.DarkBottomRight && oddity != lightSquareMod)
+ );
return h(
"div",
{
return h(
"div",
{
diff --git
a/client/src/utils/printDiagram.js
b/client/src/utils/printDiagram.js
index
524e12b
..
ebc4d11
100644
(file)
--- a/
client/src/utils/printDiagram.js
+++ b/
client/src/utils/printDiagram.js
@@
-90,8
+90,16
@@
export function getDiagram(args) {
(V.Notoodark ? "middle-square" : "dark-square");
if (j == startY) boardDiv += " border-left";
}
(V.Notoodark ? "middle-square" : "dark-square");
if (j == startY) boardDiv += " border-left";
}
- else if ((i + j) % 2 == 0) boardDiv += "light-square";
- else boardDiv += "dark-square";
+ else {
+ const oddity = (i + j) % 2;
+ if (
+ (oddity == 0 && !V.DarkBottomRight) ||
+ (oddity == 1 && V.DarkBottomRight)
+ ) {
+ boardDiv += "light-square";
+ }
+ else boardDiv += "dark-square";
+ }
boardDiv += " " + store.state.settings.bcolor;
if (shadowArray.length > 0 && shadowArray[i][j])
boardDiv += " in-shadow";
boardDiv += " " + store.state.settings.bcolor;
if (shadowArray.length > 0 && shadowArray[i][j])
boardDiv += " in-shadow";
diff --git
a/client/src/variants/Omega.js
b/client/src/variants/Omega.js
index
289c05b
..
bac8d50
100644
(file)
--- a/
client/src/variants/Omega.js
+++ b/
client/src/variants/Omega.js
@@
-17,6
+17,10
@@
export class OmegaRules extends ChessRules {
);
}
);
}
+ static get DarkBottomRight() {
+ return true;
+ }
+
// For space between corners:
static get NOTHING() {
return "xx";
// For space between corners:
static get NOTHING() {
return "xx";