From dd069e934508d00b45c9b324999ba8bba630435b Mon Sep 17 00:00:00 2001 From: NeilClack Date: Thu, 23 Apr 2026 16:44:09 -0500 Subject: [PATCH] WIP: Stagger proclamations Proclamations are now inserted 10 times, and in between each proclamation, the Universal Wellness proclamation is inserted. Now I need to optimize the loop & remove the Universal Wellbeing option from the Proclamations menu (hide it) because it's always enabled. --- internal/page/scrollerPage.go | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/internal/page/scrollerPage.go b/internal/page/scrollerPage.go index 02c21cf..c5ab2d1 100644 --- a/internal/page/scrollerPage.go +++ b/internal/page/scrollerPage.go @@ -74,6 +74,12 @@ import ( "rhemawavetech.com/rhemawave/internal/shaderManager" ) +const ( + defaultProclamationID string = "f3d42354-3197-45e4-9b08-be447f14386d" + proclamationPlayCount int = 10 + defaultProclamationPlayCount int = 10 +) + type Line struct { words []StringItem width int32 @@ -330,13 +336,32 @@ func (p *ScrollerPage) loadProclamations() error { return err } + var defaultProclamation db.Proclamation + err = p.Context.DbPtr.Where("ID = ?", defaultProclamationID).Find(&defaultProclamation).Error + if err != nil { + return err + } + // Build word list from selected, available proclamations + // For each proclamation in proclamations + // until count reaches 10 + // add the words into the world list + // update count + // when the count reaches 10 + // insert the defaultProclamation + // reset the count to 0 + var count int = 0 for _, proclamation := range proclamations { - if proclamation.Selected { - // Split content into words and add to list + for count < 10 { + logger.Debug("Adding %s", proclamation.Name) words := strings.Fields(proclamation.Content) p.words = append(p.words, words...) + count += 1 } + logger.Debug("Adding %s", defaultProclamation.Name) + defaultWords := strings.Fields(defaultProclamation.Content) + p.words = append(p.words, defaultWords...) + count = 0 } if len(p.words) == 0 {