Example #1
0
        private void SwapButton_Click(object sender, EventArgs e)
        {
            string path = global.CurrentConfig.Paks + @"\pakchunk0-WindowsClient.sig";

            if (!File.Exists(path))
            {
                MessageBox.Show("Select your paks folder in Settings", "Pro Swapper");
                return;
            }
            if (!EpicGamesLauncher.CloseFNPrompt())
            {
                return;
            }
            foreach (api.Asset asset in ThisItem.Asset)
            {
                //Check if replace is longer
                for (int i = 0; i < asset.Search.Length; i++)
                {
                    if (asset.Search[i].Length < asset.Replace[i].Length)
                    {
                        string error = "The replace length is longer than the search, pleaes make sure the search is greater than or equal to the replace length";
                        MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Log(error);
                        return;
                    }
                }
            }
            logbox.Clear();
            Log("Loading...");
            bool isconverting = ((BunifuFlatButton)(sender)).Text == "Convert";

            Task.Run(() => ButtonbgWorker(isconverting));
        }
Example #2
0
        private void SwapButton_Click(object sender, EventArgs e)
        {
            string path = global.CurrentConfig.Paks + @"\pakchunk0-WindowsClient.sig";

            if (!File.Exists(path))
            {
                MessageBox.Show("Select your paks folder in Settings", "Pro Swapper");
                return;
            }
            if (!EpicGamesLauncher.CloseFNPrompt())
            {
                return;
            }

            logbox.Clear();
            Log("Loading...");
            bool isconverting = ((BunifuFlatButton)(sender)).Text == "Convert";

            Task.Run(() => ButtonbgWorker(isconverting));
        }
