Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from PCL-Community:main #31

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:

- name: Replace
run: |
(gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const PysioServer As String = ""', 'Public Const PysioServer As String = "${{ secrets.PYSIO_SERVER }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
(gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const OAuthClientId As String = ""', 'Public Const OAuthClientId As String = "${{ secrets.CLIENT_ID }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
(gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const CurseForgeAPIKey As String = ""', 'Public Const CurseForgeAPIKey As String = "${{ secrets.CURSEFORGE_API_KEY }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
(gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const LittleSkinClientId As String = ""', 'Public Const LittleSkinClientId As String = "${{ secrets.LITTLESKIN_CLIENT_ID }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
Expand Down
22 changes: 11 additions & 11 deletions Plain Craft Launcher 2/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<SolidColorBrush x:Key="ColorBrushHalfWhite" Color="#55ffffff" />
<SolidColorBrush x:Key="ColorBrushSemiWhite" Color="#bbffffff" />
<SolidColorBrush x:Key="ColorBrushWhite" Color="#ffffff" />
<SolidColorBrush x:Key="ColorBrushTransparent" Color="Transparent" />
<SolidColorBrush x:Key="ColorBrushTransparent" Color="#00ffffff" />
<SolidColorBrush x:Key="ColorBrushSemiTransparent">#01eaf2fe</SolidColorBrush>
<SolidColorBrush x:Key="ColorBrushBackgroundTransparentSidebar" Color="#D2FFFFFF" />
<SolidColorBrush x:Key="ColorBrushToolTip">#e5ffffff</SolidColorBrush>
Expand Down Expand Up @@ -166,7 +166,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border Background="{StaticResource ColorBrushSemiTransparent}" SnapsToDevicePixels="True">
<Border Background="{DynamicResource ColorBrushSemiTransparent}" SnapsToDevicePixels="True">
<Border Background="{TemplateBinding Foreground}" CornerRadius="3" Margin="2" />
</Border>
</ControlTemplate>
Expand Down Expand Up @@ -199,7 +199,7 @@
<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Opacity="0" />
</Track.IncreaseRepeatButton> <!-- 不能删,删了点击 Thumb 以外的部分就不能翻页了 -->
<Track.Thumb>
<Thumb Style="{StaticResource MyThumb}" Foreground="{TemplateBinding Foreground}" />
<Thumb Style="{DynamicResource MyThumb}" Foreground="{TemplateBinding Foreground}" />
</Track.Thumb>
</Track>
</Border>
Expand Down Expand Up @@ -293,7 +293,7 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="3">
<ScrollViewer x:Name="PART_ContentHost" Style="{StaticResource ScrollViewerNoMargin}" RenderOptions.ClearTypeHint="Enabled" BorderThickness="0"
<ScrollViewer x:Name="PART_ContentHost" Style="{DynamicResource ScrollViewerNoMargin}" RenderOptions.ClearTypeHint="Enabled" BorderThickness="0"
Margin="5,0,0,0" Cursor="IBeam" />
<!-- 由于未知原因,TextView 会有 2,0 的 Margin -->
</Border>
Expand Down Expand Up @@ -326,8 +326,8 @@
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Trigger.Setters>
<Setter Property="BorderBrush" Value="{StaticResource ColorBrushGray5}" />
<Setter Property="Background" Value="{StaticResource ColorBrushGray6}" />
<Setter Property="BorderBrush" Value="{DynamicResource ColorBrushGray5}" />
<Setter Property="Background" Value="{DynamicResource ColorBrushGray6}" />
</Trigger.Setters>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
Expand Down Expand Up @@ -380,7 +380,7 @@
<Grid x:Name="PanPopup">
<Border Background="{DynamicResource ColorBrushWhite}" CornerRadius="3" />
<Border x:Name="dropDownBorder" CornerRadius="3" BorderBrush="{TemplateBinding Foreground}" BorderThickness="1" Width="{TemplateBinding Width}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<local:MyScrollViewer x:Name="DropDownScrollViewer" PanningMode="VerticalOnly" SnapsToDevicePixels="False" Style="{StaticResource ScrollViewerFullMargin}" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto">
<local:MyScrollViewer x:Name="DropDownScrollViewer" PanningMode="VerticalOnly" SnapsToDevicePixels="False" Style="{DynamicResource ScrollViewerFullMargin}" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
</local:MyScrollViewer>
</Border>
Expand All @@ -398,7 +398,7 @@
<Style.Triggers>
<Trigger Property="IsEditable" Value="True">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="ItemTemplate" Value="{StaticResource ComboBoxItemTemplateWithDelete}"/>
<Setter Property="ItemTemplate" Value="{DynamicResource ComboBoxItemTemplateWithDelete}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
Expand All @@ -410,7 +410,7 @@
<Grid x:Name="PanPopup">
<Border Background="{DynamicResource ColorBrushWhite}" CornerRadius="3" />
<Border x:Name="dropDownBorder" SnapsToDevicePixels="False" CornerRadius="3" BorderBrush="{TemplateBinding Foreground}" BorderThickness="1" Width="{TemplateBinding Width}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<local:MyScrollViewer x:Name="DropDownScrollViewer" Style="{StaticResource ScrollViewerFullMargin}" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto">
<local:MyScrollViewer x:Name="DropDownScrollViewer" Style="{DynamicResource ScrollViewerFullMargin}" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
</local:MyScrollViewer>
</Border>
Expand All @@ -432,7 +432,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="{StaticResource ColorBrushSemiTransparent}">
<Border Background="{DynamicResource ColorBrushSemiTransparent}">
<Path x:Name="path" Width="15" RenderTransformOrigin="0.3,0.5" HorizontalAlignment="Right" Data="M1,1L4.5,4.5L8,1" StrokeThickness="1.5" Stroke="{TemplateBinding Foreground}" VerticalAlignment="Center">
<Path.RenderTransform>
<RotateTransform />
Expand Down Expand Up @@ -477,7 +477,7 @@
<Setter Property="ToolTipService.InitialShowDelay" Value="150" />
<Setter Property="ToolTipService.BetweenShowDelay" Value="150" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Background" Value="{StaticResource ColorBrushTransparent}" />
<Setter Property="Background" Value="{DynamicResource ColorBrushTransparent}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
Expand Down
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Application.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ WaitRetry:
'日志初始化
LogStart()
'添加日志
Log($"[Start] 程序版本:{VersionDisplayName} ({VersionCode}{If(CommitHash = "", "", $",#{CommitHash}")})")
Log($"[Start] 程序版本:{VersionBaseName} ({VersionBranchName}, {VersionCode}{If(CommitHash = "", "", $",#{CommitHash}")})")
Log($"[Start] 识别码:{UniqueAddress}{If(ThemeCheckOne(9), ",已解锁反馈主题", "")}")
Log($"[Start] 程序路径:{PathWithName}")
Log($"[Start] 系统版本:{Environment.OSVersion.Version}")
Expand Down
4 changes: 2 additions & 2 deletions Plain Craft Launcher 2/FormMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Public Class FormMain
'整理更新日志文本
Dim ContentList As New List(Of String)
Dim SortedFeatures = Sort(FeatureList, Function(Left, Right) Left.Key > Right.Key)
If Not SortedFeatures.Any() AndAlso FeatureCount = 0 AndAlso BugCount = 0 Then ContentList.Add("Pigeon0v0 忘记写更新日志啦!可以去提醒他一下……")
If Not SortedFeatures.Any() AndAlso FeatureCount = 0 AndAlso BugCount = 0 Then ContentList.Add("开发团队忘记写更新日志啦!可以去提醒一下……")
For i = 0 To Math.Min(9, SortedFeatures.Count - 1) '最多取 10 项
ContentList.Add(SortedFeatures(i).Value)
Next
Expand All @@ -154,7 +154,7 @@ Public Class FormMain
'输出更新日志
RunInNewThread(
Sub()
If MyMsgBox(Content, "PCL 已更新至 " & VersionDisplayName, "确定", "完整更新日志") = 2 Then
If MyMsgBox(Content, "PCL 已更新至 " & VersionBaseName & If(VersionBranchName = "Fast Ring", "." + VersionCodeString, ""), "确定", "完整更新日志") = 2 Then
OpenWebsite("https://github.com/PCL-Community/PCL2-CE/releases")
End If
End Sub, "UpdateLog Output")
Expand Down
19 changes: 9 additions & 10 deletions Plain Craft Launcher 2/Modules/Base/ModBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@ Public Module ModBase
#Region "声明"

'下列版本信息由更新器自动修改
Public Const VersionBaseName As String = "2.10.2" '不含分支前缀的显示用版本名
Public Const VersionStandardCode As String = "2.10.2." & VersionBranchCode '标准格式的四段式版本号
Public Const VersionBaseName As String = "2.10.3" '不含分支前缀的显示用版本名
Public Const VersionStandardCode As String = "2.10.3." & VersionCodeString '标准格式的四段式版本号
Public Const CommitHash As String = "native" 'Commit Hash,由 GitHub Workflow 自动替换
Public CommitHashShort As String = If(CommitHash = "native", "native", CommitHash.Substring(0, 7)) 'Commit Hash,取前 7 位
Public Const UpstreamVersion As String = "2.8.13" '上游版本
#If RELEASE Then
Public Const VersionCode As Integer = 357 'Release
#Else
Public Const VersionCode As Integer = 357 'Snapshot
#End If
Public Const VersionCode As Integer = 358 '内部版本号
Public Const VersionCodeString As String = "358" '内部版本号的字符串形式
'自动生成的版本信息
Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName
#If RELEASE Then
Public Const VersionBranchName As String = "Release"
Public Const VersionBranchName As String = "Slow Ring"
Public Const VersionBranchCode As String = "0"
Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName
#ElseIf BETA Then
Public Const VersionBranchName As String = "Beta"
Public Const VersionBranchName As String = "Fast Ring"
Public Const VersionBranchCode As String = "50"
Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName & "." & VersionCodeString
#Else
Public Const VersionBranchName As String = "Debug"
Public Const VersionBranchCode As String = "100"
Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName & "." & VersionCodeString
#End If

''' <summary>
Expand Down
Loading