- Layout Verschiebung behoben bei Configeditor
- Config zuordnung überarbeitet -> keine vorhanden zeigt im editor dann hinweis an: Keine Config gefunden. Server bereits neu gestartet ? - Config Speichern behoben - Ladeanimationen hinzugefügt - Mod löschen funktion eingefügt -> Popup zur bestätigung ob gelöscht werden soll
This commit is contained in:
31
Valheim Dashboard/Views/ConfirmDialog.axaml
Normal file
31
Valheim Dashboard/Views/ConfirmDialog.axaml
Normal file
@@ -0,0 +1,31 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Valheim_Dashboard.Views.ConfirmDialog"
|
||||
Width="400" Height="200"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource Cfg.BgBrush}">
|
||||
|
||||
<StackPanel Margin="20" Spacing="20" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="MessageText"
|
||||
FontSize="20"
|
||||
Foreground="{DynamicResource Cfg.FgBrush}"
|
||||
TextWrapping="Wrap"
|
||||
TextAlignment="Center"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||
<Button x:Name="YesButton"
|
||||
Content="Ja"
|
||||
Width="100"
|
||||
Height="40"
|
||||
Background="Green"
|
||||
Foreground="White"/>
|
||||
<Button x:Name="NoButton"
|
||||
Content="Nein"
|
||||
Width="100"
|
||||
Height="40"
|
||||
Background="Red"
|
||||
Foreground="White"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
30
Valheim Dashboard/Views/ConfirmDialog.axaml.cs
Normal file
30
Valheim Dashboard/Views/ConfirmDialog.axaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Valheim_Dashboard.Views
|
||||
{
|
||||
public partial class ConfirmDialog : Window
|
||||
{
|
||||
private TaskCompletionSource<bool> _tcs = new();
|
||||
|
||||
public ConfirmDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
YesButton.Click += (_, __) => { _tcs.TrySetResult(true); Close(); };
|
||||
NoButton.Click += (_, __) => { _tcs.TrySetResult(false); Close(); };
|
||||
}
|
||||
|
||||
public void SetMessage(string message)
|
||||
{
|
||||
MessageText.Text = message;
|
||||
}
|
||||
|
||||
public Task<bool> ShowDialogAsync(Window parent)
|
||||
{
|
||||
base.ShowDialog(parent); // Fenster modal <20>ffnen
|
||||
return _tcs.Task;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,11 @@
|
||||
x:Class="Valheim_Dashboard.Views.ServerDashboardView"
|
||||
x:DataType="vm:ServerDashboardViewModel"
|
||||
xmlns:ae="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
|
||||
xmlns:icons="clr-namespace:Lucide.Avalonia;assembly=Lucide.Avalonia">
|
||||
xmlns:icons="clr-namespace:Lucide.Avalonia;assembly=Lucide.Avalonia"
|
||||
xmlns:li="using:LoadingIndicators.Avalonia">
|
||||
|
||||
|
||||
<Grid ColumnDefinitions="2*,3*">
|
||||
<Grid ColumnDefinitions="570,*">
|
||||
<!-- Linke Spalte -->
|
||||
<Grid Margin="20" RowDefinitions="Auto,*" RowSpacing="20">
|
||||
|
||||
@@ -25,7 +26,7 @@
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding BepInExStatus}" FontSize="20"/>
|
||||
<ProgressBar IsVisible="{Binding IsLoading}" />
|
||||
<li:LoadingIndicator IsActive="{Binding IsLoading}" IsVisible="{Binding IsLoading}" Mode="Arcs" SpeedRatio="0.8" Height="100" Width="100" />
|
||||
<Button Content="Installieren"
|
||||
Command="{Binding InstallBepInExCommand}"
|
||||
IsVisible="{Binding ShowInstallButton}"
|
||||
@@ -51,18 +52,19 @@
|
||||
<TextBlock Text="Mods" FontSize="28" FontWeight="Bold" Grid.Row="0"/>
|
||||
|
||||
<!-- ListBox füllt jetzt automatisch den Rest -->
|
||||
<StackPanel IsVisible="{Binding !IsModsLoading}">
|
||||
<ListBox ItemsSource="{Binding Mods}" SelectedItem="{Binding SelectedMod}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Margin="5">
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="5" VerticalAlignment="Center">
|
||||
<!-- Links: Name + Version -->
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="0,0,10,0"/>
|
||||
<TextBlock Text="{Binding Version}" Foreground="Gray"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Rechts: Icon-Buttons -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" DockPanel.Dock="Right">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<!-- Update nur wenn HasUpdate true -->
|
||||
<Button Command="{Binding $parent[UserControl].DataContext.UpdateModCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
@@ -70,10 +72,7 @@
|
||||
BorderThickness="0"
|
||||
ToolTip.Tip="Update verfügbar"
|
||||
IsVisible="{Binding HasUpdate}"
|
||||
HorizontalAlignment="Right"
|
||||
Content="{LucideIconContent ArrowUp}">
|
||||
|
||||
</Button>
|
||||
Content="{LucideIconContent ArrowUp}" />
|
||||
|
||||
<!-- Löschen -->
|
||||
<Button Command="{Binding $parent[UserControl].DataContext.RemoveModCommand}"
|
||||
@@ -81,15 +80,25 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ToolTip.Tip="Mod entfernen"
|
||||
HorizontalAlignment="Right"
|
||||
Content="{LucideIconContent Trash2}">
|
||||
|
||||
</Button>
|
||||
Content="{LucideIconContent Trash2}" />
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
<!-- Spinner -->
|
||||
<StackPanel IsVisible="{Binding IsModsLoading}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="10">
|
||||
<li:LoadingIndicator IsActive="True" Mode="Arcs" SpeedRatio="0.8" Height="100" Width="100" />
|
||||
<TextBlock Text="Mods werden geladen..."
|
||||
Foreground="Gray"
|
||||
FontSize="16"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Button Content="Mod hochladen" Command="{Binding UploadModCommand}" Height="80" VerticalContentAlignment="Center" HorizontalAlignment="Center" />
|
||||
@@ -105,8 +114,9 @@
|
||||
<ae:TextEditor
|
||||
Document="{Binding ConfigDocument}"
|
||||
ShowLineNumbers="True"
|
||||
FontFamily="Cascadia Code, Consolas, Menlo, monospace"
|
||||
FontSize="16"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
SyntaxHighlighting="CfgDark"
|
||||
Background="{DynamicResource Cfg.BgBrush}"
|
||||
|
||||
Reference in New Issue
Block a user