mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
minor bug fixes
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -44,7 +45,11 @@ class TextureWrapper:
|
|||||||
else:
|
else:
|
||||||
ray.unload_texture(tex_object.texture)
|
ray.unload_texture(tex_object.texture)
|
||||||
|
|
||||||
def get_animation(self, index: int):
|
def get_animation(self, index: int, is_copy: bool = False):
|
||||||
|
if index not in self.animations:
|
||||||
|
raise Exception(f"Unable to find id {index} in loaded animations")
|
||||||
|
if is_copy:
|
||||||
|
return copy.deepcopy(self.animations[index])
|
||||||
return self.animations[index]
|
return self.animations[index]
|
||||||
|
|
||||||
def update_attr(self, subset: str, texture: str, attr: str, value: float | int):
|
def update_attr(self, subset: str, texture: str, attr: str, value: float | int):
|
||||||
@@ -121,6 +126,8 @@ class TextureWrapper:
|
|||||||
if tex_object.is_frames:
|
if tex_object.is_frames:
|
||||||
if not isinstance(tex_object.texture, list):
|
if not isinstance(tex_object.texture, list):
|
||||||
raise Exception("Texture was marked as multiframe but is only 1 texture")
|
raise Exception("Texture was marked as multiframe but is only 1 texture")
|
||||||
|
if frame >= len(tex_object.texture):
|
||||||
|
raise Exception(f"Frame {frame} not available in iterable texture {tex_object.name}")
|
||||||
ray.draw_texture_pro(tex_object.texture[frame], source_rect, dest_rect, ray.Vector2(0, 0), 0, color)
|
ray.draw_texture_pro(tex_object.texture[frame], source_rect, dest_rect, ray.Vector2(0, 0), 0, color)
|
||||||
else:
|
else:
|
||||||
if isinstance(tex_object.texture, list):
|
if isinstance(tex_object.texture, list):
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ global_data = GlobalData()
|
|||||||
|
|
||||||
text_cache = set()
|
text_cache = set()
|
||||||
if not Path('cache/image').exists():
|
if not Path('cache/image').exists():
|
||||||
|
if not Path('cache').exists():
|
||||||
|
Path('cache').mkdir()
|
||||||
Path('cache/image').mkdir()
|
Path('cache/image').mkdir()
|
||||||
|
|
||||||
for file in Path('cache/image').iterdir():
|
for file in Path('cache/image').iterdir():
|
||||||
|
|||||||
@@ -14,3 +14,15 @@ dependencies = [
|
|||||||
"dotenv>=0.9.9",
|
"dotenv>=0.9.9",
|
||||||
"gitpython>=3.1.44",
|
"gitpython>=3.1.44",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = []
|
||||||
|
|
||||||
|
[tool.codeflash]
|
||||||
|
# All paths are relative to this pyproject.toml's directory.
|
||||||
|
module-root = "."
|
||||||
|
tests-root = "tests"
|
||||||
|
test-framework = "pytest"
|
||||||
|
ignore-paths = []
|
||||||
|
disable-telemetry = true
|
||||||
|
formatter-cmds = ["disabled"]
|
||||||
|
|||||||
7
uv.lock
generated
7
uv.lock
generated
@@ -1,6 +1,10 @@
|
|||||||
version = 1
|
version = 1
|
||||||
revision = 2
|
revision = 2
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
resolution-markers = [
|
||||||
|
"python_full_version >= '3.13'",
|
||||||
|
"python_full_version < '3.13'",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cffi"
|
name = "cffi"
|
||||||
@@ -310,6 +314,9 @@ requires-dist = [
|
|||||||
{ name = "tomlkit", specifier = ">=0.13.3" },
|
{ name = "tomlkit", specifier = ">=0.13.3" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[package.metadata.requires-dev]
|
||||||
|
dev = []
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-dotenv"
|
name = "python-dotenv"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user