ya2 · news · projects · code · about

removed next/prev/rewind
authorFlavio Calva <f.calva@gmail.com>
Tue, 24 May 2022 17:58:11 +0000 (18:58 +0100)
committerFlavio Calva <f.calva@gmail.com>
Tue, 24 May 2022 17:58:11 +0000 (18:58 +0100)
game/scene.py
lib/tools/functional_test.py
prj.org

index 9d4861daa00256d03326bccc03a4859487824d81..e049c4b1d63b429196640297524b6848fa993334 100644 (file)
@@ -155,9 +155,10 @@ class Scene(DirectObject):
             ('home', self.on_home, NORMAL, abl, 'gray'),
             ('information', self._set_instructions, NORMAL, abl, 'gray'),
             ('right', self.on_play, NORMAL, abr, 'green'),
             ('home', self.on_home, NORMAL, abl, 'gray'),
             ('information', self._set_instructions, NORMAL, abl, 'gray'),
             ('right', self.on_play, NORMAL, abr, 'green'),
-            ('next', self.on_next, DISABLED, abr, 'gray'),
-            ('previous', self.on_prev, DISABLED, abr, 'gray'),
-            ('rewind', self.reset, NORMAL, abr, 'gray')]
+            #('next', self.on_next, DISABLED, abr, 'gray'),
+            #('previous', self.on_prev, DISABLED, abr, 'gray'),
+            #('rewind', self.reset, NORMAL, abr, 'gray')
+        ]
         num_l = num_r = 0
         btns = []
         for binfo in btn_info:
         num_l = num_r = 0
         btns = []
         for binfo in btn_info:
@@ -177,8 +178,8 @@ class Scene(DirectObject):
                 clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
             btn.set_transparency(True)
             btns += [btn]
                 clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
             btn.set_transparency(True)
             btns += [btn]