Example #3
0
        private static void Main()
        {
            try
            {
                //Kill duplicate Pro Swapper's
                Process CurrentProc = Process.GetCurrentProcess();
                foreach (Process proc in Process.GetProcessesByName(CurrentProc.ProcessName))
                {
                    if (proc.Id != CurrentProc.Id)
                    {
                        proc.Kill();
                    }
                }


                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Directory.CreateDirectory(global.ProSwapperFolder + "\\Config");
                Directory.CreateDirectory(global.ProSwapperFolder + "\\Images");
                global.InitConfig();
                logger = new Logger.Logger(global.ProSwapperFolder + "Pro_Swapper.log");
                logger.Log($"Pro Swapper Version: {global.version}");
                UI.Splash splash = new UI.Splash();
                Task.Run(() => Application.Run(splash));
                logger.Log("Started Splash Screen");

                if (!File.Exists(global.CurrentConfig.Paks + @"\pakchunk0-WindowsClient.sig"))
                {
                    logger.Log("Fortnite paks have not been found! Searching for paks now");
                    if (EpicGamesLauncher.FindPakFiles() && global.CurrentConfig.Paks.Contains("Paks"))
                    {
                        logger.Log($"Found paks folder -> {global.CurrentConfig.Paks}");
                    }
                    else
                    {
                        logger.Log($"ERROR -> Paks folder could not be found!");
                        MessageBox.Show("Your Fortnite install location could not be found! Please make sure you have Fortnite installed!", "Pro Swapper", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                logger.Log(global.GetPaksList);

                if (!File.Exists(oodledll))
                {
                    if (EpicGamesLauncher.GetOodleDll(out string oodleFilePath))
                    {
                        File.Copy(oodleFilePath, oodledll);
                        logger.Log($"Copied {oodledll} from {oodleFilePath}!");
                    }
                    else
                    {
                        File.WriteAllBytes(oodledll, new WebClient().DownloadData("https://cdn.proswapper.xyz/oo2core_5_win64.dll"));
                        logger.Log($"Downloaded {oodledll} from Pro Swapper cdn. ??? Not found in user's game files");
                    }
                }
                else
                {
                    logger.Log($"{oodledll} already exists so no need to fetch it!");
                }
                logger.Log("Running main form");
                Application.Run(new Main(splash));
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
            }
        }
Example #4
0
        private void Main_Load(object sender, EventArgs e)
        {
            try
            {
                global.CreateDir(global.ProSwapperFolder);
                api.UpdateAPI();
                string apiversion = api.apidata.version;
                string thishr     = DateTime.Now.ToString("MMddHH");

                if (global.ReadSetting(global.Setting.lastopened) != thishr)
                {
                    string discordurl = api.apidata.discordurl;
                    Process.Start(discordurl);
                    global.WriteSetting(thishr, global.Setting.lastopened);
                }

                if (!apiversion.Contains(global.version)) //if outdated
                {
                    MessageBox.Show("New Pro Swapper Update found! Redirecting you to the new download!", "Pro Swapper Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Process.Start("https://linkvertise.com/86737/proswapper");
                    Cleanup();
                }

                string filename = AppDomain.CurrentDomain.FriendlyName;
                if (!filename.Contains("Pro") && !filename.Contains("Swapper"))
                {
                    ThrowError("This version of Pro Swapper has been modified (renamed) " + filename + " , please download the original Pro Swapper on the Discord server");
                }


                if (apiversion.Contains("OFFLINE"))
                {
                    ThrowError("Pro Swapper is currently not working. Take a look at our Discord for any announcments");
                }


                string[] data    = global.ReadSetting(global.Setting.theme).Split(';');
                string[] panel1d = data[0].Split(',');
                string[] panel2d = data[1].Split(',');
                string[] panel3d = data[2].Split(',');
                string[] panel4d = data[3].Split(',');
                global.MainMenu  = Color.FromArgb(255, int.Parse(panel1d[0]), int.Parse(panel1d[1]), int.Parse(panel1d[2]));
                global.ItemsBG   = Color.FromArgb(255, int.Parse(panel2d[0]), int.Parse(panel2d[1]), int.Parse(panel2d[2]));
                global.Button    = Color.FromArgb(255, int.Parse(panel3d[0]), int.Parse(panel3d[1]), int.Parse(panel3d[2]));
                global.TextColor = Color.FromArgb(255, int.Parse(panel4d[0]), int.Parse(panel4d[1]), int.Parse(panel4d[2]));

                RPC.rpctimestamp = Timestamps.Now;
                RPC.InitializeRPC();
                new Thread(LoadIcons).Start();
                new Thread(CloseFN).Start();
                Icon   = appIcon;
                Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 30, 30));
                SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                versionlabel.Text = global.version;
                if (!File.Exists(global.ReadSetting(global.Setting.Paks) + @"\pakchunk0-WindowsClient.sig"))
                {
                    EpicGamesLauncher.FindPakFiles();
                }

                panelContainer.Controls.Add(Dashboard.Instance);
                #region ThemeColors
                BackColor                          = global.MainMenu;
                panel1.BackColor                   = global.MainMenu;
                bunifuFlatButton1.BackColor        = global.Button;
                bunifuFlatButton1.IconZoom         = 85;
                bunifuFlatButton1.Normalcolor      = global.Button;
                bunifuFlatButton1.OnHovercolor     = global.Button;
                bunifuFlatButton1.Activecolor      = global.Button;
                bunifuFlatButton1.Textcolor        = global.TextColor;
                bunifuFlatButton1.OnHoverTextColor = global.TextColor;
                bunifuFlatButton2.BackColor        = global.Button;
                bunifuFlatButton2.Normalcolor      = global.Button;
                bunifuFlatButton2.OnHovercolor     = global.Button;
                bunifuFlatButton2.Activecolor      = global.Button;
                bunifuFlatButton2.Textcolor        = global.TextColor;
                bunifuFlatButton2.OnHoverTextColor = global.TextColor;
                bunifuFlatButton2.IconZoom         = 90;
                bunifuFlatButton3.BackColor        = global.Button;
                bunifuFlatButton3.Normalcolor      = global.Button;
                bunifuFlatButton3.OnHovercolor     = global.Button;
                bunifuFlatButton3.Activecolor      = global.Button;
                bunifuFlatButton3.Textcolor        = global.TextColor;
                bunifuFlatButton3.OnHoverTextColor = global.TextColor;
                bunifuFlatButton3.IconZoom         = 90;
                bunifuFlatButton4.BackColor        = global.Button;
                bunifuFlatButton4.Normalcolor      = global.Button;
                bunifuFlatButton4.OnHovercolor     = global.Button;
                bunifuFlatButton4.Activecolor      = global.Button;
                bunifuFlatButton4.Textcolor        = global.TextColor;
                bunifuFlatButton4.OnHoverTextColor = global.TextColor;
                bunifuFlatButton4.IconZoom         = 100;
                bunifuFlatButton5.BackColor        = global.Button;
                bunifuFlatButton5.Normalcolor      = global.Button;
                bunifuFlatButton5.OnHovercolor     = global.Button;
                bunifuFlatButton5.Activecolor      = global.Button;
                bunifuFlatButton5.Textcolor        = global.TextColor;
                bunifuFlatButton5.OnHoverTextColor = global.TextColor;
                bunifuFlatButton5.IconZoom         = 90;
                bunifuFlatButton6.BackColor        = global.Button;
                bunifuFlatButton6.Normalcolor      = global.Button;
                bunifuFlatButton6.OnHovercolor     = global.Button;
                bunifuFlatButton6.Activecolor      = global.Button;
                bunifuFlatButton6.Textcolor        = global.TextColor;
                bunifuFlatButton6.OnHoverTextColor = global.TextColor;
                bunifuFlatButton6.IconZoom         = 85;
                versionlabel.ForeColor             = global.TextColor;
                #endregion
                if (!EpicGamesLauncher.InstalledFortniteVersion().Contains(api.apidata.fnver))
                {
                    new Message("Hold Up!", $"Looks like there has recently been a Fortnite update and Pro Swapper hasn't been updated for that new version. Please check again later, also don't delete this program because it'll auto update :)\n\nDebug Info:\nInstalled Version: {EpicGamesLauncher.InstalledFortniteVersion()}\nAPI Version:{api.apidata.fnver}", true).ShowDialog();
                }
            }
            catch (Exception ex)
            {
                ThrowError(ex.Message);
            }
        }