コード例 #1
0
ファイル: RomSelector.cs プロジェクト: Game4all/gamebosu
        private void load(AudioManager audio)
        {
            selectSample        = audio.Samples.Get("UI/generic-hover-soft");
            confirmSelectSample = audio.Samples.Get("UI/notification-pop-in");

            selection.BindValueChanged(updateSelection, true);

            AvailableRoms.BindValueChanged(roms =>
            {
                noRomPopup.State.Value = roms.NewValue.Count() > 0 ? Visibility.Hidden : Visibility.Visible;

                selectionContainer.Clear();
                selectionContainer.AddRange(roms.NewValue.Select(rom => new SelectionCard(rom)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Alpha  = 0,
                }));

                selection.MaxValue = (roms.NewValue.Count() - 1) > 0 ? (roms.NewValue.Count() - 1) : 0;
                selection.TriggerChange();
            }, true);

            selection.BindValueChanged(updateSelectedDrawableCard, true);
        }
コード例 #2
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            Count.BindValueChanged(_ => updateDisplay(), true);
            ShowDeleted.BindValueChanged(_ => updateDisplay(), true);
        }
コード例 #3
0
        public AutoFocusToEditLyricMenu(KaraokeRulesetEditConfigManager config, string text)
            : base(text)
        {
            var selections = new List <MenuItem>
            {
                new ToggleMenuItem(getName(disable_selection_index), MenuItemType.Standard, _ => updateAutoFocusToEditLyric())
            };

            selections.AddRange(Enumerable.Range(0, 4).Select(x => new ToggleMenuItem(getName(x), MenuItemType.Standard, _ => updateAutoFocusToEditLyricSkipRows(x))));
            Items = selections;

            config.BindWith(KaraokeRulesetEditSetting.AutoFocusToEditLyric, bindableAutoFocusToEditLyric);
            config.BindWith(KaraokeRulesetEditSetting.AutoFocusToEditLyricSkipRows, bindableAutoFocusToEditLyricSkipRows);

            // mark disable as selected option.
            bindableAutoFocusToEditLyric.BindValueChanged(e =>
            {
                updateSelectionState();
            }, true);

            // mark line as selected option.
            bindableAutoFocusToEditLyricSkipRows.BindValueChanged(e =>
            {
                updateSelectionState();
            }, true);
        }
コード例 #4
0
 public KaraokeLyricEditor(Ruleset ruleset)
 {
     AddInternal(new KaraokeEditInputManager(ruleset.RulesetInfo)
     {
         RelativeSizeAxes = Axes.Both,
         Child            = lyricEditor = new LyricEditor
         {
             RelativeSizeAxes = Axes.Both,
         }
     });
     bindableLyricEditorMode.BindValueChanged(e =>
     {
         lyricEditor.Mode = e.NewValue;
     });
     bindableLyricEditorFontSize.BindValueChanged(e =>
     {
         lyricEditor.FontSize = e.NewValue;
     });
     bindableRecordingMovingCaretMode.BindValueChanged(e =>
     {
         lyricEditor.RecordingMovingCaretMode = e.NewValue;
     });
     bindableAutoFocusToEditLyric.BindValueChanged(e =>
     {
         lyricEditor.AutoFocusEditLyric = e.NewValue;
     });
     bindableAutoFocusToEditLyricSkipRows.BindValueChanged(e =>
     {
         lyricEditor.AutoFocusEditLyricSkipRows = e.NewValue;
     });
 }
コード例 #5
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            Team1Score.BindValueChanged(_ => updateScores());
            Team2Score.BindValueChanged(_ => updateScores(), true);
        }
コード例 #6
0
        private void load(MatchIPCInfo ipc)
        {
            score1.BindValueChanged(_ => updateScores());
            score1.BindTo(ipc.Score1);

            score2.BindValueChanged(_ => updateScores());
            score2.BindTo(ipc.Score2);
        }
コード例 #7
0
ファイル: VotePill.cs プロジェクト: Azyyyyyy/osu
 protected override void LoadComplete()
 {
     base.LoadComplete();
     isVoted.Value    = comment.IsVoted;
     votesCount.Value = comment.VotesCount;
     isVoted.BindValueChanged(voted => Background.Colour    = voted.NewValue ? AccentColour : colourProvider.Background6, true);
     votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
 }
