コード例 #1
0
        private void ProcessTables()
        {
            //scaling and positining
            var w             = Hud.Window.Size.Width;
            var h             = Hud.Window.Size.Height;
            var XRatio        = XPosRatio;
            var YRatio        = YPosRatio;
            int tablesPerLine = (int)(1.0 / Table2TableXDistance);
            int count         = 1;
            //iterate floors where monsters are tracked for
            int maxLineCount = 0;

            foreach (string f in MonsterTracked.Keys.ToList())
            {
                if (!MonsterProgression.ContainsKey(f) ||
                    !MonsterSeenCount.ContainsKey(f) ||
                    !MonsterSummonedCount.ContainsKey(f) ||
                    !MonsterKilledCount.ContainsKey(f))
                {
                    continue;
                }
                //create table for floor
                TopTable t = getNewTable(XRatio, YRatio, f);
                //fill table with each tracked monster on floor
                foreach (string m in MonsterProgression[f].Keys.ToList())
                {
                    string         mtype = m.ToString();
                    string         floor = f.ToString();
                    TopTableCell[] l     = getLine(floor, mtype).ToArray();
                    t.AddLine(
                        new TopTableHeader(Hud, (pos, curPos) => string.Empty)
                    {
                        RatioWidth    = 62 / (float)Hud.Window.Size.Height,
                        RatioHeight   = CellRatioHeight,
                        HighlightFunc = (pos, curPos) => false,     //highlight empty line for new area
                        TextAlign     = align,
                    }, l
                        );
                }//foreach-end monster
                //sort and add table
                t.SortLines((int)SortByColumn, SortDescending);
                Tables.Add(t);
                //counters and offsets
                maxLineCount = (t.Lines.Count > maxLineCount) ? t.Lines.Count : maxLineCount;
                XRatio      += Table2TableXDistance;
                if (count % tablesPerLine == 0)     //move tables to next line
                {
                    XRatio       = XPosRatio;
                    YRatio       = YPosRatio + CellRatioHeight * maxLineCount + Table2TableYDistance;
                    maxLineCount = 0;
                }
                count++;
            }//foreach-end floor
            tablesProcessed = true;
        }
コード例 #2
0
        private void InitTable()
        {
            Table = new TopTable(Hud)
            {
                RatioPositionX       = 0.5f,
                RatioPositionY       = 0.2f,
                HorizontalCenter     = true,
                VerticalCenter       = false,
                PositionFromRight    = false,
                PositionFromBottom   = false,
                ShowHeaderLeft       = true,
                ShowHeaderTop        = true,
                ShowHeaderRight      = false,
                ShowHeaderBottom     = false,
                DefaultCellDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHighlightDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 242, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHeaderDecorator = new TopTableCellDecorator(Hud)
                {
                    //BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
                    //BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1),
                    TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                }
            };

            var columnCount = difficultiesData.GetLength(1);
            var headers     = Enumerable.Range(0, columnCount).Select(x => HeaderTemplate).ToArray();

            Table.DefineColumns(headers);

            var lineCount = difficultiesData.GetLength(0);

            for (var i = 0; i < lineCount; i++)
            {
                Table.AddLine(
                    LineHeaderTemplate,
                    LineCellsTemplate
                    );
            }
        }
コード例 #3
0
        private void InitTable()
        {
            Table = new TopTable(Hud)
            {
                RatioPositionX       = 0.5f,
                RatioPositionY       = 0.2f,
                HorizontalCenter     = true,
                VerticalCenter       = false,
                PositionFromRight    = false,
                PositionFromBottom   = false,
                ShowHeaderLeft       = true,
                ShowHeaderTop        = true,
                ShowHeaderRight      = false,
                ShowHeaderBottom     = false,
                DefaultCellDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHighlightDecorator = new TopTableCellDecorator(Hud)
                {
                    BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 242, 0),
                    BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                    TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                },
                DefaultHeaderDecorator = new TopTableCellDecorator(Hud)
                {
                    //BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
                    //BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1),
                    TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, false, false, true),
                }
            };

            Table.DefineColumns(
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioHeight   = 22 / 1080f,   // define only once on first column, value on others will be ignored
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            },
                new TopTableHeader(Hud, (pos, curPos) => GetColumnHeaderText(pos))
            {
                RatioWidth    = 0.075f,
                HighlightFunc = (pos, curPos) => HighlightColumn(pos),
                TextAlign     = HorizontalAlign.Center,
            }
                );

            for (var i = 0; i < 13; i++)
            {
                Table.AddLine(
                    new TopTableHeader(Hud, (pos, curPos) => GetLineHeaderText(pos))
                {
                    RatioWidth         = 62 / 1080f, // define only once on first line, value on other will be ignored
                    RatioHeight        = 22 / 1080f,
                    HighlightFunc      = (pos, curPos) => false,
                    TextAlign          = HorizontalAlign.Right,
                    HighlightDecorator = new TopTableCellDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                        TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, true),
                    },
                    CellHighlightDecorator = new TopTableCellDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        BorderBrush     = Hud.Render.CreateBrush(255, 255, 255, 255, -1),
                        TextFont        = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, true),
                    },
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                },
                    new TopTableCell(Hud, (line, column, lineSorted, columnSorted) => GetCellText(line, column))
                {
                    TextAlign = HorizontalAlign.Center
                }
                    );
            }
        }