Skip to content

Commit 503244a

Browse files
committed
2.9.1
1 parent 1a0c7b0 commit 503244a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3380
-1856
lines changed

Plain Craft Launcher 2/App.config

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<system.net>
4-
<settings>
5-
<httpWebRequest useUnsafeHeaderParsing="true"/>
6-
</settings>
7-
</system.net>
3+
<system.net>
4+
<settings>
5+
<httpWebRequest useUnsafeHeaderParsing="true"/>
6+
</settings>
7+
</system.net>
88
<startup>
99
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
1010
</startup>
11-
<runtime>
12-
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false" />
13-
<AppContextSwitchOverrides value="Switch.System.Windows.DoNotScaleForDpiChanges=false"/> <!-- #5337 -->
14-
<generatePublisherEvidence enabled="false"/>
15-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
16-
<dependentAssembly>
17-
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
18-
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
19-
</dependentAssembly>
20-
<dependentAssembly>
21-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
22-
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0"/>
23-
</dependentAssembly>
24-
<dependentAssembly>
25-
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
26-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
27-
</dependentAssembly>
28-
<dependentAssembly>
29-
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
30-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
31-
</dependentAssembly>
32-
</assemblyBinding>
33-
</runtime>
11+
<runtime>
12+
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false" />
13+
<AppContextSwitchOverrides value="Switch.System.Windows.DoNotScaleForDpiChanges=false"/> <!-- #5337 -->
14+
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" /> <!-- 长路径支持 -->
15+
<generatePublisherEvidence enabled="false"/>
16+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
17+
<dependentAssembly>
18+
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
19+
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
20+
</dependentAssembly>
21+
<dependentAssembly>
22+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
23+
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0"/>
24+
</dependentAssembly>
25+
<dependentAssembly>
26+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
27+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
28+
</dependentAssembly>
29+
<dependentAssembly>
30+
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
31+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
32+
</dependentAssembly>
33+
</assemblyBinding>
34+
</runtime>
3435
</configuration>

Plain Craft Launcher 2/Application.xaml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
1414
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
1515
</ResourceDictionary.MergedDictionaries>
16+
17+
<!-- Converter -->
18+
<local:AdditionConverter x:Key="AdditionConverter"/>
19+
<local:MultiplicationConverter x:Key="MultiplicationConverter"/>
20+
<local:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
21+
<local:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
1622

1723
<!-- 颜色表 -->
1824
<SolidColorBrush x:Key="ColorBrush1">#343d4a</SolidColorBrush>

Plain Craft Launcher 2/Controls/MyButton.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Border.RenderTransform>
88
<ScaleTransform />
99
</Border.RenderTransform>
10-
<TextBlock TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True" TextTrimming="None" Text="Button" HorizontalAlignment="Center" x:Name="LabText" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Foreground="{Binding Parent.BorderBrush, RelativeSource={RelativeSource Self}}" FontSize="13" IsHitTestVisible="False">
10+
<TextBlock TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True" TextTrimming="None" HorizontalAlignment="Center" x:Name="LabText" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Foreground="{Binding Parent.BorderBrush, RelativeSource={RelativeSource Self}}" FontSize="13" IsHitTestVisible="False">
1111
<TextBlock.RenderTransform>
1212
<ScaleTransform />
1313
</TextBlock.RenderTransform>

Plain Craft Launcher 2/Controls/MyButton.xaml.vb

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
Public Class MyButton
1+
Imports System.Windows.Markup
2+
3+
<ContentProperty("Inlines")>
4+
Public Class MyButton
25

36
'声明
47
Public Event Click(sender As Object, e As MouseButtonEventArgs) '自定义事件
58

