Exemplo n.º 1
0
        public void StartMenuArea(double priority, ITooltipProvider tooltipProvider = null)
        {
            if (CurrentMenuArea != null)
            {
                throw new Exception();
            }

            CurrentMenuArea = new MenuAreaText(this, priority, tooltipProvider);

            StartHandler(CurrentMenuArea);
        }
Exemplo n.º 2
0
        public MenuAreaText EndMenuArea()
        {
            if (CurrentMenuArea == null)
            {
                throw new Exception();
            }

            var menuArea = CurrentMenuArea;

            CurrentMenuArea = null;

            EndHandler(menuArea);
            MenuAreas.Add(menuArea);
            return(menuArea);
        }
Exemplo n.º 3
0
        private void Init()
        {
            var cursor = SpriteLoader.Instance.AddSprite("content/cursor");

            Text = new TextBuilder(Width, float.MaxValue);
            int index = 0;

            foreach (var action in Actions)
            {
                Text.StartTableRow(Width, new ColumnConfigs(new IColumnWidth[] {
                    new ColumnFixedWidth(16, true),
                    new ColumnFixedWidth(0, false),
                    new ColumnFixedWidth(16, true),
                })
                {
                    Padding = 0
                });
                Text.StartTableCell();
                Text.AppendElement(new TextElementCursor(cursor, 16, 16, () => IsSelected(action)));
                Text.EndTableCell();
                Text.StartTableCell();
                action.Text(Text);
                Text.EndTableCell();
                Text.StartTableCell();

                Text.EndTableCell();
                var row           = Text.EndTableRow();
                var selectionArea = new MenuAreaText(Text, 0, null);
                selectionArea.Add(row);
                SelectionAreas.Add(index, selectionArea);
                index++;
            }
            Text.EndContainer();
            Text.Finish();
            Dirty = false;
        }