Ejemplo n.º 1
0
        private void MeshSlotFilenameUpdated(object sender, ResourceBuilder.StringEventArgs e)
        {
            MeshSlotParameter updatedParam = MeshSlotParameter.IB;

            if (sender == ibResource)
            {
                updatedParam = MeshSlotParameter.IB;
                ModPackGui.CacheString(e.value, ref ModPackGui.ibList);
            }
            else if (sender == vbResource)
            {
                updatedParam = MeshSlotParameter.VB;
                ModPackGui.CacheString(e.value, ref ModPackGui.vbList);
            }
            else if (sender == sibResource)
            {
                updatedParam = MeshSlotParameter.SIB;
                ModPackGui.CacheString(e.value, ref ModPackGui.ibList);
            }
            else if (sender == svbResource)
            {
                updatedParam = MeshSlotParameter.SVB;
                ModPackGui.CacheString(e.value, ref ModPackGui.vbList);
            }
            else if (sender == ps0Resource)
            {
                updatedParam = MeshSlotParameter.PS0;
                ModPackGui.CacheString(e.value, ref ModPackGui.textureList);
            }
            else if (sender == ps1Resource)
            {
                updatedParam = MeshSlotParameter.PS1;
                ModPackGui.CacheString(e.value, ref ModPackGui.textureList);
            }
            else if (sender == ps2Resource)
            {
                updatedParam = MeshSlotParameter.PS2;
                ModPackGui.CacheString(e.value, ref ModPackGui.textureList);
            }
            else if (sender == pscb2Resource)
            {
                updatedParam = MeshSlotParameter.PSCB2;
                ModPackGui.CacheString(e.value, ref ModPackGui.constantBufferList);
            }
            if (sender is ResourceBuilder)
            {
                (sender as ResourceBuilder).SetValue(e.value);
            }

            MeshSlotUpdated?.Invoke(this, new MeshSlotParameterEventArgs(updatedParam, e.value));
        }
Ejemplo n.º 2
0
        private void MeshSlotFilenameUpdated(object sender, ResourceBuilder.StringEventArgs e)
        {
            Option selectedOption = this.optionsBox.SelectedItem as Option;

            if (selectedOption != null)
            {
                foreach (BodyMesh bodyMesh in selectedOption.BodyMeshes)
                {
                    switch (bodyMesh.MeshType)
                    {
                    case BodyMeshType.Torso:
                        if (sender == resourceNailIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.chestIBList);
                        }
                        else if (sender == resourceNailVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.chestVBList);
                        }
                        break;

                    case BodyMeshType.Breast:
                        if (sender == resourceSkinIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.breastIBList);
                        }
                        else if (sender == resourceSkinVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.breastVBList);
                        }
                        break;

                    case BodyMeshType.Groin:
                        if (sender == resourceSkinIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.groinIBList);
                        }
                        else if (sender == resourceSkinVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.groinVBList);
                        }
                        break;

                    case BodyMeshType.Arm:
                        if (sender == resourceSkinIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.armIBList);
                        }
                        else if (sender == resourceSkinVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.armVBList);
                        }
                        break;

                    case BodyMeshType.Leg:
                        if (sender == resourceSkinIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.legIBList);
                        }
                        else if (sender == resourceSkinVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.legVBList);
                        }
                        break;

                    case BodyMeshType.FingerNail:
                        if (sender == resourceNailIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.fingerNailIBList);
                        }
                        else if (sender == resourceNailVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.fingerNailVBList);
                        }
                        break;

                    case BodyMeshType.ToeNail:
                        if (sender == resourceNailIB)
                        {
                            bodyMesh.IndexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.IndexBuffer, ref ModPackGui.toeNailIBList);
                        }
                        else if (sender == resourceNailVB)
                        {
                            bodyMesh.VertexBuffer = e.value;
                            ModPackGui.CacheString(bodyMesh.VertexBuffer, ref ModPackGui.toeNailVBList);
                        }
                        break;
                    }
                }
            }
        }