Ejemplo n.º 1
0
 private void LoadSegments()
 {
     var segments = new BindableList<WordSegmentViewModel>();
     if (_word.Shape != null && _word.Shape.Count > 0)
     {
         Annotation<ShapeNode> prefixAnn = _word.Prefix;
         if (prefixAnn != null)
             segments.AddRange(GetSegments(prefixAnn));
         segments.Add(new WordSegmentViewModel("|"));
         segments.AddRange(GetSegments(_word.Stem));
         segments.Add(new WordSegmentViewModel("|"));
         Annotation<ShapeNode> suffixAnn = _word.Suffix;
         if (suffixAnn != null)
             segments.AddRange(GetSegments(suffixAnn));
     }
     segments.CollectionChanged += SegmentsChanged;
     Set("Segments", ref _segments, segments);
     IsValid = _word.Shape != null && _word.Shape.Count > 0;
 }
Ejemplo n.º 2
0
        public EditorScreen(Level level, string name)
        {
            this.name = name;
            rooms.AddRange(level.Rooms);
            selectedRoom.Value = rooms[0];

            AddRangeInternal(new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ColumnDimensions = new[]
                    {
                        new Dimension(GridSizeMode.Absolute, 200),
                        new Dimension(),
                        new Dimension(GridSizeMode.Absolute, 200)
                    },
                    RowDimensions = new[]
                    {
                        new Dimension()
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            toolSelector = new ToolSelector
                            {
                                Depth = -3
                            },
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Anchor           = Anchor.Centre,
                                Origin           = Anchor.Centre,
                                Children         = new Drawable[]
                                {
                                    drawableRoomPlaceholder = new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Anchor           = Anchor.Centre,
                                        Origin           = Anchor.Centre,
                                    },
                                    new IWannaBasicButton("Move to centre", moveToCentre)
                                    {
                                        Margin = new MarginPadding(10)
                                    }
                                }
                            },
                            toolbar = new ToolBar()
                            {
                                OnTest       = test,
                                OnSave       = save,
                                OnRoomSelect = selectRoom,
                                OnClear      = clear,
                                OnSettings   = onSettings,
                                OnCherries   = onCherries,
                            }
                        }
                    }
                },
                cherriesSettings = new CherriesEditOverlay(),
                roomSelector     = new RoomSelectorOverlay(),
                roomSettings     = new RoomEditOverlay()
            });

            roomSelector.Rooms.BindTo(rooms);
            roomSelector.Selected.BindTo(selectedRoom);

            roomSettings.CreatedRoom += onRoomChanged;
        }
Ejemplo n.º 3
0
 private void load()
 {
     beatmapSets.AddRange(beatmaps.GetAllUsableBeatmapSets().OrderBy(_ => RNG.Next()));
     beatmaps.ItemAdded   += handleBeatmapAdded;
     beatmaps.ItemRemoved += handleBeatmapRemoved;
 }
Ejemplo n.º 4
0
 public SliderPath(PathControlPoint[] controlPoints, double?expectedDistance = null)
     : this()
 {
     ControlPoints.AddRange(controlPoints);
     ExpectedDistance.Value = expectedDistance;
 }
Ejemplo n.º 5
0
 private void load()
 {
     beatmapSets.AddRange(beatmaps.GetAllUsableBeatmapSets(IncludedDetails.Minimal, true).OrderBy(t => t.Metadata.Title));
     beatmap.BindValueChanged(beatmapChanged, true);
 }