-        self.__home_btn, self.__info_btn, self.__right_btn, self.__next_btn, \
-            self.__prev_btn, self.__rewind_btn = btns
+        self.__home_btn, self.__info_btn, self.__right_btn = btns
+        # , self.__next_btn, self.__prev_btn, self.__rewind_btn
         if self._dbg_items:
             self._info_txt = OnscreenText(
                 '', parent=base.a2dTopRight, scale=0.04,
         if self._dbg_items:
             self._info_txt = OnscreenText(
                 '', parent=base.a2dTopRight, scale=0.04,
@@ -187,7 +188,8 @@ class Scene(DirectObject):
     def _unset_gui(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
     def _unset_gui(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
-            self.__next_btn, self.__prev_btn, self.__rewind_btn]
+            #self.__next_btn, self.__prev_btn, self.__rewind_btn
+        ]
         [btn.destroy() for btn in btns]
         if self._dbg_items:
             self._info_txt.destroy()
         [btn.destroy() for btn in btns]
         if self._dbg_items:
             self._info_txt.destroy()
@@ -282,12 +284,12 @@ class Scene(DirectObject):
             self._commands = self._commands[:self._command_idx]
             self._commands += [self._item_active]
             self._command_idx += 1
             self._commands = self._commands[:self._command_idx]
             self._commands += [self._item_active]
             self._command_idx += 1
-            self.__prev_btn['state'] = NORMAL
-            fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
-            self.__prev_btn['frameColor'] = fcols[0]
-            if self._item_active._command_idx == len(self._item_active._commands) - 1:
-                self.__next_btn['state'] = DISABLED
-                self.__next_btn['frameColor'] = fcols[1]
+            #self.__prev_btn['state'] = NORMAL
+            #fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
+            #self.__prev_btn['frameColor'] = fcols[0]
+            #if self._item_active._command_idx == len(self._item_active._commands) - 1:
+            #    self.__next_btn['state'] = DISABLED
+            #    self.__next_btn['frameColor'] = fcols[1]
         self._item_active = None
         [item.on_release() for item in self.items]
         self._cursor.set_image('assets/images/buttons/arrowUpLeft.dds')
         self._item_active = None
         [item.on_release() for item in self.items]
         self._cursor.set_image('assets/images/buttons/arrowUpLeft.dds')
@@ -348,8 +350,8 @@ class Scene(DirectObject):
 
     def on_play(self):
         self._state = 'playing'
 
     def on_play(self):
         self._state = 'playing'
-        self.__prev_btn['state'] = DISABLED
-        self.__next_btn['state'] = DISABLED
+        #self.__prev_btn['state'] = DISABLED
+        #self.__next_btn['state'] = DISABLED
         self.__right_btn['state'] = DISABLED
         [itm.play() for itm in self.items]
 
         self.__right_btn['state'] = DISABLED
         [itm.play() for itm in self.items]
 
@@ -357,20 +359,20 @@ class Scene(DirectObject):
         self._commands[self._command_idx].redo()
         self._command_idx += 1
         fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
         self._commands[self._command_idx].redo()
         self._command_idx += 1
         fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
-        self.__prev_btn['state'] = NORMAL
-        self.__prev_btn['frameColor'] = fcols[0]
+        #self.__prev_btn['state'] = NORMAL
+        #self.__prev_btn['frameColor'] = fcols[0]
         more_commands = self._command_idx < len(self._commands)
         more_commands = self._command_idx < len(self._commands)
-        self.__next_btn['state'] = NORMAL if more_commands else DISABLED
-        self.__next_btn['frameColor'] = fcols[0] if more_commands else fcols[1]
+        #self.__next_btn['state'] = NORMAL if more_commands else DISABLED
+        #self.__next_btn['frameColor'] = fcols[0] if more_commands else fcols[1]
 
     def on_prev(self):
         self._command_idx -= 1
         self._commands[self._command_idx].undo()
         fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
 
     def on_prev(self):
         self._command_idx -= 1
         self._commands[self._command_idx].undo()
         fcols = (.4, .4, .4, .14), (.3, .3, .3, .05)
-        self.__next_btn['state'] = NORMAL
-        self.__next_btn['frameColor'] = fcols[0]
-        self.__prev_btn['state'] = NORMAL if self._command_idx else DISABLED
-        self.__prev_btn['frameColor'] = fcols[0] if self._command_idx else fcols[1]
+        #self.__next_btn['state'] = NORMAL
+        #self.__next_btn['frameColor'] = fcols[0]
+        #self.__prev_btn['state'] = NORMAL if self._command_idx else DISABLED
+        #self.__prev_btn['frameColor'] = fcols[0] if self._command_idx else fcols[1]
 
     def on_home(self):
         self._exit_cb()
 
     def on_home(self):
         self._exit_cb()
@@ -563,7 +565,8 @@ class Scene(DirectObject):
     def __store_state(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
     def __store_state(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
-            self.__next_btn, self.__prev_btn, self.__rewind_btn]
+            #self.__next_btn, self.__prev_btn, self.__rewind_btn
+        ]
         self.__btn_state = [btn['state'] for btn in btns]
         for btn in btns:
             btn['state'] = DISABLED
         self.__btn_state = [btn['state'] for btn in btns]
         for btn in btns:
             btn['state'] = DISABLED
@@ -572,7 +575,8 @@ class Scene(DirectObject):
     def __restore_state(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
     def __restore_state(self):
         btns = [
             self.__home_btn, self.__info_btn, self.__right_btn,
-            self.__next_btn, self.__prev_btn, self.__rewind_btn]
+            #self.__next_btn, self.__prev_btn, self.__rewind_btn
+        ]
         for btn, state in zip(btns, self.__btn_state):
             btn['state'] = state
         [itm.restore_state() for itm in self.items]
         for btn, state in zip(btns, self.__btn_state):
             btn['state'] = state
         [itm.restore_state() for itm in self.items]
index e052fa9dfeaf92109bf23e58b4a8429d751c4c07..eb4c06d18a35e229a43cce7e341c1f94f5a89d2b 100644 (file)
@@ -236,10 +236,10 @@ class FunctionalTest(GameObject):
         self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left'])  # info
         self._screenshot(FunctionalTest.screenshot_time, 'info')
         self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left'])  # close instructions
         self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left'])  # info
         self._screenshot(FunctionalTest.screenshot_time, 'info')
         self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left'])  # close instructions
-        self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (430, 280), 'left'])  # drag a piece
-        self._screenshot(FunctionalTest.screenshot_time, 'domino_dragged')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1220, 740), 'left'])  # rewind
-        self._screenshot(FunctionalTest.screenshot_time, 'rewind')
+        self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (430, 280), 'left'])  # drag a piece
+        self._screenshot(FunctionalTest.screenshot_time, 'domino_dragged')
+        self._event(FunctionalTest.evt_time, 'mouseclick', [(1220, 740), 'left'])  # rewind
+        self._screenshot(FunctionalTest.screenshot_time, 'rewind')
         self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left'])  # drag a piece
         # self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left'])  # drag a piece
         self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
         self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left'])  # drag a piece
         # self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left'])  # drag a piece
         self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
diff --git a/prj.org b/prj.org
index 547fc11e049b13ec42850b2670a16e85e6977777..e15761237942308af65f31fde0f1240fb2fe3972 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,8 +3,7 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* RED fix actions: rewind, prev, next                                   :bug:
-* READY restore tests for level 6 and 7
+* RED restore tests for level 6 and 7
 * READY move functional tests in tests from lib.engine
 * READY rename lib to ya2
 * READY refactoring
 * READY move functional tests in tests from lib.engine
 * READY rename lib to ya2
 * READY refactoring
@@ -17,6 +16,7 @@
 - [ ] when you win save the id + version
 - [ ] put an "update" if id is saved and versions are different
 * BACKLOG functional tests for performance (frame rate)
 - [ ] when you win save the id + version
 - [ ] put an "update" if id is saved and versions are different
 * BACKLOG functional tests for performance (frame rate)
+* BACKLOG actions: rewind, prev, next
 * BACKLOG functional tests for "cleaning" i.e. at the end of the states verify:
 - [ ] active threads
 - [ ] active tasks
 * BACKLOG functional tests for "cleaning" i.e. at the end of the states verify:
 - [ ] active threads
 - [ ] active tasks