Update keybindings and enhance loading screen functionality
- Refactor keybindings for gas spawning across multiple configurations - Implement new loading screen updates during game initialization - Add tests to ensure all weapon actions are exposed in keybinding profiles - Introduce new assets for explosion effects
This commit is contained in:
@@ -9,6 +9,12 @@ class Graphics():
|
||||
def load_assets(self):
|
||||
theme_index = self.get_theme_index()
|
||||
print(f"[gfx] load_assets requested: level={self.current_level + 1} theme={theme_index}")
|
||||
if getattr(self, "startup_loading_active", False):
|
||||
self._update_startup_loading(
|
||||
"Loading graphics",
|
||||
detail=f"Preparing theme {theme_index}",
|
||||
progress=0.3,
|
||||
)
|
||||
if not hasattr(self, "theme_assets_cache"):
|
||||
self.theme_assets_cache = {}
|
||||
if not hasattr(self, "blood_layer_sprites"):
|
||||
@@ -18,6 +24,12 @@ class Graphics():
|
||||
|
||||
if not getattr(self, "common_assets_loaded", False):
|
||||
print("Loading graphics assets...")
|
||||
if getattr(self, "startup_loading_active", False):
|
||||
self._update_startup_loading(
|
||||
"Loading graphics",
|
||||
detail="Decoding sprites and tiles",
|
||||
progress=0.4,
|
||||
)
|
||||
self.rat_assets = {}
|
||||
self.rat_assets_textures = {}
|
||||
self.rat_image_sizes = {}
|
||||
@@ -56,6 +68,12 @@ class Graphics():
|
||||
)
|
||||
|
||||
print("Pre-generating blood stain pool...")
|
||||
if getattr(self, "startup_loading_active", False):
|
||||
self._update_startup_loading(
|
||||
"Loading graphics",
|
||||
detail="Generating blood pool",
|
||||
progress=0.58,
|
||||
)
|
||||
self.blood_stain_textures = []
|
||||
for _ in range(10):
|
||||
blood_surface = self.render_engine.generate_blood_surface()
|
||||
@@ -70,6 +88,12 @@ class Graphics():
|
||||
|
||||
if theme_index not in self.theme_assets_cache:
|
||||
print(f"Loading theme assets {theme_index}...")
|
||||
if getattr(self, "startup_loading_active", False):
|
||||
self._update_startup_loading(
|
||||
"Loading graphics",
|
||||
detail=f"Loading theme {theme_index} art",
|
||||
progress=0.74,
|
||||
)
|
||||
self.theme_assets_cache[theme_index] = {
|
||||
"floor_tile": self.render_engine.create_color_surface((128, 128, 128)),
|
||||
"tunnel": self.render_engine.load_image("Rat/BMP_TUNNEL.png"),
|
||||
@@ -122,6 +146,13 @@ class Graphics():
|
||||
else:
|
||||
print(f"[gfx] theme cache hit -> reusing theme {theme_index}")
|
||||
|
||||
if getattr(self, "startup_loading_active", False):
|
||||
self._update_startup_loading(
|
||||
"Loading graphics",
|
||||
detail="Finishing render setup",
|
||||
progress=0.84,
|
||||
)
|
||||
|
||||
self.loaded_theme_index = theme_index
|
||||
theme_assets = self.theme_assets_cache[theme_index]
|
||||
self.floor_tile = theme_assets["floor_tile"]
|
||||
|
||||
Reference in New Issue
Block a user