示例#1
0
        public void Init(Terrain terrain)
        {
            View = terrain;

            DataService.Get <City>((uint)0).ContinueWith(city =>
            {
                CurrentCity.Value = city.Result;
                DataService.Request(MaskedStruct.CurrentCity, 0);
            });
        }
 public void CallAvatar(uint avatarId)
 {
     DataService.Get <Avatar>(avatarId).ContinueWith(x =>
     {
         var msg = Chat.Call(UserReference.Wrap(x.Result));
         if (msg != null)
         {
             Chat.ShowWindow(msg);
         }
     });
 }
示例#3
0
        public void Show(uint avatarId)
        {
            View.TrySaveDescription();
            AvatarId = avatarId;

            DataService.Get <Avatar>(avatarId).ContinueWith(x =>
            {
                View.CurrentAvatar.Value = x.Result;
            });
            DataService.Request(MaskedStruct.MyAvatar, avatarId);

            if (View.MyAvatar.Value == null)
            {
                DataService.Get <Avatar>(Network.MyCharacter).ContinueWith(x =>
                {
                    View.MyAvatar.Value = x.Result;
                    if (x.Result != null && x.Result.Avatar_LotGridXY != 0 && (View.MyLot.Value == null || View.MyLot.Value.Lot_Location_Packed != x.Result.Avatar_LotGridXY))
                    {
                        DataService.Request(MaskedStruct.AdmitInfo_Lot, x.Result.Avatar_LotGridXY).ContinueWith(y =>
                        {
                            View.MyLot.Value = (Lot)y.Result;
                        });
                    }
                });
            }
            else
            {
                if (View.MyAvatar.Value != null && View.MyAvatar.Value.Avatar_LotGridXY != 0 && (View.MyLot.Value == null || View.MyLot.Value.Lot_Location_Packed != View.MyAvatar.Value.Avatar_LotGridXY))
                {
                    DataService.Request(MaskedStruct.AdmitInfo_Lot, View.MyAvatar.Value.Avatar_LotGridXY).ContinueWith(y =>
                    {
                        View.MyLot.Value = (Lot)y.Result;
                    });
                }
            }

            //if we're due a relationship poll on our own avatar, perform it.
            if (MyRelDirty)
            {
                MyRelDirty = false;
                DataService.Request(MaskedStruct.FriendshipWeb_Avatar, Network.MyCharacter);
                MyRelPollTimeout = GameThread.SetTimeout(() => { MyRelDirty = true; }, 60000);
            }

            View.CurrentTab = UIPersonPageTab.Description;
            View.SetOpen(false);
            View.Parent.Add(View);
            View.Visible = true;
            ChangeTopic();
        }
        public void Show(uint character)
        {
            View.Parent.Add(View);
            if (!View.Visible)
            {
                View.CenterAround(GameFacade.Screens.CurrentUIScreen);
            }
            View.Visible = true;
            View.SetPersonID(character);

            DataService.Request(MaskedStruct.FriendshipWeb_Avatar, character).ContinueWith(y =>
            {
                View.UpdateRelationships(((Avatar)y.Result).Avatar_FriendshipVec);
            });

            DataService.Get <Avatar>(character).ContinueWith(x =>
            {
                var sim = x.Result;
                if (x.Result != null && x.Result.Avatar_LotGridXY != 0)
                {
                    DataService.Request(MaskedStruct.PropertyPage_LotInfo, x.Result.Avatar_LotGridXY).ContinueWith(y =>
                    {
                        View.SetRoommates(((Lot)y.Result).Lot_RoommateVec);
                    });
                }
            });
        }
