private void TestDialogueSystem() { foreach (NPC npc in npcs) { if (npc.canInteract()) { ContentManager content = gameRef.Content; Texture2D tooltipBackground = content.Load <Texture2D>(@"GUI\Inventory\Tooltip\background-v2"); Texture2D tooltipBorder = content.Load <Texture2D>(@"GUI\Inventory\Tooltip\border-v6"); SpriteFont font = content.Load <SpriteFont>(@"Fonts\ItemDataFont"); Rectangle screenRectangle = gameRef.ScreenRectangle; SimpleHUDWindow dialogueWindow = new SimpleHUDWindow(font); DialogueComponent dialogueComponent = new DialogueComponent(font, gameRef.Content, npc); dialogueComponent.RegisterCommand(Keys.Escape, CloseDialogueWindow, ClickState.RELEASED); dialogueComponent.RegisterCommand(Keys.E, CloseDialogueWindow, ClickState.RELEASED); dialogueWindow.Size = new Vector2(screenRectangle.Width * (2f / 3f), (screenRectangle.Height / 2f) - 100); dialogueWindow.Position = new Vector2( (screenRectangle.Width - dialogueWindow.Size.X) / 2f, screenRectangle.Height / 2f + (screenRectangle.Height / 2f - dialogueWindow.Size.Y) / 2f); dialogueWindow.Title = npc.Name; dialogueWindow.BorderTexture = tooltipBorder; dialogueWindow.Component = dialogueComponent; dialogueWindow.Show(); dialogueComponent.DialogueSelected += dialogueManager.OnSelected; hudManager.Put(Window.DIALOGUE, dialogueWindow); isPaused = true; break; } } }
public void ShowInventory() { if (!Enabled) { Show(); } InventoryWindowComponent inventory = inventoryWindow.Component as InventoryWindowComponent; inventory.Inventory.SetEnabled(true); inventoryWindow.Show(); }
public void ShowEquipment() { if (!Enabled) { Show(); } EquipmentWindowComponent equipment = equipmentWindow.Component as EquipmentWindowComponent; equipment.SetEnabled(true); equipmentWindow.Show(); }