From: Flavio Calva Date: Tue, 24 May 2022 17:58:11 +0000 (+0100) Subject: removed next/prev/rewind X-Git-Url: http://git.ya2.it/?p=pmachines.git;a=commitdiff_plain;h=f26497a5d0456a2f399e32a252d6dc4a3a14f67f;ds=sidebyside removed next/prev/rewind --- diff --git a/game/scene.py b/game/scene.py index 9d4861d..e049c4b 100644 --- a/game/scene.py +++ b/game/scene.py @@ -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'), - ('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: @@ -177,8 +178,8 @@ class Scene(DirectObject): 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, @@ -187,7 +188,8 @@ class Scene(DirectObject): 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() @@ -282,12 +284,12 @@ class Scene(DirectObject): 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') @@ -348,8 +350,8 @@ class Scene(DirectObject): 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] @@ -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.__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) - 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) - 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() @@ -563,7 +565,8 @@ class Scene(DirectObject): 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 @@ -572,7 +575,8 @@ class Scene(DirectObject): 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] diff --git a/lib/tools/functional_test.py b/lib/tools/functional_test.py index e052fa9..eb4c06d 100644 --- a/lib/tools/functional_test.py +++ b/lib/tools/functional_test.py @@ -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.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 diff --git a/prj.org b/prj.org index 547fc11..e157612 100644 --- a/prj.org +++ b/prj.org @@ -3,8 +3,7 @@ #+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 @@ -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) +* BACKLOG actions: rewind, prev, next * BACKLOG functional tests for "cleaning" i.e. at the end of the states verify: - [ ] active threads - [ ] active tasks