mirror of
https://github.com/ApfelTeeSaft/SkidFN-Launcher.git
synced 2026-08-26 19:33:35 +00:00
added all /pages/ files that were modified
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.Home"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
mc:Ignorable="d" Width="890" Height="650">
|
||||
<Grid Background="#1f1f1f">
|
||||
<Image HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="818" Source="/Pages/banner.png" RenderTransformOrigin="1.268,0.599" Margin="44,0,0,0"/>
|
||||
<Grid>
|
||||
|
||||
<TextBlock x:Name="digitalClock" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="50" Margin="45,136,0,0" Width="242" Height="61" FontFamily="Impact"/>
|
||||
<TextBlock x:Name="hourText" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" FontFamily="Impact"/>
|
||||
<TextBlock x:Name="minuteText" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Impact"/>
|
||||
<TextBlock x:Name="secondText" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" FontFamily="Impact"/>
|
||||
<Border BorderThickness="0.5" HorizontalAlignment="Left" Height="2" Margin="15,0,0,0" VerticalAlignment="Center" Width="825" Background="White" Opacity="0.4"/>
|
||||
<Rectangle Fill="#FF111111" Margin="30,346,720,118" RadiusX="10" RadiusY="10"/>
|
||||
<Button x:Name="Browse" Content="Find Build" Margin="43,492,0,0" VerticalAlignment="Top" Width="111" Height="31" Click="FindBuild"/>
|
||||
<Image HorizontalAlignment="Left" Height="108" VerticalAlignment="Top" Width="123" Source="/Pages/fortnites12.png" RenderTransformOrigin="1.268,0.599" Margin="46,360,0,0"/>
|
||||
<ItemsControl x:Name="versionList" Grid.Column="0" Visibility="Visible" ItemsSource="{Binding VersionItems}" Margin="175,326,10,98">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="0.5" BorderBrush="#FF111111" Background="#FF111111" Margin="5" CornerRadius="10" Width="140" Height="186">
|
||||
<Grid>
|
||||
<Image Source="{Binding FullImagePath}" Width="108" Height="109" Margin="16,13,10,9" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="UniformToFill">
|
||||
<Image.Clip>
|
||||
<RectangleGeometry RadiusX="10" RadiusY="10" Rect="0,0,108,109"/>
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
|
||||
<Button Content="Launch" Margin="-40,10,0,8" VerticalAlignment="Bottom" HorizontalAlignment="Center" Width="80" Height="32" Click="LaunchButton" Tag="{Binding}"/>
|
||||
|
||||
<Button Margin="100,10,2,8" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="35" Height="32" Click="DeleteVersion">
|
||||
<Image Source="trashbin.png" Width="20" Height="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
<TextBlock TextWrapping="Wrap" Height="26" Width="72" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="20" Margin="16,300,0,0" FontFamily="Arial Black" Text="Builds"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,396 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using WpfApp6.Services;
|
||||
using WpfApp6.Services.Launch;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
public partial class Home : System.Windows.Controls.UserControl
|
||||
{
|
||||
private DispatcherTimer clockTimer;
|
||||
public ObservableCollection<VersionItem> VersionItems { get; set; }
|
||||
private int versionNumber = 1;
|
||||
|
||||
public Home()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
InitializeClockTimer();
|
||||
|
||||
|
||||
VersionItems = new ObservableCollection<VersionItem>();
|
||||
versionList.ItemsSource = VersionItems;
|
||||
|
||||
|
||||
LoadConfigFile();
|
||||
}
|
||||
|
||||
private void InitializeClockTimer()
|
||||
{
|
||||
clockTimer = new DispatcherTimer();
|
||||
clockTimer.Interval = TimeSpan.FromSeconds(1);
|
||||
clockTimer.Tick += ClockTimer_Tick;
|
||||
clockTimer.Start();
|
||||
|
||||
|
||||
UpdateDigitalClock();
|
||||
}
|
||||
|
||||
private void ClockTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
UpdateDigitalClock();
|
||||
}
|
||||
|
||||
private void UpdateDigitalClock()
|
||||
{
|
||||
|
||||
digitalClock.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
|
||||
private void LoadConfigFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
|
||||
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
|
||||
string jsonText = File.ReadAllText(configFilePath);
|
||||
|
||||
|
||||
JObject json = JObject.Parse(jsonText);
|
||||
|
||||
|
||||
JArray folderPathsArray = (JArray)json["FolderPaths"];
|
||||
|
||||
|
||||
VersionItems.Clear();
|
||||
versionNumber = 1;
|
||||
|
||||
|
||||
foreach (var folderPathToken in folderPathsArray)
|
||||
{
|
||||
string folderPath = folderPathToken.ToString();
|
||||
|
||||
|
||||
DisplayBuilds(folderPath, versionNumber);
|
||||
versionNumber++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
System.Windows.MessageBox.Show("Configuration file does not exist.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
System.Windows.MessageBox.Show($"Error loading configuration file: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayBuilds(string selectedFolderPath, int versionNumber)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string[] buildFiles = Directory.GetFiles(selectedFolderPath, "Splash.bmp", SearchOption.AllDirectories);
|
||||
|
||||
foreach (string buildFile in buildFiles)
|
||||
{
|
||||
|
||||
BitmapImage bitmap = new BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.UriSource = new Uri(buildFile, UriKind.Absolute);
|
||||
bitmap.CacheOption = BitmapCacheOption.OnLoad;
|
||||
bitmap.EndInit();
|
||||
|
||||
|
||||
VersionItem versionItem = new VersionItem
|
||||
{
|
||||
FullImagePath = buildFile,
|
||||
ImageSource = bitmap,
|
||||
CornerRadius = new CornerRadius(10),
|
||||
VersionNumber = versionNumber
|
||||
};
|
||||
|
||||
|
||||
VersionItems.Add(versionItem);
|
||||
}
|
||||
|
||||
versionList.Visibility = Visibility.Visible;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
System.Windows.MessageBox.Show($"Error loading builds: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
versionList.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
private void LaunchButton(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sender is System.Windows.Controls.Button launchButton && launchButton.Tag is VersionItem versionItem)
|
||||
{
|
||||
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
string jsonText = File.ReadAllText(configFilePath);
|
||||
JObject json = JObject.Parse(jsonText);
|
||||
JArray folderPathsArray = (JArray)json["FolderPaths"];
|
||||
|
||||
// Retrieve the index of the version item
|
||||
int index = VersionItems.IndexOf(versionItem);
|
||||
|
||||
if (index >= 0 && index < folderPathsArray.Count)
|
||||
{
|
||||
string selectedFolderPath = folderPathsArray[index].ToString();
|
||||
string executablePath = Path.Combine(selectedFolderPath, "FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe");
|
||||
|
||||
if (File.Exists(executablePath))
|
||||
{
|
||||
string credentialsFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "credentials.json");
|
||||
|
||||
if (File.Exists(credentialsFilePath))
|
||||
{
|
||||
string credentialsText = File.ReadAllText(credentialsFilePath);
|
||||
JObject credentialsJson = JObject.Parse(credentialsText);
|
||||
string email = credentialsJson["Email"].ToString();
|
||||
string password = credentialsJson["Password"].ToString();
|
||||
|
||||
if (email == "NONE" || password == "NONE")
|
||||
{
|
||||
System.Windows.MessageBox.Show("Error code 1", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
WebClient OMG = new WebClient();
|
||||
string dllPath = Path.Combine(selectedFolderPath, "Engine\\Binaries\\ThirdParty\\NVIDIA\\NVaftermath\\Win64", "GFSDK_Aftermath_Lib.x64.dll");
|
||||
OMG.DownloadFile("Cobalt.dll", dllPath);
|
||||
|
||||
PSBasics.Start(selectedFolderPath, "-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", email, password);
|
||||
FakeAC.Start(selectedFolderPath, "FortniteClient-Win64-Shipping_BE.exe", $"-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", "r");
|
||||
FakeAC.Start(selectedFolderPath, "FortniteLauncher.exe", $"-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", "dsf");
|
||||
|
||||
PSBasics._FortniteProcess.WaitForExit();
|
||||
try
|
||||
{
|
||||
FakeAC._FNLauncherProcess.Close();
|
||||
FakeAC._FNAntiCheatProcess.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Windows.MessageBox.Show("There was an error closing: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("Fortnite executable not found.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("Invalid version item index.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("Configuration file does not exist.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Windows.MessageBox.Show($"Error launching Fortnite: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void FindBuild(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
|
||||
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
|
||||
string jsonText = File.ReadAllText(configFilePath);
|
||||
|
||||
|
||||
JObject json = JObject.Parse(jsonText);
|
||||
|
||||
|
||||
JArray folderPathsArray = (JArray)json["FolderPaths"];
|
||||
|
||||
|
||||
if (folderPathsArray.Count >= 4)
|
||||
{
|
||||
System.Windows.MessageBox.Show("You cannot add more than 4 versions please delete one.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var dialog = new FolderBrowserDialog();
|
||||
|
||||
DialogResult result = dialog.ShowDialog();
|
||||
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string selectedFolderPath = dialog.SelectedPath;
|
||||
|
||||
|
||||
SaveSelectedFolderPath(selectedFolderPath);
|
||||
|
||||
LoadConfigFile();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
System.Windows.MessageBox.Show($"Error finding build: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
private void SaveSelectedFolderPath(string selectedFolderPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
|
||||
|
||||
|
||||
JObject json = new JObject();
|
||||
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
|
||||
string jsonText = File.ReadAllText(configFilePath);
|
||||
|
||||
|
||||
json = JObject.Parse(jsonText);
|
||||
}
|
||||
|
||||
|
||||
JArray folderPathsArray = json.ContainsKey("FolderPaths") ? (JArray)json["FolderPaths"] : new JArray();
|
||||
|
||||
|
||||
folderPathsArray.Add(selectedFolderPath);
|
||||
|
||||
|
||||
json["FolderPaths"] = folderPathsArray;
|
||||
|
||||
|
||||
string output = json.ToString();
|
||||
|
||||
|
||||
File.WriteAllText(configFilePath, output);
|
||||
|
||||
Console.WriteLine($"Selected Folder Path saved to config file: {configFilePath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
System.Windows.MessageBox.Show($"Error saving selected folder path: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
private void DeleteVersion(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is System.Windows.Controls.Button button && button.DataContext is VersionItem version)
|
||||
{
|
||||
VersionItems.Remove(version);
|
||||
SaveConfigFile();
|
||||
}
|
||||
}
|
||||
private void SaveConfigFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
|
||||
|
||||
JObject json;
|
||||
JArray folderPathsArray;
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
|
||||
string existingJson = File.ReadAllText(configFilePath);
|
||||
json = JObject.Parse(existingJson);
|
||||
|
||||
if (json["FolderPaths"] == null)
|
||||
{
|
||||
|
||||
folderPathsArray = new JArray();
|
||||
json["FolderPaths"] = folderPathsArray;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
folderPathsArray = (JArray)json["FolderPaths"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
json = new JObject();
|
||||
folderPathsArray = new JArray();
|
||||
json["FolderPaths"] = folderPathsArray;
|
||||
}
|
||||
|
||||
if (folderPathsArray.Count > 0)
|
||||
{
|
||||
folderPathsArray.RemoveAt(0);
|
||||
}
|
||||
|
||||
|
||||
string output = json.ToString();
|
||||
File.WriteAllText(configFilePath, output);
|
||||
Console.WriteLine($"Configuration file updated: {configFilePath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Windows.MessageBox.Show($"Error saving configuration file: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
//class
|
||||
public class VersionItem
|
||||
{
|
||||
public string FullImagePath { get; set; }
|
||||
public BitmapImage ImageSource { get; set; }
|
||||
public CornerRadius CornerRadius { get; set; } = new CornerRadius(10);
|
||||
public int VersionNumber { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.Settings"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
mc:Ignorable="d" d:DesignWidth="890" Height="650" Visibility="Visible">
|
||||
|
||||
<Grid Background="#1f1f1f">
|
||||
<Image HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="818" Source="/Pages/Banner.png" RenderTransformOrigin="1.268,0.599" Margin="44,0,0,0"/>
|
||||
<PasswordBox x:Name="PasswordBox" Margin="345,340,345,278" Padding="5"/>
|
||||
<TextBlock Text="Password:" Foreground="White" Margin="256,346,481,288" FontFamily="Arial Black" FontSize="15"/>
|
||||
<TextBlock x:Name="clock"
|
||||
Height="61"
|
||||
Margin="270,139,344,0"
|
||||
VerticalAlignment="Top"
|
||||
Padding="70,0,0,0"
|
||||
FontFamily="Impact"
|
||||
TextAlignment="Center"
|
||||
Foreground="White"
|
||||
FontSize="50"><InlineUIContainer/></TextBlock>
|
||||
<TextBlock Text="Email:" Foreground="White" Margin="16,346,786,278" FontFamily="Arial Black" FontSize="15"/>
|
||||
<Button Content="Save Settings" Click="SaveSettings_Click" Margin="659,339,0,0" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="EmailTextBox" Margin="78,340,612,278" Padding="5" Text="Email" Foreground="Gray" GotFocus="EmailTextBox_GotFocus" LostFocus="EmailTextBox_LostFocus"/>
|
||||
<Border BorderThickness="0.5" HorizontalAlignment="Left" Height="2" Margin="15,0,0,0" VerticalAlignment="Center" Width="825" Background="White" Opacity="0.4"/>
|
||||
<CheckBox x:Name="RememberMeCheckBox" Content="Remember Me" Foreground="White" Margin="525,340,0,0" VerticalAlignment="Top"/>
|
||||
<TextBlock TextWrapping="Wrap" Height="26" Width="123" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="20" Margin="16,300,0,0" FontFamily="Arial Black" Text="Settings"/>
|
||||
<TextBlock TextWrapping="Wrap" Height="49" Width="400" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="20" Margin="428,535,0,0" FontFamily="Arial Black" RenderTransformOrigin="0.505,0.538"><Run Text=" Launcher made For ByteFN"/><LineBreak/><Run Text=" Dsc.gg/bytefn"/></TextBlock>
|
||||
<Grid Margin="238,403,322,205" MouseLeftButtonDown="DiscordLinkCard_MouseLeftButtonDown" MouseEnter="DiscordLinkCard_MouseEnter" MouseLeave="DiscordLinkCard_MouseLeave">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Newtonsoft.Json;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
public partial class Settings : UserControl
|
||||
{
|
||||
private DispatcherTimer timer;
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadSettings();
|
||||
|
||||
|
||||
timer = new DispatcherTimer();
|
||||
timer.Interval = TimeSpan.FromSeconds(1);
|
||||
timer.Tick += Timer_Tick;
|
||||
timer.Start();
|
||||
|
||||
|
||||
this.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
clock.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
private void DiscordLinkCard_MouseLeftButtonDown(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process process = new Process();
|
||||
process.StartInfo.UseShellExecute = true;
|
||||
process.StartInfo.FileName = "https://cdn.discordapp.com/attachments/1176535201661337700/1221194199668621322/Cobalt.dll?ex=6611b0b9&is=65ff3bb9&hm=ed96b7551fb9f58e8d2890a830e6ef0a986a152958ece80feee78164b8ebd8ee&";
|
||||
process.Start();
|
||||
}
|
||||
|
||||
private void DiscordLinkCard_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Hand;
|
||||
}
|
||||
|
||||
private void DiscordLinkCard_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Arrow;
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists("credentials.json"))
|
||||
{
|
||||
string json = File.ReadAllText("credentials.json");
|
||||
dynamic credentials = JsonConvert.DeserializeObject(json);
|
||||
|
||||
string email = credentials.Email;
|
||||
string password = credentials.Password;
|
||||
bool rememberMe = credentials.RememberMe;
|
||||
|
||||
EmailTextBox.Text = email;
|
||||
PasswordBox.Password = password;
|
||||
RememberMeCheckBox.IsChecked = rememberMe;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error loading settings: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string email = EmailTextBox.Text;
|
||||
string password = PasswordBox.Password;
|
||||
bool rememberMe = RememberMeCheckBox.IsChecked ?? false;
|
||||
|
||||
dynamic credentials = new
|
||||
{
|
||||
Email = email,
|
||||
Password = password,
|
||||
RememberMe = rememberMe
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(credentials);
|
||||
File.WriteAllText("credentials.json", json);
|
||||
|
||||
MessageBox.Show("Settings saved successfully.", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error saving settings: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void EmailTextBox_GotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (EmailTextBox.Text == "Email")
|
||||
{
|
||||
EmailTextBox.Text = "";
|
||||
EmailTextBox.Foreground = Brushes.White;
|
||||
}
|
||||
}
|
||||
|
||||
private void EmailTextBox_LostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(EmailTextBox.Text))
|
||||
{
|
||||
EmailTextBox.Text = "Email";
|
||||
EmailTextBox.Foreground = Brushes.Gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 786 KiB |
@@ -0,0 +1,49 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.download"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:N="clr-namespace:WpfApp6.Pages"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
mc:Ignorable="d" d:DesignWidth="890" Height="650">
|
||||
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="CaptionTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Rectangle Fill="#FF111111" Margin="40,346,60,242" RadiusX="10" RadiusY="10"/>
|
||||
<Image HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="818" Source="/Pages/Banner.png" RenderTransformOrigin="1.268,0.599" Margin="44,0,0,0"/>
|
||||
<TextBlock TextWrapping="Wrap" Height="20" Width="154" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Margin="120,354,0,0" FontFamily="Arial Black" Text="Fortnite 8.51"/>
|
||||
<Image HorizontalAlignment="Left" Height="50" VerticalAlignment="Top" Width="73" Source="/Pages/Fortnites11.png" RenderTransformOrigin="1.268,0.599" Margin="53,352,0,0"/>
|
||||
|
||||
<TextBlock x:Name="clock"
|
||||
Height="61"
|
||||
Margin="-70,136,0,0"
|
||||
VerticalAlignment="Top"
|
||||
Padding="70,0,0,0"
|
||||
FontFamily="Impact"
|
||||
TextAlignment="Center"
|
||||
Foreground="White"
|
||||
FontSize="50">
|
||||
</TextBlock>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="DownloadBuild" Content="Start Download" Click="DownloadBuild_Click" Margin="658,361,0,0" VerticalAlignment="Top"/>
|
||||
<Border BorderThickness="0.5" HorizontalAlignment="Left" Height="2" Margin="15,0,0,0" VerticalAlignment="Center" Width="825" Background="White" Opacity="0.4"/>
|
||||
<TextBlock TextWrapping="Wrap" Height="26" Width="123" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="20" Margin="16,300,0,0" FontFamily="Arial Black" Text="Downloads"/>
|
||||
</Grid>
|
||||
<TextBlock TextWrapping="Wrap" Height="20" Width="232" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Margin="120,379,0,0" FontFamily="Arial Black" Text="ByteFN"/>
|
||||
<TextBlock TextWrapping="Wrap" Height="20" Width="83" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Margin="445,369,0,0" FontFamily="Arial Black" RenderTransformOrigin="0.479,0.45" Text="unavalible"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
public partial class download : UserControl
|
||||
{
|
||||
private DispatcherTimer timer;
|
||||
|
||||
|
||||
private void DownloadBuild_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process process = new Process();
|
||||
process.StartInfo.UseShellExecute = true;
|
||||
process.StartInfo.FileName = "https://cdn.fnbuilds.services/8.51.rar";
|
||||
process.Start();
|
||||
}
|
||||
|
||||
|
||||
public download()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Initialize and start the timer
|
||||
timer = new DispatcherTimer();
|
||||
timer.Interval = TimeSpan.FromSeconds(1); // Update every second
|
||||
timer.Tick += Timer_Tick;
|
||||
timer.Start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
// Update the clock content here
|
||||
clock.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user