diff --git a/src/ui/flutter_app/lib/widgets/game_page.dart b/src/ui/flutter_app/lib/widgets/game_page.dart index 2a883d64..ead5e582 100644 --- a/src/ui/flutter_app/lib/widgets/game_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_page.dart @@ -662,6 +662,7 @@ class _GamePageState extends State with RouteAware { ], ), onPressed: () { + if (Config.developerMode) return; Game.instance.regret(steps: 2); setState(() {}); }, diff --git a/src/ui/flutter_app/lib/widgets/game_settings_page.dart b/src/ui/flutter_app/lib/widgets/game_settings_page.dart index c5d33adf..8d1e380d 100644 --- a/src/ui/flutter_app/lib/widgets/game_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_settings_page.dart @@ -69,6 +69,7 @@ class _GameSettingsPageState extends State { restoreFactoryDefaultSettings() async { confirm() async { Navigator.of(context).pop(); + if (Config.developerMode) return; final profile = await Settings.instance(); await profile.restore(); exit(0); @@ -189,19 +190,6 @@ class _GameSettingsPageState extends State { ], ), SizedBox(height: AppTheme.sizedBoxHeight), - Text(S.of(context).forDevelopers, style: AppTheme.settingsHeaderStyle), - SettingsCard( - context: context, - children: [ - SettingsSwitchListTile( - context: context, - value: Config.developerMode, - onChanged: setDeveloperMode, - titleString: S.of(context).developerMode, - ), - ], - ), - SizedBox(height: AppTheme.sizedBoxHeight), Text(S.of(context).restore, style: AppTheme.settingsHeaderStyle), SettingsCard( context: context, @@ -214,6 +202,19 @@ class _GameSettingsPageState extends State { ListItemDivider(), ], ), + SizedBox(height: AppTheme.sizedBoxHeight), + Text(S.of(context).forDevelopers, style: AppTheme.settingsHeaderStyle), + SettingsCard( + context: context, + children: [ + SettingsSwitchListTile( + context: context, + value: Config.developerMode, + onChanged: setDeveloperMode, + titleString: S.of(context).developerMode, + ), + ], + ), ]; } diff --git a/src/ui/flutter_app/lib/widgets/home_drawer.dart b/src/ui/flutter_app/lib/widgets/home_drawer.dart index 15ca0e69..8c4ff195 100644 --- a/src/ui/flutter_app/lib/widgets/home_drawer.dart +++ b/src/ui/flutter_app/lib/widgets/home_drawer.dart @@ -23,6 +23,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:sanmill/generated/l10n.dart'; import 'package:sanmill/style/app_theme.dart'; +import 'package:sanmill/common/config.dart'; enum DrawerIndex { humanVsAi, @@ -181,6 +182,10 @@ class _HomeDrawerState extends State { color: AppTheme.exitIconColor, ), onTap: () async { + if (Config.developerMode) { + return; + } + await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); }, ); diff --git a/src/ui/flutter_app/lib/widgets/navigation_home_screen.dart b/src/ui/flutter_app/lib/widgets/navigation_home_screen.dart index 79844151..1f8d2f91 100644 --- a/src/ui/flutter_app/lib/widgets/navigation_home_screen.dart +++ b/src/ui/flutter_app/lib/widgets/navigation_home_screen.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:sanmill/engine/engine.dart'; import 'package:sanmill/mill/game.dart'; +import 'package:sanmill/common/config.dart'; import 'package:sanmill/style/app_theme.dart'; import 'package:sanmill/widgets/about_page.dart'; import 'package:sanmill/widgets/drawer_user_controller.dart'; @@ -104,11 +105,11 @@ class _NavigationHomeScreenState extends State { setState(() { screenView = PersonalizationSettingsPage(); }); - } else if (drawerIndex == DrawerIndex.Help) { + } else if (drawerIndex == DrawerIndex.Help && !Config.developerMode) { setState(() { screenView = HelpScreen(); }); - } else if (drawerIndex == DrawerIndex.About) { + } else if (drawerIndex == DrawerIndex.About && !Config.developerMode) { setState(() { screenView = AboutPage(); });