public NavWindow(GameObject.MapEntities.Actors.Player Player, Microsoft.Xna.Framework.Graphics.Texture2D tex) { this.WM = Gameplay.WindowManager; this.Player = Player; this.Width = 276; this.Height = 300; this.AnchorRight = true; Placename = new GUI.Controls.RichTextDisplay("World", 256, 20, WM) { Y = 0, X = 4 }; GUI.Controls.TextureContainer texcont = new GUI.Controls.TextureContainer(tex, WM) { Y = 20, X = 4 }; Coords = new GUI.Controls.RichTextDisplay("loading...", 256, 20, WM) { Y = 280, X = 4 }; this.AddControl(texcont); this.AddControl(Placename); this.AddControl(Coords); }
public NPCWindow(GUI.WindowManager WM, GameObject.MapEntities.Actors.NPC NPC, GameObject.MapEntities.Actors.Player Player) { this.Player = Player; this.Width = 320; this.Height = 512; GUI.Controls.RichTextDisplay greeting = new GUI.Controls.RichTextDisplay(NPC.Greeting, 180, 200, WM); this.Controls.Add(greeting); this.Title = NPC.DisplayName; int yoffset = greeting.Height + 2; if (NPC.Commands != null && NPC.Commands.Count > 0) { for (int i = 0; i < NPC.Commands.Count; i++) { NPCMenuItem mi = new NPCMenuItem(Player, NPC.Commands[i]) { Y = yoffset }; yoffset += mi.Height; AddControl(mi); } } NPCMenuItem end = NPCMenuItem.Close(); end.Y = yoffset; AddControl(end); }
public NPCWindow(GUI.WindowManager WM, GameObject.MapEntities.Actors.NPC NPC) { this.Width = 320; this.Height = 512; GUI.Controls.RichTextDisplay greeting = new GUI.Controls.RichTextDisplay(NPC.Greeting, 180, 200, WM); this.Controls.Add(greeting); this.Title = NPC.DisplayName; }
public ConsoleWindow(GUI.WindowManager WM) { this.WM = WM; this.Width = 320; this.Height = 436; this.messages = new GUI.Controls.RichTextDisplay("", this.Width - this.Margin.X - this.Margin.Width, this.Height - this.Margin.Y - this.Margin.Height - 20, WM); this.messages.Flip = true; this.messages.AddLine("Click ^BEGINLINK ^0000E7 here ^ENDLINK ^FFFFFF to write a ^BEGINLINK ^0000E7 message! Actually, the rest of this text as well. ^ENDLINK hahaha", new List <Action> { new Action(() => { Console.Write("^FF0000 It works!"); }), new Action(() => { Console.Write("^FFFF00 Hidden link"); }) }); AddControl(messages); this.AnchorBottom = true; }
void SetupBasket() { for (int i = 0; i < 8; i++) { int index = i; _basketslots[i] = new ItemSlot(null); _basketslots[i].OnClick += new ClickEventHandler((sender, m) => RemoveFromBasket(index, 1)); _basketslots[i].Y = ShopHeight * _basketslots[i].Height + 30; _basketslots[i].X = i * _basketslots[i].Width; _basketslots[i].CanGrab = false; _basketslots[i].CanPut = false; AddControl(_basketslots[i]); } TotalLabel = new GUI.Controls.RichTextDisplay("0", 320, 16, WM); TotalLabel.X = 0; TotalLabel.Y = (ShopHeight + 1) * _basketslots[0].Height + 30 + 16; AddControl(TotalLabel); }
public ConsoleWindow(GUI.WindowManager WM, Gameplay GameRef) { this.WM = WM; this.gameRef = GameRef; this.Width = 320; this.Height = 436; this.messages = new GUI.Controls.RichTextDisplay("", this.Width - this.Margin.X - this.Margin.Width, this.Height - this.Margin.Y - this.Margin.Height - 20, WM); this.messages.Flip = true; this.messages.AddLine("Click ^BEGINLINK ^0000E7 here ^ENDLINK ^FFFFFF to write a ^BEGINLINK ^0000E7 message! Actually, the rest of this text as well. ^ENDLINK hahaha", new List <Action> { new Action(() => { Console.Write("^FF0000 It works!"); }), new Action(() => { Console.Write("^FFFF00 Hidden link"); }) }); AddControl(messages); GUI.Controls.TextBox textBox = new GUI.Controls.TextBox(); textBox.Height = 20; textBox.Width = this.Width - this.Margin.X - this.Margin.Width; textBox.Y = messages.Height; textBox.OnSubmit += TextBox_OnSubmit; textBox.KeepFocusOnSubmit = true; AddControl(textBox); this.AnchorBottom = true; }