private async void OnAddClick(object sender, RoutedEventArgs e) { // TODO: replace this with a SelectorDrawer object instead TargetSelectorView selector = new TargetSelectorView(); await this.viewService.ShowDrawer(selector, "Selection", DrawerDirection.Left); while (selector.Actor == null) { await Task.Delay(100); } if (selector.Actor.Type == ActorTypes.BattleNpc || selector.Actor.Type == ActorTypes.EventNpc) { MessageBoxResult result = MessageBox.Show(this, $"The Actor: \"{selector.Actor.Name}\" is not a player. Do you want to change them to a player to allow for posing and appearance changes?", "Actor Selection", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { selector.Actor.SetValue(Offsets.Main.ActorType, ActorTypes.Player); selector.Actor.Type = ActorTypes.Player; selector.Actor.SetValue(Offsets.Main.ModelType, 0); await selector.Actor.ActorRefreshAsync(); } } TabItem tab = new TabItem(); tab.Content = new ActorEditor(); tab.Header = new ActorHeaderView(); tab.DataContext = selector.Actor; this.Tabs.Items.Add(tab); this.Tabs.SelectedItem = tab; }
private async void OnAddClick(object sender, RoutedEventArgs e) { // TODO: replace this with a SelectorDrawer object instead TargetSelectorView selector = new TargetSelectorView(); await this.viewService.ShowDrawer(selector, "Selection", DrawerDirection.Left); while (selector.Actor == null) { await Task.Delay(100); } Actor selection = selector.Actor; this.Actors.Add(selection); this.Tabs.SelectedItem = selection; }
private async void OnAddClick(object sender, RoutedEventArgs e) { TargetSelectorView selector = new TargetSelectorView(); await this.viewService.ShowDrawer(selector, "Selection", DrawerDirection.Left); }