public static GossipMenu CreateTeleMenu(List <INamedWorldZoneLocation> locations, Action <GossipConversation, INamedWorldZoneLocation> callback) { GossipMenu gossipMenu = new GossipMenu(); foreach (INamedWorldZoneLocation location in locations) { INamedWorldZoneLocation loc = location; gossipMenu.AddItem((GossipMenuItemBase) new GossipMenuItem(loc.Names.LocalizeWithDefaultLocale(), (GossipActionHandler)(convo => callback(convo, loc)))); } return(gossipMenu); }
public static GossipMenu CreateTeleMenu(List <INamedWorldZoneLocation> locations, Action <GossipConversation, INamedWorldZoneLocation> callback) { // create gossip of all options var menu = new GossipMenu(); foreach (var location in locations) { var loc = location; // create local reference // TODO: Localize names menu.AddItem(new GossipMenuItem(loc.Names.LocalizeWithDefaultLocale(), convo => { callback(convo, loc); })); } return(menu); }