flutter: game_page: New menu style

This commit is contained in:
Calcitem 2021-05-22 01:51:43 +08:00
parent 8677f9f322
commit e5aefd4f7f
2 changed files with 13 additions and 22 deletions
src/ui/flutter_app/lib

View File

@ -26,7 +26,7 @@ class AppTheme {
static var moveHistoryDialogBackgroundColor = Colors.transparent;
static var infoDialogBackgroundColor = moveHistoryDialogBackgroundColor;
static var infoTextColor = moveHistoryTextColor;
static var simpleDialogOptionTextColor = appPrimaryColor;
static var simpleDialogOptionTextColor = Colors.yellow;
/// Settings page
static var darkBackgroundColor = UIColors.crusoe;

View File

@ -456,11 +456,13 @@ class _GamePageState extends State<GamePage> with RouteAware {
context: context,
builder: (BuildContext context) {
return SimpleDialog(
backgroundColor: Colors.transparent,
children: <Widget>[
SimpleDialogOption(
child: Text(
S.of(context).startNewGame,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: confirm),
],
@ -477,15 +479,18 @@ class _GamePageState extends State<GamePage> with RouteAware {
}
onMoveButtonPressed() {
showDialog(
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return SimpleDialog(
backgroundColor: Colors.transparent,
children: <Widget>[
SimpleDialogOption(
child: Text(
S.of(context).takeBack,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onTakeBackButtonPressed,
),
@ -496,6 +501,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
child: Text(
S.of(context).stepForward,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onStepForwardButtonPressed,
),
@ -506,6 +512,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
child: Text(
S.of(context).takeBackAll,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onTakeBackAllButtonPressed,
),
@ -516,6 +523,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
child: Text(
S.of(context).stepForwardAll,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onStepForwardAllButtonPressed,
),
@ -526,6 +534,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
child: Text(
S.of(context).moveList,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onMoveListButtonPressed,
),
@ -537,6 +546,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
child: Text(
S.of(context).moveNow,
style: AppTheme.simpleDialogOptionTextStyle,
textAlign: TextAlign.center,
),
onPressed: onMoveNowButtonPressed,
),
@ -581,26 +591,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
}
onStepForwardAllButtonPressed() async {
Navigator.of(context).pop();
if (mounted) {
showTip(S.of(context).takingBack);
}
if (isGoingToHistory) {
print("[TakeBack] Is taking back, ignore Take Back button press.");
return;
}
isGoingToHistory = true;
await Game.instance.position.stepForwardAll();
isGoingToHistory = false;
//Audios.playTone(Audios.placeSoundId);
if (mounted) {
showTip(S.of(context).takeBack + " " + S.of(context).done);
}
onGotoHistoryButtonsPressed(Game.instance.position.stepForwardAll());
}
onMoveListButtonPressed() {