示例#1
0
        private void FindPaksB_Click(object sender, EventArgs e)
        {
            try
            {
                string line;
                string path;
                string EpicDir = Swapper.GetEpicDir();
                if (EpicDir == "a")
                {
                    MessageBox.Show("Please select your pak files manually!", Form1.swappername, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                StreamReader file = new StreamReader(EpicDir);
                while ((line = file.ReadLine()) != null)
                {
                    if (line.Contains("\"InstallLocation\"") && line.Contains("Fortnite"))
                    {
                        path = line.Replace("\"InstallLocation\": \"", "").Replace(@"\\", @"\").Replace("Fortnite\",", @"Fortnite\FortniteGame\Content\Paks").Trim();
                        SavePaks(path);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Swapper.CloseFN();
            this.Text = swappername + " | " + swapfrom + " - " + swapto;

            label3.Text = Properties.Settings.Default.item;
            switch (label3.Text)
            {
            case "ON":
                label3.ForeColor = Color.Lime;
                ConvertB.Enabled = false;
                RevertB.Enabled  = true;
                break;

            case "OFF":
                label3.ForeColor = Color.Red;
                ConvertB.Enabled = true;
                RevertB.Enabled  = false;
                break;
            }
        }
        private void Swap_DoWork(object sender, DoWorkEventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;
            Stopwatch s = new Stopwatch();

            s.Start();


            //Swaps Swapper.Swap(string pakslocation, byte array to search, byte array to replace, long to start offset)
            Swapper.Swap(path3, search1, replace1, swap1offset);


            Log("Converted Item");
            label3.Text      = "ON";
            label3.ForeColor = Color.Lime;
            s.Stop();
            if (showswaptime)
            {
                Log("Converted in " + s.ElapsedMilliseconds + "ms");
            }
        }