public void OpenContainer(OpenSelectedContainerEvent e, GamePlayChestItemNode containerNode) { OpenContainerEvent eventInstance = new OpenContainerEvent { Amount = containerNode.userItemCounter.Count }; base.ScheduleEvent(eventInstance, containerNode); }
public void OpenGameplayChest(ButtonClickEvent e, SingleNode <OpenGameplayChestButtonComponent> button, [JoinAll] UserNode user, [JoinByLeague] LeagueNode league, [JoinAll] ScreenNode screen) { screen.battleResultsAwardsScreen.openChestButton.SetActive(false); Entity entity = Flow.Current.EntityRegistry.GetEntity(league.chestBattleReward.ChestId); GamePlayChestItemNode node = base.Select <GamePlayChestItemNode>(entity, typeof(MarketItemGroupComponent)).FirstOrDefault <GamePlayChestItemNode>(); if ((node != null) && (node.userItemCounter.Count != 0L)) { OpenContainerEvent eventInstance = new OpenContainerEvent { Amount = node.userItemCounter.Count }; base.ScheduleEvent(eventInstance, node); } }
public void ShowExp(NodeAddedEvent e, ScreenNode screen, [JoinAll] ResultsNode results, [JoinAll] SelfUserNode selfUser, [JoinByLeague] LeagueNode league, [JoinAll] ModuleUpgradeConfigNode moduleUpgradeConfig, [JoinAll] RankNamesNode rankNames, [JoinAll] SingleNode <RanksExperiencesConfigComponent> ranksExperiencesConfig) { BattleResultForClient resultForClient = results.battleResults.ResultForClient; PersonalBattleResultForClient personalResult = resultForClient.PersonalResult; UserResult result = resultForClient.FindUserResultByUserId(selfUser.Entity.Id); int rank = selfUser.userRank.Rank; int index = rank - 2; int initValue = ((index < 0) || (index >= ranksExperiencesConfig.component.RanksExperiences.Length)) ? 0 : ranksExperiencesConfig.component.RanksExperiences[index]; int num4 = rank - 1; int maxValue = ((num4 < 0) || (num4 >= ranksExperiencesConfig.component.RanksExperiences.Length)) ? 0 : ranksExperiencesConfig.component.RanksExperiences[num4]; screen.battleResultsAwardsScreen.ShowRankProgress(initValue, personalResult.RankExp, maxValue, personalResult.RankExpDelta, result.ScoreWithoutPremium, rank, rankNames.ranksNames.Names); Entity entity = Flow.Current.EntityRegistry.GetEntity(league.chestBattleReward.ChestId); GamePlayChestItemNode node = base.Select <GamePlayChestItemNode>(entity, typeof(MarketItemGroupComponent)).FirstOrDefault <GamePlayChestItemNode>(); screen.battleResultsAwardsScreen.openChestButton.SetActive((node != null) && (node.userItemCounter.Count != 0L)); screen.battleResultsAwardsScreen.ShowContainerProgress(personalResult.ContainerScore, personalResult.ContainerScoreDelta, result.ScoreWithoutPremium, personalResult.ContainerScoreLimit, ((personalResult.Container == null) || !personalResult.Container.HasComponent <ImageItemComponent>()) ? string.Empty : personalResult.Container.GetComponent <ImageItemComponent>().SpriteUid); screen.battleResultsAwardsScreen.SetTankInfo(result.HullId, result.WeaponId, result.Modules, moduleUpgradeConfig.moduleUpgradablePowerConfig); screen.battleResultsAwardsScreen.SetHullExp(personalResult.TankInitExp, personalResult.TankExp, personalResult.TankFinalExp, personalResult.ItemsExpDelta, result.ScoreWithoutPremium, personalResult.TankLevel); screen.battleResultsAwardsScreen.SetTurretExp(personalResult.WeaponInitExp, personalResult.WeaponExp, personalResult.WeaponFinalExp, personalResult.ItemsExpDelta, result.ScoreWithoutPremium, personalResult.WeaponLevel); }