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; }
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(); }
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); }
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(); }