- BepInEx Installation schneller gemach

- BepInEx Installation Progress Bar hinzugefügt um fortschritt anzuzeigen
-BepInEx Leere ordner werden jetzt direkt mit erstellt, falls der user selber prüfen will oder so damit er sie sieht. Also 1zu1 die ZIP
-Mods werden jetzt vom ftp server gelesen mit version und config suche. Plugin funktion fehlt dafür nur
- Text Editor für Config von Simple zu wirklichen Editor mit highlights wie notepad++ geändert. funktioniert aber noch nicht
This commit is contained in:
tbS
2025-08-27 19:19:23 +02:00
parent 2c7d442441
commit cf6bd3765f
9 changed files with 497 additions and 60 deletions

View File

@@ -3,11 +3,12 @@
xmlns:vm="using:Valheim_Dashboard.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="1280" d:DesignHeight="800"
mc:Ignorable="d" d:DesignWidth="1424" d:DesignHeight="714"
x:Class="Valheim_Dashboard.Views.MainWindow"
x:DataType="vm:MainWindowViewModel" CanResize="false"
Icon="/Assets/avalonia-logo.ico"
Title="Valheim_Dashboard">
Title="Valheim_Dashboard"
>
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,

View File

@@ -1,4 +1,5 @@
using Avalonia.Controls;
using System.Diagnostics;
using Valheim_Dashboard.ViewModels;
namespace Valheim_Dashboard.Views;
@@ -8,6 +9,13 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
// Loggen, sobald das Fenster ge<67>ffnet wurde (Layout fertig)
this.Opened += (_, __) =>
{
Debug.WriteLine($"Window size after open: {Bounds.Width} x {Bounds.Height}");
};
var locator = new ViewModelLocator();
var mainVm = new MainWindowViewModel(locator);
DataContext = mainVm;

View File

@@ -4,9 +4,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Valheim_Dashboard.ViewModels"
mc:Ignorable="d" d:DesignWidth="1280" d:DesignHeight="800"
mc:Ignorable="d" d:DesignWidth="1424" d:DesignHeight="714"
x:Class="Valheim_Dashboard.Views.ServerDashboardView"
x:DataType="vm:ServerDashboardViewModel">
x:DataType="vm:ServerDashboardViewModel"
xmlns:ae="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit">
<Grid ColumnDefinitions="2*,3*">
@@ -14,11 +15,13 @@
<StackPanel Margin="20" Spacing="20">
<!-- BepInEx Status -->
<Border BorderBrush="Gray" BorderThickness="2" CornerRadius="12" Padding="20">
<StackPanel Spacing="10" Height="150">
<StackPanel Spacing="10" Height="120">
<TextBlock Text="BepInEx Status" FontSize="28" FontWeight="Bold"/>
<TextBlock Text="{Binding BepInExStatus}" FontSize="20"/>
<ProgressBar IsVisible="{Binding IsLoading}" />
<Button Content="Installieren"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Command="{Binding InstallBepInExCommand}"
IsVisible="{Binding ShowInstallButton}"
Height="80"/>
@@ -26,6 +29,8 @@
Command="{Binding UpdateBepInExCommand}"
IsVisible="{Binding ShowUpdateButton}"
Height="80"/>
<ProgressBar Minimum="0" Maximum="100" Value="{Binding ProgressValue}" IsVisible="{Binding IsProgress}" Height="20"/>
<TextBlock Text="{Binding ProgressText}" Margin="0,5,0,0" IsVisible="{Binding IsProgress}"/>
</StackPanel>
</Border>
@@ -33,7 +38,7 @@
<Border BorderBrush="Gray" BorderThickness="2" CornerRadius="12" Padding="20">
<StackPanel Height="450">
<TextBlock Text="Mods" FontSize="28" FontWeight="Bold"/>
<ListBox ItemsSource="{Binding Mods}" SelectedItem="{Binding SelectedMod}" Height="380">
<ListBox ItemsSource="{Binding Mods}" SelectedItem="{Binding SelectedMod}" Height="330">
<ListBox.ItemTemplate>
<DataTemplate>
@@ -45,7 +50,7 @@
</ListBox.ItemTemplate>
</ListBox>
<Grid>
<Grid Margin="0,20,0,0">
<Button Content="Mod hochladen" Command="{Binding UploadModCommand}" Height="80" HorizontalAlignment="Left"/>
<Button Content="Aus Store installieren" Command="{Binding InstallFromStoreCommand}" Height="80" HorizontalAlignment="Right"/>
@@ -57,7 +62,19 @@
<!-- Rechte Spalte (Config Editor) -->
<StackPanel Grid.Column="1" Margin="20" Spacing="20">
<TextBlock Text="{Binding SelectedMod.Name}" FontSize="28" FontWeight="Bold"/>
<TextBox Text="{Binding SelectedModConfig}" AcceptsReturn="True" FontSize="20" Height="550"/>
<ae:TextEditor
Document="{Binding ConfigDocument}"
x:Name="MyEditorName"
IsVisible="True"
BorderBrush="Black"
BorderThickness="20"
ShowLineNumbers="True"
Background="Red"
Foreground="Yellow"
FontFamily="Cascadia Code, Consolas, Menlo, monospace"
FontSize="20"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" Height="520" />
<Grid>
<Button Content="Speichern" Command="{Binding SaveConfigCommand}" Height="80" HorizontalAlignment="Left"/>
<Button Content="Mod entfernen" Command="{Binding RemoveModCommand}" Height="80" Background="Red" HorizontalAlignment="Right"/>

View File

@@ -1,6 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using System.Diagnostics;
using Valheim_Dashboard.ViewModels;
namespace Valheim_Dashboard.Views;
@@ -10,5 +11,10 @@ public partial class ServerDashboardView : UserControl
public ServerDashboardView()
{
InitializeComponent();
this.AttachedToVisualTree += (_, __) =>
{
var te = this.FindControl<AvaloniaEdit.TextEditor>("MyEditorName");
Debug.WriteLine("TE Document text = " + te?.Document?.Text?.Length);
};
}
}