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 * 3 / 2; 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; }
public void SetMessage(string message) { if (messageWidget != null) { messageWidget.Dispose(); } messageWidget = ChatTextWidget.Create(game, 0, -30, message, Anchor.Centre, Anchor.Centre, font); }
public void SetTitle(string title) { if (titleWidget != null) { titleWidget.Dispose(); } titleWidget = ChatTextWidget.Create(game, 0, -80, title, Anchor.Centre, Anchor.Centre, font); }
public override void Init() { base.Init(); if (keyNames == null) { keyNames = Enum.GetNames(typeof(Key)); } keyFont = new Font(game.FontName, 16, FontStyle.Bold); regularFont = new Font(game.FontName, 16, FontStyle.Italic); statusWidget = ChatTextWidget.Create(game, 0, 130, "", Anchor.Centre, Anchor.Centre, regularFont); }
void MakeOthers() { widgets[index++] = ChatTextWidget.Create(game, 0, -180, title, Anchor.Centre, Anchor.Centre, keyFont); if (game.ClassicMode) { widgets[index++] = MakeBack(false, titleFont, (g, w) => g.SetNewScreen(new ClassicOptionsScreen(g))); } else { widgets[index++] = MakeBack("Back to menu", 5, titleFont, (g, w) => g.SetNewScreen(new OptionsGroupScreen(g))); } }
public override void Init() { base.Init(); left = new KeyBind[3]; left[0] = KeyBind.MouseLeft; left[1] = KeyBind.MouseMiddle; left[2] = KeyBind.MouseRight; leftDesc = new[] { "Left mouse", "Middle mouse", "Right mouse" }; widgets = new Widget[left.Length + 5]; title = "Mouse key bindings"; leftPage = (g, w) => g.SetNewScreen(new HacksKeyBindingsScreen(g)); MakeWidgets(-50); widgets[index++] = ChatTextWidget.Create( game, 0, 80, "&eRight click to remove the key binding", Anchor.Centre, Anchor.Centre, regularFont); }
public override void Init() { game.Keyboard.KeyRepeat = true; base.Init(); regularFont = new Font(game.FontName, 16, FontStyle.Regular); inputWidget = MenuInputWidget.Create( game, 0, -30, 500, 30, "", Anchor.Centre, Anchor.Centre, regularFont, titleFont, new PathValidator()); widgets = new Widget[] { ButtonWidget.Create(game, 0, 20, 301, 40, "Save", Anchor.Centre, Anchor.Centre, titleFont, SaveClassic), ButtonWidget.Create(game, -150, 120, 201, 40, "Save schematic", Anchor.Centre, Anchor.Centre, titleFont, SaveSchematic), ChatTextWidget.Create(game, 110, 120, "&eCan be imported into MCEdit", Anchor.Centre, Anchor.Centre, regularFont), null, MakeBack(false, titleFont, (g, w) => g.SetNewScreen(new PauseScreen(g))), }; }
public override void Init() { textFont = new Font(game.FontName, 16, FontStyle.Bold); arrowFont = new Font(game.FontName, 18, FontStyle.Bold); titleFont = new Font(game.FontName, 16, FontStyle.Bold); title = ChatTextWidget.Create(game, 0, -155, titleText, Anchor.Centre, Anchor.Centre, titleFont); buttons = new ButtonWidget[] { MakeText(0, -100, Get(0)), MakeText(0, -50, Get(1)), MakeText(0, 0, Get(2)), MakeText(0, 50, Get(3)), MakeText(0, 100, Get(4)), Make(-220, 0, "<", (g, w) => PageClick(false)), Make(220, 0, ">", (g, w) => PageClick(true)), MakeBack(false, titleFont, (g, w) => g.SetNewScreen(new PauseScreen(g))), }; UpdateArrows(); }
void MakeDescWidget(string text) { DisposeDescWidget(); descWidget = ChatTextWidget.Create(game, 0, 65, text, Anchor.Centre, Anchor.Centre, regularFont); }
public override void Init() { overview = ChatTextWidget.Create(game, 0, 0, "Connected players:", Anchor.Centre, Anchor.Centre, font); base.Init(); }