dst reset button functionality

This commit is contained in:
YK committed 2025-09-13 12:58:15 +03:00
1 parent e956e986fb
commit 8f1ec42e48
2 files changed
+13 -1

No files matched your search

+6 -1
View File
@@ -184,7 +184,12 @@ pub fn Sidebar () -> impl IntoView {
</For> </For>
</div> </div>
<div class="reset"> <div class="reset">
<button title="Сбросить кости">"⟳"</button> <button
title="Сбросить кости"
on:click=move |_| dt.update(|d| d.reset())
>
"⟳"
</button>
</div> </div>
<div class="succeeded dt-list"> <div class="succeeded dt-list">
<For <For
+7
View File
@@ -179,6 +179,13 @@ pub struct DeathSaveThrows {
pub succeeded: u8, pub succeeded: u8,
} }
impl DeathSaveThrows {
pub fn reset (&mut self) {
self.failed = 0;
self.succeeded = 0;
}
}
#[derive(Clone, Debug, Store)] #[derive(Clone, Debug, Store)]
pub struct ContactBook (pub HashMap<String, Contact>); pub struct ContactBook (pub HashMap<String, Contact>);