Skip to content

Commit

Permalink
Add Killbox mate and Vukovic mate
Browse files Browse the repository at this point in the history
Both are new themes present in the latest puzzle database,
thanks lichess user Instit for pointing this out.
  • Loading branch information
brianch committed Feb 18, 2025
1 parent d615ace commit 11dcdfa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/search_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ pub enum TacticalThemes {
Opening, Middlegame, Endgame, RookEndgame, BishopEndgame, PawnEndgame, KnightEndgame, QueenEndgame, QueenRookEndgame,
AdvancedPawn, AtackingF2F7, CapturingDefender, DiscoveredAttack, DoubleCheck, ExposedKing, Fork, HangingPiece, KingsideAttack, Pin, QueensideAttack, Sacrifice, Skewer, TrappedPiece,
Attraction, Clearance, DefensiveMove, Deflection, Interference, Intermezzo, QuietMove, XRayAttack, Zugzwang,
Mate, MateIn1, MateIn2, MateIn3, MateIn4, MateIn5, AnastasiaMate, ArabianMate, BackRankMate, BodenMate, DoubleBishopMate, DovetailMate, HookMate, SmotheredMate,
Castling, EnPassant, Promotion, UnderPromotion, Equality, Advantage, Crushing,
Mate, MateIn1, MateIn2, MateIn3, MateIn4, MateIn5, AnastasiaMate, ArabianMate, BackRankMate, BodenMate, DoubleBishopMate, DovetailMate, HookMate, KillBoxMate, VukovicMate, SmotheredMate,
Castling, EnPassant, Promotion, UnderPromotion,
Equality, Advantage, Crushing,
OneMove, Short, Long, VeryLong,
Master, MasterVsMaster, SuperGM
}

impl TacticalThemes {

const ALL: [TacticalThemes; 61] = [
const ALL: [TacticalThemes; 63] = [
TacticalThemes::All,
TacticalThemes::Opening, TacticalThemes::Middlegame, TacticalThemes::Endgame, TacticalThemes::RookEndgame,
TacticalThemes::BishopEndgame, TacticalThemes::PawnEndgame, TacticalThemes::KnightEndgame,
Expand All @@ -80,11 +81,13 @@ impl TacticalThemes {
TacticalThemes::Mate, TacticalThemes::MateIn1, TacticalThemes::MateIn2, TacticalThemes::MateIn3,
TacticalThemes::MateIn4, TacticalThemes::MateIn5, TacticalThemes::AnastasiaMate, TacticalThemes::ArabianMate,
TacticalThemes::BackRankMate, TacticalThemes::BodenMate, TacticalThemes::DoubleBishopMate,
TacticalThemes::DovetailMate, TacticalThemes::HookMate, TacticalThemes::SmotheredMate,
TacticalThemes::DovetailMate, TacticalThemes::HookMate, TacticalThemes::KillBoxMate,
TacticalThemes::VukovicMate, TacticalThemes::SmotheredMate,

TacticalThemes::Castling, TacticalThemes::EnPassant, TacticalThemes::Promotion,
TacticalThemes::UnderPromotion, TacticalThemes::Equality, TacticalThemes::Advantage,
TacticalThemes::Crushing,
TacticalThemes::UnderPromotion,

TacticalThemes::Equality, TacticalThemes::Advantage, TacticalThemes::Crushing,

TacticalThemes::OneMove, TacticalThemes::Short, TacticalThemes::Long, TacticalThemes::VeryLong,

Expand Down Expand Up @@ -149,6 +152,8 @@ impl TacticalThemes {
TacticalThemes::DoubleBishopMate => "doubleBishopMate",
TacticalThemes::DovetailMate => "dovetailMate",
TacticalThemes::HookMate => "hookMate",
TacticalThemes::KillBoxMate => "killBoxMate",
TacticalThemes::VukovicMate => "vukovicMate",
TacticalThemes::SmotheredMate => "smotheredMate",

TacticalThemes::Castling => "castling",
Expand Down Expand Up @@ -511,7 +516,7 @@ impl Tab for SearchTab {
};
row_promotion = row_promotion.push(Row::new().spacing(0).align_y(Alignment::Center)
.push(Button::new(
Text::new(text).font(config::CHESS_ALPHA).size(60).line_height(LineHeight::Absolute(60.into()))
Text::new(text).font(config::CHESS_ALPHA).size(60).align_y(Alignment::Center).line_height(LineHeight::Absolute(60.into()))
)
.padding(0)
.width(60)
Expand All @@ -528,16 +533,16 @@ impl Tab for SearchTab {
} else {
styles::btn_style_light_square
};
row_promotion = row_promotion.push(Row::new().spacing(5).align_y(Alignment::Center)
row_promotion = row_promotion.push(
Row::new().width(60).height(60).align_y(Alignment::Start)
.push(Button::new(
Svg::new(self.promotion_piece_img[piece.to_index()].clone())
)
.width(60)
.height(60)
.on_press(SearchMesssage::SelectPiecePromotion(piece))
.style(square_style)
));
}

}

search_col = search_col.push(Space::new(Length::Fill, 10));
Expand Down
2 changes: 2 additions & 0 deletions translations/en-US/ocp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ bodenMate = Boden's mate
doubleBishopMate = Double bishop mate
dovetailMate = Dovetail mate
hookMate = Hook mate
killBoxMate = Kill Box Mate
vukovicMate = Vukovic Mate
smotheredMate = Smothered mate
castling = Castling
Expand Down
2 changes: 2 additions & 0 deletions translations/es/ocp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ bodenMate = Mate de Boden
doubleBishopMate = Mate de los dos alfiles
dovetailMate = Mate de Cozio
hookMate = Mate del gancho
killBoxMate = Mate del recuadro mortal
vukovicMate = Mate de Vukovic
smotheredMate = Mate de la coz
castling = Enroque
Expand Down
3 changes: 3 additions & 0 deletions translations/fr/ocp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ black = Noirs
searching = Recherche en cours, veuillez patienter...
btn_search = Rechercher
promotion_piece = Choix de la promotion:
#Settings
#============================================================
piece_theme = Jeu de pièces:
Expand Down Expand Up @@ -152,6 +153,8 @@ bodenMate = Mat de Boden
doubleBishopMate = Mat des deux Fous
dovetailMate = Mat de Cozio
hookMate = Mat de l'hameçon
killBoxMate = Mat par mise en boîte
vukovicMate = Mat de Vuković
smotheredMate = Mat à l'étouffée
castling = Roque
Expand Down
2 changes: 2 additions & 0 deletions translations/pt-BR/ocp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ bodenMate = Mate de Boden
doubleBishopMate = Mate de dois bispos
dovetailMate = Mate da causa de andorinha
hookMate = Mate do gancho
killBoxMate = Mate do caixão
vukovicMate = Mate de Vukovic
smotheredMate = Mate sufocado
castling = Roque
Expand Down

0 comments on commit 11dcdfa

Please sign in to comment.