private void GetObjectAtGridPosition(Vector2 gridPos) { IFloorLayoutObject mapObject = DigimonWorld2ToolForm.CurrentMapLayout.FloorLayoutObjects.FirstOrDefault(o => o.Position == gridPos); if (mapObject != null) { DigimonWorld2ToolForm.Main.SetCurrentObjectInformation(mapObject); } }
public void SetCurrentObjectInformation(IFloorLayoutObject mapObject) { ResetCurrentObjectInformation(); ObjectTypeLabel.Text = $"Type: {mapObject.ObjectType}"; ObjectPositionLabel.Text = GridPosHexCheckBox.Checked ? $"Position: ({mapObject.Position.x:X2}, {mapObject.Position.y:X2})" : $"Position: {mapObject.Position}"; switch (mapObject.ObjectType) { case IFloorLayoutObject.MapObjectType.Warp: Warp warp = (Warp)mapObject; ObjectSubTypeLabel.Text = $"Sub type: {warp.Type}"; break; case IFloorLayoutObject.MapObjectType.Chest: Chest chest = (Chest)mapObject; ObjectSlotOneLabel.Text = $"Slot 1: {chest.chestSlots[0].ItemName} - {chest.chestSlots[0].TrapLevel}"; ObjectSlotTwoLabel.Text = $"Slot 2: {chest.chestSlots[1].ItemName} - {chest.chestSlots[1].TrapLevel}"; ObjectSlotThreeLabel.Text = $"Slot 3: {chest.chestSlots[2].ItemName} - {chest.chestSlots[2].TrapLevel}"; ObjectSlotFourLabel.Text = $"Slot 4: {chest.chestSlots[3].ItemName} - {chest.chestSlots[3].TrapLevel}"; break; case IFloorLayoutObject.MapObjectType.Trap: Trap trap = (Trap)mapObject; ObjectSubTypeLabel.Text = $"Sub type: {trap.Type}"; ObjectSlotOneLabel.Text = $"Slot 1: {trap.TrapSlots[0]}"; ObjectSlotTwoLabel.Text = $"Slot 2: {trap.TrapSlots[1]}"; ObjectSlotThreeLabel.Text = $"Slot 3: {trap.TrapSlots[2]}"; ObjectSlotFourLabel.Text = $"Slot 4: {trap.TrapSlots[3]}"; break; case IFloorLayoutObject.MapObjectType.Digimon: Digimon digimon = (Digimon)mapObject; ObjectSubTypeLabel.Text = $"Pack 1 Level: {digimon.DigimonPacks[0].Level}"; ObjectSlotOneLabel.Text = $"Slot 1: {digimon.DigimonPacks[0].ObjectModelDigimonName:X2}"; ObjectSlotTwoLabel.Text = $"Slot 2: {digimon.DigimonPacks[1].ObjectModelDigimonName:X2}"; ObjectSlotThreeLabel.Text = $"Slot 3: {digimon.DigimonPacks[2].ObjectModelDigimonName:X2}"; ObjectSlotFourLabel.Text = $"Slot 4: {digimon.DigimonPacks[3].ObjectModelDigimonName:X2}"; break; default: break; } }