Enable inspector panel and improve viewport resizing handling in HUD
Some checks failed
Build Simulation and Test / Run All Tests (push) Failing after 3m33s

This commit is contained in:
Sam 2025-11-08 20:00:11 -06:00
parent fa808e691a
commit 36d13a53a0
2 changed files with 7 additions and 2 deletions

View File

@ -216,6 +216,9 @@ class SimulationEngine:
# Reset TPS display to current value # Reset TPS display to current value
if self.hud.custom_tps_entry: if self.hud.custom_tps_entry:
self.hud.custom_tps_entry.set_text(str(int(self.simulation_core.timing.state.tps))) self.hud.custom_tps_entry.set_text(str(int(self.simulation_core.timing.state.tps)))
elif action == 'viewport_resized':
# Update simulation viewport when panels are resized
self._update_simulation_view()
def _handle_sprint_mode(self): def _handle_sprint_mode(self):
"""Handle sprint mode by running multiple simulation ticks quickly.""" """Handle sprint mode by running multiple simulation ticks quickly."""

View File

@ -14,7 +14,7 @@ DARKER_GRAY = (25, 25, 25)
# Panel visibility constants # Panel visibility constants
SHOW_CONTROL_BAR = True SHOW_CONTROL_BAR = True
SHOW_INSPECTOR_PANEL = False SHOW_INSPECTOR_PANEL = True
SHOW_PROPERTIES_PANEL = True SHOW_PROPERTIES_PANEL = True
SHOW_CONSOLE_PANEL = False SHOW_CONSOLE_PANEL = False
@ -348,7 +348,9 @@ class HUD:
self.dragging_splitter = "console" self.dragging_splitter = "console"
self.update_layout(self.screen_width, self.screen_height) self.update_layout(self.screen_width, self.screen_height)
elif event.type == pygame.MOUSEBUTTONUP and event.button == 1: elif event.type == pygame.MOUSEBUTTONUP and event.button == 1:
if self.dragging_splitter is not None:
self.dragging_splitter = None self.dragging_splitter = None
return 'viewport_resized'
elif event.type == pygame.MOUSEMOTION and self.dragging_splitter: elif event.type == pygame.MOUSEMOTION and self.dragging_splitter:
mx, my = event.pos mx, my = event.pos
if self.dragging_splitter == "inspector": if self.dragging_splitter == "inspector":