mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-11 15:24:02 +08:00
225 lines
11 KiB
XML
225 lines
11 KiB
XML
<Window x:Class="BetterGenshinImpact.View.MaskWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
xmlns:viewModel="clr-namespace:BetterGenshinImpact.ViewModel"
|
|
Title="MaskWindow"
|
|
Width="500"
|
|
Height="800"
|
|
AllowsTransparency="True"
|
|
FontFamily="{DynamicResource TextThemeFontFamily}"
|
|
ShowInTaskbar="False"
|
|
Topmost="True"
|
|
WindowStyle="None">
|
|
<Window.DataContext>
|
|
<viewModel:MaskWindowViewModel />
|
|
</Window.DataContext>
|
|
<b:Interaction.Triggers>
|
|
<b:EventTrigger EventName="Loaded">
|
|
<b:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding}" />
|
|
</b:EventTrigger>
|
|
</b:Interaction.Triggers>
|
|
|
|
<Window.Background>
|
|
<SolidColorBrush Opacity="0" Color="#FFB0B0B0" />
|
|
</Window.Background>
|
|
<Window.Style>
|
|
<Style TargetType="Window">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Window">
|
|
<ContentPresenter />
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Window.Style>
|
|
|
|
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="/View/Controls/Draggable/DraggableResizableItem.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
|
|
<AdornerDecorator ClipToBounds="True">
|
|
<Canvas x:Name="WholeCanvas" SnapsToDevicePixels="True">
|
|
|
|
<!--<CheckBox x:Name="TestChk" Click="OnClick"
|
|
Content=" select"
|
|
Foreground="LightGray"
|
|
FontFamily="UISegoe"
|
|
FontSize="15"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top" Canvas.Left="27" Canvas.Top="409" />-->
|
|
|
|
<ContentControl x:Name="LogTextBoxWrapper"
|
|
Canvas.Left="-500"
|
|
Canvas.Top="-500"
|
|
Width="477"
|
|
Height="188"
|
|
Style="{StaticResource OuterDraggableResizableItemStyle}">
|
|
<RichTextBox x:Name="LogTextBox"
|
|
Padding="0,5,0,0"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
FontFamily="Cascadia Mono, Consolas, Courier New, monospace, /Assets/Fonts/MiSans-Regular.ttf#MiSans"
|
|
FontSize="12"
|
|
Foreground="LightGray"
|
|
IsHitTestVisible="False"
|
|
VerticalScrollBarVisibility="Hidden"
|
|
Visibility="{Binding Config.MaskWindowConfig.ShowLogBox, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
</ContentControl>
|
|
|
|
|
|
<ContentControl x:Name="StatusWrapper"
|
|
Canvas.Left="-476"
|
|
Canvas.Top="-476"
|
|
Width="477"
|
|
Height="24"
|
|
Style="{StaticResource OuterDraggableResizableItemStyle}">
|
|
<ui:ListView ItemsSource="{Binding StatusList}" Visibility="{Binding Config.MaskWindowConfig.ShowStatus, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="Focusable" Value="False" />
|
|
<Setter Property="IsHitTestVisible" Value="False" />
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
<ListView.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListView.ItemsPanel>
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<StackPanel.Resources>
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
<Setter Property="Margin" Value="0,0,8,0" />
|
|
</Style>
|
|
</StackPanel.Resources>
|
|
<TextBlock FontFamily="{StaticResource FgiIconFontFamily}"
|
|
FontSize="12"
|
|
Text="{Binding Name}">
|
|
<TextBlock.Style>
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
<Setter Property="Foreground" Value="LightGray" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsEnabled}" Value="True">
|
|
<Setter Property="Foreground" Value="LightGreen" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
</ui:ListView>
|
|
</ContentControl>
|
|
|
|
<!--<ContentControl Width="230"
|
|
Height="130"
|
|
Canvas.Top="150"
|
|
Canvas.Left="470"
|
|
Style="{StaticResource DraggableResizableItemStyle}">
|
|
<Rectangle Fill="White" IsHitTestVisible="False" Opacity="0.2" />
|
|
<TextBlock Text="识别窗口" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
</Grid>
|
|
</ContentControl>-->
|
|
|
|
<ItemsControl ItemsSource="{Binding MaskButtons, Mode=TwoWay}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<Canvas IsItemsHost="True" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemContainerStyle>
|
|
<Style>
|
|
<Setter Property="Canvas.Left" Value="{Binding X}" />
|
|
<Setter Property="Canvas.Top" Value="{Binding Y}" />
|
|
</Style>
|
|
</ItemsControl.ItemContainerStyle>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Button Name="btn"
|
|
Width="{Binding Width}"
|
|
Height="{Binding Height}"
|
|
Command="{Binding ClickAction}"
|
|
Content="{Binding Name}"
|
|
Opacity="0.5" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<!-- uid遮盖 -->
|
|
<Rectangle Canvas.Left="{Binding UidCoverRect.X, Mode=OneWay}"
|
|
Canvas.Top="{Binding UidCoverRect.Y, Mode=OneWay}"
|
|
Width="{Binding UidCoverRect.Width, Mode=OneWay}"
|
|
Height="{Binding UidCoverRect.Height, Mode=OneWay}"
|
|
Fill="White"
|
|
IsHitTestVisible="False"
|
|
Visibility="{Binding Config.MaskWindowConfig.UidCoverEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
|
|
<!-- 方位 -->
|
|
<TextBlock Canvas.Left="{Binding EastPoint.X, Mode=OneWay}"
|
|
Canvas.Top="{Binding EastPoint.Y, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
FontSize="38"
|
|
FontStretch="Medium"
|
|
FontWeight="DemiBold"
|
|
Foreground="White"
|
|
Text="东"
|
|
Visibility="{Binding Config.MaskWindowConfig.DirectionsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
<TextBlock Canvas.Left="{Binding SouthPoint.X, Mode=OneWay}"
|
|
Canvas.Top="{Binding SouthPoint.Y, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
FontSize="38"
|
|
FontStretch="Medium"
|
|
FontWeight="DemiBold"
|
|
Foreground="White"
|
|
Text="南"
|
|
Visibility="{Binding Config.MaskWindowConfig.DirectionsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
<TextBlock Canvas.Left="{Binding WestPoint.X, Mode=OneWay}"
|
|
Canvas.Top="{Binding WestPoint.Y, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
FontSize="38"
|
|
FontStretch="Medium"
|
|
FontWeight="DemiBold"
|
|
Foreground="White"
|
|
Text="西"
|
|
Visibility="{Binding Config.MaskWindowConfig.DirectionsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
<TextBlock Canvas.Left="{Binding NorthPoint.X, Mode=OneWay}"
|
|
Canvas.Top="{Binding NorthPoint.Y, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
FontSize="38"
|
|
FontStretch="Medium"
|
|
FontWeight="DemiBold"
|
|
Foreground="White"
|
|
Text="北"
|
|
Visibility="{Binding Config.MaskWindowConfig.DirectionsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
|
|
<!-- 展示FPS -->
|
|
<Border Margin="4,4,0,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Background="#00000000"
|
|
CornerRadius="4"
|
|
Opacity="0.5"
|
|
Visibility="{Binding Config.MaskWindowConfig.ShowFps, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource DigitalThemeFontFamily}"
|
|
FontSize="16"
|
|
Foreground="White"
|
|
Text="{Binding Fps}" />
|
|
</Border>
|
|
</Canvas>
|
|
</AdornerDecorator>
|
|
|
|
</Window> |