public void AttachProfileScreenToUserGroup(UserProfileLoadedEvent e, RemoteUserNode remoteUser, [JoinAll] ProfileScreenNode screen, [JoinByScreen] ProfileScreenContextNode profileScreenContext) { if (remoteUser.Entity.Id.Equals(profileScreenContext.profileScreenContext.UserId)) { remoteUser.userGroup.Attach(screen.Entity); } }
public void ColorizeRemoteUserRow(NodeAddedEvent e, UserRowNode userRow, [JoinByScoreTable] ScoreTableColorNode scoreTableColor, [Context] UserRowNode userRow1, [JoinByUser] RemoteUserNode remoteUser) { userRow.scoreTableRow.Color = !remoteUser.Entity.HasComponent <AcceptedFriendComponent>() ? scoreTableColor.scoreTableRowColor.rowColor : scoreTableColor.scoreTableRowColor.friendRowColor; }
public void OnRemoteGraffiti(NodeAddedEvent e, GraffitiNode node, [JoinByUser] SingleNode <UserUidComponent> UidNode, [JoinByUser] RemoteUserNode user) { string uid = UidNode.component.Uid; Vector3 sprayPosition = node.graffitiDecal.SprayPosition; Vector3 sprayDirection = node.graffitiDecal.SprayDirection; Vector3 sprayUpDirection = node.graffitiDecal.SprayUpDirection; GraffitiAntiSpamTimerComponent graffitiAntiSpamTimer = node.graffitiAntiSpamTimer; if (!graffitiAntiSpamTimer.GraffitiDelayDictionary.ContainsKey(uid)) { base.ScheduleEvent(new CreateGraffitiEvent(sprayPosition, sprayDirection, sprayUpDirection), node.Entity); GraffitiAntiSpamTimerComponent.GraffityInfo info2 = new GraffitiAntiSpamTimerComponent.GraffityInfo { Time = Time.realtimeSinceStartup }; graffitiAntiSpamTimer.GraffitiDelayDictionary.Add(uid, info2); } else { float realtimeSinceStartup = Time.realtimeSinceStartup; GraffitiAntiSpamTimerComponent.GraffityInfo info3 = graffitiAntiSpamTimer.GraffitiDelayDictionary[uid]; float timeInSec = (info3.Time + 2f) - realtimeSinceStartup; if (timeInSec <= 0f) { info3.CreateGraffitiEvent = new CreateGraffitiEvent(sprayPosition, sprayDirection, sprayUpDirection); info3.Time = Time.realtimeSinceStartup; base.NewEvent(info3.CreateGraffitiEvent).Attach(node.Entity).Schedule(); } else if (info3.Time > realtimeSinceStartup) { info3.CreateGraffitiEvent.Position = sprayPosition; info3.CreateGraffitiEvent.Direction = sprayDirection; info3.CreateGraffitiEvent.Up = sprayUpDirection; } else { info3.CreateGraffitiEvent = new CreateGraffitiEvent(sprayPosition, sprayDirection, sprayUpDirection); info3.Time += 2f; base.NewEvent(info3.CreateGraffitiEvent).Attach(node.Entity).ScheduleDelayed(timeInSec); } } }
public void DrawGraffiti(CreateGraffitiEvent e, GraffitiSimpleNode graffitiNode, [JoinByUser] RemoteUserNode user, [JoinByUser] TankWithGraffitiNode tank, [JoinByUser] Optional <SingleNode <PremiumAccountBoostComponent> > premium, [JoinAll] SingleNode <DecalManagerComponent> decalManagerNode, [JoinAll] SingleNode <BurningTargetBloomComponent> bloomPostEffect) { GameObject obj2 = this.DrawGraffiti(decalManagerNode.component, graffitiNode.dynamicDecalProjector, e.Position, e.Direction, e.Up); if (obj2) { graffitiNode.graffitiInstance.GraffitiDecalObject = obj2; this.PlaySound(graffitiNode.graffitiSound.Sound, e.Position); this.AddEmitEffect(graffitiNode, bloomPostEffect.component); if (premium.IsPresent()) { GraffitiVisualEffectComponent graffitiVisualEffect = tank.graffitiVisualEffect; GraffitiVisualEffect visualEffectPrefab = graffitiVisualEffect.VisualEffectPrefab; this.DrawEffect(visualEffectPrefab, graffitiVisualEffect.TimeToDestroy, tank.tankCommonInstance.TankCommonInstance.transform, graffitiNode.imageItem.SpriteUid, graffitiNode.itemRarity.RarityType); } } }
public void ShowScreenElementsForRemoteUser(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] RemoteUserNode remoteUser, [JoinByLeague] LeagueNode leagueNode) { profileScreen.profileScreen.selfUserAccountButtonsTab.SetActive(false); profileScreen.profileScreen.otherUserAccountButtonsTab.SetActive(true); profileScreen.profileScreen.OtherPlayerNickname.gameObject.SetActive(true); profileScreen.profileScreen.OtherPlayerNickname.text = remoteUser.userUid.Uid; profileScreen.profileScreen.Avatar.SpriteUid = remoteUser.userAvatar.Id; profileScreen.profileScreen.IsPremium = remoteUser.Entity.HasComponent <PremiumAccountBoostComponent>(); profileScreen.profileScreen.LeagueBorder.SelectedSpriteIndex = leagueNode.leagueConfig.LeagueIndex; profileScreen.profileScreen.SetPlayerColor(remoteUser.Entity.HasComponent <AcceptedFriendComponent>()); }
public void AttachProfileScreenToUserGroup(UserProfileLoadedEvent e, RemoteUserNode remoteUser, [JoinAll] SingleNode <AddFriendDialogComponent> dialog, [JoinByScreen] SearchUserInputFieldNode searchField, [JoinByScreen] SingleNode <SearchUserButtonComponent> button, [JoinAll] SingleNode <SelfUserComponent> selfUser) { base.ScheduleEvent(new RequestFriendEvent(remoteUser.Entity), selfUser); base.ScheduleEvent <FriendRequestSentEvent>(selfUser); dialog.component.Hide(); }