69
'自定义属性
710
Public Uuid As Integer = GetUuid()
11+
Public ReadOnly Property Inlines As InlineCollection
12+
Get
13+
Return LabText.Inlines
14+
End Get
15+
End Property
816
Public Property Text As String
917
Get
10-
Return LabText.Text
18+
Return GetValue(TextProperty)
1119
End Get
1220
Set(value As String)
13-
LabText.Text = value
21+
SetValue(TextProperty, value)
1422
End Set
1523
End Property '显示文本
1624
Public Shared ReadOnly TextProperty As DependencyProperty = DependencyProperty.Register("Text", GetType(String), GetType(MyButton), New PropertyMetadata(New PropertyChangedCallback(
17-
Sub(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
18-
If Not IsNothing(sender) Then CType(sender, MyButton).LabText.Text = e.NewValue
19-
End Sub)))
25+
Sub(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
26+
If sender IsNot Nothing Then CType(sender, MyButton).LabText.Text = e.NewValue
27+
End Sub)))
2028
Public Property TextPadding As Thickness
2129
Get
2230
Return LabText.Padding

Plain Craft Launcher 2/Controls/MyCard.vb

+23-14
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636

3737
'属性
3838
Public Uuid As Integer = GetUuid()
39+
Public ReadOnly Property Inlines As InlineCollection
40+
Get
41+
Return MainTextBlock.Inlines
42+
End Get
43+
End Property
3944
Public Property Title As String
4045
Get
4146
Return GetValue(TitleProperty)
@@ -62,7 +67,7 @@
6267
If IsLoad Then Exit Sub
6368
IsLoad = True
6469
'初次加载限定
65-
If Title <> "" AndAlso MainTextBlock Is Nothing Then
70+
If MainTextBlock Is Nothing Then
6671
MainTextBlock = New TextBlock With {.HorizontalAlignment = HorizontalAlignment.Left, .VerticalAlignment = VerticalAlignment.Top, .Margin = New Thickness(15, 12, 0, 0), .FontWeight = FontWeights.Bold, .FontSize = 13, .IsHitTestVisible = False}
6772
MainTextBlock.SetResourceReference(TextBlock.ForegroundProperty, "ColorBrush1")
6873
MainTextBlock.SetBinding(TextBlock.TextProperty, New Binding("Title") With {.Source = Me, .Mode = BindingMode.OneWay})
@@ -222,20 +227,21 @@
222227
'高度增加较大,使用弹起动画
223228
Dim Delta As Double = MathClamp(Math.Abs(DeltaHeight) * 0.05, 3, 10) * Math.Sign(DeltaHeight)
224229
AnimList.AddRange({
225-
AaHeight(Me, DeltaHeight + Delta, 300, If(IsLoadAnimation, 30, 0), If(DeltaHeight > FrmMain.Height, New AniEaseInFluent(AniEasePower.ExtraStrong), New AniEaseOutFluent(AniEasePower.ExtraStrong))),
226-
AaHeight(Me, -Delta, 150, 260, Ease:=New AniEaseOutFluent(AniEasePower.Strong))
227-
})
230+
AaHeight(Me, DeltaHeight + Delta, 300, If(IsLoadAnimation, 30, 0), If(DeltaHeight > FrmMain.Height, New AniEaseInFluent(AniEasePower.ExtraStrong), New AniEaseOutFluent(AniEasePower.ExtraStrong))),
231+
AaHeight(Me, -Delta, 150, 260, Ease:=New AniEaseOutFluent(AniEasePower.Strong))
232+
})
228233
Else
229234
'普通的改变就行啦
230235
AnimList.AddRange({
231-
AaHeight(Me, DeltaHeight, MathClamp(Math.Abs(DeltaHeight) * 4, 150, 250),, New AniEaseOutFluent)
232-
})
236+
AaHeight(Me, DeltaHeight, MathClamp(Math.Abs(DeltaHeight) * 4, 150, 250),, New AniEaseOutFluent)
237+
})
233238
End If
234-
AnimList.Add(AaCode(Sub()
235-
IsHeightAnimating = False
236-
Height = ActualUsedHeight
237-
If IsSwaped Then SwapControl.Visibility = Visibility.Collapsed
238-
End Sub,, True))
239+
AnimList.Add(AaCode(
240+
Sub()
241+
IsHeightAnimating = False
242+
Height = ActualUsedHeight
243+
If IsSwaped Then SwapControl.Visibility = Visibility.Collapsed
244+
End Sub,, True))
239245
AniStart(AnimList, "MyCard Height " & Uuid)
240246

241247
IsHeightAnimating = True
@@ -253,7 +259,8 @@
253259

