Skip to content

Commit 646ef69

Browse files
committed
Merge branches 'master' and 'master' of https://github.com/MusyaCliento/MusyaLoader
2 parents f51eee3 + 5057e6e commit 646ef69

3 files changed

Lines changed: 105 additions & 33 deletions

File tree

SS14.Launcher/Models/Data/CVars.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static readonly CVarDef<bool> HasDismissedRosettaWarning
174174
/// <summary>
175175
/// Enables soft background gradient for launcher theme.
176176
/// </summary>
177-
public static readonly CVarDef<bool> ThemeGradient = CVarDef.Create("ThemeGradient", true);
177+
public static readonly CVarDef<bool> ThemeGradient = CVarDef.Create("ThemeGradient", false);
178178

179179
/// <summary>
180180
/// Enables decorative striped texture on tabs and login background.

SS14.Launcher/ViewModels/MainWindowViewModel.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ public sealed class MainWindowViewModel : ViewModelBase, IErrorOverlayOwner
5050
[Reactive] public bool LauncherUpdateInProgress { get; private set; }
5151
[Reactive] public string LauncherUpdateVersionText { get; private set; } = "";
5252
[Reactive] public string LauncherUpdateVersionLine { get; private set; } = "";
53-
[Reactive] public string LauncherUpdateChannelText { get; private set; } = "";
54-
[Reactive] public string LauncherUpdateChannelBadgeBackground { get; private set; } = "#2A5FA8";
55-
[Reactive] public string LauncherUpdateChannelBadgeForeground { get; private set; } = "#FFFFFF";
5653
[Reactive] public string LauncherUpdateNotes { get; private set; } = "";
5754
[Reactive] public bool LauncherUpdateInstallSupported { get; private set; } = true;
5855
[Reactive] public string? LauncherUpdateError { get; private set; }
@@ -318,6 +315,9 @@ private async Task CheckLauncherSelfUpdate()
318315
_pendingLauncherUpdate = update;
319316
LauncherUpdateVersionText = update.VersionText;
320317
LauncherUpdateVersionLine = _loc.GetString("launcher-update-overlay-version", ("version", update.VersionText));
318+
LauncherUpdateChannelText = update.ReleaseTag;
319+
LauncherUpdateChannelBadgeBackground = update.IsPreRelease ? "#8A6C2E" : "#2A5FA8";
320+
LauncherUpdateChannelBadgeForeground = "#FFFFFF";
321321
LauncherUpdateNotes = update.ReleaseNotes;
322322
LauncherUpdateInstallSupported = update.InstallSupported;
323323
LauncherUpdateAvailable = true;
@@ -341,6 +341,7 @@ public void SkipLauncherUpdatePressed()
341341
LauncherUpdateAvailable = false;
342342
_pendingLauncherUpdate = null;
343343
LauncherUpdateVersionLine = "";
344+
LauncherUpdateChannelText = "";
344345
LauncherUpdateNotes = "";
345346
}
346347

@@ -456,6 +457,9 @@ private async Task InstallSpecificLauncherUpdate(LauncherSelfUpdateInfo update)
456457
_pendingLauncherUpdate = update;
457458
LauncherUpdateVersionText = update.VersionText;
458459
LauncherUpdateVersionLine = _loc.GetString("launcher-update-overlay-version", ("version", update.VersionText));
460+
LauncherUpdateChannelText = update.ReleaseTag;
461+
LauncherUpdateChannelBadgeBackground = update.IsPreRelease ? "#8A6C2E" : "#2A5FA8";
462+
LauncherUpdateChannelBadgeForeground = "#FFFFFF";
459463
LauncherUpdateNotes = update.ReleaseNotes;
460464
LauncherUpdateInstallSupported = update.InstallSupported;
461465
LauncherUpdateError = update.InstallSupported

SS14.Launcher/Views/MainWindowContent.xaml

Lines changed: 97 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,39 @@
1212
<vm:MainWindowViewModel />
1313
</Design.DataContext>
1414

