jp.keijiro.klutter-tools 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.attestation.p7m CHANGED
Binary file
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.6.0] - 2026-01-25
9
+
10
+ ### Added
11
+
12
+ - Added a Download All button to the Downloader tool.
13
+
14
+
8
15
  ## [2.5.1] - 2026-01-21
9
16
 
10
17
  ### Fixed
@@ -0,0 +1,24 @@
1
+ using System;
2
+ using UnityEngine;
3
+
4
+ namespace KlutterTools.Downloader {
5
+
6
+ public static class AwaitableExtensions
7
+ {
8
+ public static async void Forget(this Awaitable awaitable)
9
+ {
10
+ try
11
+ {
12
+ await awaitable;
13
+ }
14
+ catch (OperationCanceledException)
15
+ {
16
+ }
17
+ catch (Exception e)
18
+ {
19
+ Debug.LogException(e);
20
+ }
21
+ }
22
+ }
23
+
24
+ } // namespace KlutterTools.Downloader
@@ -0,0 +1,2 @@
1
+ fileFormatVersion: 2
2
+ guid: 3ed4aca600679449e9dee4e2b305f520
@@ -32,9 +32,35 @@ sealed class DownloaderWindow : EditorWindow
32
32
  list.bindItem = BindItem;
33
33
  list.itemsSource = GlobalManifest.Instance.FileEntries;
34
34
 
35
+ // Download-all button setup
36
+ var button = doc.Q<Button>("download-all-button");
37
+ button.clicked += () => DownloadAllAsync(list, button).Forget();
38
+
35
39
  rootVisualElement.Add(doc);
36
40
  }
37
41
 
42
+ async Awaitable DownloadAllAsync(ListView list, Button button)
43
+ {
44
+ button.enabledSelf = false;
45
+ button.text = "Downloading...";
46
+ try
47
+ {
48
+ foreach (var entry in GlobalManifest.Instance.FileEntries)
49
+ {
50
+ if (entry.CurrentState != FileState.Missing) continue;
51
+ var download = entry.DownloadAsync();
52
+ list.RefreshItems(); // To disable download button
53
+ await download;
54
+ }
55
+ list.RefreshItems();
56
+ AssetDatabase.Refresh();
57
+ }
58
+ finally
59
+ {
60
+ button.text = "Done";
61
+ }
62
+ }
63
+
38
64
  // List view item binding
39
65
  void BindItem(VisualElement element, int index)
40
66
  {
@@ -2,5 +2,6 @@
2
2
  <ui:VisualElement name="root-container" style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px;">
3
3
  <ui:Label text="Some files are missing:" name="caption-label" style="margin-bottom: 8px; white-space: normal;"/>
4
4
  <ui:ListView item-template="project://database/Packages/jp.keijiro.klutter-tools/Editor/Downloader/FileEntry.uxml?fileID=9197481963319205126&amp;guid=e5fb5605902c247d8b81f9a365e2b6e4&amp;type=3#FileEntry" binding-source-selection-mode="AutoAssign" name="entry-list"/>
5
+ <ui:Button name="download-all-button" text="Download All" class="toolbar-button" />
5
6
  </ui:VisualElement>
6
7
  </ui:UXML>
@@ -1,6 +1,5 @@
1
1
  using System;
2
2
  using System.IO;
3
- using System.Threading.Tasks;
4
3
  using Unity.Properties;
5
4
  using UnityEngine;
6
5
  using UnityEngine.Networking;
@@ -53,7 +52,7 @@ public sealed class FileEntry
53
52
  }
54
53
 
55
54
  // Asynchronous file download method
56
- public async Task<bool> DownloadAsync()
55
+ public async Awaitable<bool> DownloadAsync()
57
56
  {
58
57
  var destPath = DestinationPath;
59
58
  var tempPath = TemporaryPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jp.keijiro.klutter-tools",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "displayName": "Klutter Tools",
5
5
  "description": "Miscellaneous editor tools.",
6
6
  "unity": "6000.0",
@@ -11,11 +11,11 @@
11
11
  "licensesUrl": "https://github.com/keijiro/KlutterTools/blob/main/LICENSE",
12
12
  "license": "Unlicense",
13
13
  "_upm": {
14
- "changelog": "<b>Fixed</b><br>- Adjusted Downloader launch delay to be applied when constructing the launcher.<br>- Avoided setting the Downloader visible flag when the window is not shown."
14
+ "changelog": "<b>Added</b><br>- Added a Download All button to the Downloader tool."
15
15
  },
16
16
  "repository": {
17
17
  "url": "git@github.com:keijiro/KlutterTools.git",
18
18
  "type": "git",
19
- "revision": "9afabac843d781841341be05c6421c499ea29a5c"
19
+ "revision": "62e7014667eb3ad15c8e68a744528e419ceee5d5"
20
20
  }
21
21
  }