コード例 #8
0
            public LaneReceptor()
            {
                Position = SentakkiExtensions.GetCircularPosition(SentakkiPlayfield.INTERSECTDISTANCE, 0);
                Size     = new Vector2(300);

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                CornerRadius   = 150;
                CornerExponent = 2;
                currentKeys.BindValueChanged(handleKeyPress);
            }
コード例 #9
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            CurrentPage.BindValueChanged(_ => Scheduler.AddOnce(redraw));
            AvailablePages.BindValueChanged(_ =>
            {
                CurrentPage.Value = 0;

                // AddOnce as the reset of CurrentPage may also trigger a redraw.
                Scheduler.AddOnce(redraw);
            }, true);
        }
コード例 #10
0
            private void load()
            {
                AutoSizeAxes = Axes.Both;
                Origin       = Anchor.TopCentre;

                Children = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Alpha            = 0.5f,
                        Colour           = Colour4.Black,
                    },
                    new FillFlowContainer
                    {
                        Direction    = FillDirection.Horizontal,
                        AutoSizeAxes = Axes.Both,
                        Spacing      = new Vector2(4),
                        Padding      = new MarginPadding {
                            Left = 4
                        },
                        Children = new Drawable[]
                        {
                            new BasicSliderBar <int>
                            {
                                Anchor                = Anchor.CentreLeft,
                                Origin                = Anchor.CentreLeft,
                                Size                  = new Vector2(100, 13),
                                BackgroundColour      = Colour4.DimGray,
                                SelectionColour       = Colour4.White,
                                Current               = sliderValue,
                                TransferValueOnCommit = true,
                            },
                            textBox = new NumericTextBox
                            {
                                Anchor      = Anchor.CentreLeft,
                                Origin      = Anchor.CentreLeft,
                                Size        = new Vector2(65, 35),
                                LengthLimit = 5,
                            },
                        },
                    },
                };

                textBox.Current.Value = target.Value ?? default_min_slider_value;
                sliderValue.MaxValue  = Math.Max(target.Value ?? default_max_slider_value, default_max_slider_value);
                sliderValue.Value     = target.Value ?? default_min_slider_value;

                textBox.OnCommit += delegate { changeValue((int)textBox.Current.Value); };
                sliderValue.BindValueChanged(c => changeValue(c.NewValue));
            }
コード例 #11
0
        public KaraokePlayfield()
        {
            AddInternal(LyricPlayfield = CreateLyricPlayfield().With(x =>
            {
                x.RelativeSizeAxes = Axes.Both;
            }));

            AddInternal(new Container
            {
                Padding          = new MarginPadding(50),
                RelativeSizeAxes = Axes.Both,
                Child            = NotePlayfield = CreateNotePlayfield(9).With(x =>
                {
                    x.Alpha            = 0;
                    x.RelativeSizeAxes = Axes.X;
                })
            });

            AddNested(LyricPlayfield);
            AddNested(NotePlayfield);

            bindablePitch.BindValueChanged(value =>
            {
                // Convert between -10 and 10 into 0.5 and 1.5
                var newValue = 1.0f + (float)value.NewValue / 40;
                WorkingBeatmap.Track.Frequency.Value = newValue;
            });

            bindableVocalPitch.BindValueChanged(value =>
            {
                // TODO : implement until has vocal track
            });

            bindablePlayback.BindValueChanged(value =>
            {
                // Convert between -10 and 10 into 0.5 and 1.5
                var newValue = 1.0f + (float)value.NewValue / 40;
                WorkingBeatmap.Track.Tempo.Value = newValue;
            });

            // Alpha
            notePlayfieldAlpha.BindValueChanged(x =>
            {
                // todo : how to check is there any notes in this playfield?
                var alpha           = WorkingBeatmap.Beatmap.IsScorable() ? x.NewValue : 0;
                NotePlayfield.Alpha = (float)alpha;
            });
            lyricPlayfieldAlpha.BindValueChanged(x => LyricPlayfield.Alpha = (float)x.NewValue);
        }
コード例 #12
0
        private void load(TextureStore textures)
        {
            Size = new Vector2(LearningVoltexPlayfield.LANE_HEIGHT);

            Child = new Sprite
            {
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Scale            = new Vector2(1.2f),
                RelativeSizeAxes = Axes.Both,
                Texture          = textures.Get("character")
            };

            LanePosition.BindValueChanged(e => { this.MoveToY(e.NewValue * LearningVoltexPlayfield.LANE_HEIGHT); });
        }
