Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.0
3.9.0
2 changes: 1 addition & 1 deletion core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: openrom_core
description: OpenROM Pure Dart Backend Core & Toolkit Library
version: 3.7.0
version: 3.9.0
publish_to: 'none'

environment:
Expand Down
149 changes: 111 additions & 38 deletions gui/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// OpenROM — Universal ROM Compression Suite
// M5 Dev | GPL v3

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'controllers/home_controller.dart';
Expand Down Expand Up @@ -43,6 +44,8 @@ class _OpenROMAppState extends State<OpenROMApp> {
String _outputDir = '';
String _audioCodec = 'flac';

static const List<int> _mobileScreenIndices = [0, 1, 2, 4];

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -135,6 +138,19 @@ class _OpenROMAppState extends State<OpenROMApp> {
},
);

final screens = [
HomeScreen(theme: theme, controller: _homeController),
PatcherScreen(theme: theme),
ToolsScreen(theme: theme),
DreamcastScreen(theme: theme),
settingsWidget,
AboutScreen(theme: theme),
ThemeEditorScreen(
theme: theme,
themeService: widget.themeService,
),
];

return MaterialApp(
title: 'OpenROM',
debugShowCheckedModeBanner: false,
Expand All @@ -149,49 +165,106 @@ class _OpenROMAppState extends State<OpenROMApp> {
primary: theme.accent,
),
),
home: Scaffold(
backgroundColor: theme.background,
body: Row(
children: [
Sidebar(
selectedIndex: _selectedIndex,
onDestinationSelected: (index) {
setState(() => _selectedIndex = index);
},
theme: theme,
),
Expanded(
child: Column(
children: [
TopBar(
theme: theme,
fileCount: fileCount,
isConverting: isConverting,
onConvertPressed: _onConvertPressed,
onAddFilesPressed: _onAddFilesPressed,
home: LayoutBuilder(
builder: (context, constraints) {
final isNarrow = constraints.maxWidth < 650;
final isMobile = isNarrow ||
defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS;

if (isMobile) {
final mobileCurrentIndex =
_mobileScreenIndices.contains(_selectedIndex)
? _mobileScreenIndices.indexOf(_selectedIndex)
: 0;

return Scaffold(
backgroundColor: theme.background,
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: TopBar(
theme: theme,
fileCount: fileCount,
isConverting: isConverting,
onConvertPressed: _onConvertPressed,
onAddFilesPressed: _onAddFilesPressed,
),
),
body: IndexedStack(
index: _selectedIndex,
children: screens,
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: mobileCurrentIndex,
onTap: (int index) {
setState(() {
_selectedIndex = _mobileScreenIndices[index];
});
},
backgroundColor: theme.surface,
selectedItemColor: theme.accent,
unselectedItemColor: theme.textSecondary,
type: BottomNavigationBarType.fixed,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.sync_alt_outlined),
activeIcon: Icon(Icons.sync_alt),
label: 'Convert',
),
Expanded(
child: IndexedStack(
index: _selectedIndex,
children: [
HomeScreen(theme: theme, controller: _homeController),
PatcherScreen(theme: theme),
ToolsScreen(theme: theme),
DreamcastScreen(theme: theme),
settingsWidget,
AboutScreen(theme: theme),
ThemeEditorScreen(
theme: theme,
themeService: widget.themeService,
),
],
),
BottomNavigationBarItem(
icon: Icon(Icons.healing_outlined),
activeIcon: Icon(Icons.healing),
label: 'Patch',
),
BottomNavigationBarItem(
icon: Icon(Icons.construction_outlined),
activeIcon: Icon(Icons.construction),
label: 'Tools',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings_outlined),
activeIcon: Icon(Icons.settings),
label: 'Settings',
),
],
),
);
}

return Scaffold(
backgroundColor: theme.background,
body: Row(
children: [
Sidebar(
selectedIndex: _selectedIndex,
onDestinationSelected: (index) {
setState(() => _selectedIndex = index);
},
theme: theme,
),
Expanded(
child: Column(
children: [
TopBar(
theme: theme,
fileCount: fileCount,
isConverting: isConverting,
onConvertPressed: _onConvertPressed,
onAddFilesPressed: _onAddFilesPressed,
),
Expanded(
child: IndexedStack(
index: _selectedIndex,
children: screens,
),
),
],
),
),
],
),
],
),
);
},
),
);
}
Expand Down
8 changes: 6 additions & 2 deletions gui/lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';

