Skip to content

Commit

Permalink
🎨 ι‡ε†™εˆε§‹εŒ–
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiYu-233 committed Jul 30, 2024
1 parent bf9b94a commit 8a26f4f
Show file tree
Hide file tree
Showing 30 changed files with 3,602 additions and 1,582 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
repo_token: "${{ secrets.TOKEN }}"
title: "v${{ steps.date.outputs.title }}"
automatic_release_tag: "AutoRelease-${{ steps.date.outputs.date }}"
prerelease: true
prerelease: false
files: |
YMCL.Main/bin/Release/net8.0/osx-arm64/publish/YMCL.Main.osx.arm64.bin
YMCL.Main/bin/Release/net8.0/osx-x64/publish/YMCL.Main.osx.x64.bin
Expand Down
Binary file removed YMCL.Main/Public/Assets/bass.dll
Binary file not shown.
7 changes: 6 additions & 1 deletion YMCL.Main/Public/Classes/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ public class Setting
public string Language { get; set; } = "Unset";
public string MinecraftFolder { get; set; }
public double MaximumDownloadThread { get; set; } = 64;
public bool IsCompleteJavaInitialize { get; set; }
public bool IsCompleteMinecraftFolderInitialize { get; set; }
public bool IsCompleteAccountInitialize { get; set; }
public OpenFileWay OpenFileWay { get; set; }
public DownloadSource DownloadSource { get; set; } = DownloadSource.Mojang;
public LauncherVisibility LauncherVisibility { get; set; } = LauncherVisibility.AfterLaunchKeepLauncherVisible;
public int AccountSelectionIndex { get; set; }
public Theme Theme { get; set; } = Theme.Light;
public double MaxMem { get; set; } = 1024;
public double Volume { get; set; } = 50;
public Repeat Repeat { get; set; } = Repeat.RepeatAll;
public LaunchCore LaunchCore { get; set; } = LaunchCore.MinecraftLaunch;
public string Version { get; set; }
public bool EnableIndependencyCore { get; set; } = true;
public bool EnableCustomUpdateUrl { get; set; } = true;
public bool EnableCustomUpdateUrl { get; set; } = false;
public string CustomUpdateUrl { get; set; } = "https://gh.api.99988866.xyz/{%url%}";
public bool EnableCustomBackGroundImg { get; set; } = false;
public bool AlreadyWrittenIntoTheUrlScheme { get; set; } = false;
Expand Down
1 change: 1 addition & 0 deletions YMCL.Main/Public/Const.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ public class Window
public class Notification
{
public static WindowNotificationManager main { get; set; }
public static WindowNotificationManager initialize { get; set; }
}
}
64 changes: 32 additions & 32 deletions YMCL.Main/Public/Controls/TitleBar/TitleBar.axaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<UserControl
mc:Ignorable="d"
x:Class="YMCL.Main.Public.Controls.TitleBar"
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"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
mc:Ignorable="d">
<Border
Background="{DynamicResource TitleBarColor}"
CornerRadius="8,8,0,0"
Height="30"
VerticalAlignment="Top">
VerticalAlignment="Top"
Background="{DynamicResource TitleBarColor}"
CornerRadius="8,8,0,0">
<Grid
Background="{DynamicResource TitleBarColor}"
Name="MoveDragArea"
Margin="8,0,8,0"
Name="MoveDragArea">
Background="{DynamicResource TitleBarColor}">
<TextBlock />
<TextBlock
Name="TitleText"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontFamily="{DynamicResource Font}"
FontSize="16"
HorizontalAlignment="Left"
Name="TitleText"
Text="Title"
VerticalAlignment="Center" />
<Button
Classes="icon-button"
Content="{DynamicResource Close}"
HorizontalAlignment="Right"
Margin="0,0,-5,0"
Name="CloseButton"
VerticalAlignment="Center" />
<Button
Classes="icon-button"
Content="{DynamicResource Maximize}"
HorizontalAlignment="Right"
Margin="0,0,21,0"
Name="MaximizeButton"
VerticalAlignment="Center" />
<Button
Classes="icon-button"
Content="{DynamicResource Minimize}"
HorizontalAlignment="Right"
Margin="0,8,47,0"
Name="MinimizeButton"
VerticalAlignment="Center" />
Text="Title" />
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button
Name="MinimizeButton"
Margin="0,6,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Classes="icon-button"
Content="{DynamicResource Minimize}" />
<Button
Name="MaximizeButton"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Classes="icon-button"
Content="{DynamicResource Maximize}" />
<Button
Name="CloseButton"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Classes="icon-button"
Content="{DynamicResource Close}" />
</StackPanel>
</Grid>
</Border>
</UserControl>
19 changes: 12 additions & 7 deletions YMCL.Main/Public/Controls/TitleBar/TitleBar.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public partial class TitleBar : UserControl
public static readonly StyledProperty<bool> IsCloseBtnShowProperty =
AvaloniaProperty.Register<TitleBar, bool>(nameof(IsCloseBtnShow), true);

public static readonly StyledProperty<bool> IsMaxBtnShowProperty =
AvaloniaProperty.Register<TitleBar, bool>(nameof(IsMaxBtnShow), true);

private DateTime? lastClickTime;

public TitleBar()
Expand All @@ -30,12 +33,8 @@ public TitleBar()
Loaded += (_, _) =>
{
TitleText.Text = Title;
if (!IsCloseBtnShow)
{
CloseButton.IsVisible = false;
MaximizeButton.Margin = new Thickness(0, 0, -5, 0);
MinimizeButton.Margin = new Thickness(0, 0, 21, 0);
}
CloseButton.IsVisible = IsCloseBtnShow;
MaximizeButton.IsVisible = IsMaxBtnShow;
};
}

Expand All @@ -57,6 +56,12 @@ public bool IsCloseBtnShow
set => SetValue(IsCloseBtnShowProperty, value);
}

public bool IsMaxBtnShow
{
get => GetValue(IsMaxBtnShowProperty);
set => SetValue(IsMaxBtnShowProperty, value);
}

private void MoveDragArea_PointerPressed(object? sender, PointerPressedEventArgs e)
{
if (e.Pointer.Type == PointerType.Mouse)
Expand All @@ -68,7 +73,7 @@ private void MoveDragArea_PointerPressed(object? sender, PointerPressedEventArgs
window.BeginMoveDrag(e);
}

if (lastClickTime.HasValue && (DateTime.Now - lastClickTime.Value).TotalMilliseconds < 300)
if (IsMaxBtnShow && lastClickTime.HasValue && (DateTime.Now - lastClickTime.Value).TotalMilliseconds < 300)
{
lastClickTime = null;
var window = this.GetVisualRoot() as Window;
Expand Down
15 changes: 15 additions & 0 deletions YMCL.Main/Public/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ public enum Repeat
RepeatOne
}

public enum LaunchCore
{
MinecraftLaunch,
StarLight
}

public enum LauncherVisibility
{
AfterLaunchKeepLauncherVisible,
AfterLaunchMakeLauncherMinimize,
AfterLaunchMinimizeAndShowWhenGameExit,
AfterLaunchHideAndShowWhenGameExit,
AfterLaunchExitLauncher
}

public enum OpenFileWay
{
FileSelectWindow,
Expand Down
Loading

0 comments on commit 8a26f4f

Please sign in to comment.