15+
<UserControl.Styles>
16+
<Style Selector="Border.launcher-update-card">
17+
<Setter Property="Background" Value="{DynamicResource ThemePopupBackgroundColor}" />
18+
<Setter Property="BorderBrush" Value="#607A91A8" />
19+
<Setter Property="BorderThickness" Value="1.5" />
20+
<Setter Property="CornerRadius" Value="16" />
21+
<Setter Property="Padding" Value="16" />
22+
<Setter Property="MinWidth" Value="620" />
23+
<Setter Property="MaxWidth" Value="860" />
24+
</Style>
25+
26+
<Style Selector="Border.launcher-update-hero">
27+
<Setter Property="Background" Value="#2A3E6C45" />
28+
<Setter Property="BorderBrush" Value="#7A8E94B8" />
29+
<Setter Property="BorderThickness" Value="1" />
30+
<Setter Property="CornerRadius" Value="12" />
31+
<Setter Property="Padding" Value="12,10" />
32+
</Style>
33+
34+
<Style Selector="Border.launcher-update-section">
35+
<Setter Property="Background" Value="#20000000" />
36+
<Setter Property="BorderBrush" Value="#406B6F8F" />
37+
<Setter Property="BorderThickness" Value="1" />
38+
<Setter Property="CornerRadius" Value="10" />
39+
<Setter Property="Padding" Value="12" />
40+
</Style>
41+
42+
<Style Selector="Border.launcher-update-channel">
43+
<Setter Property="Padding" Value="10,3" />
44+
<Setter Property="CornerRadius" Value="10" />
45+
</Style>
46+
</UserControl.Styles>
47+
1548
<Panel>
1649
<DockPanel LastChildFill="true">
1750
<!-- Header -->
@@ -97,37 +130,72 @@
97130
</StackPanel>
98131
</ContentControl>
99132

100-
<ContentControl Classes="OverlayBox" IsVisible="{Binding LauncherUpdateAvailable}">
101-
<StackPanel Orientation="Vertical" Spacing="10">
102-
<TextBlock HorizontalAlignment="Center" Classes="NanoHeadingMedium" Text="{loc:Loc launcher-update-overlay-title}" />
103-
<TextBlock TextAlignment="Center" Text="{Binding LauncherUpdateVersionLine}" />
104-
<StackPanel IsVisible="{Binding LauncherUpdateNotes, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
105-
Spacing="4" MaxWidth="620">
106-
<TextBlock Text="{loc:Loc launcher-update-overlay-notes}" FontWeight="SemiBold" />
107-
<ScrollViewer MaxHeight="220" HorizontalScrollBarVisibility="Disabled">
108-
<TextBlock Text="{Binding LauncherUpdateNotes}" TextWrapping="Wrap" />
109-
</ScrollViewer>
110-
</StackPanel>
111-
<TextBlock IsVisible="{Binding LauncherUpdateError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
112-
Text="{Binding LauncherUpdateError}" TextWrapping="Wrap" MaxWidth="520" Foreground="#FF8A8A" />
133+
<ContentControl Classes="OverlayBox"
134+
Background="Transparent"
135+
BorderBrush="Transparent"
136+
IsVisible="{Binding LauncherUpdateAvailable}">
137+
<Border Classes="launcher-update-card">
138+
<StackPanel Orientation="Vertical" Spacing="10">
139+
<Border Classes="launcher-update-hero">
140+
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*,Auto">
141+
<TextBlock Grid.Row="0"
142+
Grid.Column="0"
143+
Classes="NanoHeadingMedium"
144+
FontWeight="SemiBold"
145+
Margin="0,0,8,4"
146+
Text="{loc:Loc launcher-update-overlay-title}" />
147+
<Border Grid.Row="0"
148+
Grid.Column="1"
149+
Classes="launcher-update-channel"
150+
Background="{Binding LauncherUpdateChannelBadgeBackground}"
151+
Margin="0,0,0,4"
152+
IsVisible="{Binding LauncherUpdateChannelText, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
153+
<TextBlock Text="{Binding LauncherUpdateChannelText}"
154+
FontSize="10"
155+
FontWeight="SemiBold"
156+
Foreground="{Binding LauncherUpdateChannelBadgeForeground}" />
157+
</Border>
158+
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding LauncherUpdateVersionLine}" Opacity="0.85" />
159+
</Grid>
160+
</Border>
113161

