0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 08:30:44 -05:00
launcher/project/SPT.Launcher/Views/ModInfoView.axaml

105 lines
5.5 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:cc="using:SPT.Launcher.CustomControls"
xmlns:launcher="using:SPT.Launcher.Models.SPT"
xmlns:helpers="using:SPT.Launcher.Helpers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.Views.ModInfoView">
<Grid RowDefinitions="10, Auto, 10, Auto, 10, *, 10" ColumnDefinitions="10, 2*, 10, 2*, 10">
<!-- back button -->
<Button Content="&#x279C;" FontSize="25"
HorizontalAlignment="Right"
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"
Command="{Binding NavigateBack}"
Classes="link"
/>
<!-- Active Mods List Header -->
<Border Grid.Row="3" Grid.Column="1"
CornerRadius="5"
Background="{StaticResource SPT_Background_Dark}">
<StackPanel Spacing="2" Margin="10">
<!-- Active mods count and text -->
<Label VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16">
<Label.Content>
<MultiBinding StringFormat="{}{0}: {1}">
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="active_server_mods"/>
<Binding Path="ModsCollection.ActiveMods.Count"/>
</MultiBinding>
</Label.Content>
</Label>
<!-- Active mods info text -->
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=active_server_mods_info_text}"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="12"
TextWrapping="Wrap"
Foreground="{StaticResource SPT_Foreground_Light}"
/>
</StackPanel>
</Border>
<!-- Active Mods List -->
<ScrollViewer Grid.Row="5" Grid.Column="1">
<ItemsControl Items="{Binding ModsCollection.ActiveMods}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type launcher:SPTMod}">
<cc:ModInfoCard ModName="{Binding Name}"
Author="{Binding Author}"
Version="{Binding Version}"
IsInServer="{Binding InServer}"
IsInProfile="{Binding InProfile}"
ModUrl="{Binding Url}"
OpenUrlCommand="{Binding $parent[ItemsControl].DataContext.OpenUrlCommand}"
Margin="0 0 0 10" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- Inactive Mods List Header -->
<Border Grid.Row="3" Grid.Column="3"
CornerRadius="5"
Background="{StaticResource SPT_Background_Dark}">
<StackPanel Spacing="2" Margin="10">
<!-- Inactive mods count and text -->
<Label VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16">
<Label.Content>
<MultiBinding StringFormat="{}{0}: {1}">
<Binding Source="{x:Static helpers:LocalizationProvider.Instance}" Path="inactive_server_mods"/>
<Binding Path="ModsCollection.InactiveMods.Count"/>
</MultiBinding>
</Label.Content>
</Label>
<!-- Inactive mods info text -->
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=inactive_server_mods_info_text}"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="12"
TextWrapping="Wrap"
Foreground="{StaticResource SPT_Foreground_Light}"
/>
</StackPanel>
</Border>
<!-- Inactive Mods List -->
<ScrollViewer Grid.Row="5" Grid.Column="3" >
<ItemsControl Items="{Binding ModsCollection.InactiveMods}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type launcher:SPTMod}">
<cc:ModInfoCard ModName="{Binding Name}"
Author="{Binding Author}"
Version="{Binding Version}"
IsInServer="{Binding InServer}"
IsInProfile="{Binding InProfile}"
ModUrl="{Binding Url}"
OpenUrlCommand="{Binding $parent[ItemsControl].DataContext.OpenUrlCommand}"
Margin="0 0 0 10" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>