From 74b0b21fbe3609e8ac203118a5f3e1cb841bf997 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Sun, 26 Feb 2023 17:49:58 -0500 Subject: [PATCH 1/4] Initial Commit Adjust script to actually use cover image defined in xLinkingBookDefs.py --- Scripts/Python/xLinkingBookGUIPopup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scripts/Python/xLinkingBookGUIPopup.py b/Scripts/Python/xLinkingBookGUIPopup.py index 4aa864007b..9ce7125e73 100644 --- a/Scripts/Python/xLinkingBookGUIPopup.py +++ b/Scripts/Python/xLinkingBookGUIPopup.py @@ -527,9 +527,10 @@ def IShowBookNoTreasure(self): gLinkingBook = ptBook(bookdef,self.key) gLinkingBook.setSize( width, height ) # make sure there is a cover to show - if not showOpen: - if not self.IsThereACover(bookdef): - showOpen = 1 + if not showOpen and not self.IsThereACover(bookdef): + showOpen = 1 + else: + showOpen = 0 gLinkingBook.setGUI(gui) gLinkingBook.show(showOpen) except LookupError: From 4dde718387342ee34aadccfbb0b24e2139ceae52 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Fri, 3 Mar 2023 07:28:55 -0500 Subject: [PATCH 2/4] Add another check for cover * New elif line to weed out opened pedestal Books without covers defined. Should fix Books getting default cover for no reason. --- Scripts/Python/xLinkingBookGUIPopup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Python/xLinkingBookGUIPopup.py b/Scripts/Python/xLinkingBookGUIPopup.py index 9ce7125e73..ba79b2d4c1 100644 --- a/Scripts/Python/xLinkingBookGUIPopup.py +++ b/Scripts/Python/xLinkingBookGUIPopup.py @@ -529,6 +529,8 @@ def IShowBookNoTreasure(self): # make sure there is a cover to show if not showOpen and not self.IsThereACover(bookdef): showOpen = 1 + elif showOpen and not self.IsThereACover(bookdef): + showOpen = 1 else: showOpen = 0 gLinkingBook.setGUI(gui) From 864d9e9ab10e527963cbb8cfbe4595dc925dc67b Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Thu, 21 Dec 2023 15:54:37 -0500 Subject: [PATCH 3/4] Add Hazado's suggestions that actually work --- Scripts/Python/xLinkingBookGUIPopup.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Scripts/Python/xLinkingBookGUIPopup.py b/Scripts/Python/xLinkingBookGUIPopup.py index ba79b2d4c1..7d7dcf4018 100644 --- a/Scripts/Python/xLinkingBookGUIPopup.py +++ b/Scripts/Python/xLinkingBookGUIPopup.py @@ -527,11 +527,7 @@ def IShowBookNoTreasure(self): gLinkingBook = ptBook(bookdef,self.key) gLinkingBook.setSize( width, height ) # make sure there is a cover to show - if not showOpen and not self.IsThereACover(bookdef): - showOpen = 1 - elif showOpen and not self.IsThereACover(bookdef): - showOpen = 1 - else: + if showOpen and self.IsThereACover(bookdef): showOpen = 0 gLinkingBook.setGUI(gui) gLinkingBook.show(showOpen) @@ -867,7 +863,7 @@ def IAddShare(self): def IsThereACover(self,bookHtml): # search the bookhtml string looking for a cover idx = bookHtml.find(' 0: + if idx >= 0: return 1 return 0 From a717fd081079470277e541f4ac80100bc7d11a49 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 14 Nov 2024 18:11:56 -0500 Subject: [PATCH 4/4] Fix safety valve. --- Scripts/Python/xLinkingBookGUIPopup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Python/xLinkingBookGUIPopup.py b/Scripts/Python/xLinkingBookGUIPopup.py index 7d7dcf4018..ee519bda0f 100644 --- a/Scripts/Python/xLinkingBookGUIPopup.py +++ b/Scripts/Python/xLinkingBookGUIPopup.py @@ -527,7 +527,7 @@ def IShowBookNoTreasure(self): gLinkingBook = ptBook(bookdef,self.key) gLinkingBook.setSize( width, height ) # make sure there is a cover to show - if showOpen and self.IsThereACover(bookdef): + if showOpen and not self.IsThereACover(bookdef): showOpen = 0 gLinkingBook.setGUI(gui) gLinkingBook.show(showOpen)