private void ActionKeyMappingUp_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (currentItemIndex > 0) { currentItemIndex--; } }
private void ActionKeyMappingUse_ActionTriggered(object sender, ActionTriggeredEventArgs e) { //if (isNavigatingBag) //{ // if (currentIndex < this.BaseContainer.Items.Count) // { // var item = this.BaseContainer.Items[currentIndex]; // if (item != null) // this.Use(item, false); // if (currentIndex >= this.BaseContainer.Items.Count && currentIndex > 0) // currentIndex--; // } //} //else //{ // if (currentIndex < this.GroundItems.Count) // { // var item = this.GroundItems[currentIndex]; // if (item != null) // this.Use(item, true); // if (currentIndex >= this.GroundItems.Count && currentIndex > 0) // currentIndex--; // } //} }
private void ActionKeyMappingOpenBags_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (world.PlayerCharacter == null) { return; } if (world.PlayerCharacter.Inventory == null) { return; } if (world.PlayerCharacter.IsDead) { return; } List <Item> worldItems = world.WorldItemsInRange(world.PlayerCharacter.Id); ContainerItem worldItemsTempContainer = new BagClientItem(worldItems); ContainerItem playerContainer = (BagClientItem)world.PlayerCharacter.Inventory; InventoryScreen inventoryScreen = new InventoryScreen(world, worldItemsTempContainer, playerContainer); //inventoryScreen.Player = world.PlayerCharacter; //inventoryScreen.BaseContainer = (BagClientItem)world.PlayerCharacter.Inventory; //new ClientBagItem((BagItem)world.GetItem(world.PlayerCharacter.InventoryBagId)); //inventoryScreen.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); inventoryScreen.Initialize(this.Manager); inventoryScreen.Activate(); }
private void ActionKeyMappingChat_ActionTriggered(object sender, ActionTriggeredEventArgs e) { ChatScreen chatScreen = new ChatScreen(world.PlayerCharacter.Id); chatScreen.Initialize(this.Manager); chatScreen.Show(); }
private void ActionKeyMappingOpenGameMenu(object sender, ActionTriggeredEventArgs e) { GameMenuScreen menuScreen = new GameMenuScreen(); menuScreen.Initialize(this.Manager); menuScreen.Show(); }
private void ActionKeyMappingDown_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (this.Character.Powers.Count > currentIndex + 1) { currentIndex++; } }
private void ActionKeyMappingUse_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (navigatingBase) { if (currentItemIndex < this.BaseContainer.Items.Count) { var item = this.BaseContainer.Items[currentItemIndex]; if (item != null) { this.Use(item); } if (currentItemIndex >= this.BaseContainer.Items.Count && currentItemIndex > 0) { currentItemIndex--; } } } else { if (currentItemIndex < this.ParentContainer.Items.Count) { var item = this.ParentContainer.Items[currentItemIndex]; if (item != null) { this.MoveToBaseContainer(item); } if (currentItemIndex >= this.ParentContainer.Items.Count && currentItemIndex > 0) { currentItemIndex--; } } } //else //{ // if (currentItemIndex < this.ParentContainer.Items.Count) // { // var item = this.ParentContainer.Items[currentItemIndex]; // if (item != null) // this.Use(item, false); // if (currentItemIndex >= this.ParentContainer.Items.Count && currentItemIndex > 0) // currentItemIndex--; // } //} //else //{ // if (currentItemIndex < this.GroundItems.Count) // { // var item = this.GroundItems[currentItemIndex]; // if (item != null) // this.Use(item, true); // if (currentItemIndex >= this.GroundItems.Count && currentItemIndex > 0) // currentItemIndex--; // } //} }
private void ActionKeyMappingSend(object sender, ActionTriggeredEventArgs e) { if (textMessage.Length > 0) { NetworkEngine.Instance.SendMessage(playerId, textMessage); } this.Close(); }
private void ActionKeyMappingDown(object sender, ActionTriggeredEventArgs e) { //if (characters == null) // return; //if (selectedIndex >= characters.Count - 1) // return; selectedIndex++; }
private void ActionButtonMappingAimTo_ActionTriggered(object sender, ActionTriggeredEventArgs e) { Point worldPosition = ScreenToWorld(e.MouseState.Position); if (world.PlayerCharacter.AimToPosition != worldPosition) { world.PlayerCharacter.SetAimToPosition(worldPosition); network.AimTo(world.PlayerCharacter.Id, worldPosition); } }
private void ActionKeyMappingDrop_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (navigatingBase) { if (currentItemIndex < this.BaseContainer.Items.Count) { var item = this.BaseContainer.Items[currentItemIndex]; if (item != null) { if (this.ParentContainer.Id == 0) { if (world.PlayerCharacter.MoveItem(item, world.PlayerCharacter.Position)) { NetworkEngine.Instance.MoveItem(item, world.PlayerCharacter.Position); //this.BaseContainer.Items.Remove(item); this.ParentContainer.Items.Add(item); } } else { if (world.PlayerCharacter.MoveItem(item, this.ParentContainer)) { NetworkEngine.Instance.MoveItem(item, this.ParentContainer); //this.BaseContainer.Items.Remove(item); //this.ParentContainer.Items.Add(item); } } } if (currentItemIndex >= this.BaseContainer.Items.Count && currentItemIndex > 0) { currentItemIndex--; } } } //if (isNavigatingBag) //{ // if (currentItemIndex < this.BaseContainer.Items.Count) // { // var item = this.BaseContainer.Items[currentItemIndex]; // if (item != null) // { // if (world.PlayerCharacter.DropItem(item)) // { // NetworkEngine.Instance.DropItem(world.PlayerCharacter, item); // this.BaseContainer = (BagClientItem)world.PlayerCharacter.Inventory; //new ClientBagItem((BagItem)world.GetItem(this.Player.InventoryBagId)); // this.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); // } // } // if (currentItemIndex >= this.BaseContainer.Items.Count && currentItemIndex > 0) // currentItemIndex--; // } //} }
private void ActionKeyMappingUp(object sender, ActionTriggeredEventArgs e) { //if (characters == null) // return; if (selectedIndex <= 0) { return; } selectedIndex--; }
private void ActionKeyMappingSelect(object sender, ActionTriggeredEventArgs e) { //if (characters == null) // return; //network.SelectCharacter(characters[selectedIndex].CharacterId); //GameplayScreen screenToLoad = new GameplayScreen(network); //LoadingScreen loadingScreen = new LoadingScreen(screenToLoad); //loadingScreen.Initialize(this.Manager); //loadingScreen.Activate(); //this.Close(); Game.Exit(); }
private void ActionKeyMappingSelect(object sender, ActionTriggeredEventArgs e) { if (characters == null) { return; } network.SelectCharacter(characters[selectedIndex]); GameplayScreen screenToLoad = new GameplayScreen(); LoadingScreen loadingScreen = new LoadingScreen(screenToLoad); loadingScreen.Initialize(this.Manager); loadingScreen.Activate(); this.Close(); }
private void ActionKeyMappingDown_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (navigatingBase) { if (this.BaseContainer.Items.Count > currentItemIndex + 1) { currentItemIndex++; } } else { if (this.ParentContainer.Items.Count > currentItemIndex + 1) { currentItemIndex++; } //if (this.GroundItems.Count > currentItemIndex + 1) // currentItemIndex++; } }
private void ActionButtonMappingMoveTo_ActionTriggered(object sender, ActionTriggeredEventArgs e) { Point worldPosition = ScreenToWorld(e.MouseState.Position); if (world.PlayerCharacter.MovingToPosition != worldPosition) { world.PlayerCharacter.SetMoveToPosition(worldPosition); network.MoveTo(world.PlayerCharacter.Id, worldPosition); } if (lastMovementClickTicks + doubleClickSpeed.Ticks >= e.GameTime.TotalGameTime.Ticks) { if (world.PlayerCharacter.AimToPosition != worldPosition) { world.PlayerCharacter.SetAimToPosition(worldPosition); network.AimTo(world.PlayerCharacter.Id, worldPosition); } } lastMovementClickTicks = e.GameTime.TotalGameTime.Ticks; }
private void ActionKeyMappingOpenCharacter_ActionTriggered(object sender, ActionTriggeredEventArgs e) { if (world.PlayerCharacter == null) { return; } if (world.PlayerCharacter.Powers == null) { return; } //if (world.PlayerCharacter.IsDead) // return; CharacterScreen characterScreen = new CharacterScreen(); characterScreen.Character = world.PlayerCharacter; characterScreen.Initialize(this.Manager); characterScreen.Activate(); //inventoryScreen.Player = world.PlayerCharacter; //inventoryScreen.BaseContainer = (BagClientItem)world.PlayerCharacter.Inventory; //new ClientBagItem((BagItem)world.GetItem(world.PlayerCharacter.InventoryBagId)); //inventoryScreen.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); //inventoryScreen.Activate(); }
private void actionKeyMappingAbility_ActionTriggered(object sender, ActionTriggeredEventArgs e) { var abilityIndex = e.Action.Id - 12; if (abilityIndex == -1) { if (world.PerformAbility(CharacterPowerIdentity.DefaultAttack, world.PlayerCharacter)) { network.PerformAbility(world.PlayerCharacter, CharacterPowerIdentity.DefaultAttack); } } else { if (world.PlayerCharacter.Powers.Count > abilityIndex) { CharacterPowerIdentity abilityId = world.PlayerCharacter.Powers[abilityIndex]; if (world.PerformAbility(abilityId, world.PlayerCharacter)) { network.PerformAbility(world.PlayerCharacter, abilityId); } } } }
private void ActionKeyMappingRight_ActionTriggered(object sender, ActionTriggeredEventArgs e) { //currentIndex = 0; //isNavigatingBag = true; }
private void ActionKeyMappingOpenBags_ActionTriggered(object sender, ActionTriggeredEventArgs e) { this.Hide(); //ToDo: Close all InventoryScreens. }
private void ActionKeyMappingCancel(object sender, ActionTriggeredEventArgs e) { NetworkEngine.Instance.ToggleChat(playerId, false); this.Close(); }
//private void InventoryScreen_ItemUsed(object sender, ItemUsedEventArgs e) //{ // if (e.IsWorldItem) // { // if (world.PlayerCharacter.PickupItem(e.ItemUsed)) // { // network.UseItem(world.PlayerCharacter.Id, e.ItemUsed); // inventoryScreen.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); // } // } // else // { // if (e.ItemUsed.Category == ItemCategory.Consumable) // { // ConsumableItem consumable = (ConsumableItem)e.ItemUsed; // if (consumable.Use(world.PlayerCharacter, world)) // { // network.UseItem(world.PlayerCharacter.Id, consumable); // inventoryScreen.BaseContainer = (BagClientItem)world.PlayerCharacter.Inventory; //new ClientBagItem((BagItem)world.GetItem(world.PlayerCharacter.InventoryBagId)); // inventoryScreen.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); // } // } // if (e.ItemUsed.Category == ItemCategory.Armor || e.ItemUsed.Category == ItemCategory.Weapon) // { // if (world.PlayerCharacter.Equip(e.ItemUsed)) // { // network.UseItem(world.PlayerCharacter.Id, e.ItemUsed); // inventoryScreen.BaseContainer = (BagClientItem)world.PlayerCharacter.Inventory; //new ClientBagItem((BagItem)world.GetItem(world.PlayerCharacter.InventoryBagId)); // inventoryScreen.GroundItems = world.GroundItemsInRange(world.PlayerCharacter.Id); // } // } // } //} private void ActionKeyMappingToggleFlullscreen_ActionTriggered(object sender, ActionTriggeredEventArgs e) { this.Game.Window.IsBorderless = !this.Game.Window.IsBorderless; this.Game.Window.Position = Point.Zero; }
private void ActionKeyMappingRight_ActionTriggered(object sender, ActionTriggeredEventArgs e) { currentItemIndex = 0; navigatingBase = true; }
private void ActionKeyMappingBack_ActionTriggered(object sender, ActionTriggeredEventArgs e) { this.Hide(); }
private void ActionKeyMappingCancel(object sender, ActionTriggeredEventArgs e) { this.Close(); }