public void RefreshUnion() { _memberList.Clear(); if (Main.netMode == 1) { MessageSender.GetComplexUnionData(); } else { for (var i = 0; i < 19; i++) { var testinfo = new JsonData.SimplifiedPlayerInfo { Name = ServerUtils.RandomGenString(), IsLogin = Main.rand.NextBool(), }; var bar = new UIUnionMemberBar(testinfo, Main.rand.Next(2) == 0 ? UnionPosition.会员 : UnionPosition.建筑师, Main.rand.Next(10000000)); _memberList.Add(bar); } var ownerinfo = new JsonData.SimplifiedPlayerInfo { Name = "Skirt", IsLogin = true, }; _memberList.Add(new UIUnionMemberBar(ownerinfo, UnionPosition.会长, Main.rand.Next(10000000))); _memberList.Sort(); unionNameText.SetText("裙中世界"); AdjustOwnerUI(true); } _relaxTimer = 180; _rotation = 0f; }
public void RefreshOnlinePlayer() { uIPlayerBars.Clear(); _onlinePlayerList.Clear(); if (Main.netMode == 1) { MessageSender.SendRequestOnlinePlayer(); } else { for (var i = 0; i < 20; i++) { var testinfo = new JsonData.SimplifiedPlayerInfo { Name = ServerUtils.RandomGenString() }; var bar = new UINormalPlayerBar(testinfo); uIPlayerBars.Add(bar); _onlinePlayerList.Add(bar); onlinelabel.SetText($"在线玩家 人数: {uIPlayerBars.Count}"); } } _relaxTimer = 180; _rotation = 0f; }
public override void Update(GameTime gameTime) { base.Update(gameTime); if (Main.netMode == 0) { var info = new JsonData.SimplifiedPlayerInfo { Name = Main.LocalPlayer.name, IsFriend = true, IsLogin = true, Rank = 1500, KillCount = 50, ChatPrefix = "公民", ChatColor = Color.Red, RegistedTime = DateTime.Now, CurrentMatch = "吃鸡" }; uIPlayerProfileHead.SetPlayer(info); } if (_relaxTimer > 0) { _relaxTimer--; _rotation += 0.1f; refreshButton.Enabled = false; } else { _rotation = 0f; refreshButton.Enabled = true; } refreshButton.Rotation = _rotation; }
public void OpenInventory(JsonData.SimplifiedPlayerInfo info) { if (!_canShowUITable[SSCUIState.InventoryPage]) { _canShowUITable[SSCUIState.InventoryPage] = true; } _playerInventoryState.GetInventory(info.PlayerID); }
public void AppendPlayers(JsonData.SimplifiedPlayerInfo info) { var bar = new UINormalPlayerBar(info); uIPlayerBars.Add(bar); _onlinePlayerList.Add(bar); onlinelabel.SetText($"在线玩家 人数: {uIPlayerBars.Count}"); }
public void OpenProfile(JsonData.SimplifiedPlayerInfo info) { if (!_canShowUITable[SSCUIState.ProfilePage]) { _canShowUITable[SSCUIState.ProfilePage] = true; } _playerProfileState.SetProfile(info); if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("see-inventory")) { OpenInventory(info); } }
public void SetProfile(JsonData.SimplifiedPlayerInfo info) { uIPlayerProfileHead.SetPlayer(info); if (info.VIPLevel == 0) { if (crownSwitch.Value) { crownSwitch.Switch(); } crownSwitch.Enabled = false; } else { crownSwitch.Enabled = true; } }
public void RefreshFriends() { //uIFriendBars.Clear(); _friendList.Clear(); if (Main.netMode == 1) { MessageSender.SendGetFriends(); } else { for (var i = 0; i < 20; i++) { var testinfo = new JsonData.SimplifiedPlayerInfo { Name = ServerUtils.RandomGenString() }; var bar = new UIFriendBar(testinfo); _friendList.Add(bar); } } _relaxTimer = 180; _rotation = 0f; }
//private void RefreshButton_OnClick(UIMouseEvent evt, UIElement listeningElement) //{ // RefreshFriends(); //} public void SetProfile(JsonData.SimplifiedPlayerInfo info) { uIPlayerProfileHead.SetPlayer(info); }
//public override void Update(GameTime gameTime) //{ // base.Update(gameTime); // if (Main.netMode == 0) // { // JsonData.SimplifiedPlayerInfo info = new JsonData.SimplifiedPlayerInfo // { // Name = Main.LocalPlayer.name, // IsFriend = true, // IsLogin = true, // Rank = 1500 // }; // uIPlayerProfileHead.SetPlayer(info); // } // if (_relaxTimer > 0) // { // _relaxTimer--; // _rotation += 0.1f; // refreshButton.Enabled = false; // } // else // { // _rotation = 0f; // refreshButton.Enabled = true; // } // refreshButton.Rotation = _rotation; //} public void AppendFriends(JsonData.SimplifiedPlayerInfo info) { UIFriendBar bar = new UIFriendBar(info); _friendList.Add(bar); }
public void SetMyPlayerProfile(JsonData.SimplifiedPlayerInfo info) { _homePageState.SetProfile(info); }
public void AppendOnlinePlayers(JsonData.SimplifiedPlayerInfo info) { _playerOnlineWindow.AppendPlayers(info); }
public void AppendFriends(JsonData.SimplifiedPlayerInfo info) { // _homePageState.AppendFriends(info); }