configurable storm/racer animation speed

pull/9436/head
Thibault Duplessis 2021-07-18 16:32:26 +02:00
parent 2baeeac5d2
commit acb50ecffd
16 changed files with 28 additions and 18 deletions

View File

@ -99,6 +99,15 @@ case class Pref(
case _ => 250 case _ => 250
} }
def animationMillisForSpeedPuzzles: Int =
animation match {
case Animation.NONE => 0
case Animation.FAST => 70
case Animation.NORMAL => 100
case Animation.SLOW => 160
case _ => 100
}
def isBlindfold = blindfold == Pref.Blindfold.YES def isBlindfold = blindfold == Pref.Blindfold.YES
def bgImgOrDefault = bgImg | Pref.defaultBgImg def bgImgOrDefault = bgImg | Pref.defaultBgImg

View File

@ -23,7 +23,8 @@ final class StormJson(sign: StormSign) {
"destination" -> p.destination, "destination" -> p.destination,
"moveEvent" -> p.moveEvent, "moveEvent" -> p.moveEvent,
"highlight" -> p.highlight, "highlight" -> p.highlight,
"is3d" -> p.is3d "is3d" -> p.is3d,
"animation" -> p.animationMillisForSpeedPuzzles
) )
def newHigh(n: Option[StormHigh.NewHigh]) = def newHigh(n: Option[StormHigh.NewHigh]) =

View File

@ -25,7 +25,7 @@
"ceval": "2.0.0", "ceval": "2.0.0",
"chat": "2.0.0", "chat": "2.0.0",
"chess": "2.0.0", "chess": "2.0.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"chessops": "^0.9.0", "chessops": "^0.9.0",
"common": "2.0.0", "common": "2.0.0",
"game": "2.0.0", "game": "2.0.0",

View File

@ -18,7 +18,7 @@
"prod": "yarn run compile" "prod": "yarn run compile"
}, },
"dependencies": { "dependencies": {
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0", "common": "2.0.0",
"snabbdom": "^3.0.1" "snabbdom": "^3.0.1"
}, },

View File

@ -15,7 +15,7 @@
"@build/rollupProject": "2.0.0" "@build/rollupProject": "2.0.0"
}, },
"dependencies": { "dependencies": {
"chessground": "^8.1.2", "chessground": "^8.1.3",
"chessops": "^0.9.0", "chessops": "^0.9.0",
"snabbdom": "^3.0.1", "snabbdom": "^3.0.1",
"common": "2.0.0" "common": "2.0.0"

View File

@ -18,7 +18,7 @@
"@types/lichess": "2.0.0" "@types/lichess": "2.0.0"
}, },
"dependencies": { "dependencies": {
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0", "common": "2.0.0",
"snabbdom": "^3.0.1" "snabbdom": "^3.0.1"
}, },

View File

@ -16,7 +16,7 @@
"dependencies": { "dependencies": {
"chessops": "^0.9.0", "chessops": "^0.9.0",
"snabbdom": "^3.0.1", "snabbdom": "^3.0.1",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0" "common": "2.0.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -9,6 +9,7 @@ export interface PuzPrefs {
rookCastle: boolean; rookCastle: boolean;
moveEvent: number; moveEvent: number;
highlight: boolean; highlight: boolean;
animation: number;
} }
export type UserMove = (orig: Key, dest: Key) => void; export type UserMove = (orig: Key, dest: Key) => void;

View File

@ -46,8 +46,7 @@ export function makeConfig(opts: CgConfig, pref: PuzPrefs, userMove: UserMove):
check: pref.highlight, check: pref.highlight,
}, },
animation: { animation: {
enabled: true, duration: pref.animation,
duration: 100,
}, },
disableContextMenu: true, disableContextMenu: true,
}; };

View File

@ -20,7 +20,7 @@
"ceval": "2.0.0", "ceval": "2.0.0",
"chart.js": "^2.9", "chart.js": "^2.9",
"chess": "2.0.0", "chess": "2.0.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"chessops": "^0.9.0", "chessops": "^0.9.0",
"common": "2.0.0", "common": "2.0.0",
"nvui": "2.0.0", "nvui": "2.0.0",

View File

@ -18,7 +18,7 @@
"dependencies": { "dependencies": {
"chess": "2.0.0", "chess": "2.0.0",
"chessops": "^0.9.0", "chessops": "^0.9.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"snabbdom": "^3.0.1", "snabbdom": "^3.0.1",
"common": "2.0.0", "common": "2.0.0",
"puz": "2.0.0" "puz": "2.0.0"

View File

@ -19,7 +19,7 @@
"ab": "https://github.com/lichess-org/ab-stub", "ab": "https://github.com/lichess-org/ab-stub",
"chat": "2.0.0", "chat": "2.0.0",
"chess": "2.0.0", "chess": "2.0.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0", "common": "2.0.0",
"game": "2.0.0", "game": "2.0.0",
"nvui": "2.0.0", "nvui": "2.0.0",

View File

@ -18,7 +18,7 @@
"dependencies": { "dependencies": {
"chess": "2.0.0", "chess": "2.0.0",
"chessops": "^0.9.0", "chessops": "^0.9.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"snabbdom": "^3.0.1", "snabbdom": "^3.0.1",
"common": "2.0.0", "common": "2.0.0",
"puz": "2.0.0" "puz": "2.0.0"

View File

@ -17,7 +17,7 @@
}, },
"dependencies": { "dependencies": {
"chat": "2.0.0", "chat": "2.0.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0", "common": "2.0.0",
"game": "2.0.0", "game": "2.0.0",
"snabbdom": "^3.0.1" "snabbdom": "^3.0.1"

View File

@ -17,7 +17,7 @@
}, },
"dependencies": { "dependencies": {
"chat": "2.0.0", "chat": "2.0.0",
"chessground": "^8.1.2", "chessground": "^8.1.3",
"common": "2.0.0", "common": "2.0.0",
"game": "2.0.0", "game": "2.0.0",
"snabbdom": "^3.0.1" "snabbdom": "^3.0.1"

View File

@ -967,10 +967,10 @@ chessground@^4.4:
merge "1.2.0" merge "1.2.0"
mithril "github:ornicar/mithril.js#v1.0.1" mithril "github:ornicar/mithril.js#v1.0.1"
chessground@^8.1.2: chessground@^8.1.3:
version "8.1.2" version "8.1.3"
resolved "https://registry.yarnpkg.com/chessground/-/chessground-8.1.2.tgz#08be47dc838316054a03b441c370c09613bf487a" resolved "https://registry.yarnpkg.com/chessground/-/chessground-8.1.3.tgz#8c573e86c6b37cdd154870ade24f7f874959d1e8"
integrity sha512-DRRBUbagjfKGnWAU9heiIfM1mowYxcV2Q/gukdR+TxjJwW9s0QjgTqipBqt0xki+SanQRuqhi37t2gLMd09RuQ== integrity sha512-ca6NJKA0AUsDD0Z6Niuj4MubMlv37yVguB43mn3I2G05uT9x/z0yWmpDCsjci75xrDgX7yKFchgDpZ08YT1nrA==
chessops@^0.9.0: chessops@^0.9.0:
version "0.9.0" version "0.9.0"