コード例 #1
0
ファイル: LayoutMania.cs プロジェクト: notperry1234567890/osu
 internal Keys this[int index, ManiaLayoutAccess access = ManiaLayoutAccess.Keys]
 {
     get
     {
         return(keys[accessIndex(index, access)]);
     }
     set
     {
         //Prevent duplicate entries
         for (int i = 0; i < keys.Length; i++)
         {
             if (keys[i] == value)
             {
                 keys[i] = Keys.None;
             }
         }
         keys[accessIndex(index, access)] = value;
     }
 }
コード例 #2
0
        private void ProcessKey(Keys key)
        {
            LayoutListMania ll = stage.LayoutList;

            if (ll.Selected < 0)
            {
                ll.Insert(0);
                ll.Selected = 0;
                stage.CopyBindingToLayout(ll.Layout);
            }

            ManiaLayoutAccess access = cBindAlternateKeys.Checked ? ManiaLayoutAccess.AlternateKeys : ManiaLayoutAccess.Keys;

            ll.Layout[keys[currentBindingColumn].TagNumeric, access] = key;
            stage.RebindColumnKeys();
            for (int i = 0; i < currentKeyConfig; i++)
            {
                if (keys[i] != null)
                {
                    keys[i].Text = getKeyText(i);
                }
            }

            while (++currentBindingColumn < currentKeyConfig && keys[currentBindingColumn] == null)
            {
            }
            if (currentBindingColumn >= currentKeyConfig)
            {
                if (incrementKeyConfig(ref currentKeyConfig) > StageMania.MAX_COLUMNS)
                {
                    currentKeyConfig = 1;
                }

                dKeyConfig.SetSelected(currentKeyConfig, false);
            }
            else
            {
                arrow.MoveToX(keys[currentBindingColumn].Position.X, 300, EasingTypes.Out);
            }
        }
コード例 #3
0
ファイル: LayoutMania.cs プロジェクト: notperry1234567890/osu
        private int accessIndex(int index, ManiaLayoutAccess access)
        {
            switch (access)
            {
            case ManiaLayoutAccess.Keys:
                if (index < Columns)
                {
                    return(index);
                }
                break;

            case ManiaLayoutAccess.AlternateKeys:
                if (index < AlternateColumns)
                {
                    return(index + Columns);
                }
                break;

            case ManiaLayoutAccess.Full:
                return(index);
            }
            throw new IndexOutOfRangeException();
        }