From 310098b39dda1d236e64b24b106a6817eb07b4c9 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 1 Jun 2025 01:48:12 -0700 Subject: [PATCH] Alter updatetool to include the completed and total task count in output file --- lib/updateTool.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/updateTool.dart b/lib/updateTool.dart index aa02ec3..4a63e36 100644 --- a/lib/updateTool.dart +++ b/lib/updateTool.dart @@ -49,6 +49,9 @@ class _main extends State { Generation? currentGen; int maxTasks = 5; + int total = 0; + int completed = 0; + int state = 0; @override @@ -125,8 +128,12 @@ class _main extends State { var pokemon = Pokemon.values[iterNumber]; if (currentGen != pokemon.generation) { + sb.append("\n- Completed ${completed}/${total}\n"); + sb.append("\n# Generation ${pokemon.generation.name}\n\n"); currentGen = pokemon.generation; + total = 0; + completed = 0; } progress = index * 100 / Pokemon.values.length; @@ -156,6 +163,7 @@ class _main extends State { if (pokemon.locations.isNotEmpty && pokemon.dexEntries.isNotEmpty) { sb.append("- [x] ${pokemon.pokemonName}\n"); + completed++; } else if (pokemon.locations.isNotEmpty) { sb.append( "- [ ] ${pokemon.pokemonName} (MISSING DEX ENTRIES)\n", @@ -169,6 +177,7 @@ class _main extends State { sb.append("- [ ] ${pokemon.pokemonName} (OUT OF DATE DATA)\n"); } } + total++; index++; progress = progress / 100; // push it into a 0-1 range. state++; @@ -176,6 +185,8 @@ class _main extends State { setState(() {}); } else if (state - index == 6) { // Task - write file + sb.append("\n- Completed ${completed}/${total}\n"); + maxTasks += 3; statusMessage = "Saving to COMPLETED.md"; File complete = File("COMPLETED.md");