From f6c750172aa019537f0f600539b247c5e95c596e Mon Sep 17 00:00:00 2001 From: mytja Date: Wed, 1 Jan 2025 01:23:13 +0100 Subject: [PATCH] minor bug fixes --- tarok/lib/game/game_controller.dart | 49 +++++++++++-------- tarok/lib/game_log/game_log_tab.dart | 6 +-- tarok/lib/internationalization/languages.dart | 4 +- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/tarok/lib/game/game_controller.dart b/tarok/lib/game/game_controller.dart index fc79251..f5b9e44 100644 --- a/tarok/lib/game/game_controller.dart +++ b/tarok/lib/game/game_controller.dart @@ -2486,7 +2486,7 @@ class GameController extends GetxController { isPlaying: u.playing || u.secretlyPlaying, userType: u.botType == "NAB" ? 0 : 1, userCards: [], - action: stockskisContext!.stihiCount, + action: stockskisContext!.stihi.length - 1, card: analysis.cardPicks.card.asset, additionalData: [], actionTime: DateTime.now().millisecondsSinceEpoch, @@ -2500,7 +2500,7 @@ class GameController extends GetxController { isPlaying: u.playing || u.secretlyPlaying, userType: u.botType == "NAB" ? 0 : 1, userCards: u.cards.map((e) => e.card.asset).toList(), - action: stockskisContext!.stihiCount + 1, + action: stockskisContext!.stihi.length, card: "", additionalData: [], actionTime: DateTime.now().millisecondsSinceEpoch, @@ -3091,7 +3091,8 @@ class GameController extends GetxController { child: Container( decoration: BoxDecoration( border: analysis != null && - analysis.cardPicks.card.asset == e.asset + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD ? Border.all( width: 10.0, color: Colors.red, @@ -3141,7 +3142,8 @@ class GameController extends GetxController { child: Container( decoration: BoxDecoration( border: analysis != null && - analysis.cardPicks.card.asset == e.asset + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD ? Border.all( width: 10.0, color: Colors.red, @@ -3215,13 +3217,14 @@ class GameController extends GetxController { turns: stihBoolValues[3] != true ? 0 : e.angle, child: Container( decoration: BoxDecoration( - border: - analysis != null && analysis.cardPicks.card.asset == e.asset - ? Border.all( - width: 10.0, - color: Colors.red, - ) - : null, + border: analysis != null && + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD + ? Border.all( + width: 10.0, + color: Colors.red, + ) + : null, borderRadius: radius, ), child: Stack( @@ -3286,7 +3289,8 @@ class GameController extends GetxController { child: Container( decoration: BoxDecoration( border: analysis != null && - analysis.cardPicks.card.asset == e.asset + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD ? Border.all( width: 10.0, color: Colors.red, @@ -3332,7 +3336,8 @@ class GameController extends GetxController { child: Container( decoration: BoxDecoration( border: analysis != null && - analysis.cardPicks.card.asset == e.asset + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD ? Border.all( width: 10.0, color: Colors.red, @@ -3378,7 +3383,8 @@ class GameController extends GetxController { child: Container( decoration: BoxDecoration( border: analysis != null && - analysis.cardPicks.card.asset == e.asset + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD ? Border.all( width: 10.0, color: Colors.red, @@ -3452,13 +3458,14 @@ class GameController extends GetxController { turns: stihBoolValues[3] != true ? 0 : e.angle, child: Container( decoration: BoxDecoration( - border: - analysis != null && analysis.cardPicks.card.asset == e.asset - ? Border.all( - width: 10.0, - color: Colors.red, - ) - : null, + border: analysis != null && + analysis.cardPicks.card.asset == e.asset && + SHOW_MOST_POWERFUL_CARD + ? Border.all( + width: 10.0, + color: Colors.red, + ) + : null, borderRadius: radius, ), child: Stack( diff --git a/tarok/lib/game_log/game_log_tab.dart b/tarok/lib/game_log/game_log_tab.dart index 45a2610..8d49fe7 100644 --- a/tarok/lib/game_log/game_log_tab.dart +++ b/tarok/lib/game_log/game_log_tab.dart @@ -58,7 +58,7 @@ class _GameLogTabState extends State { creation: stats.modified.millisecondsSinceEpoch, )); } - files.sort((a, b) => a.creation.compareTo(b.creation)); + files.sort((a, b) => -a.creation.compareTo(b.creation)); return files; } @@ -222,7 +222,7 @@ class _GameLogTabState extends State { finalName = "${'predicted'.tr}$predictionName"; } else { finalName = - "${'kontra_predicted'.tr}$predictionName (${2 << int.parse(d)})"; + "${'kontra_predicted'.tr}$predictionName (${2 << (int.parse(d) - 1)})"; } finalNames.add(finalName); } @@ -330,7 +330,7 @@ class _GameLogTabState extends State { ListTile( leading: const Icon(Icons.games), title: Text('game_number'.trParams({ - "gameNumber": i.toString(), + "gameNumber": (snapshot.data.length - i).toString(), })), onTap: () async { selectedGame = file.path; diff --git a/tarok/lib/internationalization/languages.dart b/tarok/lib/internationalization/languages.dart index 8a109e3..1e954da 100644 --- a/tarok/lib/internationalization/languages.dart +++ b/tarok/lib/internationalization/languages.dart @@ -1535,8 +1535,8 @@ class Messages extends Translations { "show_most_powerful_card_desc": "Označi trenutno najbolj močno karto v rundi z rdečo.", "game_number": "Igra #@gameNumber", - "game_log_beta": "Zgodovina igre (beta)", - "game_log": "Zgodovina igre", + "game_log_beta": "Zgodovina iger (beta)", + "game_log": "Zgodovina iger", "game_ended": "Igra se je končala", "game_ended_subtitle": "Sistem je končal igro.", "game_started": "Igra se je začela",