From c7020252832c1008577741c9c9733884eaf3cce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Wed, 13 Apr 2022 15:47:26 +0200 Subject: [PATCH] gam: add dirty bool to TextEntryPayloads Useful to filter out unused entries. --- services/gam/src/modal.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/gam/src/modal.rs b/services/gam/src/modal.rs index 7ce8875bb..81237f493 100644 --- a/services/gam/src/modal.rs +++ b/services/gam/src/modal.rs @@ -72,7 +72,7 @@ impl ItemName { #[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone, Eq, PartialEq, Default)] pub struct TextEntryPayload { - pub id: u32, + dirty: bool, pub content: String::<256>, pub placeholder: Option>, } @@ -80,14 +80,14 @@ pub struct TextEntryPayload { impl TextEntryPayload { pub fn new() -> Self { TextEntryPayload{ - id: Default::default(), + dirty: Default::default(), content: Default::default(), placeholder: Default::default(), } } - pub fn new_with_fields(id: u32, content: String::<256>, placeholder: Option>) -> Self { - TextEntryPayload { id: id, content: content, placeholder: placeholder } + pub fn new_with_fields(content: String::<256>, placeholder: Option>) -> Self { + TextEntryPayload { dirty: false, content: content, placeholder: placeholder } } /// Ensures that 0's are written to the storage of this struct, and not optimized out; important for password fields. pub fn volatile_clear(&mut self) {