private bool onThemesRetrieved(CatalogServiceProxyEvents.ChallengesReponse evt) { eventChannel.RemoveListener <CatalogServiceProxyEvents.ChallengesReponse>(onThemesRetrieved); eventChannel.RemoveListener <WorldServiceEvents.SelfRoomJoinedEvent>(onRoomJoined); if (evt.Themes.Count > 0) { CurrentThemeData currentThemeData = evt.Themes[0]; CatalogThemeDefinition themeByScheduelId = Service.Get <CatalogServiceProxy>().GetThemeByScheduelId(currentThemeData.scheduledThemeChallengeId); TaskDefinition clothingCatalogChallenge = Service.Get <TaskService>().ClothingCatalogChallenge; clothingCatalogChallenge.Title = themeByScheduelId.Title; clothingCatalogChallenge.CompletionMessage = themeByScheduelId.CompleteMessage; clothingCatalogChallenge.Description = themeByScheduelId.Description; } return(false); }
public CatalogThemeDefinition GetThemeById(long themeId) { CatalogThemeDefinition result = null; Dictionary <int, CatalogThemeDefinition> dictionary = Service.Get <GameData>().Get <Dictionary <int, CatalogThemeDefinition> >(); if (dictionary != null) { if (dictionary.ContainsKey((int)themeId)) { result = dictionary[(int)themeId]; } else { Log.LogErrorFormatted(this, "Unable to locate theme definition with id {0}.", themeId); } } return(result); }