Moved all widgets and logic from gui app to Flutter package
- Implemented DebugToolsScreen for navigation to asset galleries. - Created GameScreen to manage gameplay and renderer integrations. - Added NoGameDataScreen to handle scenarios with missing game data. - Developed SpriteGallery for visual browsing of sprite assets. - Introduced VgaGallery for displaying VGA images from game data. - Added GalleryGameSelector widget for selecting game variants in galleries. - Created Wolf3dApp as the main application shell for managing game states. - Implemented WolfMenuShell for consistent menu layouts across screens. - Enhanced Wolf3d class to support debug mode and related functionalities. - Updated pubspec.yaml to include window_manager dependency. - Added tests for game screen lifecycle and debug mode functionalities. Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -12,6 +12,30 @@ import 'package:wolf_3d_flutter/wolf_3d_input_flutter.dart';
|
||||
export 'package:wolf_3d_dart/wolf_3d_audio.dart' show DebugMusicPlayer;
|
||||
|
||||
export 'audio/wolf3d_platform_audio.dart' show Wolf3dPlatformAudio;
|
||||
export 'managers/desktop_windowing_support.dart' show supportsDesktopWindowing;
|
||||
export 'managers/game_app_lifecycle_manager.dart' show GameAppLifecycleManager;
|
||||
export 'managers/game_display_manager.dart' show GameDisplayManager;
|
||||
export 'managers/game_persistence_manager.dart' show GamePersistenceManager;
|
||||
export 'managers/game_renderer_mode_manager.dart'
|
||||
show GameRendererMode, gameRendererModeFromSettings, handleGlslUnavailable;
|
||||
export 'managers/game_screen_input_manager.dart'
|
||||
show
|
||||
HostShortcutBinding,
|
||||
HostShortcutHandler,
|
||||
HostShortcutIntent,
|
||||
HostShortcutRegistry,
|
||||
GameScreenInputManager,
|
||||
isAltEnterShortcut;
|
||||
export 'screens/audio_gallery.dart' show AudioGallery;
|
||||
export 'screens/debug_tools_screen.dart' show DebugToolsScreen;
|
||||
export 'screens/game_screen.dart' show GameScreen;
|
||||
export 'screens/no_game_data_screen.dart' show NoGameDataScreen;
|
||||
export 'screens/sprite_gallery.dart' show SpriteGallery;
|
||||
export 'screens/vga_gallery.dart' show VgaGallery;
|
||||
export 'widgets/gallery_game_selector.dart'
|
||||
show GalleryGameSelector, formatGalleryGameTitle;
|
||||
export 'widgets/wolf3d_app.dart' show Wolf3dApp;
|
||||
export 'widgets/wolf_menu_shell.dart' show WolfMenuShell;
|
||||
|
||||
/// Coordinates asset discovery, audio initialization, and input reuse for apps.
|
||||
class Wolf3d {
|
||||
@@ -37,6 +61,17 @@ class Wolf3d {
|
||||
/// Shared Flutter input adapter reused by gameplay screens.
|
||||
final Wolf3dFlutterInput input = Wolf3dFlutterInput();
|
||||
|
||||
bool _debugEnabled = false;
|
||||
|
||||
/// Whether host-level debug affordances should be visible.
|
||||
bool get isDebugEnabled => _debugEnabled;
|
||||
|
||||
/// Enables host-level debug affordances such as debug navigation UI.
|
||||
Wolf3d enableDebug() {
|
||||
_debugEnabled = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// The currently selected game data set.
|
||||
///
|
||||
/// Throws a [StateError] until [setActiveGame] has been called.
|
||||
@@ -194,7 +229,12 @@ class Wolf3d {
|
||||
}
|
||||
|
||||
/// Initializes the engine by loading available game data.
|
||||
Future<Wolf3d> init({String? directory}) async {
|
||||
///
|
||||
/// Set [debug] to `true` to explicitly enable host-level debug affordances.
|
||||
Future<Wolf3d> init({String? directory, bool debug = false}) async {
|
||||
if (debug) {
|
||||
_debugEnabled = true;
|
||||
}
|
||||
await audio.init();
|
||||
availableGames.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user