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); } }
internal NotificationMassive(string text, int duration, NotificationType type) { Type = type; int startTime = GameBase.Time; int endTime = startTime + duration; message = new pText(text, 18, new Vector2(GameBase.WindowManager.WidthScaled / 2, 240), new Vector2(GameBase.WindowManager.Width / GameBase.WindowManager.Ratio, 0), 1, false, Color.White, false); message.Origin = Origins.TopCentre; message.TextAlignment = TextAlignment.Centre; message.TextBorder = true; message.Transformations.Add(new Transformation(TransformationType.Fade, 0, 1, startTime, startTime + FADE_IN_TIME)); message.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, endTime, endTime + FADE_OUT_TIME)); //Call the long version of MeasureText so we don't make a texture on the wrong thread. float yMeasure = message.MeasureText().Y; message.Position.Y -= yMeasure / 2; SpriteCollection.Add(message); yMeasure *= 1.5f; background = new pSprite(GameBase.WhitePixel, new Vector2(0, 240 - yMeasure / 2), 0.999f, false, new Color(0, 0, 0, 180)); background.Scale = 1.6f; background.Origin = Origins.TopLeft; background.VectorScale = new Vector2(GameBase.WindowManager.WidthScaled, yMeasure); background.Transformations.Add(new Transformation(TransformationType.VectorScale, new Vector2(GameBase.WindowManager.WidthScaled, 0), background.VectorScale, startTime, startTime + 300, EasingTypes.OutBack)); background.Transformations.Add(new Transformation(new Vector2(0, 240), background.InitialPosition, startTime, startTime + 300, EasingTypes.OutBack)); background.Transformations.Add(new Transformation(TransformationType.Fade, 180 / 255f, 0, endTime, endTime + FADE_OUT_TIME)); SpriteCollection.Add(background); switch (type) { case NotificationType.Error: background.InitialColour = Color.Red; //has not been tested. will look horrible. break; case NotificationType.Warning: message.BorderColour = new Color(146, 82, 0); background.InitialColour = new Color(255, 186, 0); pSprite border = new pSprite(TextureManager.Load(@"test-build-overlay", SkinSource.Osu), Origins.BottomLeft, new Vector2(0, 240 - yMeasure / 2), 0.9991f, false, Color.White); border.Scale = 1.5f; border.FadeInFromZero(300); border.MoveToX(-100, duration); border.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, endTime, endTime + FADE_OUT_TIME)); SpriteCollection.Add(border); border = new pSprite(TextureManager.Load(@"test-build-overlay", SkinSource.Osu), new Vector2(-100, 240 + yMeasure / 2), 0.9991f, false, Color.White); border.FlipVertical = true; border.MoveToX(0, duration); border.Scale = 1.5f; border.FadeInFromZero(300); border.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, endTime, endTime + FADE_OUT_TIME)); SpriteCollection.Add(border); break; } }