private static void Game_Hotbar(Panels.Structure Tool) { string Indicator = string.Empty; Point Panel_Position = Tool.Position; Game.Need_Information &= ~(1); // Desenha os itens da hotbar for (byte i = 1; i <= Game.Max_Hotbar; i++) { byte Slot = Player.Hotbar[i].Slot; if (Slot > 0) { // Itens if (Player.Hotbar[i].Type == (byte)Game.Hotbar.Item) { // Desenha as visualizações do item Point Position = new Point(Panel_Position.X + 8 + (i - 1) * 36, Panel_Position.Y + 6); Render(Tex_Item[Lists.Item[Player.Inventory[Slot].Item_Num].Texture], Position); if (Tools.IsAbove(new Rectangle(Position.X, Position.Y, 32, 32))) { Game.Infomation_Index = Player.Inventory[Slot].Item_Num; Panels.Get("Information").Position = new Point(Panel_Position.X, Panel_Position.Y + 42); Panels.Get("Information").Visible = true; Game.Need_Information |= 1; } } } // Números da hotbar if (i < 10) { Indicator = i.ToString(); } else if (i == 10) { Indicator = "0"; } // Desenha os números DrawText(Indicator, Panel_Position.X + 16 + 36 * (i - 1), Panel_Position.Y + 22, SFML.Graphics.Color.White); } // Movendo slot if (Player.Hotbar_Change > 0) { if (Player.Hotbar[Player.Hotbar_Change].Type == (byte)Game.Hotbar.Item) { Render(Tex_Item[Lists.Item[Player.Inventory[Player.Hotbar[Player.Hotbar_Change].Slot].Item_Num].Texture], new Point(Tools.Mouse.X + 6, Tools.Mouse.Y + 6)); } } // Fecha a janela de informa~ção caso necessário if (Game.Need_Information == 0) { Panels.Get("Information").Visible = false; } }
private static Panels.Structure Panel(BinaryReader Data) { // Carrega os dados Panels.Structure Tool = new Panels.Structure(); Tool.Name = Data.ReadString(); Tool.Position.X = Data.ReadInt32(); Tool.Position.Y = Data.ReadInt32(); Tool.Visible = Data.ReadBoolean(); Tool.Window = (Tools.Windows)Data.ReadByte(); Tool.Texture_Num = Data.ReadByte(); return(Tool); }
private static void Game_Menu_Character(Panels.Structure Tool) { Point Panel_Position = Tool.Position; Game.Need_Information &= ~(1 << 1); // Dados básicos DrawText(Player.Me.Name, Panel_Position.X + 18, Panel_Position.Y + 52, SFML.Graphics.Color.White); DrawText(Player.Me.Level.ToString(), Panel_Position.X + 18, Panel_Position.Y + 79, SFML.Graphics.Color.White); Render(Tex_Face[Player.Me.Texture_Num], new Point(Panel_Position.X + 82, Panel_Position.Y + 37)); // Atributos DrawText("Strength: " + Player.Me.Attribute[(byte)Game.Attributes.Strength], Panel_Position.X + 32, Panel_Position.Y + 146, SFML.Graphics.Color.White); DrawText("Resistance: " + Player.Me.Attribute[(byte)Game.Attributes.Resistance], Panel_Position.X + 32, Panel_Position.Y + 162, SFML.Graphics.Color.White); DrawText("Intelligence: " + Player.Me.Attribute[(byte)Game.Attributes.Intelligence], Panel_Position.X + 32, Panel_Position.Y + 178, SFML.Graphics.Color.White); DrawText("Agility: " + +Player.Me.Attribute[(byte)Game.Attributes.Agility], Panel_Position.X + 32, Panel_Position.Y + 194, SFML.Graphics.Color.White); DrawText("Vitality: " + +Player.Me.Attribute[(byte)Game.Attributes.Vitality], Panel_Position.X + 32, Panel_Position.Y + 210, SFML.Graphics.Color.White); DrawText("Points: " + Player.Me.Points, Panel_Position.X + 14, Panel_Position.Y + 228, SFML.Graphics.Color.White); // Equipamentos for (byte i = 0; i < (byte)Game.Equipments.Count; i++) { if (Player.Me.Equipment[i] == 0) { Render(Tex_Equipments, Panel_Position.X + 7 + i * 34, Panel_Position.Y + 247, i * 34, 0, 34, 34); } else { Render(Tex_Item[Lists.Item[Player.Me.Equipment[i]].Texture], Panel_Position.X + 8 + i * 35, Panel_Position.Y + 247, 0, 0, 34, 34); if (Tools.IsAbove(new Rectangle(Panel_Position.X + 7 + i * 36, Panel_Position.Y + 247, 32, 32))) { Game.Infomation_Index = Player.Me.Equipment[i]; Panels.Get("Information").Position = new Point(Panel_Position.X - 186, Panel_Position.Y + 5); Panels.Get("Information").Visible = true; Game.Need_Information |= 1 << 1; } } } // Fecha a janela de informa~ção caso necessário if (Game.Need_Information == 0) { Panels.Get("Information").Visible = false; } }
private static void Game_Menu_Inventory(Panels.Structure Tool) { byte NumColumns = 5; Point Panel_Position = Tool.Position; Game.Need_Information &= ~(1 << 2); // Desenha todos os itens do inventário for (byte i = 1; i <= Game.Max_Inventory; i++) { if (Player.Inventory[i].Item_Num > 0) { byte Line = (byte)((i - 1) / NumColumns); int Column = i - (Line * 5) - 1; Point Position = new Point(Panel_Position.X + 7 + Column * 36, Panel_Position.Y + 30 + Line * 36); // Desenha as visualizações do item Render(Tex_Item[Lists.Item[Player.Inventory[i].Item_Num].Texture], Position); if (Tools.IsAbove(new Rectangle(Position.X, Position.Y, 32, 32))) { Game.Infomation_Index = Player.Inventory[i].Item_Num; Panels.Get("Information").Position = new Point(Panel_Position.X - 186, Panel_Position.Y + 3); Panels.Get("Information").Visible = true; Game.Need_Information |= 1 << 2; } // Quantidade if (Player.Inventory[i].Amount > 1) { DrawText(Player.Inventory[i].Amount.ToString(), Position.X + 2, Position.Y + 17, SFML.Graphics.Color.White); } } } // Movendo item if (Player.Inventory_Change > 0) { Render(Tex_Item[Lists.Item[Player.Inventory[Player.Inventory_Change].Item_Num].Texture], new Point(Tools.Mouse.X + 6, Tools.Mouse.Y + 6)); } if (Game.Need_Information == 0) { Panels.Get("Information").Visible = false; } }
private static void Game_Chat() { Panels.Structure Tool = Panels.Get("Chat"); Tool.Visible = TextBoxes.Focused != null && ((TextBoxes.Structure)TextBoxes.Focused.Data).Name.Equals("Chat"); // Renderiza as mensagens if (Tool.Visible || (Chat.Text_Visible && Lists.Options.Chat)) { for (byte i = Chat.Lines_First; i <= Chat.Lines_Visible + Chat.Lines_First; i++) { if (Chat.Order.Count > i) { DrawText(Chat.Order[i].Text, 16, 461 + 11 * (i - Chat.Lines_First), Chat.Order[i].Color); } } } // Dica de como abrir o chat if (!Tool.Visible) { DrawText("Press [Enter] to open chat.", TextBoxes.Get("Chat").Position.X + 5, TextBoxes.Get("Chat").Position.Y + 3, SFML.Graphics.Color.White); } }
public static void Type() { TextBoxes.Structure Tool = TextBoxes.Get("Chat"); Panels.Structure Panel = Panels.Get("Chat"); // Somente se necessário if (!Player.IsPlaying(Player.MyIndex)) { return; } // Altera a visiblidade da caixa Panel.Visible = !Panel.Visible; // Altera o foco do digitalizador if (Panel.Visible) { Text_Visible = true; TextBoxes.Focused = Tools.Get(Tool); return; } else { TextBoxes.Focused = null; } // Dados string Message = Tool.Text; // Somente se necessário if (Message.Length < 3) { Tool.Text = string.Empty; return; } // Limpa a caixa de texto Tool.Text = string.Empty; // Separa as mensagens em partes string[] Parts = Message.Split(' '); // Comandos switch (Parts[0].ToLower()) { case "/party": if (Parts.Length > 1) { Send.Party_Invite(Parts[1]); } break; case "/partyleave": Send.Party_Leave(); break; default: // Mensagem lobal if (Message.Substring(0, 1) == "'") { Send.Message(Message.Substring(1), Game.Messages.Global); } // Mensagem particular else if (Message.Substring(0, 1) == "!") { // Previne erros if (Parts.GetUpperBound(0) < 1) { AddText("Use: '!' + Addressee + 'Message'", Color.White); } else { // Dados string Destiny = Message.Substring(1, Parts[0].Length - 1); Message = Message.Substring(Parts[0].Length + 1); // Envia a mensagem Send.Message(Message, Game.Messages.Private, Destiny); } } // Mensagem mapa else { Send.Message(Message, Game.Messages.Map); } break; } }
private static void Party_Invitation(Panels.Structure Tool) { DrawText(Game.Party_Invitation + " has invite you to a party. Would you like to join?", Tool.Position.X + 14, Tool.Position.Y + 33, SFML.Graphics.Color.White, 160); }
private static void Panel(Panels.Structure Tool) { // Desenha o painel Render(Tex_Panel[Tool.Texture_Num], Tool.Position); }