force ready all only in debug builds

changed "ready" to less ambiguous "force ready" for the
force ready button during role reveal
This commit is contained in:
emilis 2025-12-09 21:35:06 +00:00
parent 390a757928
commit 160675435c
No known key found for this signature in database
2 changed files with 13 additions and 5 deletions

View File

@ -445,7 +445,12 @@ impl Component for Host {
}) })
}); });
html! { html! {
<RoleReveal ackd={ackd} waiting={waiting} on_force_ready={on_force_ready}/> <RoleReveal
ackd={ackd}
waiting={waiting}
on_force_ready={on_force_ready}
allow_ready_all={self.debug}
/>
} }
} }
HostState::Prompt(prompt, page) => { HostState::Prompt(prompt, page) => {

View File

@ -24,6 +24,8 @@ pub struct RoleRevealProps {
pub ackd: Box<[CharacterIdentity]>, pub ackd: Box<[CharacterIdentity]>,
pub waiting: Box<[CharacterIdentity]>, pub waiting: Box<[CharacterIdentity]>,
pub on_force_ready: Option<Callback<CharacterIdentity>>, pub on_force_ready: Option<Callback<CharacterIdentity>>,
#[prop_or_default]
pub allow_ready_all: bool,
} }
pub struct RoleReveal {} pub struct RoleReveal {}
@ -42,6 +44,7 @@ impl Component for RoleReveal {
ackd, ackd,
waiting, waiting,
on_force_ready, on_force_ready,
allow_ready_all,
} = ctx.props(); } = ctx.props();
let mut chars = ackd let mut chars = ackd
.iter() .iter()
@ -73,10 +76,10 @@ impl Component for RoleReveal {
} }
}) })
}) })
.map(|on_force_all| { .and_then(|on_force_all| {
html! { allow_ready_all.then_some(html! {
<Button on_click={on_force_all}>{"force ready all"}</Button> <Button on_click={on_force_all}>{"force ready all"}</Button>
} })
}); });
html! { html! {
<div class="role-reveal-cards"> <div class="role-reveal-cards">
@ -104,7 +107,7 @@ pub fn RoleRevealCard(props: &RoleRevealCardProps) -> Html {
let on_click = Callback::from(move |_| { let on_click = Callback::from(move |_| {
on_force_ready.emit(target.clone()); on_force_ready.emit(target.clone());
}); });
html! {<Button on_click={on_click}>{"ready"}</Button>} html! {<Button on_click={on_click}>{"force ready"}</Button>}
}) })
}); });