From a2cfa8759d5677d6753b9e22b3fd8b466976022f Mon Sep 17 00:00:00 2001 From: Barinade Date: Sat, 15 Jul 2023 19:46:34 -0500 Subject: [PATCH] rebirth allow specifying a list of input contexts to check --- Themes/Rebirth/Scripts/10 InputContextManager.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Themes/Rebirth/Scripts/10 InputContextManager.lua b/Themes/Rebirth/Scripts/10 InputContextManager.lua index ba64a5c7af..39510268e5 100644 --- a/Themes/Rebirth/Scripts/10 InputContextManager.lua +++ b/Themes/Rebirth/Scripts/10 InputContextManager.lua @@ -76,13 +76,16 @@ function CONTEXTMAN.RegisterToContextSet(self, screen, group, name) self.ScreenToContext[screen][group][name] = true end --- return if a group exists and is enabled -function CONTEXTMAN.CheckContextSet(self, screen, group) +-- return if a list of groups exists and is enabled +function CONTEXTMAN.CheckContextSet(self, screen, ...) if self.ContextIgnored then return false end if self.ScreenToContext[screen] ~= nil then - if self.ScreenToContext[screen][group] ~= nil then - return self.ScreenToContext[screen][group].enabled + local groups = {...} + for _, group in ipairs(groups) do + if self.ScreenToContext[screen][group] ~= nil then + return self.ScreenToContext[screen][group].enabled + end end end return false