114-
<StackPanel IsVisible="{Binding LauncherUpdateInProgress}" Spacing="6">
115-
<ProgressBar Minimum="0" Maximum="1" Value="{Binding LauncherUpdateProgress}" Width="460" HorizontalAlignment="Center"/>
116-
<TextBlock Text="{Binding LauncherUpdateProgressText}" HorizontalAlignment="Center" />
117-
</StackPanel>
162+
<Border Classes="launcher-update-section"
163+
IsVisible="{Binding LauncherUpdateNotes, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
164+
<StackPanel Spacing="6">
165+
<TextBlock Text="{loc:Loc launcher-update-overlay-notes}" FontWeight="SemiBold" />
166+
<ScrollViewer MaxHeight="280" HorizontalScrollBarVisibility="Disabled">
167+
<TextBlock Text="{Binding LauncherUpdateNotes}" TextWrapping="Wrap" />
168+
</ScrollViewer>
169+
</StackPanel>
170+
</Border>
118171

119-
<DockPanel LastChildFill="False" IsVisible="{Binding !LauncherUpdateInProgress}">
120-
<Button DockPanel.Dock="Right"
121-
IsVisible="{Binding LauncherUpdateInstallSupported}"
122-
Content="{loc:Loc launcher-update-overlay-install}"
123-
Command="{Binding InstallLauncherUpdatePressed}" />
124-
<Button DockPanel.Dock="Right"
125-
IsVisible="{Binding !LauncherUpdateInstallSupported}"
126-
Content="{loc:Loc launcher-update-overlay-open-release}"
127-
Command="{Binding OpenLauncherUpdatePagePressed}" />
128-
<Button DockPanel.Dock="Left" Content="{loc:Loc launcher-update-overlay-skip}" Command="{Binding SkipLauncherUpdatePressed}" />
129-
</DockPanel>
130-
</StackPanel>
172+
<Border Classes="launcher-update-section"
173+
IsVisible="{Binding LauncherUpdateError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
174+
<TextBlock Text="{Binding LauncherUpdateError}" TextWrapping="Wrap" Foreground="#FF8A8A" />
175+
</Border>
176+
177+
<Border Classes="launcher-update-section" IsVisible="{Binding LauncherUpdateInProgress}">
178+
<StackPanel Spacing="6">
179+
<ProgressBar Minimum="0" Maximum="1" Value="{Binding LauncherUpdateProgress}" />
180+
<TextBlock Text="{Binding LauncherUpdateProgressText}" Opacity="0.85" />
181+
</StackPanel>
182+
</Border>
183+
184+
<DockPanel LastChildFill="False" IsVisible="{Binding !LauncherUpdateInProgress}">
185+
<Button DockPanel.Dock="Left"
186+
Content="{loc:Loc launcher-update-overlay-skip}"
187+
Command="{Binding SkipLauncherUpdatePressed}" />
188+
<Button DockPanel.Dock="Right"
189+
IsVisible="{Binding LauncherUpdateInstallSupported}"
190+
Content="{loc:Loc launcher-update-overlay-install}"
191+
Command="{Binding InstallLauncherUpdatePressed}" />
192+
<Button DockPanel.Dock="Right"
193+
IsVisible="{Binding !LauncherUpdateInstallSupported}"
194+
Content="{loc:Loc launcher-update-overlay-open-release}"
195+
Command="{Binding OpenLauncherUpdatePagePressed}" />
196+
</DockPanel>
197+
</StackPanel>
198+
</Border>
131199
</ContentControl>
132200

133201
<ContentControl Classes="OverlayBox" IsVisible="{Binding OutOfDate}">

0 commit comments

Comments
 (0)