Skip to content

Commit

Permalink
razni popravki na frontendu
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Jan 21, 2024
1 parent e1494a7 commit 579c865
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
19 changes: 14 additions & 5 deletions tarok/lib/game/game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -538,17 +538,26 @@ class Game extends StatelessWidget {
"talon": controller.talonSelected.value
.toString()
})),
const SizedBox(
height: 10,
),
ElevatedButton(
style: ElevatedButton.styleFrom(
textStyle: const TextStyle(
fontSize: 18,
),
),
onPressed: () {
controller.validCards();
},
child: Text("reevaluate_cards".tr),
),
const SizedBox(
height: 5,
),
ElevatedButton(
onPressed: () {
controller.socket.close();
controller.connect(controller.gameId);
controller.listen();
},
child: Text("reset_websocket".tr),
)
]),
if (!controller.bots)
ListView(children: [
Expand Down
10 changes: 9 additions & 1 deletion tarok/lib/game/game_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class GameController extends GetxController {

var tournamentStatistics = Rxn<Messages.TournamentStatistics>();

late final WebSocket socket;
late WebSocket socket;

/*
INIT FUNCTIONS
Expand Down Expand Up @@ -1159,6 +1159,14 @@ class GameController extends GetxController {
}
}

if (msg.hasUserList()) {
// rejoin, izbrišemo vse karte za vsak slučaj
cards.value = [];
for (int i = 0; i < userWidgets.length; i++) {
userWidgets[i].points = [];
}
}

resetPremoves();
premovedCard.value = null;
cardStih.value = [];
Expand Down
3 changes: 3 additions & 0 deletions tarok/lib/internationalization/languages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ class Messages extends Translations {
"counterclockwise_gameplay": "Counterclockwise game",
"counterclockwise_gameplay_desc":
"The game will be running counterclockwise. You have to restart the game or leave it to apply this change.",
"reset_websocket": "Reset the WebSocket connection",
},
"fr_FR": {
"login": "Connexion",
Expand Down Expand Up @@ -918,6 +919,7 @@ class Messages extends Translations {
"counterclockwise_gameplay": "Counterclockwise game",
"counterclockwise_gameplay_desc":
"The game will be running counterclockwise. You have to restart the game or leave it to apply this change.",
"reset_websocket": "Reset the WebSocket connection",
},
"sl_SI": {
"login": "Prijava",
Expand Down Expand Up @@ -1362,6 +1364,7 @@ class Messages extends Translations {
"counterclockwise_gameplay": "Igra v nasprotni smeri urinega kazalca",
"counterclockwise_gameplay_desc":
"Igra bo potekala v nasprotni smeri urinega kazalca. Ko to vključite, morate zapustiti igro.",
"reset_websocket": "Resetiraj WebSocket povezavo",
}
};
}

0 comments on commit 579c865

Please sign in to comment.