0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 06:50:43 -05:00

84 lines
3.7 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"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:helpers="using:SPT.Launcher.Helpers"
x:Class="SPT.Launcher.CustomControls.ModInfoCard">
<Border Classes="card" HorizontalAlignment="Stretch">
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,AUTO,10"
Background="{DynamicResource BackgroundBrush}"
Margin="2"
>
<!-- Icon stack -->
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="1"
VerticalAlignment="Center"
Orientation="Horizontal" Spacing="5"
>
<!-- Server Icon -->
<Path Data="{StaticResource Server}" Fill="{DynamicResource AltAccentBrush}"
IsVisible="{Binding IsInServer, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Profile Icon -->
<Path Data="{StaticResource Profile}" Fill="{DynamicResource AltAccentBrush}"
IsVisible="{Binding IsInProfile, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Info Icon -->
<Canvas>
<Rectangle ToolTip.Tip="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=mod_not_in_server_warning}" Fill="Transparent" Height="20" Width="20"/>
<Path Data="{StaticResource Info}" Fill="{DynamicResource AccentBrush}"
ToolTip.Tip="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=mod_not_in_server_warning}"
>
<Path.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="IsInProfile" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
<Binding Path="!IsInServer" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
</MultiBinding>
</Path.IsVisible>
</Path>
</Canvas>
</StackPanel>
<!-- Open mod url -->
<Button Grid.Row="1" Grid.Column="3" Classes="link"
IsVisible="{Binding ModUrl,
RelativeSource={RelativeSource AncestorType=UserControl},
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Command="{Binding OpenUrlCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter="{Binding ModUrl, RelativeSource={RelativeSource AncestorType=UserControl}}"
>
<StackPanel Orientation="Horizontal">
<Label Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=open_link}"/>
<Path Data="{StaticResource Open}" Fill="{DynamicResource AccentBrush}"
IsVisible="{Binding IsInProfile, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
</StackPanel>
</Button>
<!-- Mod Name -->
<Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
Content="{Binding ModName, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Author Text -->
<Label Grid.Row="3" Grid.Column="1" FontSize="12" Foreground="{DynamicResource AltAccentBrush}"
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=author}"
/>
<!-- Mod Author -->
<Label Grid.Row="3" Grid.Column="2" FontSize="12" HorizontalAlignment="Left"
Content="{Binding Author, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<!-- Mod Version -->
<Label Grid.Row="3" Grid.Column="3" FontSize="12"
Content="{Binding Version, RelativeSource={RelativeSource AncestorType=UserControl}}"
Classes="acc"
/>
</Grid>
</Border>
</UserControl>