コード例 #13
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            saitenPitch.BindValueChanged(value =>
            {
                var newValue     = value.NewValue;
                var targetTone   = new Tone((newValue < 0 ? newValue - 1 : newValue) / 2, newValue % 2 != 0);
                var targetY      = calculator.YPositionAt(targetTone);
                var targetHeight = targetTone.Half ? 5 : DefaultColumnBackground.COLUMN_HEIGHT;
                var alpha        = targetTone.Half ? 0.6f : 0.2f;

                centerLine.MoveToY(targetY, 100);
                centerLine.ResizeHeightTo(targetHeight, 100);
                centerLine.Alpha = alpha;
            }, true);
        }
コード例 #14
0
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontSize = editor.FontSize.GetBoundCopy() as BindableFloat;
            _fontSize.BindValueChanged(s => Scheduler.AddOnce(ResetFlicker));

            _lineNumberWidth = editor.LineNumberWidth.GetBoundCopy() as BindableInt;
            _lineNumberWidth.BindValueChanged(w => Scheduler.AddOnce(ResetFlicker));

            _selectionStart = _selection.Start.GetBoundCopy() as BindableInt;
            _selectionStart.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd = _selection.End.GetBoundCopy() as BindableInt;
            _selectionEnd.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd.TriggerChange();
        }
コード例 #15
0
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontSize = editor.FontSize.GetBoundCopy() as BindableFloat;
            _fontSize.BindValueChanged(s => Scheduler.AddOnce(() =>
            {
                Size = new Vector2(3, s);
                ResetFlicker();
            }));

            _lineNumberWidth = editor.LineNumberWidth.GetBoundCopy() as BindableInt;
            _lineNumberWidth.BindValueChanged(w => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd = _selection.End.GetBoundCopy() as BindableInt;
            _selectionEnd.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            // This updates the caret
            _fontSize.TriggerChange();
        }
コード例 #16
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            Mentions.BindValueChanged(change =>
            {
                int mentionCount = change.NewValue;

                countText.Text = mentionCount > 99 ? "99+" : mentionCount.ToString();

                if (mentionCount > 0)
                {
                    this.FadeIn(1000, Easing.OutQuint);
                    box.FlashColour(Color4.White, 500, Easing.OutQuint);
                }
                else
                {
                    this.FadeOut(100, Easing.OutQuint);
                }
            }, true);
        }
コード例 #17
0
        public KaraokePlayfield()
        {
            AddInternal(LyricPlayfield = new LyricPlayfield
            {
                RelativeSizeAxes = Axes.Both,
            });

            AddInternal(new Container
            {
                Padding          = new MarginPadding(50),
                RelativeSizeAxes = Axes.Both,
                Child            = NotePlayfield = new NotePlayfield(9)
                {
                    Alpha            = 0,
                    RelativeSizeAxes = Axes.X
                }
            });

            AddNested(LyricPlayfield);
            AddNested(NotePlayfield);

            bindablePitch.BindValueChanged(value =>
            {
                // Convert between -10 and 10 into 0.5 and 1.5
                var newValue = 1.0f + (float)value.NewValue / 40;
                WorkingBeatmap.Track.Frequency.Value = newValue;
            });

            bindableVocalPitch.BindValueChanged(value =>
            {
                // TODO : implement until has vocal track
            });

            bindablePlayback.BindValueChanged(value =>
            {
                // Convert between -10 and 10 into 0.5 and 1.5
                var newValue = 1.0f + (float)value.NewValue / 40;
                WorkingBeatmap.Track.Tempo.Value = newValue;
            });
        }
コード例 #18
0
ファイル: MetronomeDisplay.cs プロジェクト: Henry-YSLin/osu
        protected override void LoadComplete()
        {
            base.LoadComplete();

            interpolatedBpm.BindValueChanged(bpm => bpmText.Text = bpm.NewValue.ToLocalisableString());
        }
コード例 #19
0
ファイル: CommentsShowMoreButton.cs プロジェクト: Wieku/osu
 protected override void LoadComplete()
 {
     Current.BindValueChanged(onCurrentChanged, true);
     base.LoadComplete();
 }
コード例 #20
0
 protected override void LoadComplete()
 {
     Current.BindValueChanged(value => counter.Text = value.NewValue.ToString("N0"), true);
     base.LoadComplete();
 }