コード例 #1
0
        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()))
                    {
                        IconColor = Items[i].DrawColor
                    };
                    UI_Inv_Items.AddChild(neo);
                    prev = neo;
                }
            }
        }
コード例 #2
0
ファイル: ClientInventory.cs プロジェクト: MoTo1496/Voxalia
        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), new UIPositionHelper(CWindow.MainUI).Anchor(UIAnchor.TOP_LEFT).ConstantXY(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), new UIPositionHelper(CWindow.MainUI).Anchor(UIAnchor.TOP_LEFT).GetterX(() => p.Position.X).GetterY(() => (int)(p.Position.Y + p.Position.Height)))
                    {
                        IconColor = Items[i].DrawColor
                    };
                    UI_Inv_Items.AddChild(neo);
                    prev = neo;
                }
            }
        }
コード例 #3
0
        public void UpdateChats()
        {
            ChatScroller.RemoveAllChildren();
            float by = 0;

            for (int i = 0; i < ChatMessages.Count; i++)
            {
                if (Channels[(int)ChatMessages[i].Channel])
                {
                    by += FontSets.Standard.font_default.Height;
                    int y = (int)by;
                    ChatScroller.AddChild(new UILabel(ChatMessages[i].Channel.ToString() + ": " + ChatMessages[i].Text, FontSets.Standard, UIAnchor.TOP_LEFT, () => 0, () => y, () => (int)ChatScroller.GetWidth()));
                }
            }
        }
コード例 #4
0
ファイル: ClientChat.cs プロジェクト: MoTo1496/Voxalia
        public void UpdateChats()
        {
            ChatScroller.RemoveAllChildren();
            float by = 0;

            for (int i = 0; i < ChatMessages.Count; i++)
            {
                if (Channels[(int)ChatMessages[i].Channel])
                {
                    by += FontSets.Standard.font_default.Height;
                    int    y  = (int)by;
                    string ch = (ChatMessages[i].Channel == TextChannel.ALWAYS) ? "" : (ChatMessages[i].Channel.ToString() + ": ");
                    ChatScroller.AddChild(new UILabel(ch + ChatMessages[i].Text, FontSets.Standard, new UIPositionHelper(CWindow.MainUI).Anchor(UIAnchor.TOP_LEFT).ConstantXY(0, y).GetterWidth(() => (int)ChatScroller.Position.Width)));
                }
            }
            by                    += FontSets.Standard.font_default.Height;
            ChatBottom             = (int)(by - ChatScroller.Position.Height);
            ChatScroller.MaxScroll = ChatBottom;
        }
コード例 #5
0
ファイル: ClientChat.cs プロジェクト: BlackCoyote/Voxalia
        public void UpdateChats()
        {
            ChatScroller.RemoveAllChildren();
            float by = 0;

            for (int i = 0; i < ChatMessages.Count; i++)
            {
                if (Channels[(int)ChatMessages[i].Channel])
                {
                    by += FontSets.Standard.font_default.Height;
                    int    y  = (int)by;
                    string ch = (ChatMessages[i].Channel == TextChannel.ALWAYS) ? "" : (ChatMessages[i].Channel.ToString() + ": ");
                    ChatScroller.AddChild(new UILabel(ch + ChatMessages[i].Text, FontSets.Standard, UIAnchor.TOP_LEFT, () => 0, () => y, () => (int)ChatScroller.GetWidth()));
                }
            }
            by                    += FontSets.Standard.font_default.Height;
            ChatBottom             = (int)(by - ChatScroller.GetHeight());
            ChatScroller.MaxScroll = ChatBottom;
        }