Beispiel #1
0
        private void btnEntryCommit_Click(object sender, EventArgs e)
        {
            if (lstEntries.SelectedItems.Count > 0)
            {
                MadScience.Wrappers.BoneDeltaEntry entry = this.bdFile.bonedelta.entries[lstEntries.SelectedIndices[0]];
                try
                {
                    //lstEntries.SelectedItems[0].SubItems[1].Text = cmbBoneList.Text;
                    //lstEntries.SelectedItems[0].SubItems[1].Text = lstBones.SelectedItems[0].Text;
                    lstEntries.SelectedItems[0].SubItems[1].Text = listBox1.Text;

                    entry.boneHash = MadScience.StringHelpers.ParseHex32("0x" + txtBoneHash.Text);
                    entry.offset.x = Convert.ToSingle(txtMinX.Text, CultureInfo.InvariantCulture);
                    entry.offset.y = Convert.ToSingle(txtMinY.Text, CultureInfo.InvariantCulture);
                    entry.offset.z = Convert.ToSingle(txtMinZ.Text, CultureInfo.InvariantCulture);
                    entry.scale.x  = Convert.ToSingle(txtMaxX.Text, CultureInfo.InvariantCulture);
                    entry.scale.y  = Convert.ToSingle(txtMaxY.Text, CultureInfo.InvariantCulture);
                    entry.scale.z  = Convert.ToSingle(txtMaxZ.Text, CultureInfo.InvariantCulture);
                    entry.quat.x   = Convert.ToSingle(txtQuatX.Text, CultureInfo.InvariantCulture);
                    entry.quat.y   = Convert.ToSingle(txtQuatY.Text, CultureInfo.InvariantCulture);
                    entry.quat.z   = Convert.ToSingle(txtQuatZ.Text, CultureInfo.InvariantCulture);
                    entry.quat.w   = Convert.ToSingle(txtQuatW.Text, CultureInfo.InvariantCulture);
                    this.bdFile.bonedelta.entries[lstEntries.SelectedIndices[0]] = entry;
                    entry = null;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error in numbers " + ex.Message);
                }
            }
        }
Beispiel #2
0
 private void txtBoneHash_TextChanged(object sender, EventArgs e)
 {
     if (lstEntries.SelectedItems.Count > 0)
     {
         MadScience.Wrappers.BoneDeltaEntry entry = this.bdFile.bonedelta.entries[lstEntries.SelectedIndices[0]];
         entry.boneHash = MadScience.StringHelpers.ParseHex32("0x" + txtBoneHash.Text);
         //lstEntries.SelectedItems[0].SubItems[1].Text = cmbBoneList.Text;
         lstEntries.SelectedItems[0].SubItems[1].Text = listBox1.Text.Trim();
         //lstEntries.SelectedItems[0].SubItems[1].Text = lstBones.SelectedItems[0].Text.Trim();
     }
 }
Beispiel #3
0
 private void btnEntryCopy_Click(object sender, EventArgs e)
 {
     if (lstEntries.SelectedItems.Count > 0)
     {
         // Applys the settings only to all bones
         for (int i = 0; i < this.bdFile.bonedelta.entries.Count; i++)
         {
             if (i != lstEntries.SelectedItems[0].Index)
             {
                 MadScience.Wrappers.BoneDeltaEntry entry = this.bdFile.bonedelta.entries[i];
                 entry.offset.x = Convert.ToSingle(txtMinX.Text, CultureInfo.InvariantCulture);
                 entry.offset.y = Convert.ToSingle(txtMinY.Text, CultureInfo.InvariantCulture);
                 entry.offset.z = Convert.ToSingle(txtMinZ.Text, CultureInfo.InvariantCulture);
                 entry.scale.x  = Convert.ToSingle(txtMaxX.Text, CultureInfo.InvariantCulture);
                 entry.scale.y  = Convert.ToSingle(txtMaxY.Text, CultureInfo.InvariantCulture);
                 entry.scale.z  = Convert.ToSingle(txtMaxZ.Text, CultureInfo.InvariantCulture);
                 entry.quat.x   = Convert.ToSingle(txtQuatX.Text, CultureInfo.InvariantCulture);
                 entry.quat.y   = Convert.ToSingle(txtQuatY.Text, CultureInfo.InvariantCulture);
                 entry.quat.z   = Convert.ToSingle(txtQuatZ.Text, CultureInfo.InvariantCulture);
                 entry.quat.w   = Convert.ToSingle(txtQuatW.Text, CultureInfo.InvariantCulture);
             }
         }
     }
 }