Пример #1
0
    public static void DownloadValues(TextBox txt, Action update)
    {
        string id = txt.Text;

        if (id.Length != 8)
        {
            MessageBox.Show("Invalid ID detected.\nPlease ensure your ID is correct and try again.", "Dynago", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            return;
        }
        string result = Networking.ShareDownload("values", id);

        if (string.IsNullOrEmpty(result))
        {
            MessageBox.Show("An error has occurred.\nUnable to download values from ID: " + id + "\nPlease ensure your ID is correct and try again.", "Dynago", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            return;
        }
        int validOffsets = 0, validBones = 0;

        OffsetList.ParseOffsets(OffsetList.List, result, ref validOffsets);
        BoneList.ParseBones(BoneList.List, result, ref validBones);
        MessageBox.Show("Values downloaded and parsed successfully!\n" +
                        "Valid Offsets: " + validOffsets + "/" + OffsetList.List.Count + "\n" +
                        "Valid Bones: " + validBones + "/" + BoneList.List.Count,
                        "Dynago", MessageBoxButtons.OK, MessageBoxIcon.Information);
        txt.Clear();
        update();
    }