/// <summary> /// Player wished to log into a city! /// </summary> /// <param name="button">The avatar button that was clicked.</param> public void AvatarButton_OnButtonClick(UIElement button) { PersonSlot PSlot = m_PersonSlots.First(x => x.AvatarButton == button); UISim Avatar = NetworkFacade.Avatars.First(x => x.Name == PSlot.PersonNameText.Caption); //This is important, the avatar contains ResidingCity, which is neccessary to //continue to CityTransitionScreen. PlayerAccount.CurrentlyActiveSim = Avatar; UIPacketSenders.RequestCityToken(NetworkFacade.Client, Avatar); }
private void Client_OnConnected(LoginArgsContainer LoginArgs) { ProgressEvent Progress = new ProgressEvent(EventCodes.PROGRESS_UPDATE); Progress.Done = 1; Progress.Total = 3; UIPacketSenders.SendLoginRequestCity(LoginArgs); OnTransitionProgress(Progress); }
private void Client_OnConnected(LoginArgsContainer LoginArgs) { TSOClient.Network.Events.ProgressEvent Progress = new TSOClient.Network.Events.ProgressEvent(TSOClient.Events.EventCodes.PROGRESS_UPDATE); Progress.Done = 1; Progress.Total = 2; if (m_CharacterCreated) { UIPacketSenders.SendCharacterCreateCity(LoginArgs, PlayerAccount.CurrentlyActiveSim); OnTransitionProgress(Progress); } else { UIPacketSenders.SendCityToken(NetworkFacade.Client); OnTransitionProgress(Progress); } }
private void Controller_OnLoginSuccessCity() { ProgressEvent Progress = new ProgressEvent(EventCodes.PROGRESS_UPDATE); Progress.Done = 2; Progress.Total = 3; if (m_CharacterCreated) { UIPacketSenders.SendCharacterCreateCity(NetworkFacade.Client, PlayerAccount.CurrentlyActiveSim); OnTransitionProgress(Progress); } else { UIPacketSenders.SendCityToken(NetworkFacade.Client); OnTransitionProgress(Progress); } }
private void AcceptButton_OnButtonClick(UIElement button) { var sim = new UISim(Guid.NewGuid(), false); sim.Name = NameTextEdit.CurrentText; sim.Sex = System.Enum.GetName(typeof(Gender), Gender); sim.Description = DescriptionTextEdit.CurrentText; sim.Timestamp = DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"); sim.ResidingCity = SelectedCity; var selectedHead = (CollectionItem)((UIGridViewerItem)m_HeadSkinBrowser.SelectedItem).Data; var selectedBody = (CollectionItem)((UIGridViewerItem)m_BodySkinBrowser.SelectedItem).Data; var headPurchasable = Content.Get().AvatarPurchasables.Get(selectedHead.PurchasableOutfitId); var bodyPurchasable = Content.Get().AvatarPurchasables.Get(selectedBody.PurchasableOutfitId); sim.Head = Content.Get().AvatarOutfits.Get(headPurchasable.OutfitID); sim.HeadOutfitID = headPurchasable.OutfitID; sim.Body = Content.Get().AvatarOutfits.Get(bodyPurchasable.OutfitID); sim.BodyOutfitID = bodyPurchasable.OutfitID; sim.Handgroup = Content.Get().AvatarOutfits.Get(bodyPurchasable.OutfitID); sim.Avatar.Appearance = this.AppearanceType; //GameFacade.Controller.ShowCity(); PlayerAccount.CurrentlyActiveSim = sim; if (PlayerAccount.Sims.Count == 0) { PlayerAccount.Sims.Add(sim); } else if (PlayerAccount.Sims.Count == 2) { PlayerAccount.Sims[1] = sim; } else if (PlayerAccount.Sims.Count == 3) { PlayerAccount.Sims[2] = sim; } UIPacketSenders.SendCharacterCreate(sim, DateTime.Now.ToString()); }
/// <summary> /// User confirmed character retirement. /// </summary> private void PersonSlot_OnButtonClick(UIElement button) { UIPacketSenders.SendCharacterRetirement(Avatar); UIScreen.RemoveDialog(RetireCharAlert); }