private void MeshSlotSIBFormatUpdated(object sender, EventArgs e)
        {
            shadowFormatValue = this.shadowFormat.Text;
            ModPackGui.CacheString(shadowFormatValue, ref ModPackGui.formatList);

            MeshSlotUpdated?.Invoke(this, new MeshSlotParameterEventArgs(MeshSlotParameter.SIB_FORMAT, this.shadowFormat.Text));
        }
        public void SetBindingList(ref BindingList <String> bindingList)
        {
            BindingSource bSource = new BindingSource();

            bSource.DataSource   = bindingList;
            bSource.ListChanged += BSource_ListChanged;
            String currentValue = this.filenameBox.Text;

            ModPackGui.CacheString(currentValue, ref bindingList);
            this.filenameBox.DataSource   = bSource;
            this.filenameBox.SelectedItem = currentValue;
        }
        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));
        }
        private void comboNailFormat_Leave(object sender, EventArgs e)
        {
            Option selectedOption = this.optionsBox.SelectedItem as Option;

            if (selectedOption != null)
            {
                foreach (BodyMesh nailMesh in selectedOption.BodyMeshes)
                {
                    if (nailMesh.MeshType == BodyMeshType.Torso || nailMesh.MeshType == BodyMeshType.FingerNail || nailMesh.MeshType == BodyMeshType.ToeNail)
                    {
                        nailMesh.Format = this.comboNailFormat.Text;
                        ModPackGui.CacheString(nailMesh.Format, ref ModPackGui.formatList);
                    }
                }
            }
        }
        private void comboBoxBodyFormat_Leave(object sender, EventArgs e)
        {
            Option selectedOption = this.optionsBox.SelectedItem as Option;

            if (selectedOption != null)
            {
                foreach (BodyMesh bodyMesh in selectedOption.BodyMeshes)
                {
                    if (bodyMesh.MeshType == BodyMeshType.Breast || bodyMesh.MeshType == BodyMeshType.Groin || bodyMesh.MeshType == BodyMeshType.Arm || bodyMesh.MeshType == BodyMeshType.Leg)
                    {
                        bodyMesh.Format = this.comboBoxBodyFormat.Text;
                        ModPackGui.CacheString(bodyMesh.Format, ref ModPackGui.formatList);
                    }
                }
            }
        }
Example #6
0
        public SkinCustomizer(CCModConfig.BodyMesh bMesh, CCModConfig.ModelType modelType)
        {
            InitializeComponent();
            SkinTextures = new Dictionary <string, string>();

            TanTexture = bMesh.TanTexture;

            StringCollection textureSlots = Properties.Settings.Default.CommonSkins;

            if (modelType == CCModConfig.ModelType.Honoka)
            {
                resourceBuilderTan.SetBindingList(ref ModPackGui.honokaTanList);
                textureSlots = Properties.Settings.Default.HonokaSkins;
            }
            else if (modelType == CCModConfig.ModelType.MarieRose)
            {
                resourceBuilderTan.SetBindingList(ref ModPackGui.marieTanList);
                textureSlots = Properties.Settings.Default.MarieSkins;
            }
            else
            {
                resourceBuilderTan.SetBindingList(ref ModPackGui.commonTanList);
            }

            foreach (CCModConfig.SkinTexture aSkinTexture in bMesh.SkinTextures)
            {
                SkinTextures[aSkinTexture.SkinSlot] = aSkinTexture.Filename;
            }

            this.SuspendLayout();
            foreach (String aTextureSlot in textureSlots)
            {
                if (!SkinTextures.ContainsKey(aTextureSlot))
                {
                    SkinTextures[aTextureSlot] = "";
                }

                this.tableLayoutPanel1.RowCount++;
                this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 40.0f));

                ResourceBuilder textureSlotResource = new ResourceBuilder();
                textureSlotResource.FileFilter = "DDS (*.dds)|*.dds|PNG (*.png)|*.png";
                textureSlotResource.Dock       = DockStyle.Top;
                if (modelType == CCModConfig.ModelType.Honoka)
                {
                    textureSlotResource.SetBindingList(ref ModPackGui.honokaSkinList);
                }
                else if (modelType == CCModConfig.ModelType.MarieRose)
                {
                    textureSlotResource.SetBindingList(ref ModPackGui.marieSkinList);
                }
                else
                {
                    textureSlotResource.SetBindingList(ref ModPackGui.commonSkinList);
                }
                textureSlotResource.SetValue(SkinTextures[aTextureSlot]);

                textureSlotResource.ResourceUpdated = delegate(object sender, ResourceBuilder.StringEventArgs e)
                {
                    SkinTextures[aTextureSlot] = e.value;
                    if (modelType == CCModConfig.ModelType.Honoka)
                    {
                        ModPackGui.CacheString(e.value, ref ModPackGui.honokaSkinList);
                    }
                    else if (modelType == CCModConfig.ModelType.MarieRose)
                    {
                        ModPackGui.CacheString(e.value, ref ModPackGui.marieSkinList);
                    }
                    else
                    {
                        ModPackGui.CacheString(e.value, ref ModPackGui.commonSkinList);
                    }
                };

                Label textureLabel = new Label();
                textureLabel.Text      = aTextureSlot;
                textureLabel.Dock      = DockStyle.Fill;
                textureLabel.AutoSize  = false;
                textureLabel.TextAlign = ContentAlignment.MiddleCenter;

                this.tableLayoutPanel1.Controls.Add(textureLabel);
                this.tableLayoutPanel1.Controls.Add(textureSlotResource);
            }

            this.tableLayoutPanel1.RowCount++;
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 40.0f));

            Button okButton = new Button();

            okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.tableLayoutPanel1.SetColumnSpan(okButton, 2);
            okButton.Location = new System.Drawing.Point(367, 453);
            okButton.Margin   = new System.Windows.Forms.Padding(3, 3, 20, 10);
            okButton.Size     = new System.Drawing.Size(91, 29);
            okButton.TabIndex = 100;
            okButton.Text     = "OK";
            okButton.UseVisualStyleBackColor = true;
            okButton.Click += new System.EventHandler(this.buttonOK_Click);
            this.tableLayoutPanel1.Controls.Add(okButton);

            this.ResumeLayout();
        }
        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;
                    }
                }
            }
        }