Use player names in two-player briscola
Classic briscola has no partnerships: its "teams" are just the two players, but the UI labelled them Team A/Team B. - add is_individual_game() and GameView::player_name_for_team() to the model; - the briscola table HUD reads "Alice 0 — 0 Bob (target 61)" and the seat panels drop the Team badge for two-player games; - the deal summary and game-over screen name the sides and the winner; - the waiting room and join preview hide the Team badge. briscola a quattro and scopone keep their team labels, and the match history table is unchanged.
This commit is contained in:
5 files changed
+121
-27
No files matched your search
+11
-6
@@ -15,8 +15,8 @@ use crate::api;
|
||||
use crate::components::card::card_back;
|
||||
use crate::components::toast::toast;
|
||||
use crate::model::{
|
||||
fallback_game_types, AuthProvider, GameTypeInfo, JoinPreview, OptionField, OptionKind,
|
||||
PlayerRating, User,
|
||||
fallback_game_types, is_individual_game, AuthProvider, GameTypeInfo, JoinPreview,
|
||||
OptionField, OptionKind, PlayerRating, User,
|
||||
};
|
||||
|
||||
/// Human-readable label for a provider name ("google" -> "Google").
|
||||
@@ -237,15 +237,20 @@ fn join_preview_panel(
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let seated = p.players.len();
|
||||
let show_teams = !is_individual_game(&p.game_type);
|
||||
let players = p
|
||||
.players
|
||||
.iter()
|
||||
.map(|player| {
|
||||
let name = player.name.clone();
|
||||
let team = player.team.as_ref().map(|t| {
|
||||
let label = t.clone();
|
||||
view! { span(class="badge text-bg-info ms-2") { "Team " (label) } }
|
||||
});
|
||||
let team = if show_teams {
|
||||
player.team.as_ref().map(|t| {
|
||||
let label = t.clone();
|
||||
view! { span(class="badge text-bg-info ms-2") { "Team " (label) } }
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
view! {
|
||||
li(
|
||||
class="list-group-item d-flex justify-content-between \
|
||||
|
||||
Reference in new issue
Block a user