ya2 · news · projects · code · about

fixes for building
authorFlavio Calva <f.calva@gmail.com>
Sat, 18 Feb 2023 08:25:14 +0000 (10:25 +0200)
committerFlavio Calva <f.calva@gmail.com>
Sat, 18 Feb 2023 08:25:14 +0000 (10:25 +0200)
pmachines/application/application.py
pmachines/editor/inspector.py
pmachines/scene/scene.py
prj.org
tests/functional_test.py

index 0fcc1be4422178506504412d2377179ebd5a71b9..5cd33d3459b809f6bbb4c7d9aa7110a70b39d3f5 100755 (executable)
@@ -126,7 +126,7 @@ class Pmachines:
             self._fsm.demand('Menu')
 
     def on_menu_enter(self):
-        self._menu_bg = Background()
+        self._menu_bg = Background('wood')
         self._menu = Menu(
             lambda scene_name: self._fsm.demand('Scene', scene_name),
             self.lang_mgr.set_language, self._options,
index 5b114b8823aafa5c28ecd1b09211bf01b6433976..4dc713b56f7121ab534a3090dd373be14b6c180f 100644 (file)
@@ -90,7 +90,7 @@ class Inspector(DirectObject):
             for l, b in zip(strategy_labels, comps):
                 b.__class__ = type('DirectFrameMixed', (DirectFrame, DirectGuiMixin), {})
                 p = b.pos_pixel()
-                self.__pos_mgr[l] = (p[0] + 5, p[1])
+                self.__pos_mgr[l] = (p[0] + 5, p[1] + 10)
         strategy_entry._show_cb = strategy_set
         p = strategy_entry.pos_pixel()
         self.__pos_mgr['editor_inspector_strategy'] = (p[0] + 5, p[1])
@@ -394,6 +394,7 @@ class PixelSpaceInspector(DirectObject):
             parent=self._frm,
             text_fg=self._common['text_fg'],
             command=callback)
+        self.__pos_mgr[f'editor_inspector_test_{id_}'] = e.pos_pixel()
         self.__z -= .1
         return t, e
 
index 1bff770dfb3938fae283de67f48970612bd65b5d..53e38f4eb4105ab56706ea59330a48f8806239a5 100644 (file)
@@ -72,6 +72,8 @@ class Scene(DirectObject):
             self.__restore_state()
         elif self.__json_name:
             self._set_instructions()
+        if not self.__json_name:
+            self.json = {'background': 'wood'}
         self._bg = Background(self.json['background'])
         self._side_panel = SidePanel(world, self._mouse_plane_node, (-5, 4), (-3, 1), 1, self.__items)
         self._scene_tsk = taskMgr.add(self.on_frame, 'scene_on_frame')
@@ -120,12 +122,14 @@ class Scene(DirectObject):
         return items
 
     def _set_items(self):
+        info(f'{self.__json_name=}')
         if not self.__json_name: return
         self.__items = []
         self._test_items = []
         if not self.json:
             with open(f'assets/scenes/{self.__json_name}.json') as f:
                 self.json = loads(f.read())
+                info(f'{self.json=}')
         for item in self.json['start_items']:
             args = {
                 'world': self._world,
@@ -311,6 +315,7 @@ class Scene(DirectObject):
             #('previous', self.on_prev, DISABLED, abr, 'gray'),
             #('rewind', self.reset, NORMAL, abr, 'gray')
         ]
+        info(f'{self.__editor=}')
         if self.__editor:
             btn_info.insert(2, ('wrench', self._set_editor, NORMAL, abl, 'gray', _('Editor'), 'right'))
         num_l = num_r = 0
diff --git a/prj.org b/prj.org
index 06bfb4bc425d064353a73bcef1faa2dfe29e85d9..abe4db72309ce4ea454f65df7da0a9222923f3dd 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,13 +3,12 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* BACKLOG second background
-* BACKLOG teeter-tooter with constraints (real teeter tooter)
-* BACKLOG magnet, road cone, bucket
-* BACKLOG actions: rewind, prev, next
-* BACKLOG (python 3.11) manylinux2014_x86_64
-* BACKLOG (when panda3d provides it) android build (test with the emulator of android studio)
-* BACKLOG (when itch.io's client works with wine) functional tests for windows-itch.io
+* teeter-tooter with constraints (real teeter tooter)
+* magnet, road cone, bucket
+* actions: rewind, prev, next
+* (python 3.11) manylinux2014_x86_64
+* (when panda3d provides it) android build (test with the emulator of android studio)
+* (when itch.io's client works with wine) functional tests for windows-itch.io
 * calendar                                                         :calendar:
 ** publish post q1; reschedule
 SCHEDULED: <2023-03-20 Mon +1y>
index 8a3396e9fa3c516400409529f1fe5c40c25b7b41..3fcbe3a80145ad499ecceac919682dc8e77c30a4 100644 (file)
@@ -555,6 +555,7 @@ class FunctionalTest:
         await self._event(FunctionalTest.evt_time, 'keyboard', ['a', 'b', 'c', 'Return', 'BackSpace', 'BackSpace', 'BackSpace', 'BackSpace'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_sorting', 'left'])
         await self._screenshot(FunctionalTest.start_time, 'editor_sorting')
+        await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_sorting_text', 'left'])
         await self._event(FunctionalTest.evt_time, 'keyboard', ['a', 'b', 'c', 'Return'])
         await self._screenshot(FunctionalTest.start_time, 'editor_sorting_changed')
@@ -569,6 +570,7 @@ class FunctionalTest:
         await self._screenshot(FunctionalTest.start_time, 'editor_sorting_save')
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_sorting_close', 'left'])
         await self._screenshot(FunctionalTest.start_time, 'editor_sorting_closed')
+        await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_start', 'left'])
         await self._screenshot(FunctionalTest.start_time, 'editor_start')
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_start_class', 'left'])
@@ -631,7 +633,7 @@ class FunctionalTest:
         await self._screenshot(FunctionalTest.start_time, 'editor_start_delete')
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_start_close', 'left'])
         await self._screenshot(FunctionalTest.start_time, 'editor_start_close')
-        await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_new', 'left'])
+        #await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_new', 'left'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['test_piece', 'left'])
         await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_inspector_strategy', 'left'])