private void comboBoxCharacters_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!_IsInitialized)
            {
                return;
            }

            _CurrentFighter = DB.FightersDB.Fighters[comboBoxCharacters.SelectedIndex];
            GetCurrentCharacterActiveMods();
            _GridSlots.ChangeSelectedFighter(_CurrentFighter);
            _GridSlotsInactive.ChangeSelectedFighter(_CurrentFighter);
            _GridGeneral.ChangeSelectedFighter(_CurrentFighter);
            _GridGeneralInactive.ChangeSelectedFighter(_CurrentFighter);
            Globals.EventManager.CharSlotModSelectionChanged(null);
        }
示例#2
0
 public void ChangeSelectedFighter(DB.Fighter a_fighter)
 {
     if (_ModListType == ModListType.General || _ModListType == ModListType.Stage)
     {
         return;
     }
     _CurrentFighter = a_fighter;
     if (_Rows != null)
     {
         for (int i = 0; i < _Rows.Count; ++i)
         {
             _Rows[i].ChangeSelectedFighter(_CurrentFighter);
         }
     }
     RefreshRowData();
 }
示例#3
0
        public SlotModProperties(string modPath, string charName, SmashProjectManager project)
        {
            InitializeComponent();
            ModPath              = modPath;
            CharName             = charName;
            _SmashProjectManager = project;
            DB.Fighter currentFighter = project._CharacterModsPage.CurrentFighter;
            PathKami    = ModPath + Path.DirectorySeparatorChar + "kamimod.xml";
            PathVoice   = ModPath + Path.DirectorySeparatorChar + "sound" + Path.DirectorySeparatorChar + "snd_vc_" + (string.IsNullOrEmpty(currentFighter.nameSoundPack) ? CharName : currentFighter.nameSoundPack) + "_cxx.nus3bank";
            PathSound   = ModPath + Path.DirectorySeparatorChar + "sound" + Path.DirectorySeparatorChar + "snd_se_" + (string.IsNullOrEmpty(currentFighter.nameSoundPack) ? CharName : currentFighter.nameSoundPack) + "_cxx.nus3bank";
            PathChr00   = ModPath + Path.DirectorySeparatorChar + "chr" + Path.DirectorySeparatorChar + "chr_00_" + CharName + "_XX.nut";
            PathChr11   = ModPath + Path.DirectorySeparatorChar + "chr" + Path.DirectorySeparatorChar + "chr_11_" + CharName + "_XX.nut";
            PathChr13   = ModPath + Path.DirectorySeparatorChar + "chr" + Path.DirectorySeparatorChar + "chr_13_" + CharName + "_XX.nut";
            PathStock90 = ModPath + Path.DirectorySeparatorChar + "chr" + Path.DirectorySeparatorChar + "stock_90_" + CharName + "_XX.nut";
            PathChrn11  = ModPath + Path.DirectorySeparatorChar + "chr" + Path.DirectorySeparatorChar + "chrn_11_" + CharName + "_XX.nut";

            XMLData = Utils.DeserializeXML <CharacterSlotModXML>(PathKami);
            if (XMLData == null)
            {
                return;
            }

            XMLData.isDirty = false;

            if (XMLData.BoxingRingText == null)
            {
                XMLData.BoxingRingText = String.Empty;
            }
            if (XMLData.CharacterName == null)
            {
                XMLData.CharacterName = String.Empty;
            }
            if (XMLData.DisplayName == null)
            {
                XMLData.DisplayName = String.Empty;
            }
            if (XMLData.Notes == null)
            {
                XMLData.Notes = String.Empty;
            }

            XMLData.chr_00   = File.Exists(PathChr00);
            XMLData.chr_11   = File.Exists(PathChr11);
            XMLData.chr_13   = File.Exists(PathChr13);
            XMLData.stock_90 = File.Exists(PathStock90);
            XMLData.chrn_11  = File.Exists(PathChrn11);
            XMLData.Voice    = File.Exists(PathVoice);
            XMLData.Sound    = File.Exists(PathSound);

            if (XMLData.chr_00)
            {
                pictureBox_chr00.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathChr00);
                UpdatePictureBoxClickable(pictureBox_chr00);
            }
            if (XMLData.chr_11)
            {
                pictureBox_chr11.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathChr11);
                UpdatePictureBoxClickable(pictureBox_chr11);
            }
            if (XMLData.chr_13)
            {
                pictureBox_chr13.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathChr13);
                UpdatePictureBoxClickable(pictureBox_chr13);
            }
            if (XMLData.stock_90)
            {
                pictureBox_stock90.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStock90);
                UpdatePictureBoxClickable(pictureBox_stock90);
            }
            if (XMLData.chrn_11)
            {
                pictureBox_chrn11.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathChrn11, true);
                UpdatePictureBoxClickable(pictureBox_chrn11);
            }

            textBoxDisplayName.Text       = XMLData.DisplayName;
            checkBoxUseCustomName.Checked = XMLData.UseCustomName;
            textBoxCustomName.Text        = XMLData.CharacterName;
            textBoxBoxingRing.Text        = XMLData.BoxingRingText.Replace("\n", "\r\n");
            textBoxCustomName.Enabled     = checkBoxUseCustomName.Checked;
            textBoxBoxingRing.Enabled     = checkBoxUseCustomName.Checked;

            bool hasModels = false;

            string[] nutFiles = new string[0];
            if (Directory.Exists(ModPath + Path.DirectorySeparatorChar + "model"))
            {
                if (Directory.Exists(ModPath + Path.DirectorySeparatorChar + "model" + Path.DirectorySeparatorChar + "body"))
                {
                    nutFiles = Directory.GetFiles(ModPath + Path.DirectorySeparatorChar + "model" + Path.DirectorySeparatorChar + "body", "*.nut", SearchOption.AllDirectories);
                }
                if (nutFiles.Length > 0)
                {
                    hasModels = true;
                }
                else
                {
                    nutFiles = Directory.GetFiles(ModPath + Path.DirectorySeparatorChar + "model", "*.nut", SearchOption.AllDirectories);
                    if (nutFiles.Length > 0)
                    {
                        hasModels = true;
                    }
                }
            }
            if (hasModels)
            {
                FileTypes.NUT nut = new FileTypes.NUT();
                nut.Read(nutFiles[0]);
                if (nut.Textures.Count > 0)
                {
                    XMLData.TextureID = (nut.Textures[0].HashId & 0x0000FF00) >> 8;
                }
                XMLData.Haslxx = Directory.Exists(ModPath + Path.DirectorySeparatorChar + "model" + Path.DirectorySeparatorChar + "lxx");
                List <string> modelparts = currentFighter.modelParts;
                if (modelparts != null)
                {
                    string modelsString = "";
                    for (int i = 0; i < modelparts.Count; ++i)
                    {
                        if (i != 0)
                        {
                            modelsString += ", ";
                        }
                        modelsString += modelparts[i] + " = " + (Directory.Exists(ModPath + Path.DirectorySeparatorChar + "model" + Path.DirectorySeparatorChar + modelparts[i]) ? "Yes" : "No");
                    }
                    if (currentFighter.lowPolySlots != DB.Fighter.LowPolySlots.None)
                    {
                        modelsString += ", lxx = " + (XMLData.Haslxx ? "Yes" : "No");
                    }
                    labelModels.Text = modelsString;
                }
            }
            else
            {
                labelModels.Text              = "Mod has no models";
                XMLData.TextureID             = -1;
                XMLData.MetalModel            = CharacterSlotModXML.MetalModelStatus.Works;
                comboBoxMetalModel.Enabled    = false;
                textBoxTextureID.Enabled      = false;
                buttonTextureIDChange.Enabled = false;
            }
            textBoxTextureID.Text = XMLData.TextureID.ToString();

            checkBoxWifiSafe.Checked      = XMLData.WifiSafe;
            comboBoxMetalModel.DataSource = new List <String> {
                "Unknown", "Works", "Errors", "Crashes"
            };
            comboBoxMetalModel.SelectedIndex = (int)XMLData.MetalModel;

            labelVoicePack.Text = XMLData.Voice ? "Yes" : "No";
            labelSoundPack.Text = XMLData.Sound ? "Yes" : "No";

            buttonExport_chr00.Enabled   = XMLData.chr_00;
            buttonExport_chr11.Enabled   = XMLData.chr_11;
            buttonExport_chr13.Enabled   = XMLData.chr_13;
            buttonExport_stock90.Enabled = XMLData.stock_90;
            buttonExport_chrn11.Enabled  = XMLData.chrn_11;
            buttonVoiceRemove.Enabled    = XMLData.Voice;
            buttonSoundRemove.Enabled    = XMLData.Sound;

            //TODO: Portraits

            textBoxNotes.Text = XMLData.Notes.Replace("\n", "\r\n");

            IsInitialized = true;
        }
        public void ChangeSelectedFighter(DB.Fighter a_fighter)
        {
            if (a_fighter == _CurrentFighter)
            {
                return;
            }
            _CurrentFighter = a_fighter;
            if (_Rows != null)
            {
                for (int i = 0; i < _Rows.Count; ++i)
                {
                    _Rows[i].ChangeSelectedFighter(_CurrentFighter);
                }
            }
            switch (_CurrentFighter.voicePackSlots)
            {
            case (DB.Fighter.VoicePackSlots.All): groupBoxVoiceMods.Visible = false; break;

            case (DB.Fighter.VoicePackSlots.One):
                comboBoxVoiceSlot2.Visible = false;
                groupBoxVoiceMods.Visible  = true;
                break;

            case (DB.Fighter.VoicePackSlots.Two):
                comboBoxVoiceSlot2.Visible = true;
                groupBoxVoiceMods.Visible  = true;
                break;
            }
            switch (_CurrentFighter.soundPackSlots)
            {
            case (DB.Fighter.SoundPackSlots.All): groupBoxSoundSlots.Visible = false; break;

            case (DB.Fighter.SoundPackSlots.One):
                comboBoxSoundSlot2.Visible = false;
                groupBoxSoundSlots.Visible = true;
                break;

            case (DB.Fighter.SoundPackSlots.Two):
                comboBoxSoundSlot2.Visible = true;
                groupBoxSoundSlots.Visible = true;
                break;
            }
            if (!groupBoxVoiceMods.Visible && !groupBoxSoundSlots.Visible)
            {
                tableLayoutPanel4.SetRowSpan(panelModList, 2);
            }
            else
            {
                CharacterAudioSlotSelection audio = _SmashProjectManager._CharacterModsPage.CurrentFighterAudioSlotSelections;
                if (audio != null)
                {
                    RefreshAudioComboBoxes(audio);
                }

                tableLayoutPanel4.SetRowSpan(panelModList, 1);
                if (groupBoxVoiceMods.Visible)
                {
                    if (groupBoxSoundSlots.Visible)
                    {
                        tableLayoutPanel1.SetColumnSpan(groupBoxVoiceMods, 1);
                        tableLayoutPanel1.SetColumnSpan(groupBoxSoundSlots, 1);
                        tableLayoutPanel1.SetColumn(groupBoxSoundSlots, 1);
                    }
                    else
                    {
                        tableLayoutPanel1.SetColumnSpan(groupBoxVoiceMods, 2);
                    }
                }
                else
                {
                    tableLayoutPanel1.SetColumnSpan(groupBoxSoundSlots, 2);
                    tableLayoutPanel1.SetColumn(groupBoxSoundSlots, 1);
                }
            }
            RefreshRowData();
        }
示例#5
0
 public void ChangeSelectedFighter(DB.Fighter a_fighter)
 {
     _CurrentFighter = a_fighter;
 }