Skip to content

Commit 7b5d5f9

Browse files
committed
Reimplemented Other Platforms
1 parent 2e94f0f commit 7b5d5f9

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

34.9 KB
Binary file not shown.
10.7 KB
Binary file not shown.

LevelImposter/Shop/Components/MapBanner.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.IO;
34
using Il2CppInterop.Runtime.Attributes;
45
using Il2CppInterop.Runtime.InteropTypes.Fields;
@@ -7,6 +8,7 @@
78
using LevelImposter.FileIO;
89
using LevelImposter.Lobby;
910
using LevelImposter.Networking.API;
11+
using LevelImposter.Shop.Transitions;
1012
using TMPro;
1113
using UnityEngine;
1214

@@ -40,7 +42,15 @@ public void Awake()
4042
}
4143

4244
private void OnRandomClick() => randomOverlay.Value.Open();
43-
private void OnExternalClick() => Application.OpenURL($"https://levelimposter.net/#/map/{_currentMap?.id}");
45+
46+
private void OnExternalClick()
47+
{
48+
Process.Start(new ProcessStartInfo
49+
{
50+
FileName = $"https://levelimposter.net/#/map/{_currentMap?.id}",
51+
UseShellExecute = true
52+
});
53+
}
4454
private void OnPlayClick()
4555
{
4656
// Validate current map

LevelImposter/Shop/Components/ShopManager.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using LevelImposter.DB;
1010
using LevelImposter.FileIO;
1111
using LevelImposter.Networking.API;
12+
using LevelImposter.Shop.Transitions;
1213
using TMPro;
1314
using UnityEngine;
1415

@@ -82,8 +83,11 @@ public void OnDestroy()
8283
/// </summary>
8384
private static void OpenMapsFolder()
8485
{
85-
// TODO: Check if the current platform is supported (windows, linux, etc.)
86-
Process.Start("explorer.exe", MapFileAPI.GetDirectory());
86+
Process.Start(new ProcessStartInfo
87+
{
88+
FileName = MapFileAPI.GetDirectory(),
89+
UseShellExecute = true
90+
});
8791
}
8892

8993
/// <summary>
@@ -205,11 +209,23 @@ private void SetMaps(LIMetadata[] maps)
205209
mapBannerGrid.Value.DestroyAll();
206210

207211
// Add New Banners
212+
var delay = 0.0f;
208213
foreach (var map in maps)
209214
{
210215
// Instantiate Map Banner
211216
var mapBanner = Instantiate(mapBannerPrefab.Value);
212217
mapBanner.SetMap(map);
218+
219+
// Animate In
220+
MatOpacityTransition.Run(new TransitionParams<float>
221+
{
222+
TargetObject = mapBanner.gameObject,
223+
FromValue = 0,
224+
ToValue = 1,
225+
StartDelay = delay,
226+
Duration = 0.1f
227+
});
228+
delay += 0.05f;
213229

214230
// Add to Grid
215231
mapBannerGrid.Value.AddTransform(mapBanner.transform);

0 commit comments

Comments
 (0)