-Komplette view überarbeitet für Thunderstore mit mods suche, vorschau, markdown (readme) etc

todo: wenn neuer mod aufgerufen wird, soll die zurückfunktion deaktviert sein oder so das sie den mod mit aktualisiert zu dem der davor ausgewählt war (:
This commit is contained in:
tbS
2025-09-10 23:47:40 +02:00
parent aaf6e02862
commit 74a79c28ab
23 changed files with 1751 additions and 47 deletions

View File

@@ -132,20 +132,28 @@ public class ServerDashboardViewModel : ViewModelBase
get => _isLoading;
set => this.RaiseAndSetIfChanged(ref _isLoading, value);
}
private readonly MainWindowViewModel _main;
public ServerDashboardViewModel()
public ServerDashboardViewModel(MainWindowViewModel main)
{
_main = main;
InstallBepInExCommand = ReactiveCommand.Create(InstallBepInEx);
UpdateBepInExCommand = ReactiveCommand.Create(UpdateBepInEx);
UploadModCommand = ReactiveCommand.CreateFromTask(UploadMod);
InstallFromStoreCommand = ReactiveCommand.Create(InstallFromStore);
//InstallFromStoreCommand = ReactiveCommand.Create(InstallFromStore);
InstallFromStoreCommand = ReactiveCommand.Create(() =>
{
Debug.WriteLine("InstallFromStoreCommand");
_main.SwitchToStore();
});
SaveConfigCommand = ReactiveCommand.Create(SaveConfig);
RemoveModCommand = ReactiveCommand.Create<ModInfo,Task>(RemoveMod);
UpdateModCommand = ReactiveCommand.Create<ModInfo>(UpdateMod);
// DEBUG: harter Testtext – MUSS im Editor erscheinen
ConfigDocument.Text = "Bitte Mod Auswählen";
// SelectedModConfig Sync mit ConfigDocument text (:
@@ -167,11 +175,19 @@ public class ServerDashboardViewModel : ViewModelBase
//Mods.Add(new ModInfo { Name = "BetterUI", Version = "2.3.4", ConfigPath = "config/better_ui.cfg" });
// Start async Initialisierung
_ = InitializeAsync();
// _ = InitializeAsync();
//CheckBepInExStatus();
}
public void Init()
{
// Start async Initialisierung
_ = InitializeAsync();
ConfigDocument.Text = "Bitte Mod Auswählen";
}
private async Task InitializeAsync()
{
IsLoading = true;
@@ -714,7 +730,11 @@ public class ServerDashboardViewModel : ViewModelBase
}
private void InstallFromStore() { /* TODO */ }
private void InstallFromStore() {
}
private void SaveConfig() {
Debug.WriteLine(SelectedMod.ConfigPath);
FtpViewModel._ftpClient.UploadTextAsync(SelectedModConfig, SelectedMod.ConfigPath);