Exemplo n.º 1
0
 private void PopulateRows()
 {
     while (_Rows.Count < _RowData.Count)
     {
         if (_Rows.Count < _RowData.Count)
         {
             ModRow row = new ModRow(_SmashProjectManager, _IsActiveList, _ModListType);
             row.Dock           = DockStyle.Top;
             row.modsListParent = this;
             _Rows.Add(row);
             row.Parent = panelModList;
         }
     }
     for (int i = _RowData.Count - 1; i > -1; --i)
     {
         ModRow myRow = _Rows[_Rows.Count - i - 1];
         if (_ModListType == ModListType.CharacterGeneral || _ModListType == ModListType.CharacterSlots)
         {
             myRow.ChangeSelectedFighter(_CurrentFighter);
         }
         myRow.UpdateData(_RowData[i]);
         myRow.Visible = true;
     }
     if (_Rows.Count > _RowData.Count)
     {
         for (int i = 0; i < _Rows.Count - _RowData.Count; ++i)
         {
             _Rows[i].Visible = false;
         }
     }
 }
Exemplo n.º 2
0
 private void PopulateRows()
 {
     /*
      * for (int i = _Rows.Count - 1; i >= 0; --i)
      * {
      *  _Rows[i].Parent = null;
      *  _Rows[i].Dispose();
      *  _Rows.RemoveAt(i);
      * }*/
     while (_Rows.Count < _RowData.Count)
     {
         if (_Rows.Count < _RowData.Count)
         {
             ModRow row = new ModRow(_SmashProjectManager, true, ModsList.ModListType.CharacterSlots);
             row.Dock = DockStyle.Top;
             _Rows.Add(row);
             row.Parent = panelModList;
         }
     }
     for (int i = _RowData.Count - 1; i > -1; --i)
     {
         ModRow myRow = _Rows[_Rows.Count - i - 1];
         myRow.ChangeSelectedFighter(_CurrentFighter);
         myRow.UpdateData(_RowData[i]);
         myRow.Visible = true;
     }
     if (_Rows.Count > _RowData.Count)
     {
         for (int i = 0; i < _Rows.Count - _RowData.Count; ++i)
         {
             _Rows[i].Visible = false;
         }
     }
 }
Exemplo n.º 3
0
 private void OnModSelectionChanged(ModRow modRowSelected)
 {
     if (modRowSelected != this)
     {
         DeselectMod();
     }
     else
     {
         SelectMod();
     }
 }
 private void CharGeneralModSelectionChanged(ModRow selectedMod)
 {
     SelectedGeneralMod = selectedMod;
     if (SelectedGeneralMod == null)
     {
         buttonGeneralUp.Enabled    = false;
         buttonGeneralDown.Enabled  = false;
         buttonGeneralLeft.Enabled  = false;
         buttonGeneralRight.Enabled = false;
     }
     else
     {
         CharSlotModSelectionChanged(null);
         if (!SelectedGeneralMod.isActiveList)
         {
             buttonGeneralUp.Enabled    = false;
             buttonGeneralDown.Enabled  = false;
             buttonGeneralRight.Enabled = false;
             buttonGeneralLeft.Enabled  = true;
         }
         else
         {
             buttonGeneralRight.Enabled = true;
             buttonGeneralLeft.Enabled  = false;
             for (int i = 0; i < CurrentFighterActiveGeneralMods.Count; ++i)
             {
                 if (!SelectedGeneralMod.modFolder.Equals(CurrentFighterActiveGeneralMods[i].FolderName))
                 {
                     continue;
                 }
                 buttonGeneralUp.Enabled   = (i > 0);
                 buttonGeneralDown.Enabled = (i < CurrentFighterActiveGeneralMods.Count - 1);
                 break;
             }
         }
     }
 }
Exemplo n.º 5
0
 private void StageModSelectionChanged(ModRow selectedMod)
 {
     SelectedMod = selectedMod;
     if (SelectedMod == null)
     {
         buttonUp.Enabled    = false;
         buttonDown.Enabled  = false;
         buttonLeft.Enabled  = false;
         buttonRight.Enabled = false;
     }
     else
     {
         if (!SelectedMod.isActiveList)
         {
             buttonUp.Enabled    = false;
             buttonDown.Enabled  = false;
             buttonRight.Enabled = false;
             buttonLeft.Enabled  = true;
         }
         else
         {
             buttonRight.Enabled = true;
             buttonLeft.Enabled  = false;
             for (int i = 0; i < _SmashProjectManager.CurrentProject.ActiveStageMods.Count; ++i)
             {
                 if (!SelectedMod.modFolder.Equals(_SmashProjectManager.CurrentProject.ActiveStageMods[i].FolderName))
                 {
                     continue;
                 }
                 buttonUp.Enabled   = (i > 0);
                 buttonDown.Enabled = (i < _SmashProjectManager.CurrentProject.ActiveStageMods.Count - 1);
                 break;
             }
         }
     }
 }
 private void CharSlotModSelectionChanged(ModRow selectedMod)
 {
     SelectedSlotMod = selectedMod;
     if (SelectedSlotMod == null)
     {
         buttonSlotUp.Enabled     = false;
         buttonSlotDown.Enabled   = false;
         buttonSlotLeft.Enabled   = false;
         buttonSlotRight.Enabled  = false;
         buttonSlotBottom.Enabled = false;
     }
     else
     {
         CharGeneralModSelectionChanged(null);
         if (!SelectedSlotMod.isActiveList)
         {
             buttonSlotUp.Enabled    = false;
             buttonSlotDown.Enabled  = false;
             buttonSlotRight.Enabled = false;
             if (GetAvailableActiveSlot() > -1)
             {
                 buttonSlotLeft.Enabled = true;
             }
             else
             {
                 buttonSlotLeft.Enabled = false;
             }
             buttonSlotBottom.Enabled = false;
         }
         else
         {
             int maxSlots = _SmashProjectManager.CurrentProject.EnableMoreCustomSlots ? _CurrentFighter.unrestrictedSlots : _CurrentFighter.maxSlots;
             buttonSlotRight.Enabled = true;
             buttonSlotLeft.Enabled  = false;
             if (SelectedSlotMod.slotNum <= 0)
             {
                 buttonSlotUp.Enabled = false;
             }
             else
             {
                 buttonSlotUp.Enabled = true;
             }
             if (SelectedSlotMod.slotNum >= maxSlots - 1 || (SelectedSlotMod.slotNum >= GetHighestSlotModSlot() && SelectedSlotMod.slotNum > _CurrentFighter.defaultSlots - 1))
             {
                 buttonSlotDown.Enabled = false;
             }
             else
             {
                 buttonSlotDown.Enabled = true;
             }
             if ((_CurrentFighter.defaultSlots == maxSlots) || (SelectedSlotMod.slotNum >= _CurrentFighter.defaultSlots) || (GetHighestSlotModSlot() >= maxSlots - 1))
             {
                 buttonSlotBottom.Enabled = false;
             }
             else
             {
                 buttonSlotBottom.Enabled = true;
             }
         }
     }
 }