示例#5
0
        public UIMapWaypoint(UIMapWaypointStyle style)
        {
            DataService = FSOFacade.Kernel.Get <IClientDataService>();
            Style       = style;
            var network = FSOFacade.Kernel.Get <Network.Network>();

            MyAvatar = new Binding <Avatar>();
            MyLot    = new Binding <Lot>();
            switch (style)
            {
            case UIMapWaypointStyle.YouAreHere:     // pinkish backgound
                BgImg = GetTexture((ulong)UIFileIDs.youarehereback);
                break;

            case UIMapWaypointStyle.YourHouseHere:
                BgImg = GetTexture((ulong)UIFileIDs.yourhousehereback);
                DataService.Get <Avatar>(network.MyCharacter).ContinueWith(x =>
                {
                    MyAvatar.Value = x.Result;
                    if (x.Result != null && x.Result.Avatar_LotGridXY != 0 && (MyLot.Value == null || MyLot.Value.Lot_Location_Packed != x.Result.Avatar_LotGridXY))
                    {
                        DataService.Request(MaskedStruct.AdmitInfo_Lot, x.Result.Avatar_LotGridXY).ContinueWith(y =>
                        {
                            MyLot.Value = (Lot)y.Result;
                        });
                    }
                });
                break;
            }
            ClickHandler =
                ListenForMouse(new Rectangle(0, 0, SizeW, SizeH), new UIMouseEvent(OnMouseEvent));
        }
示例#6
0
 private void Init()
 {
     DataService.Get <Avatar>(Network.MyCharacter).ContinueWith(x =>
     {
         Binding.Value = x.Result;
     });
 }
示例#7
0
 private void Initialize()
 {
     DataService.Get <Avatar>(Network.MyCharacter).ContinueWith(x =>
     {
         if (!x.IsFaulted)
         {
             Gizmo.CurrentAvatar.Value = x.Result;
         }
     });
 }
示例#8
0
 private void Initialize()
 {
     DataService.Get <Avatar>(Network.MyCharacter).ContinueWith(x =>
     {
         if (!x.IsFaulted)
         {
             Gizmo.CurrentAvatar.Value = x.Result;
             FSO.UI.Model.DiscordRpcEngine.SendFSOPresence(x.Result.Avatar_Name, null, 0, 0, 0, 0, x.Result.Avatar_PrivacyMode > 0);
         }
     });
 }
示例#9
0
 public void Show(uint lotId)
 {
     View.TrySaveDescription();
     LotId = lotId;
     DataService.Get <Lot>(lotId).ContinueWith(x =>
     {
         View.CurrentLot.Value = x.Result;
         DataService.Request(MaskedStruct.AdmitInfo_Lot, lotId);
     });
     View.Parent.Add(View);
     View.Visible = true;
     ChangeTopic();
 }
示例#10
0
 public void Show(uint lotId)
 {
     View.TrySaveDescription();
     LotId = lotId;
     DataService.Get <Lot>(lotId).ContinueWith(x =>
     {
         View.CurrentLot.Value = x.Result;
         DataService.Request(MaskedStruct.AdmitInfo_Lot, lotId);
     });
     View.Parent.Add(View);
     View.Visible = true;
     View.AsyncAPIThumb(lotId);
     ChangeTopic();
     FSOFacade.Hints.TriggerHint("ui:lot_page");
 }
示例#11
0
        public void Show(uint lotId)
        {
            View.TrySaveDescription();
            NeighId = lotId;
            DataService.Get <Neighborhood>(lotId).ContinueWith(x =>
            {
                View.CurrentNeigh.Value = x.Result;
                DataService.Request(MaskedStruct.NeighPage_Info, lotId);
                DataService.Request(MaskedStruct.NeighPage_TopLots, lotId);
            });
            View.Parent.Add(View);
            View.HasShownFilters    = false;
            View.DescriptionChanged = false;
            View.Visible            = true;
            //View.AsyncAPIThumb(lotId);
            var gizmo = (UI.Framework.UIScreen.Current as UI.Screens.CoreGameScreen)?.gizmo;

            if (gizmo != null)
            {
                gizmo.FilterList = System.Collections.Immutable.ImmutableList <uint> .Empty;
            }
            ChangeTopic();
            FSOFacade.Hints.TriggerHint("ui:neigh_page");
        }