private void btnTeleportLocation_Click(object sender, EventArgs e) { if (lvLocations.SelectedItems.Count > 0) { TeleportLocation location = lvLocations.SelectedItems[0].Tag as TeleportLocation; helper.TeleportToLocation(location); } }
private void btnRemoveLocation_Click(object sender, EventArgs e) { if (lvLocations.SelectedItems.Count > 0) { TeleportLocation location = lvLocations.SelectedItems[0].Tag as TeleportLocation; lvLocations.Items.Remove(lvLocations.SelectedItems[0]); helper.Locations.Remove(location); } }
public bool TeleportToLocation(TeleportLocation location) { if (location != null) { TeleportToPosition(location.Position); LastLocation = location; return(true); } return(false); }
public TeleportLocation AddCurrentLocation(string locationName) { TeleportLocation location = null; if (!string.IsNullOrEmpty(locationName)) { location = FindLocation(locationName); if (location != null) { location.Position = Me.position; } else { Locations.Add(new TeleportLocation(locationName)); } } return(location); }
public bool TeleportToLocation(string locationName) { TeleportLocation location = FindLocation(locationName); return(TeleportToLocation(location)); }