diff --git a/ui/analyse/src/ctrl.ts b/ui/analyse/src/ctrl.ts index 13d6bbbf663e2..74f440392bd1a 100644 --- a/ui/analyse/src/ctrl.ts +++ b/ui/analyse/src/ctrl.ts @@ -419,7 +419,7 @@ export default class AnalyseCtrl { } site.pubsub.emit('ply', this.node.ply, this.tree.lastMainlineNode(this.path).ply === this.node.ply); this.showGround(); - this.auxUpdate(this.node.fen); + this.pluginUpdate(this.node.fen); } userJump = (path: Tree.Path): void => { @@ -592,7 +592,7 @@ export default class AnalyseCtrl { this.tree.addDests(dests, path); if (path === this.path) { this.showGround(); - this.auxUpdate(this.node.fen); + this.pluginUpdate(this.node.fen); if (this.outcome()) this.ceval.stop(); } this.withCg(cg => cg.playPremove()); @@ -993,14 +993,14 @@ export default class AnalyseCtrl { else if (plyDelta < -1) control.first(this); }; - auxMove = (orig: cg.Key, dest: cg.Key, prom: cg.Role | undefined) => { + pluginMove = (orig: cg.Key, dest: cg.Key, prom: cg.Role | undefined) => { const capture = this.chessground.state.pieces.get(dest); this.sendMove(orig, dest, capture, prom); }; - auxUpdate = (fen: string) => { + pluginUpdate = (fen: string) => { // if controller and chessground board state differ, ignore this update. once the chessground - // state is updated to match, auxUpdate will be called again. + // state is updated to match, pluginUpdate will be called again. if (!fen.startsWith(this.chessground?.getFen())) return; this.keyboardMove?.update({ fen, canMove: true }); diff --git a/ui/chess/src/moveRootCtrl.ts b/ui/chess/src/moveRootCtrl.ts index 0e346801d280e..d01ef94d3084a 100644 --- a/ui/chess/src/moveRootCtrl.ts +++ b/ui/chess/src/moveRootCtrl.ts @@ -1,7 +1,7 @@ import * as cg from 'chessground/types'; export interface MoveRootCtrl { - auxMove: (orig: cg.Key, dest: cg.Key, prom: cg.Role | undefined) => void; + pluginMove: (orig: cg.Key, dest: cg.Key, prom: cg.Role | undefined) => void; redraw: () => void; flipNow: () => void; offerDraw?: (v: boolean, immediately?: boolean) => void; diff --git a/ui/keyboardMove/src/main.ts b/ui/keyboardMove/src/main.ts index dc731e412f3f6..b2f4442ee735c 100644 --- a/ui/keyboardMove/src/main.ts +++ b/ui/keyboardMove/src/main.ts @@ -100,7 +100,7 @@ export function ctrl(root: KeyboardMoveRootCtrl): KeyboardMove { if (!role || role == 'pawn' || (role == 'king' && variant !== 'antichess')) return; cg.cancelMove(); promote(cg, dest, role); - root.auxMove(orig, dest, role); + root.pluginMove(orig, dest, role); }, update(up: MoveUpdate) { if (up.cg) cg = up.cg; diff --git a/ui/puzzle/src/ctrl.ts b/ui/puzzle/src/ctrl.ts index 257df6df68a1c..5426b15f2ecfd 100644 --- a/ui/puzzle/src/ctrl.ts +++ b/ui/puzzle/src/ctrl.ts @@ -137,7 +137,7 @@ export default class PuzzleCtrl implements ParentCtrl { game: { variant: { key: 'standard' } }, player: { color: this.pov }, }, - auxMove: this.auxMove, + pluginMove: this.pluginMove, redraw: this.redraw, flipNow: this.flip, userJumpPlyDelta: this.userJumpPlyDelta, @@ -251,7 +251,7 @@ export default class PuzzleCtrl implements ParentCtrl { showGround = (g: CgApi): void => g.set(this.makeCgOpts()); - auxMove = (orig: Key, dest: Key, role?: Role) => { + pluginMove = (orig: Key, dest: Key, role?: Role) => { if (role) this.playUserMove(orig, dest, role); else this.withGround(g => { @@ -261,7 +261,7 @@ export default class PuzzleCtrl implements ParentCtrl { }); }; - auxUpdate = (fen: string): void => { + pluginUpdate = (fen: string): void => { this.voiceMove?.update({ fen, canMove: true }); this.keyboardMove?.update({ fen, canMove: true }); }; @@ -272,7 +272,7 @@ export default class PuzzleCtrl implements ParentCtrl { !this.promotion.start(orig, dest, { submit: this.playUserMove, show: this.voiceMove?.promotionHook() }) ) this.playUserMove(orig, dest); - this.auxUpdate(this.node.fen); + this.pluginUpdate(this.node.fen); }; playUci = (uci: Uci): void => this.sendMove(parseUci(uci)!); @@ -539,7 +539,7 @@ export default class PuzzleCtrl implements ParentCtrl { this.promotion.cancel(); this.justPlayed = undefined; this.autoScrollRequested = true; - this.auxUpdate(this.node.fen); + this.pluginUpdate(this.node.fen); site.pubsub.emit('ply', this.node.ply); }; diff --git a/ui/round/src/ctrl.ts b/ui/round/src/ctrl.ts index 91d470df5b1fd..cda747c1e917d 100644 --- a/ui/round/src/ctrl.ts +++ b/ui/round/src/ctrl.ts @@ -278,7 +278,7 @@ export default class RoundController implements MoveRootCtrl { this.chessground.set(config); if (s.san && isForwardStep) site.sound.move(s); this.autoScroll(); - this.auxUpdate(s.fen); + this.pluginUpdate(s.fen); site.pubsub.emit('ply', ply); return true; }; @@ -335,7 +335,7 @@ export default class RoundController implements MoveRootCtrl { this.redraw(); }; - auxMove = (orig: cg.Key, dest: cg.Key, role?: cg.Role) => { + pluginMove = (orig: cg.Key, dest: cg.Key, role?: cg.Role) => { if (!role) { this.chessground.move(orig, dest); // TODO look into possibility of making cg.Api.move function update player turn itself. @@ -347,7 +347,7 @@ export default class RoundController implements MoveRootCtrl { this.sendMove(orig, dest, role, { premove: false }); }; - auxUpdate = (fen: string) => { + pluginUpdate = (fen: string) => { this.voiceMove?.update({ fen, canMove: this.canMove() }); this.keyboardMove?.update({ fen, canMove: this.canMove() }); }; @@ -501,7 +501,7 @@ export default class RoundController implements MoveRootCtrl { } this.autoScroll(); this.onChange(); - this.auxUpdate(step.fen); + this.pluginUpdate(step.fen); site.sound.move({ ...o, filter: 'music' }); site.sound.saySan(step.san); return true; // prevents default socket pubsub @@ -539,7 +539,7 @@ export default class RoundController implements MoveRootCtrl { this.autoScroll(); this.onChange(); this.setLoading(false); - this.auxUpdate(d.steps[d.steps.length - 1].fen); + this.pluginUpdate(d.steps[d.steps.length - 1].fen); }; endWithData = (o: ApiEnd): void => { diff --git a/ui/voice/src/move/moveCtrl.ts b/ui/voice/src/move/moveCtrl.ts index 94947e9abdff3..435412df92b12 100644 --- a/ui/voice/src/move/moveCtrl.ts +++ b/ui/voice/src/move/moveCtrl.ts @@ -366,7 +366,7 @@ export function initModule(opts: { root: MoveRootCtrl; ui: VoiceCtrl; initial: M const role = cs.promo(uci) as cs.Role; cg.cancelMove(); if (role) promote(cg, dest(uci), role); - root.auxMove(src(uci), dest(uci), role); + root.pluginMove(src(uci), dest(uci), role); return true; }