﻿<views:View x:TypeArguments="viewModels:LoadingViewModel"
            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:views="clr-namespace:Lumafly.Views"
            xmlns:viewModels="clr-namespace:Lumafly.ViewModels"
            xmlns:ext="clr-namespace:Lumafly.Extensions"
            xmlns:progRing="clr-namespace:AvaloniaProgressRing;assembly=AvaloniaProgressRing"
            xmlns:md="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia"
            xmlns:ctxt="clr-namespace:ColorTextBlock.Avalonia;assembly=ColorTextBlock.Avalonia"
            x:Class="Lumafly.Views.Pages.InfoView"
            x:CompileBindings="True"
            x:DataType="viewModels:InfoViewModel">
    <ScrollViewer>
        <StackPanel>
            <StackPanel>
                <TextBox
                    IsVisible="{Binding !AdditionalInfoVisible}"
                    BorderThickness="0"
                    IsReadOnly="True"
                    Text="{ext:Localize XAML_InfoBody}"
                    FontSize="16"
                    TextWrapping="Wrap"
                    HorizontalAlignment="Center"
                    Margin="20 0 20 40" />

                <md:MarkdownScrollViewer
                    IsVisible="{Binding AdditionalInfoVisible}"
                    Markdown="{Binding AdditionalInfo}"
                    HorizontalAlignment="Center"
                    Margin="25 0 20 0">
                    <md:MarkdownScrollViewer.Styles>
                        <Style Selector="ctxt|CTextBlock">
                            <Setter Property="FontSize" Value="16" />
                        </Style>
                    </md:MarkdownScrollViewer.Styles>
                </md:MarkdownScrollViewer>
            </StackPanel>
            <Image
                MaxHeight="360"
                HorizontalAlignment="Center"
                VerticalAlignment="Top"
                Opacity="0.75"
                Source="../../Assets/banner.png" />

            <StackPanel
                VerticalAlignment="Bottom">
                <Grid
                    RowDefinitions="Auto"
                    ColumnDefinitions="* Auto * Auto *">
                    <Button
                        Grid.Column="1"
                        IsEnabled="{Binding !IsLaunchingGame}"
                        Command="{Binding LaunchGame}"
                        CommandParameter="true">
                        <StackPanel Orientation="Horizontal">
                            <PathIcon
                                Width="20"
                                Height="20"
                                Data="{StaticResource play_regular}" />
                            <TextBlock
                                Text="{ext:Localize XAML_LaunchVanilla}"
                                Margin="10 0 0 0"
                                FontSize="16"
                                TextAlignment="Left"
                                VerticalAlignment="Center" />
                        </StackPanel>
                    </Button>
                    <Button
                        Grid.Column="3"
                        IsEnabled="{Binding !IsLaunchingGame}"
                        Command="{Binding LaunchGame}"
                        CommandParameter="false">
                        <StackPanel Orientation="Horizontal">
                            <PathIcon
                                Width="20"
                                Height="20"
                                Data="{StaticResource play_regular}" />
                            <TextBlock
                                Text="{ext:Localize XAML_LaunchModded}"
                                Margin="10 0 0 0"
                                FontSize="16"
                                TextAlignment="Left"
                                VerticalAlignment="Center" />
                        </StackPanel>
                    </Button>
                </Grid>
                <progRing:ProgressRing
                    IsVisible="{Binding IsLaunchingGame}"
                    Width="20"
                    Height="20"
                    IsActive="True"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Foreground="Ivory"
                    Margin="10,5" />
                <TextBlock
                    IsVisible="{Binding IsLaunchingGame}"
                    Text="{ext:Localize XAML_OpeningGame}"
                    TextAlignment="Center" />
            </StackPanel>

            <StackPanel
                Margin="60 40"
                MaxWidth="755">
                <TextBlock
                    Text="{ext:Localize XAML_InfoLinksHeader}"
                    FontSize="20"
                    FontWeight="Heavy"
                    HorizontalAlignment="Center"
                    Margin="0 0 0 10" />
                <ScrollViewer HorizontalScrollBarVisibility="Auto">
                    <StackPanel
                        Margin="20 0"
                        Orientation="Horizontal">
                        <StackPanel.Styles>
                            <Style Selector="Image, PathIcon, Svg">
                                <Setter Property="Height" Value="50" />
                                <Setter Property="Width" Value="50" />
                                <Setter Property="Margin" Value="10" />
                                <Setter Property="HorizontalAlignment" Value="Center" />
                            </Style>
                            <Style Selector="Button">
                                <Setter Property="MaxWidth" Value="200" />
                                <Setter Property="Margin" Value="10" />
                                <Setter Property="Command" Value="{Binding OpenLink}" />
                            </Style>
                            <Style Selector="TextBlock">
                                <Setter Property="Margin" Value="0 5 0 0" />
                                <Setter Property="FontSize" Value="14" />
                                <Setter Property="TextAlignment" Value="Center" />
                                <Setter Property="TextWrapping" Value="Wrap" />
                            </Style>
                        </StackPanel.Styles>
                        <Button
                            CommandParameter="https://themulhima.github.io/Scarab">
                            <StackPanel>
                                <Image Source="../../Assets/Lumafly.png" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkWebsite}" />
                            </StackPanel>
                        </Button>
                        <Button
                            CommandParameter="https://www.youtube.com/watch?v=z35cFvU0McQ">
                            <StackPanel>
                                <Image Source="../../Assets/youtube.png" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkTutorial}" />
                            </StackPanel>
                        </Button>
                        <Button
                            CommandParameter="https://github.com/TheMulhima/Lumafly#readme">
                            <StackPanel>
                                <PathIcon Data="{StaticResource book_information_regular}" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkReadme}" />
                            </StackPanel>
                        </Button>
                        <Button
                            CommandParameter="https://discord.gg/VDsg3HmWuB">
                            <StackPanel>
                                <PathIcon Data="{StaticResource discord}" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkDiscord}" />
                            </StackPanel>
                        </Button>
                        <Button
                            CommandParameter="https://github.com/TheMulhima/Lumafly">
                            <StackPanel>
                                <PathIcon Data="{StaticResource github}" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkGithub}" />
                            </StackPanel>
                        </Button>
                        <Button
                            CommandParameter="https://prashantmohta.github.io/ModdingDocs">
                            <StackPanel>
                                <PathIcon Data="{StaticResource wrench_regular}" />
                                <TextBlock Text="{ext:Localize XAML_InfoLinkModdingDocs}" />
                            </StackPanel>
                        </Button>
                    </StackPanel>
                </ScrollViewer>
            </StackPanel>
            <Panel Height="20" /> <!-- Bottom Spacer -->
        </StackPanel>
    </ScrollViewer>
</views:View>