179 lines
5.0 KiB
Dart
179 lines
5.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rimworld_modman/modloader.dart';
|
|
|
|
void main() {
|
|
ModList(path: modsRoot).load();
|
|
ConfigFile(path: configPath).load();
|
|
// runApp(const RimWorldModManager());
|
|
}
|
|
|
|
class RimWorldModManager extends StatelessWidget {
|
|
const RimWorldModManager({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'RimWorld Mod Manager',
|
|
theme: ThemeData.dark().copyWith(
|
|
primaryColor: const Color(0xFF3D4A59),
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: const Color(0xFF3D4A59),
|
|
brightness: Brightness.dark,
|
|
),
|
|
scaffoldBackgroundColor: const Color(0xFF1E262F),
|
|
cardColor: const Color(0xFF2A3440),
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: Color(0xFF2A3440),
|
|
foregroundColor: Colors.white,
|
|
),
|
|
),
|
|
home: const ModManagerHomePage(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ModManagerHomePage extends StatefulWidget {
|
|
const ModManagerHomePage({super.key});
|
|
|
|
@override
|
|
State<ModManagerHomePage> createState() => _ModManagerHomePageState();
|
|
}
|
|
|
|
class _ModManagerHomePageState extends State<ModManagerHomePage> {
|
|
int _selectedIndex = 0;
|
|
|
|
final List<Widget> _pages = [
|
|
const ModListPage(),
|
|
const LoadOrderPage(),
|
|
const TroubleshootingPage(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('RimWorld Mod Manager')),
|
|
body: _pages[_selectedIndex],
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _selectedIndex,
|
|
onTap: (index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
},
|
|
items: const [
|
|
BottomNavigationBarItem(icon: Icon(Icons.list), label: 'Mods'),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.reorder),
|
|
label: 'Load Order',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.build),
|
|
label: 'Troubleshoot',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// Page to display all installed mods with enable/disable toggles
|
|
class ModListPage extends StatelessWidget {
|
|
const ModListPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(Icons.extension, size: 64),
|
|
const SizedBox(height: 16),
|
|
Text('Mod List', style: Theme.of(context).textTheme.headlineMedium),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
'Here you\'ll see your installed mods.',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
const SizedBox(height: 24),
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
// TODO: Implement mod scanning functionality
|
|
},
|
|
child: const Text('Scan for Mods'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// Page to manage mod load order with dependency visualization
|
|
class LoadOrderPage extends StatelessWidget {
|
|
const LoadOrderPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(Icons.reorder, size: 64),
|
|
const SizedBox(height: 16),
|
|
Text('Load Order', style: Theme.of(context).textTheme.headlineMedium),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
'Manage your mod loading order with dependency resolution.',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 24),
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
// TODO: Implement automatic load order sorting
|
|
},
|
|
child: const Text('Auto-sort Mods'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// Page for troubleshooting problematic mods
|
|
class TroubleshootingPage extends StatelessWidget {
|
|
const TroubleshootingPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(Icons.build, size: 64),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
'Troubleshooting',
|
|
style: Theme.of(context).textTheme.headlineMedium,
|
|
),
|
|
const SizedBox(height: 16),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 32.0),
|
|
child: Text(
|
|
'Find problematic mods with smart batch testing.',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
const SizedBox(height: 24),
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
// TODO: Implement troubleshooting wizard
|
|
},
|
|
child: const Text('Start Troubleshooting'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|