Code cleanup and sound consolidation.
This commit is contained in:
26
__init__.py
26
__init__.py
@ -79,7 +79,7 @@ __version__ = '2.0.0'
|
||||
__all__ = [
|
||||
# Services
|
||||
'ConfigService', 'VolumeService', 'PathService',
|
||||
|
||||
|
||||
# Sound
|
||||
'Sound',
|
||||
'play_bgm',
|
||||
@ -97,32 +97,32 @@ __all__ = [
|
||||
'cut_scene',
|
||||
'play_random_falling',
|
||||
'calculate_volume_and_pan',
|
||||
|
||||
|
||||
# Speech
|
||||
'messagebox',
|
||||
'speak',
|
||||
'Speech',
|
||||
|
||||
|
||||
# Scoreboard
|
||||
'Scoreboard',
|
||||
|
||||
|
||||
# Input
|
||||
'get_input', 'check_for_exit', 'pause_game',
|
||||
|
||||
|
||||
# Display
|
||||
'display_text', 'initialize_gui',
|
||||
|
||||
|
||||
# Menu
|
||||
'game_menu', 'learn_sounds', 'instructions', 'credits', 'donate', 'exit_game', 'high_scores', 'has_high_scores',
|
||||
|
||||
|
||||
# Game class
|
||||
'Game',
|
||||
|
||||
|
||||
# Utils
|
||||
'check_for_updates', 'get_version_tuple', 'check_compatibility',
|
||||
'sanitize_filename', 'lerp', 'smooth_step', 'distance_2d',
|
||||
'x_powerbar', 'y_powerbar', 'generate_tone',
|
||||
|
||||
|
||||
# Re-exported functions from pygame, math, random
|
||||
'get_ticks', 'delay', 'wait',
|
||||
'sin', 'cos', 'sqrt', 'floor', 'ceil',
|
||||
@ -141,10 +141,10 @@ def initialize_gui_with_services(gameTitle):
|
||||
"""Wrapper around initialize_gui that initializes services."""
|
||||
# Initialize path service
|
||||
pathService.initialize(gameTitle)
|
||||
|
||||
|
||||
# Connect config service to path service
|
||||
configService.set_game_info(gameTitle, pathService)
|
||||
|
||||
|
||||
# Call original initialize_gui
|
||||
return _originalInitializeGui(gameTitle)
|
||||
|
||||
@ -159,11 +159,11 @@ def scoreboard_init_with_services(self, score=0, configService=None, speech=None
|
||||
# Use global services if not specified
|
||||
if configService is None:
|
||||
configService = ConfigService.get_instance()
|
||||
|
||||
|
||||
# Ensure pathService is connected if using defaults
|
||||
if not hasattr(configService, 'pathService') and pathService.game_path is not None:
|
||||
configService.pathService = pathService
|
||||
|
||||
|
||||
# Call original init with services
|
||||
_originalScoreboardInit(self, score, configService, speech)
|
||||
|
||||
|
Reference in New Issue
Block a user