From 91836e5574744f367ed6515cdbb2a3c37740c512 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 16 Dec 2021 23:21:54 +0800 Subject: [PATCH] add a warning about the fixed size of the IPC payload for selected checkbox items --- services/gam/src/modal/checkboxes.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/gam/src/modal/checkboxes.rs b/services/gam/src/modal/checkboxes.rs index 9cc0fcb38..52ddbb362 100644 --- a/services/gam/src/modal/checkboxes.rs +++ b/services/gam/src/modal/checkboxes.rs @@ -144,7 +144,10 @@ impl ActionApi for CheckBoxes { if self.action_payload.contains(item_name) { self.action_payload.remove(item_name); } else { - self.action_payload.add(item_name); + if !self.action_payload.add(item_name) { + log::warn!("Limit of {} items that can be checked hit, consider increasing MAX_ITEMS in gam/src/modal.rs", MAX_ITEMS); + log::warn!("The attempted item '{}' was not selected.", item_name); + } } } else { // the OK button select let buf = Buffer::into_buf(self.action_payload).expect("couldn't convert message to payload");