Skip to content

Commit 5b1b9ba

Browse files
committed
zipimporter
1 parent 48bad3d commit 5b1b9ba

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@
9393
</ul>
9494

9595
<h1>Updates</h1>
96+
<b>2024-09-24: v1.0.2</b>
97+
<p>
98+
<ul>
99+
<li>Small code/logic edits</li>
100+
<li>Updated About page layout & links</li>
101+
</ul>
102+
</p>
96103
<b>2024-03-02: v1.0.1</b>
97104
<p>
98105
<ul>

Unity-Zip-Importer/Assets/Minty Labs/ZipImporter/Editor/ZipImporter.cs

+60-22
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using UnityEngine;
99

1010
public class ZipImporter : EditorWindow {
11-
private const string Version = "1.0.1";
11+
private const string Version = "1.0.2";
1212
private const string LogPrefix = "[<color=#9fffe3>ZipArchive Importer</color>] ";
1313
private static readonly string ProjectUserAgent = $"ZipArchive Importer/{Version} Internal UnityWebRequest";
1414
private int _pageNumber;
@@ -63,6 +63,7 @@ private void OnGUI() {
6363
_pageNumber = 0;
6464
OnDestroy();
6565
}
66+
6667
GUI.backgroundColor = defaultBgColor;
6768
if (_pageNumber == 1)
6869
GUI.backgroundColor = new Color32(255, 255, 0, 170);
@@ -76,7 +77,7 @@ private void OnGUI() {
7677
EditorGUILayout.Separator();
7778
EditorGUILayout.Space();
7879

79-
#region Page 1 (0) - Main Menu
80+
#region Page 1 (0) - Main Menu
8081

8182
if (_pageNumber == 0) {
8283
if (!_activelyImporting) {
@@ -90,6 +91,7 @@ private void OnGUI() {
9091
Debug.Log("Importing Package Button Press");
9192
ImportWithGui();
9293
}
94+
9395
EditorGUILayout.Separator();
9496
EditorGUILayout.EndHorizontal();
9597

@@ -122,7 +124,7 @@ private void OnGUI() {
122124
window.UpdateGui(file.FullName, true);
123125
window.Show();
124126
}
125-
127+
126128
EditorGUILayout.EndHorizontal();
127129
EditorGUILayout.Space(20);
128130
*/
@@ -147,7 +149,7 @@ private void OnGUI() {
147149
GUI.backgroundColor = defaultBgColor;
148150
return;
149151
}
150-
152+
151153
EditorGUILayout.LabelField("<size=15><b>Information</b></size>");
152154
EditorGUILayout.HelpBox(" If \"Import\" is checked, the package will be imported\n" +
153155
" If \"Interactive\" is checked, the unity window with the package contents will show for each package", MessageType.Info);
@@ -194,9 +196,9 @@ private void OnGUI() {
194196
}
195197

196198
EditorGUILayout.EndHorizontal();
197-
199+
198200
EditorGUILayout.EndScrollView();
199-
201+
200202
EditorGUILayout.BeginHorizontal();
201203
GUI.backgroundColor = new Color32(0, 0, 255, 170);
202204
if (GUILayout.Button("Import", style: importBtn)) {
@@ -208,6 +210,7 @@ private void OnGUI() {
208210
var zipEntry = _zipArchive.Entries.Single(entry => entry.FullName == _zipContents[i]);
209211
_importQueue.Enqueue(() => OpenZip(zipEntry.FullName, flag, zipEntry));
210212
}
213+
211214
for (var i = 0; i < _zipContents.Count; i++) {
212215
var flag = _interactiveCheckBoxes[i];
213216
if (!_importingCheckBoxes[i] || flag) continue;
@@ -224,29 +227,38 @@ private void OnGUI() {
224227

225228
DoNextImport();
226229
}
230+
227231
return;
228232
}
229233

234+
#endregion
230235

231-
#endregion
232-
233-
#region Page 2 (1) - About
236+
#region Page 2 (1) - About
234237

235238
//if (_pageNumber == 1) return;
236239
EditorGUILayout.LabelField("<size=15><b>About</b></size>");
237240

238241
EditorGUILayout.LabelField($"<size=12><b>Version:</b> <color=#EECCE0>{Version}</color>{(_updateAvailable ? $" - <color=red>Update Available</color> - v{_newVersionString}" : "")}</size>");
239-
EditorGUILayout.BeginHorizontal();
240-
if (GUILayout.Button("Check For Update"))
241-
CheckForUpdate();
242242

243243
if (_updateAvailable) {
244+
EditorGUILayout.BeginHorizontal();
245+
GUI.enabled = false;
246+
if (GUILayout.Button("Check for Update")) { }
247+
GUI.enabled = true;
248+
EditorGUILayout.EndHorizontal();
249+
EditorGUILayout.BeginHorizontal();
244250
if (GUILayout.Button("Open Booth Page"))
245251
Application.OpenURL("https://mintylabs.booth.pm/items/5527952");
246-
if (GUILayout.Button("Open GitHub Releases Page"))
252+
if (GUILayout.Button("Open Gumroad Page"))
253+
Application.OpenURL("https://mintylabs.gumroad.com/l/ScreenshotUtility");
254+
if (GUILayout.Button("Open GitHub Page"))
247255
Application.OpenURL("https://github.com/Minty-Labs/Unity-Tools/releases");
248256
}
249-
257+
else {
258+
EditorGUILayout.BeginHorizontal();
259+
if (GUILayout.Button("Check for Update"))
260+
CheckForUpdate();
261+
}
250262
EditorGUILayout.EndHorizontal();
251263

252264
EditorGUILayout.Space(5);
@@ -255,18 +267,43 @@ private void OnGUI() {
255267
GUI.backgroundColor = new Color32(0, 255, 170, 255);
256268
if (GUILayout.Button("Minty Labs"))
257269
Application.OpenURL("https://mintylabs.dev/");
258-
GUI.backgroundColor = new Color32(252, 77, 80, 255);
259-
if (GUILayout.Button("Booth"))
260-
Application.OpenURL("https://mintylabs.booth.pm/");
261-
GUI.backgroundColor = new Color32(29, 155, 240, 255);
262-
if (GUILayout.Button("X (Twitter)"))
263-
Application.OpenURL("https://x.com/MintLiIy");
270+
264271
GUI.backgroundColor = new Color32(0, 0, 0, 255);
265272
if (GUILayout.Button("GitHub"))
266273
Application.OpenURL("https://github.com/MintLily");
274+
275+
GUI.backgroundColor = new Color32(29, 155, 240, 255);
276+
if (GUILayout.Button("X (Twitter)"))
277+
Application.OpenURL("https://x.com/MintLiIy");
278+
279+
EditorGUILayout.EndHorizontal();
280+
281+
EditorGUILayout.BeginHorizontal();
282+
283+
GUI.backgroundColor = new Color32(252, 77, 80, 255);
284+
if (GUILayout.Button("Booth"))
285+
Application.OpenURL("https://mintylabs.booth.pm/");
286+
287+
GUI.backgroundColor = new Color32(255, 144, 232, 255);
288+
if (GUILayout.Button("Gumroad"))
289+
Application.OpenURL("https://mintylabs.gumroad.com/");
290+
291+
GUI.backgroundColor = new Color32(12, 14, 29, 255);
292+
if (GUILayout.Button("Jinxxy"))
293+
Application.OpenURL("https://jinxxy.com/MintLily");
294+
295+
EditorGUILayout.EndHorizontal();
296+
297+
EditorGUILayout.BeginHorizontal();
298+
267299
GUI.backgroundColor = new Color32(0, 185, 254, 255);
268300
if (GUILayout.Button("Ko-fi (Donate)"))
269301
Application.OpenURL("https://ko-fi.com/MintLily");
302+
303+
GUI.backgroundColor = new Color32(241, 101, 82, 255);
304+
if (GUILayout.Button("Patreon (Donate)"))
305+
Application.OpenURL("https://www.patreon.com/MintLily");
306+
270307
EditorGUILayout.EndHorizontal();
271308

272309
EditorGUILayout.Space(10);
@@ -280,7 +317,7 @@ private void OnGUI() {
280317
EditorGUILayout.LabelField("Elly, Penny, Emily, Myrkur");
281318
EditorGUILayout.EndVertical();
282319

283-
#endregion
320+
#endregion
284321
}
285322

286323
private static void OpenZip(string name, bool interactive, ZipArchiveEntry archiveEntry) {
@@ -373,6 +410,7 @@ private void Import(bool interactive) {
373410
OpenZip(entry.FullName, interactive, entry));
374411
}
375412
}
413+
376414
break;
377415
case ".unitypackage":
378416
_activelyImporting = true;
@@ -383,7 +421,7 @@ private void Import(bool interactive) {
383421
}
384422
}
385423

386-
private void EventFailureMethod(string name, string msg) => ImportEndEvent(name);
424+
private void EventFailureMethod(string eventName, string msg) => ImportEndEvent(eventName);
387425

388426
private void ImportEndEvent(string nameOfPackage) {
389427
AssetDatabase.importPackageCompleted -= ImportEndEvent;

Unity-Zip-Importer/Remote/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.0.2

0 commit comments

Comments
 (0)