254260
#End Region
255261

256-
'折叠
262+
#Region "折叠"
263+
257264
'若设置了 CanSwap,或 SwapControl 不为空,则判定为会进行折叠
258265
'这是因为不能直接在 XAML 中设置 SwapControl
259266
Public SwapControl As Object
@@ -294,7 +301,7 @@
294301
Private Sub MyCard_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
295302
Dim Pos As Double = Mouse.GetPosition(Me).Y
296303
If Not IsSwaped AndAlso
297-
(SwapControl Is Nothing OrElse Pos > SwapedHeight OrElse (Pos = 0 AndAlso Not IsMouseDirectlyOver)) Then Exit Sub '检测点击位置;或已经不在可视树上的误判
304+
(SwapControl Is Nothing OrElse Pos > If(IsSwaped, SwapedHeight, SwapedHeight - 6) OrElse (Pos = 0 AndAlso Not IsMouseDirectlyOver)) Then Exit Sub '检测点击位置;或已经不在可视树上的误判
298305
IsMouseDown = True
299306
End Sub
300307
Private Sub MyCard_MouseLeftButtonUp(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseLeftButtonUp
@@ -303,7 +310,7 @@
303310

304311
Dim Pos As Double = Mouse.GetPosition(Me).Y
305312
If Not IsSwaped AndAlso
306-
(SwapControl Is Nothing OrElse Pos > SwapedHeight OrElse (Pos = 0 AndAlso Not IsMouseDirectlyOver)) Then Exit Sub '检测点击位置;或已经不在可视树上的误判
313+
(SwapControl Is Nothing OrElse Pos > If(IsSwaped, SwapedHeight, SwapedHeight - 6) OrElse (Pos = 0 AndAlso Not IsMouseDirectlyOver)) Then Exit Sub '检测点击位置;或已经不在可视树上的误判
307314

308315
Dim ee = New RouteEventArgs(True)
309316
RaiseEvent PreviewSwap(Me, ee)
@@ -320,6 +327,8 @@
320327
IsMouseDown = False
321328
End Sub
322329

330+
#End Region
331+
323332
End Class
324333
Partial Public Module ModAnimation
325334
Public Sub AniDispose(Control As MyCard, RemoveFromChildren As Boolean, Optional CallBack As ParameterizedThreadStart = Nothing)

Plain Craft Launcher 2/Controls/MyCheckBox.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="MyCheckBox"
55
FocusVisualStyle="{x:Null}"
66
MinWidth="20" x:Name="PanBack" UseLayoutRounding="False" SnapsToDevicePixels="False" MinHeight="20" Background="{StaticResource ColorBrushSemiTransparent}" Focusable="True" d:DesignWidth="126.4" d:DesignHeight="44.8">
7-
<TextBlock IsHitTestVisible="False" FontSize="13" x:Name="LabText" Padding="0" Margin="26,0,0,0" Text="Checkbox" Foreground="{DynamicResource ColorBrush1}" HorizontalAlignment="Left" VerticalAlignment="Center" />
7+
<TextBlock IsHitTestVisible="False" FontSize="13" x:FieldModifier="Public" x:Name="LabText" Padding="0" Margin="26,0,0,0" Foreground="{DynamicResource ColorBrush1}" HorizontalAlignment="Left" VerticalAlignment="Center" />
88
<Border IsHitTestVisible="False" x:Name="ShapeBorder" BorderThickness="1.1" HorizontalAlignment="Left" VerticalAlignment="Center" Width="18" Height="18" BorderBrush="{DynamicResource ColorBrush1}" CornerRadius="3" Margin="1,0,0,0" Background="{StaticResource ColorBrushHalfWhite}" />
99
<Path IsHitTestVisible="False" x:Name="ShapeCheck" HorizontalAlignment="Left" VerticalAlignment="Center" Fill="{Binding BorderBrush, ElementName=ShapeBorder}" Width="12" Height="12" Margin="4,0,0,0" Data="M0,6L1.5,4.5 4.5,7.5 10.5,1.5 12,3 4.5,10.5 0,6z">
1010
<Path.RenderTransform>

0 commit comments

Comments
 (0)