-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug: if character last in list, conditions does not expire on nex…
…t round pressed
- Loading branch information
1 parent
5477ed9
commit da85d38
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[1mdiff --git a/frosthaven_assistant/lib/Resource/commands/next_round_command.dart b/frosthaven_assistant/lib/Resource/commands/next_round_command.dart[m | ||
[1mindex 5a52bd7..40deba5 100644[m | ||
[1m--- a/frosthaven_assistant/lib/Resource/commands/next_round_command.dart[m | ||
[1m+++ b/frosthaven_assistant/lib/Resource/commands/next_round_command.dart[m | ||
[36m@@ -23,7 +23,6 @@[m [mclass NextRoundCommand extends Command {[m | ||
GameMethods.shuffleDecksIfNeeded();[m | ||
GameMethods.updateElements();[m | ||
GameMethods.setRoundState(RoundState.chooseInitiative);[m | ||
[31m- GameMethods.sortCharactersFirst();[m | ||
if(_gameState.currentList.last.turnState != TurnsState.done) {[m | ||
GameMethods.setTurnDone(_gameState.currentList.length - 1);[m | ||
}[m | ||
[36m@@ -31,6 +30,7 @@[m [mclass NextRoundCommand extends Command {[m | ||
GameMethods.setTurnDone(_gameState.currentList.length - 1);[m | ||
}[m | ||
GameMethods.clearTurnState(false);[m | ||
[32m+[m[32m GameMethods.sortCharactersFirst();[m | ||
[m | ||
_gameState.toastMessage.value = "";[m | ||
for(var rule in _gameState.scenarioSpecialRules) {[m | ||
[1mdiff --git a/frosthaven_assistant/lib/Resource/game_methods.dart b/frosthaven_assistant/lib/Resource/game_methods.dart[m | ||
[1mindex 70a3991..a95541c 100644[m | ||
[1m--- a/frosthaven_assistant/lib/Resource/game_methods.dart[m | ||
[1m+++ b/frosthaven_assistant/lib/Resource/game_methods.dart[m | ||
[36m@@ -555,7 +555,7 @@[m [mclass GameMethods {[m | ||
}[m | ||
}[m | ||
[m | ||
[31m- static void setTurnDone(int index) {[m | ||
[32m+[m[32m static void setTurnDone(int index) {[m[41m [m | ||
for (int i = 0; i < index; i++) {[m | ||
if(_gameState.currentList[i].turnState != TurnsState.done) {[m | ||
_gameState.currentList[i].turnState = TurnsState.done;[m | ||
[1mdiff --git a/frosthaven_assistant/lib/main_state.dart b/frosthaven_assistant/lib/main_state.dart[m | ||
[1mindex af5b7a9..c48e2a7 100644[m | ||
[1m--- a/frosthaven_assistant/lib/main_state.dart[m | ||
[1m+++ b/frosthaven_assistant/lib/main_state.dart[m | ||
[36m@@ -36,6 +36,7 @@[m [mclass MainState extends State<MyHomePage>[m | ||
switch (state) {[m | ||
case AppLifecycleState.resumed:[m | ||
print("app in resumed");[m | ||
[32m+[m[32m rebuildAllChildren(context); //might be a bit performance heavy[m | ||
//TODO: reconnect to last known if disconnected, and get latest state if still connected.[m | ||
[m | ||
break;[m |