Compare commits
3 Commits
main
...
SiegeWorld
Author | SHA1 | Date | |
---|---|---|---|
674b40f205 | |||
cac88090b0 | |||
e4b496f8b5 |
74
HighGroundRoyaleLauncher/BackgroundSlideshowManager.cs
Normal file
@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace HighGroundRoyaleLauncher
|
||||
{
|
||||
public class BackgroundSlideshowManager
|
||||
{
|
||||
private readonly string[] _imagePaths;
|
||||
private readonly Image _targetImage;
|
||||
private readonly DispatcherTimer _timer;
|
||||
private int _currentIndex = 0;
|
||||
|
||||
public BackgroundSlideshowManager(Image targetImage, string[] imagePaths, TimeSpan interval)
|
||||
{
|
||||
_targetImage = targetImage;
|
||||
_imagePaths = imagePaths;
|
||||
|
||||
_timer = new DispatcherTimer
|
||||
{
|
||||
Interval = interval
|
||||
};
|
||||
_timer.Tick += OnTimerTick;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
UpdateImage(); // first image
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
private void OnTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
_currentIndex = (_currentIndex + 1) % _imagePaths.Length;
|
||||
FadeToNextImage();
|
||||
}
|
||||
|
||||
private void FadeToNextImage()
|
||||
{
|
||||
var fadeOut = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(1.5)));
|
||||
fadeOut.Completed += (s, e) =>
|
||||
{
|
||||
UpdateImage();
|
||||
|
||||
var fadeIn = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(1.5)));
|
||||
_targetImage.BeginAnimation(UIElement.OpacityProperty, fadeIn);
|
||||
};
|
||||
|
||||
_targetImage.BeginAnimation(UIElement.OpacityProperty, fadeOut);
|
||||
}
|
||||
|
||||
private void UpdateImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
var uri = new Uri($"pack://application:,,,/{_imagePaths[_currentIndex]}", UriKind.Absolute);
|
||||
var bitmap = new BitmapImage(uri);
|
||||
_targetImage.Source = bitmap;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Optional: silently fail or log if an image can't load
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<ProjectGuid>{AAB4BEB9-2995-4EC3-A57C-16D753A69739}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>HighGroundRoyaleLauncher</RootNamespace>
|
||||
<AssemblyName>HighGroundRoyaleLauncher</AssemblyName>
|
||||
<AssemblyName>SiegeWorldsLauncher</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
@ -34,6 +34,9 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>SW_Logo_NoBackground.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@ -65,6 +68,7 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BackgroundSlideshowManager.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@ -96,5 +100,18 @@
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="LoginScreen_Background.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="SW_Logo_NoBackground.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="img1.jpg" />
|
||||
<Resource Include="img2.jpg" />
|
||||
<Resource Include="img3.jpg" />
|
||||
<Resource Include="installbtn.jpg" />
|
||||
<Content Include="SW_Logo_NoBackground.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
BIN
HighGroundRoyaleLauncher/Images/LoginScreen_Background.jpg
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
HighGroundRoyaleLauncher/Images/SW_Logo_NoBackground.ico
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
HighGroundRoyaleLauncher/LoginScreen_Background.jpg
Normal file
After Width: | Height: | Size: 259 KiB |
@ -1,17 +1,34 @@
|
||||
<Window x:Class="HighGroundRoyaleLauncher.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="High Ground Royale Installer" Height="220" Width="500">
|
||||
<Grid Margin="10">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Choose Installation Directory:" Margin="0,0,0,5"/>
|
||||
<DockPanel>
|
||||
<TextBox Name="installPathBox" Width="380" Margin="0,0,5,0"/>
|
||||
<Button Content="Browse..." Width="80" Click="Browse_Click"/>
|
||||
</DockPanel>
|
||||
<TextBlock Name="statusText" Text="Status: Idle" Margin="0,10,0,10"/>
|
||||
<ProgressBar Name="progressBar" Height="20" Minimum="0" Maximum="100"/>
|
||||
<Button Name="installButton" Content="Install And Launch" Click="InstallButton_Click" Margin="0,10,0,0"/>
|
||||
</StackPanel>
|
||||
Title="Siege Worlds Installer" Height="500" Width="500"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
|
||||
<Grid>
|
||||
|
||||
<!-- Slideshow Background -->
|
||||
<Image x:Name="SlideshowImage" Stretch="UniformToFill" Panel.ZIndex="0" />
|
||||
|
||||
<!-- Installer UI -->
|
||||
<Grid Margin="10" Panel.ZIndex="2">
|
||||
<Border CornerRadius="8" Padding="10">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Choose Installation Directory:" Foreground="White" Margin="0,0,0,5"/>
|
||||
|
||||
<DockPanel>
|
||||
<TextBox Name="installPathBox" Width="380" Margin="0,0,5,0"/>
|
||||
<Button Content="Browse..." Width="80" Click="Browse_Click"/>
|
||||
</DockPanel>
|
||||
|
||||
<TextBlock Name="statusText" Text="Status: Idle" Foreground="White" Margin="0,10,0,10"/>
|
||||
<ProgressBar Name="progressBar" Height="20" Minimum="0" Maximum="100"/>
|
||||
<Button Name="installButton" Click="InstallButton_Click" Margin="0,10,0,0" BorderThickness="0" Background="Transparent">
|
||||
<Image Source="installbtn.jpg" Stretch="None"/>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@ -10,19 +10,28 @@ namespace HighGroundRoyaleLauncher
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private string remoteVersionURL = "http://147.93.30.25/HGR/HGRVersion.txt";
|
||||
private string remoteZipURL = "http://147.93.30.25/HGR/HGRBuild.zip";
|
||||
private string remoteVersionURL = "http://147.93.30.25/SW/SWVersion.txt";
|
||||
private string remoteZipURL = "http://147.93.30.25/SW/SeigeWorlds.zip";
|
||||
|
||||
private string installPath = "";
|
||||
private string zipPath => Path.Combine(installPath, "game.zip");
|
||||
private string versionPath => Path.Combine(installPath, "version.txt");
|
||||
private string gameFolder => Path.Combine(installPath, "Game");
|
||||
private string exePath => Path.Combine(gameFolder, "HighGroundRoyaleNetcode.exe");
|
||||
private string exePath => Path.Combine(gameFolder, "Siege Worlds.exe");
|
||||
private BackgroundSlideshowManager _slideshow;
|
||||
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
installPathBox.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "HighGroundRoyale");
|
||||
installPathBox.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Siege worlds");
|
||||
|
||||
_slideshow = new BackgroundSlideshowManager(
|
||||
SlideshowImage,
|
||||
new[] { "img1.jpg", "img2.jpg", "img3.jpg" },
|
||||
TimeSpan.FromSeconds(4)
|
||||
);
|
||||
_slideshow.Start();
|
||||
}
|
||||
|
||||
private void Browse_Click(object sender, RoutedEventArgs e)
|
||||
|
BIN
HighGroundRoyaleLauncher/SW_Logo_NoBackground.ico
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
HighGroundRoyaleLauncher/SW_Logo_NoBackground.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
HighGroundRoyaleLauncher/img1.jpg
Normal file
After Width: | Height: | Size: 240 KiB |
BIN
HighGroundRoyaleLauncher/img2.jpg
Normal file
After Width: | Height: | Size: 392 KiB |
BIN
HighGroundRoyaleLauncher/img3.jpg
Normal file
After Width: | Height: | Size: 310 KiB |
BIN
HighGroundRoyaleLauncher/installbtn.jpg
Normal file
After Width: | Height: | Size: 14 KiB |