1
0
mirror of synced 2025-01-19 01:14:08 +01:00

Don't use datasource for some comboxes due to some bugs

This commit is contained in:
KillzXGaming 2019-04-30 18:26:15 -04:00
parent 9afacd835c
commit 819568b636
6 changed files with 30 additions and 13 deletions

Binary file not shown.

View File

@ -42,23 +42,29 @@ namespace FirstPlugin
public void LoadBone(BfresBone bn)
{
activeBone = bn;
IsLoaded = false;
rotModeCB.Items.Clear();
billboardModeCB.Items.Clear();
activeBone = bn;
boneInfoPanel1.LoadBone(bn);
foreach (var item in Enum.GetValues(typeof(BoneFlagsRotation)))
rotModeCB.Items.Add(item);
if (bn.BoneU != null)
{
var bone = bn.BoneU;
userDataEditor1.LoadUserData(bone.UserData);
rotModeCB.DataSource = Enum.GetValues(typeof(ResU.BoneFlagsRotation));
foreach (var item in Enum.GetValues(typeof(ResU.BoneFlagsBillboard)))
billboardModeCB.Items.Add(item);
rotModeCB.SelectedItem = bone.FlagsRotation;
billboardModeCB.DataSource = Enum.GetValues(typeof(ResU.BoneFlagsBillboard));
billboardModeCB.SelectedItem = bone.FlagsBillboard;
billboardIndexUD.Value = bone.BillboardIndex;
@ -86,11 +92,10 @@ namespace FirstPlugin
var bone = bn.Bone;
userDataEditor1.LoadUserData(bone.UserData.ToList());
foreach (var item in Enum.GetValues(typeof(BoneFlagsBillboard)))
billboardModeCB.Items.Add(item);
rotModeCB.DataSource = Enum.GetValues(typeof(BoneFlagsRotation));
rotModeCB.SelectedItem = bone.FlagsRotation;
billboardModeCB.DataSource = Enum.GetValues(typeof(ResU.BoneFlagsBillboard));
billboardModeCB.SelectedItem = bone.FlagsBillboard;
billboardIndexUD.Bind(bone, "BillboardIndex");

View File

@ -29,21 +29,33 @@ namespace FirstPlugin.Forms
public void LoadSkeleton(FSKL fskl)
{
IsLoaded = false;
rotationModeCB.DataSource = null;
scalingModeCB.DataSource = null;
rotationModeCB.Items.Clear();
scalingModeCB.Items.Clear();
activeSkeleton = fskl;
if (fskl.node.SkeletonU != null)
{
Console.WriteLine("FlagsScaling " + fskl.node.SkeletonU.FlagsScaling);
rotationModeCB.DataSource = Enum.GetValues(typeof(ResU.SkeletonFlagsRotation));
scalingModeCB.DataSource = Enum.GetValues(typeof(ResU.SkeletonFlagsScaling));
foreach (var item in Enum.GetValues(typeof(ResU.SkeletonFlagsRotation)))
rotationModeCB.Items.Add(item);
foreach (var item in Enum.GetValues(typeof(ResU.SkeletonFlagsScaling)))
scalingModeCB.Items.Add(item);
rotationModeCB.SelectedItem = fskl.node.SkeletonU.FlagsRotation;
scalingModeCB.SelectedItem = fskl.node.SkeletonU.FlagsScaling;
Console.WriteLine("FlagsScaling " + fskl.node.SkeletonU.FlagsScaling);
}
else
{
rotationModeCB.DataSource = Enum.GetValues(typeof(SkeletonFlagsRotation));
scalingModeCB.DataSource = Enum.GetValues(typeof(SkeletonFlagsScaling));
foreach (var item in Enum.GetValues(typeof(SkeletonFlagsRotation)))
rotationModeCB.Items.Add(item);
foreach (var item in Enum.GetValues(typeof(SkeletonFlagsScaling)))
scalingModeCB.Items.Add(item);
rotationModeCB.SelectedItem = fskl.node.Skeleton.FlagsRotation;
scalingModeCB.SelectedItem = fskl.node.Skeleton.FlagsScaling;
}