import '../l10n/app_localizations.dart';
import "../utils/app_version.dart";
import '../models/theme_config.dart';
import '../providers/locale_provider.dart';
import '../services/theme_service.dart';
Expand Down Expand Up @@ -92,7 +93,7 @@ class _SettingsScreenState extends State<SettingsScreen> {

_autoUpdateEnabled =
prefs.getBool(OnlinePrefs.autoUpdateEnabled) ?? false;
_currentVersion = readAppVersion();
_currentVersion = AppVersion.current;

_raEnabled = prefs.getBool(OnlinePrefs.raEnabled) ?? false;
_raUsername = prefs.getString(OnlinePrefs.raUsername) ?? '';
Expand Down Expand Up @@ -203,6 +204,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
return SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Expand Down Expand Up @@ -433,7 +435,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 2.5,
childAspectRatio: 2.2,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
),
Expand All @@ -454,6 +456,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
borderRadius: BorderRadius.circular(t.borderRadius),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand Down Expand Up @@ -600,6 +603,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
Expand Down
8 changes: 5 additions & 3 deletions gui/lib/services/core_bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
import '../models/errors.dart';
import '../models/conversion_job.dart';
import '../models/rom_file.dart';
import '../utils/app_version.dart';

typedef ProgressCallback = void Function(double percent);
typedef LogCallback = void Function(String log);
Expand Down Expand Up @@ -559,9 +560,10 @@ class CoreBridge {
}

static Future<String> getVersion() async {
final fallback = 'OpenROM v${AppVersion.current}';
try {
if (!await coreExists()) {
return 'OpenROM v2.2.0';
return fallback;
}
final corePath = await getCoreExecutablePath();
final List<String> args = [];
Expand All @@ -572,9 +574,9 @@ class CoreBridge {
}
final result = await Process.run(corePath, args);
final out = result.stdout.toString().trim();
return out.isNotEmpty ? out : 'OpenROM v2.2.0';
return out.isNotEmpty ? out : fallback;
} catch (_) {
return 'OpenROM v2.2.0';
return fallback;
}
}
}
1 change: 1 addition & 0 deletions gui/lib/services/theme_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ThemeService extends ChangeNotifier {
'themes/cyberpunk.json',
'themes/terminal.json',
'themes/minimal.json',
'themes/retroarch.json',
];

_availableThemes = [];
Expand Down
28 changes: 28 additions & 0 deletions gui/lib/utils/app_version.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// OpenROM — Universal ROM Compression Suite
// M5 Dev | GPL v3

import 'package:openrom_core/openrom_core.dart';

class AppVersion {
/// Default fallback version matching current release tag.
static const String fallback = '3.9.0';

/// Returns the resolved app version.
/// Priority:
/// 1. Compile-time environment variable (--dart-define=APP_VERSION=x.y.z)
/// 2. Version file read via `readAppVersion()` from `openrom_core`
/// 3. Fallback string ('3.9.0')
static String get current {
const definedVersion = String.fromEnvironment('APP_VERSION');
if (definedVersion.isNotEmpty) {
return definedVersion;
}

final readVer = readAppVersion();
if (readVer.isNotEmpty && readVer != 'unknown') {
return readVer;
}

return fallback;
}
}
14 changes: 8 additions & 6 deletions gui/lib/widgets/top_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ class TopBar extends StatelessWidget {

return Container(
height: 60,
padding: const EdgeInsets.symmetric(horizontal: 20),
padding: const EdgeInsets.symmetric(horizontal: 16),
color: theme.surface,
child: Row(
children: [
Icon(Icons.hexagon_outlined, color: theme.accent, size: 28),
const SizedBox(width: 10),
const SizedBox(width: 8),
Text(
l10n.appTitle,
style: TextStyle(
fontFamily: theme.fontFamily,
color: theme.textPrimary,
fontSize: 20,
fontSize: 18,
fontWeight: FontWeight.bold,
letterSpacing: 1.1,
),
Expand All @@ -59,28 +59,30 @@ class TopBar extends StatelessWidget {
icon: const Icon(Icons.add_circle_outline, size: 18),
label: Text(l10n.browse),
style: ElevatedButton.styleFrom(
minimumSize: const Size(0, 48),
backgroundColor: theme.surface,
foregroundColor: theme.textPrimary,
side: BorderSide(color: theme.accent.withValues(alpha: 0.5)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(theme.borderRadius),
),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
),
),
const SizedBox(width: 12),
const SizedBox(width: 8),
ElevatedButton(
onPressed:
(fileCount > 0 && !isConverting) ? onConvertPressed : null,
style: ElevatedButton.styleFrom(
minimumSize: const Size(0, 48),
backgroundColor: theme.accent,
foregroundColor: Colors.white,
elevation: isConverting ? 0 : 6,
shadowColor: theme.accent.withValues(alpha: 0.6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(theme.borderRadius),
),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
),
child: Text(
convertText,
Expand Down
2 changes: 1 addition & 1 deletion gui/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ packages:
path: "../core"
relative: true
source: path
version: "3.7.0"
version: "3.9.0"
package_config:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion gui/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: gui
description: OpenROM — Universal ROM Compression Suite Desktop App
publish_to: 'none'
version: 3.7.0+1
version: 3.9.0+1

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
Loading
Loading