Commit Graph

43 Commits

Author SHA1 Message Date
kramo
4b11a2737a Cleanups 2023-04-16 12:52:06 +02:00
kramo
aea8a6ed5f Cleanups 2023-04-16 11:04:00 +02:00
kramo
6edd85e80a Cleanups 2023-04-14 14:44:44 +02:00
kramo
fd66d07ac3 Cleanups 2023-04-11 23:31:16 +02:00
kramo
a08ed1d4c2 Cleanups 2023-04-11 20:57:11 +02:00
kramo
1d630722de Save all covers in a shared directory 2023-04-11 18:31:46 +02:00
kramo
0f6a989142 Reimplement animated covers with Pillow 2023-04-11 14:49:18 +02:00
kramo
3c6639ae07 Create GameCover class 2023-04-11 12:33:42 +02:00
kramo
3e495283b0 Revert animation support due to performance issues 2023-04-11 00:58:42 +02:00
kramo
62aff0e7cc Basic animated cover support 2023-04-10 23:24:48 +02:00
kramo
c1715aa328 Reimplement pixbuf caching 2023-04-10 20:54:24 +02:00
kramo
d136897c8c Fix cover saving issue 2023-04-10 20:05:41 +02:00
kramo
0fb7c859d2 Cleanups 2023-04-10 16:34:03 +02:00
kramo
05004b8225 Make pixbufs appear consistent 2023-04-08 09:18:05 +02:00
kramo
960eaa1949 Use utf-8 everywhere 2023-04-02 07:28:04 +02:00
kramo
6899246d01 Use simpler syntax for I/O operations 2023-04-01 16:14:19 +02:00
kramo
3bcbf8457c Refactor to use pathlib 2023-04-01 11:33:48 +02:00
Bananaman
77b083e219 A few minor code cleanups and fixes (#47)
* Avoid exception if trying to delete missing "removed" key

`.pop(key)` throws an exception if that `key` is missing. Using a default value (in this case None) means we don't throw any errors when deleting a missing key. Which is what we want here, for safety. We just want to delete the key. We don't care if it's existing or not.

There are other places in the codebase that also use `.pop(key)`, but all of those first check the validity of the key before popping, so this was the only one that needed fixing.

* Improve performance by removing keys() calls

Every `.keys()` call create a new `[list...]` of all keys from the given dictionary. It's a total waste of performance, since we can already check if a key exists in a dictionary by just using `if "key" in the_dict`.

* Use more pythonic "not in" syntax

The syntax is supposed to be `if "thing" not in other_thing`. We already use this proper `not in` syntax everywhere else in the codebase. Just fixing this location.
2023-03-31 15:24:02 +02:00
kramo
643ca368a6 Unify games import 2023-03-29 00:23:23 +02:00
kramo
228db1b2f0 Add option to launch games by clicking cover 2023-03-26 11:04:40 +02:00
Bananaman
732bb77192 Refactor game launching, and fix Windows support
The function was getting a bit convoluted to follow, and there was a maintenance burden of having to remember that "shell=True" should only be true if the argument is a single string to be passed exactly as-is to the shell. If it's a list, only the first value in the list would be ran as the shell command and the rest would be given as arguments to the shell itself.

Therefore, it's been refactored to automatically determine shell-mode based on whether "args" is a list or a string.

On Windows, we now generate a correctly escaped shell-string via "shlex". This ensures that we properly support spaces inside quoted launch arguments, by auto-escaping them on a per-argument basis.

The extra pylint hint is needed because the import is detected as unused on non-Windows machines.
2023-03-25 14:29:28 +01:00
kramo
716051d826 Fix games not launching on Windows 2023-03-25 11:09:12 +01:00
kramo
030c220d7e Cleanups 2023-03-25 00:50:17 +01:00
kramo
41c97e1af7 Move menu models to the game class 2023-03-25 00:14:37 +01:00
kramo
b65bab3528 Move toggle_hidden into the game class 2023-03-24 23:26:36 +01:00
kramo
ecceaabff1 Move run_command into the game class 2023-03-24 23:21:50 +01:00
kramo
6b103c996b Remove redundant get_cover function 2023-03-24 23:09:56 +01:00
kramo
a665241d76 Disable some pylint warnings 2023-03-24 20:29:36 +01:00
kramo
b281a4bd0d Cleanups 2023-03-22 08:36:37 +01:00
kramo
eb3f9a8b8e Use blacklist for non-game items 2023-03-15 23:46:34 +01:00
kramo
e2a2ea6da2 Add developer property 2023-03-15 13:12:48 +01:00
kramo
8a2ff2561b Cleanups 2023-03-15 02:22:11 +01:00
kramo
bd0cf7402a Code style 2023-03-15 01:57:43 +01:00
kramo
f416155c2d Update code style 2023-03-14 23:05:47 +01:00
kramo
32d9f9a880 Cleanups 2023-03-14 21:20:59 +01:00
kramo
24eac24c33 Better image handling 2023-03-14 18:42:05 +01:00
kramo
a4b1b8efd9 Refactor 2023-03-14 16:48:00 +01:00
kramo
0ee20a1a1f Update animation 2023-03-12 12:00:54 +01:00
kramo
4ed6ab2bab Fix overlay layering 2023-03-11 23:41:25 +01:00
kramo
4b9e3666be Make menu button only appear on hover 2023-03-11 23:22:36 +01:00
kramo
aa77fc8bf3 Show play button on hover - closes #4 2023-03-11 22:07:56 +01:00
kramo
a9a5a1d3c2 Rename to Cartridges 2023-02-01 16:34:26 +01:00
kra-mo
f5c1012628 Add project files 2022-12-26 14:38:37 +01:00