Skip to content

Commit

Permalink
Code update to bring to Moula Q2 and suggested fixes
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Johnson <[email protected]>
  • Loading branch information
Hazado and Hoikas committed Aug 3, 2022
1 parent a5fe58e commit 763a221
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
16 changes: 6 additions & 10 deletions Scripts/Python/clftYeeshaPage08.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
RespOpen = ptAttribResponder(3, "Open Responder")
RespLoop = ptAttribResponder(4, "Loop Responder")
RespClose = ptAttribResponder(5, "Close Responder")
RespGlow = ptAttribResponder(6, "Glow Responder",['GlowSound','PageTurn'])

#Linking Books GUI tags
DialogName="YeeshaPageGUI"
Expand Down Expand Up @@ -149,32 +150,26 @@ def OnGUINotify(self,id,control,event):
if isinstance(control,ptGUIControlButton):
btnID = control.getTagID()

if event == kShowHide:
if control.isEnabled():
#control.show()
if self.GotPage():
mydialog = PtGetDialogFromString(DialogName)
ptGUIControlButton(mydialog.getControlFromTag(kYeeshaPage08)).disable()

elif event == kAction and btnID == kYeeshaPage08:
if event == kAction and btnID == kYeeshaPage08:
PtDebugPrint("DEBUG: clftYeeshaPage08.OnGUINotify():\tPicked up page")

RespClose.run(self.key)
isOpen = 0
PtHideDialog(DialogName)
self.SetStdGUIVisibility(1)
RespGlow.run(self.key, state='GlowSound')

if self.GotPage():
PtDebugPrint ("DEBUG: clftYeeshaPage08.py: You've already found Yeesha Page #8. Move along. Move along.")
return
else:
PtDebugPrint ("DEBUG: clftYeeshaPage08.py: Yeesha Page #8 is new to you.")
PtDebugPrint ("DEBUG: clftYeeshaPage08.py: Trying to update the value of the SDL variable %s to 1" % ("YeeshaPage8"))
PtDebugPrint ("DEBUG: clftYeeshaPage08.py: Trying to update the value of the SDL variable %s to 4" % ("YeeshaPage8"))
vault = ptVault()
psnlSDL = vault.getPsnlAgeSDL()
if psnlSDL:
YeeshaPageVar = psnlSDL.findVar("YeeshaPage8")
YeeshaPageVar.setInt(1)
YeeshaPageVar.setInt(4)
vault.updatePsnlAgeSDL (psnlSDL)
mydialog = PtGetDialogFromString(DialogName)
ptGUIControlButton(mydialog.getControlFromTag(kYeeshaPage08)).disable()
Expand Down Expand Up @@ -241,3 +236,4 @@ def SetStdGUIVisibility(self, visible):
ptGUIControlButton(mydialog.getControlFromTag(kYeeshaPage08)).show()

GUIDialogObject.value.draw.disable()

4 changes: 2 additions & 2 deletions Scripts/Python/psnlYeeshaPageChanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def EnableDisable(self, val):

respAudioStop.run(self.key,avatar=None,fastforward=0)
respDisable.run(self.key,avatar=None,fastforward=1)
if len(bushDistrib.value) > 0:
if bushDistrib.value:
for x in bushDistrib.value:
x.setVisible(0)
x.setVisible(False)


def TimeToGrow(self):
Expand Down
12 changes: 6 additions & 6 deletions Scripts/Python/xYeeshaPages.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def OnGUINotify(self,id,control,event):
if event == kExitMode:
PtHideDialog(DialogName)
return

btnID = 0
if isinstance(control,ptGUIControlButton):
btnID = control.getTagID()
Expand All @@ -162,13 +162,13 @@ def OnGUINotify(self,id,control,event):
PtDebugPrint("xYeeshaPages.OnGUINotify():\tPicked up page number: ", PageNumber.value)
# PtUnloadDialog(DialogName)
PtHideDialog(DialogName)

vault = ptVault()

psnlSDL = vault.getPsnlAgeSDL()
if psnlSDL:
YeeshaPageVar = psnlSDL.findVar("YeeshaPage" + str(PageNumber.value))

PtDebugPrint ("xYeeshaPages.py: The previous value of the SDL variable %s is %s" % ("YeeshaPage" + str(PageNumber.value), YeeshaPageVar.getInt()))

if StartInCleft():
Expand All @@ -179,10 +179,10 @@ def OnGUINotify(self,id,control,event):
if YeeshaPageVar.getInt() != 0:
PtDebugPrint ("xYeeshaPages.py: You've already found Yeesha Page #%s. Move along. Move along." % (PageNumber.value))
return

else:
PtDebugPrint ("xYeeshaPages.py: Yeesha Page #%s is new to you." % (PageNumber.value))

PtDebugPrint ("xYeeshaPages.py: Trying to update the value of the SDL variable %s to 1" % ("YeeshaPage" + str(PageNumber.value)))
YeeshaPageVar.setInt(4)
vault.updatePsnlAgeSDL (psnlSDL)
Expand Down

0 comments on commit 763a221

Please sign in to comment.