From d7a38b79e1fbcd3b64490ae1b04692d0a2bcdd7d Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 25 Dec 2022 13:01:23 -0800 Subject: Bugfix: don't use last region if it's partial Because we allow users to customize the # of sync params, the board is no longer divided into regions of uniform size. When the last region is a different size than the rest, we simply omit it from paging. This is a hack but it's easy to reason about. Of course the entire paging stack should be rewritten, but not today. --- Scripts/osc_ctrl.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Scripts/osc_ctrl.py b/Scripts/osc_ctrl.py index 21c6348..d4c8bf3 100644 --- a/Scripts/osc_ctrl.py +++ b/Scripts/osc_ctrl.py @@ -12,10 +12,8 @@ from pythonosc import udp_client from math import ceil from math import floor -from generate_utils import getLayerParam from generate_utils import getSelectParam from generate_utils import getEnableParam -from generate_utils import getBoardIndex from generate_utils import config import emotes @@ -107,7 +105,7 @@ def sendMessageCellDiscrete(client, msg_cell, which_cell): client.send_message(addr, True) # Really long messages just wrap back around. - which_cell = (which_cell % generate_utils.config.numRegions(0)) + which_cell = (which_cell % generate_utils.config.numRegions(config.CHARS_PER_SYNC - 1)) enable(client) -- cgit v1.2.3