public void UpdateInventoryMenu() { UI_Inv_Items.RemoveAllChildren(); string pref1 = "^0^e^7"; string pref2 = "^7^e^0"; UITextLink prev = new UITextLink(Textures.Clear, "Air", pref1 + "Air", pref2 + "Air", FontSets.Standard, () => InventorySelectItem(0), UIAnchor.TOP_LEFT, () => 0, () => 0); UI_Inv_Items.AddChild(prev); string filter = UI_Inv_Filter.Text; for (int i = 0; i < Items.Count; i++) { if (filter.Length == 0 || Items[i].ToString().ToLowerFast().Contains(filter.ToLowerFast())) { string name = Items[i].DisplayName; UITextLink p = prev; int x = i; UITextLink neo = new UITextLink(Items[i].Tex, name, pref1 + name, pref2 + name, FontSets.Standard, () => InventorySelectItem(x + 1), UIAnchor.TOP_LEFT, p.GetX, () => (int)(p.GetY() + p.GetHeight())); neo.IconColor = Items[i].DrawColor; UI_Inv_Items.AddChild(neo); prev = neo; } } }
public MainMenuScreen(Client tclient) : base(tclient) { Background = new UIImage(TheClient.Textures.GetTexture("ui/menus/menuback"), UIAnchor.TOP_LEFT, GetWidth, GetHeight, () => 0, () => 0); AddChild(Background); FontSet font = TheClient.FontSets.SlightlyBigger; UITextLink quit = new UITextLink(null, "^%Q^7uit", "^%Q^e^7uit", "^7^e^%Q^0uit", font, () => TheClient.Window.Close(), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100); AddChild(quit); UITextLink sp = new UITextLink(null, "^%S^7ingleplayer", "^%S^e^7ingleplayer", "^7^e^%S^0ingleplayer", font, () => TheClient.ShowSingleplayer(), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100 - (int)quit.GetHeight()); AddChild(sp); UITextLink mp = new UITextLink(null, "^%M^7ultiplayer", "^%M^e^7ultiplayer", "^7^e^%M^0ultiplayer", font, () => UIConsole.WriteLine("Multiplayer menu coming soon!"), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100 - (int)(sp.GetHeight() + quit.GetHeight())); AddChild(mp); List <string> hints = TheClient.Languages.GetTextList(TheClient.Files, "voxalia", "hints.common"); UILabel label = new UILabel("^0^e^7" + hints[Utilities.UtilRandom.Next(hints.Count)], TheClient.FontSets.Standard, UIAnchor.BOTTOM_LEFT, () => 0, () => - (int)TheClient.Fonts.Standard.Height * 3, () => TheClient.Window.Width); AddChild(label); }