minor bug fixes

This commit is contained in:
Yonokid
2025-08-08 11:36:59 -04:00
parent bb3a2a1a38
commit 68ce2636b8
4 changed files with 29 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import copy
import json
import os
import tempfile
@@ -44,7 +45,11 @@ class TextureWrapper:
else:
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]
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 not isinstance(tex_object.texture, list):
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)
else:
if isinstance(tex_object.texture, list):

View File

@@ -263,6 +263,8 @@ global_data = GlobalData()
text_cache = set()
if not Path('cache/image').exists():
if not Path('cache').exists():
Path('cache').mkdir()
Path('cache/image').mkdir()
for file in Path('cache/image').iterdir():

View File

@@ -14,3 +14,15 @@ dependencies = [
"dotenv>=0.9.9",
"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
View File

@@ -1,6 +1,10 @@
version = 1
revision = 2
requires-python = ">=3.11"
resolution-markers = [
"python_full_version >= '3.13'",
"python_full_version < '3.13'",
]
[[package]]
name = "cffi"
@@ -310,6 +314,9 @@ requires-dist = [
{ name = "tomlkit", specifier = ">=0.13.3" },
]
[package.metadata.requires-dev]
dev = []
[[package]]
name = "python-dotenv"
version = "1.1.0"