Compare commits
1 commit
fa8b87d213
...
8010174b3f
| Author | SHA1 | Date | |
|---|---|---|---|
| 8010174b3f |
3 changed files with 7 additions and 23 deletions
|
|
@ -2412,7 +2412,7 @@ a:hover { text-decoration: underline; }
|
||||||
}
|
}
|
||||||
@media (min-width: 920px) {
|
@media (min-width: 920px) {
|
||||||
.controls {
|
.controls {
|
||||||
width: 200px;
|
max-width: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -327,17 +327,8 @@ fn free_mode_dests_for(
|
||||||
if dest >= 1 && dest <= 24 {
|
if dest >= 1 && dest <= 24 {
|
||||||
let d = dest as u8;
|
let d = dest as u8;
|
||||||
if !opp_present(d) {
|
if !opp_present(d) {
|
||||||
if d == 13 && is_white && displayed_value(board, staged, is_white, 12) < 2 {
|
|
||||||
// prise de coin par puissance for white
|
|
||||||
dests.push(12)
|
|
||||||
} else if d == 12 && !is_white && displayed_value(board, staged, is_white, 13) > -2
|
|
||||||
{
|
|
||||||
// prise de coin par puissance for black
|
|
||||||
dests.push(13)
|
|
||||||
} else {
|
|
||||||
dests.push(d);
|
dests.push(d);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if all_in_exit {
|
} else if all_in_exit {
|
||||||
dests.push(0); // exit
|
dests.push(0); // exit
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,23 +94,20 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
cmd_tx_effect
|
cmd_tx_effect
|
||||||
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
|
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
|
||||||
.ok();
|
.ok();
|
||||||
staged_moves.set(vec![]);
|
|
||||||
selected_origin.set(None);
|
|
||||||
prev_staged_len.set(0);
|
|
||||||
} else {
|
} else {
|
||||||
let specific_err = rules.moves_allowed(&(vm1, vm2)).err();
|
let specific_err = rules.moves_allowed(&(vm1, vm2)).err();
|
||||||
move_error.set(Some(specific_err));
|
move_error.set(Some(specific_err));
|
||||||
// Keep staged_moves intact so pieces stay in place until Retry is clicked.
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd_tx_effect
|
cmd_tx_effect
|
||||||
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
|
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
|
||||||
.ok();
|
.ok();
|
||||||
|
}
|
||||||
|
|
||||||
staged_moves.set(vec![]);
|
staged_moves.set(vec![]);
|
||||||
selected_origin.set(None);
|
selected_origin.set(None);
|
||||||
prev_staged_len.set(0);
|
prev_staged_len.set(0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// ── Auto-roll effect ─────────────────────────────────────────────────────
|
// ── Auto-roll effect ─────────────────────────────────────────────────────
|
||||||
|
|
@ -460,11 +457,7 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
<span class="free-mode-error-msg">{msg}</span>
|
<span class="free-mode-error-msg">{msg}</span>
|
||||||
<button
|
<button
|
||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
on:click=move |_| {
|
on:click=move |_| { move_error.set(None); }
|
||||||
staged_moves.set(vec![]);
|
|
||||||
selected_origin.set(None);
|
|
||||||
move_error.set(None);
|
|
||||||
}
|
|
||||||
>{t!(i18n, reset_move)}</button>
|
>{t!(i18n, reset_move)}</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue