Example #1
0
        void ConstructWidgets()
        {
            input = new ChatInputWidget(game, chatFont)
                    .SetLocation(Anchor.Min, Anchor.Max, 5, 5);
            altText = new SpecialInputWidget(game, chatFont, input);
            altText.Init();
            UpdateAltTextY();

            status = new TextGroupWidget(game, 5, chatFont, chatUrlFont)
                     .SetLocation(Anchor.Max, Anchor.Min, 0, 0);
            status.Init();
            status.SetUsePlaceHolder(0, false);
            status.SetUsePlaceHolder(1, false);

            bottomRight = new TextGroupWidget(game, 3, chatFont, chatUrlFont)
                          .SetLocation(Anchor.Max, Anchor.Max, 0, hud.BottomOffset + 15);
            bottomRight.Init();

            normalChat = new TextGroupWidget(game, chatLines, chatFont, chatUrlFont)
                         .SetLocation(Anchor.Min, Anchor.Max, 10, hud.BottomOffset + 15);
            normalChat.Init();

            clientStatus = new TextGroupWidget(game, game.Chat.ClientStatus.Length, chatFont, chatUrlFont)
                           .SetLocation(Anchor.Min, Anchor.Max, 10, hud.BottomOffset + 15);
            clientStatus.Init();

            announcement = TextWidget.Create(game, null, announcementFont)
                           .SetLocation(Anchor.Centre, Anchor.Centre, 0, -game.Height / 4);
        }
 void ConstructWidgets()
 {
     textInput         = new TextInputWidget(game, chatFont);
     textInput.YOffset = 5;
     status            = new TextGroupWidget(game, 5, chatFont, chatUrlFont,
                                             Anchor.BottomOrRight, Anchor.LeftOrTop);
     status.Init();
     status.SetUsePlaceHolder(0, false);
     status.SetUsePlaceHolder(1, false);
     bottomRight = new TextGroupWidget(game, 3, chatFont, chatUrlFont,
                                       Anchor.BottomOrRight, Anchor.BottomOrRight);
     bottomRight.YOffset = blockSize + 15;
     bottomRight.Init();
     normalChat = new TextGroupWidget(game, chatLines, chatFont, chatUrlFont,
                                      Anchor.LeftOrTop, Anchor.BottomOrRight);
     normalChat.XOffset = 10;
     normalChat.YOffset = blockSize + 15;
     normalChat.Init();
     clientStatus = new TextGroupWidget(game, game.Chat.ClientStatus.Length, chatFont,
                                        chatUrlFont, Anchor.LeftOrTop, Anchor.BottomOrRight);
     clientStatus.XOffset = 10;
     clientStatus.YOffset = blockSize + 15;
     clientStatus.Init();
     announcement = ChatTextWidget.Create(game, 0, 0, null,
                                          Anchor.Centre, Anchor.Centre, announcementFont);
     announcement.YOffset = -game.Height / 4;
 }
Example #3
0
 void DisposeExtendedHelp()
 {
     if (extHelp == null)
     {
         return;
     }
     extHelp.Dispose();
     extHelp = null;
 }
Example #4
0
        void MakeExtendedHelp(string[] desc)
        {
            extendedHelp = new TextGroupWidget(game, desc.Length, regularFont, null)
                           .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 0, 0);
            extendedHelp.Init();
            for (int i = 0; i < desc.Length; i++)
            {
                extendedHelp.SetText(i, desc[i]);
            }

            extendedHelp.XOffset = game.Width / 2 - extendedHelp.Width / 2;
            extendedHelp.YOffset = game.Height / 2 + extHelpY;
            extendedHelp.CalculatePosition();
        }
Example #5
0
        void Recreate(TextGroupWidget group, char code)
        {
            for (int i = 0; i < group.lines.Length; i++)
            {
                string line = group.lines[i];
                if (line == null)
                {
                    continue;
                }

                for (int j = 0; j < line.Length - 1; j++)
                {
                    if (line[j] == '&' && line[j + 1] == code)
                    {
                        group.SetText(i, line); break;
                    }
                }
            }
        }
Example #6
0
        void MakeExtendedHelp(string[] desc)
        {
            extendedHelp = new TextGroupWidget(game, desc.Length, extendedHelpFont, null,
                                               Anchor.Centre, Anchor.Centre);
            extendedHelp.Init();

            for (int i = 0; i < desc.Length; i++)
            {
                extendedHelp.SetText(i, desc[i]);
            }
            for (int i = 0; i < desc.Length; i++)
            {
                extendedHelp.Textures[i].X1 = extendedHelp.X;
            }

            tableWidth  = extendedHelp.Width;
            tableHeight = extendedHelp.Height;
            extendedHelp.MoveTo(extendedHelp.X, extHelpY + tableHeight / 2);
        }
Example #7
0
        void SelectExtendedHelp(int idx)
        {
            DisposeExtendedHelp();
            if (descriptions == null || input != null)
            {
                return;
            }
            string[] desc = descriptions[idx];
            if (desc == null)
            {
                return;
            }

            extHelp = new TextGroupWidget(game, desc.Length, textFont, null)
                      .SetLocation(Anchor.Min, Anchor.Min, 0, 0);
            extHelp.Init();

            for (int i = 0; i < desc.Length; i++)
            {
                extHelp.SetText(i, desc[i]);
            }
            RepositionExtendedHelp();
        }