- tweak: now decompiler work fine
This commit is contained in:
@@ -5,7 +5,7 @@ using Nebula.Launcher.ViewModels.Pages;
|
||||
namespace Nebula.Launcher.ViewModels.ContentView;
|
||||
public abstract class ContentViewBase : ViewModelBase, IDisposable
|
||||
{
|
||||
public virtual void InitialiseWithData(ContentPath path, Stream stream)
|
||||
public virtual void InitialiseWithData(ContentPath path, Stream stream, ContentEntry contentEntry)
|
||||
{
|
||||
}
|
||||
public virtual void Dispose()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using Nebula.Launcher.Services;
|
||||
using Nebula.Launcher.ViewModels.Pages;
|
||||
using Nebula.Shared.Utils;
|
||||
|
||||
namespace Nebula.Launcher.ViewModels.ContentView;
|
||||
|
||||
@@ -9,9 +10,14 @@ public sealed partial class DecompilerContentView: ContentViewBase
|
||||
{
|
||||
[GenerateProperty] private DecompilerService decompilerService {get;}
|
||||
|
||||
public override void InitialiseWithData(ContentPath path, Stream stream)
|
||||
public override void InitialiseWithData(ContentPath path, Stream stream, ContentEntry contentEntry)
|
||||
{
|
||||
base.InitialiseWithData(path, stream, contentEntry);
|
||||
decompilerService.OpenServerDecompiler(contentEntry.ServerName.ToRobustUrl());
|
||||
}
|
||||
|
||||
private void unpackContent(Stream stream)
|
||||
{
|
||||
base.InitialiseWithData(path, stream);
|
||||
var myTempFile = Path.Combine(Path.GetTempPath(), "tempie.dll");
|
||||
|
||||
var sw = new FileStream(myTempFile, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||
|
||||
@@ -70,7 +70,8 @@ public sealed partial class ContentBrowserViewModel : ViewModelBase , IViewModel
|
||||
|
||||
if(TryGetContentViewer(ext, out var contentViewBase)){
|
||||
DebugService.Debug($"Opening custom context:{item.Value.Path}");
|
||||
contentViewBase.InitialiseWithData(value.GetPath(), stream);
|
||||
contentViewBase.InitialiseWithData(value.GetPath(), stream, value);
|
||||
stream.Dispose();
|
||||
ContentView = contentViewBase;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user