Closed JimZhouZZY closed 11 months ago
Feature is working well, good job!
Just waiting for the small refactor to be done.
I'm so sorry I made this ill-advised edit. I realised how stupid is was. And I modified the code seriously.
Here are the modified functions on clicks/keys. Please let me know if any funtion need to be changed.
Left Click
outside will close a menu whose position is not fixed such as Main menu
, Item sell menu
...but except Select an action
menu.Right Click
will function as before, no changes.Escape
will close all menus except Select an action
menu, but will not undo actions.And Replying to:
My suggestion: call this method inside of right click instead of having the same piece of code twice.
I deleted the method leave_menu
, because it doesn't have a good practicality.
I'm so sorry I made this ill-advised edit. I realised how stupid is was. And I modified the code seriously.
No no no and definitely no, you don't have to be sorry for the work you are producing. In development, everyone makes "mistakes" all the time, even seniors. And what may be considered an error by someone might not be for someone else. Everything is about point of view! Solutions should be debated, and we need to think about whether or not what we did make sense, but not blame ourselves and feel bad about it.
I'm so sorry I made this ill-advised edit. I realised how stupid is was. And I modified the code seriously.
No no no and definitely no, you don't have to be sorry for the work you are producing. In development, everyone makes "mistakes" all the time, even seniors. And what may be considered an error by someone might not be for someone else. Everything is about point of view! Solutions should be debated, and we need to think about whether or not what we did make sense, but not blame ourselves and feel bad about it.
Thank you for your kind words. I appreciate your encouragement and support. I’m still learning and trying to improve my skills, so it’s good to know that the community is so accommodating and easy-going. I’ll keep your advice in mind and try to do better next time. Thanks again!
I'm confused with the Unit tests. Sometimes it passes, but sometimes fails. Always on the line self.assertIsInstance(self.start_screen.level, self.level_class)
.
======================================================================
FAIL: test_load_existent_save (tests.test_start_screen.TestStartScreen)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/rpg_tactical_fantasy_game/rpg_tactical_fantasy_game/tests/test_start_screen.py", line 147, in test_load_existent_save
self.assertIsInstance(self.start_screen.level, self.level_class)
AssertionError: None is not an instance of <class 'src.scenes.level_scene.LevelScene'>
----------------------------------------------------------------------
Ran 110 tests in 27.345s
Yes I noticed it, but it's passing most of the time, and the test doesn't look related to the changes you did.
I'm assuming it's just a flakky test (i.e., test wrongly failling sometimes) because the position is randomly generated. Will investigate it later.
Add feature:
Add interface for key operation. Now we can add key binding in "level_scene.py" like this: