Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Jan 1, 2025
1 parent de2b170 commit f6c7501
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
49 changes: 28 additions & 21 deletions tarok/lib/game/game_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tarok/lib/game_log/game_log_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class _GameLogTabState extends State<GameLogTab> {
creation: stats.modified.millisecondsSinceEpoch,
));
}
files.sort((a, b) => a.creation.compareTo(b.creation));
files.sort((a, b) => -a.creation.compareTo(b.creation));
return files;
}

Expand Down Expand Up @@ -222,7 +222,7 @@ class _GameLogTabState extends State<GameLogTab> {
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);
}
Expand Down Expand Up @@ -330,7 +330,7 @@ class _GameLogTabState extends State<GameLogTab> {
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;
Expand Down
4 changes: 2 additions & 2 deletions tarok/lib/internationalization/languages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f6c7501

Please sign in to comment.