| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Linq; |
| | 4 | | using DCL; |
| | 5 | | using ExploreV2Analytics; |
| | 6 | | using UnityEngine; |
| | 7 | | using Variables.RealmsInfo; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Main controller for the feature "Explore V2". |
| | 11 | | /// </summary> |
| | 12 | | public class ExploreV2MenuComponentController : IExploreV2MenuComponentController |
| | 13 | | { |
| | 14 | | internal const ExploreSection DEFAULT_SECTION = ExploreSection.Explore; |
| | 15 | |
|
| | 16 | | internal const float MIN_TIME_AFTER_CLOSE_OTHER_UI_TO_OPEN_START_MENU = 0.1f; |
| 58 | 17 | | internal readonly List<RealmRowComponentModel> currentAvailableRealms = new List<RealmRowComponentModel>(); |
| | 18 | | internal float chatInputHUDCloseTime = 0f; |
| | 19 | | internal float controlsHUDCloseTime = 0f; |
| | 20 | | internal ExploreSection currentOpenSection; |
| | 21 | | internal float emotesHUDCloseTime = 0f; |
| | 22 | | internal IExploreV2Analytics exploreV2Analytics; |
| | 23 | | internal MouseCatcher mouseCatcher; |
| | 24 | | internal IPlacesAndEventsSectionComponentController placesAndEventsSectionController; |
| | 25 | | internal float playerInfoCardHUDCloseTime = 0f; |
| | 26 | | private Dictionary<BaseVariable<bool>, ExploreSection> sectionsByInitVar; |
| | 27 | | internal Dictionary<BaseVariable<bool>, ExploreSection> sectionsByVisiblityVar; |
| | 28 | |
|
| | 29 | | private Dictionary<ExploreSection, (BaseVariable<bool> initVar, BaseVariable<bool> visibilityVar)> sectionsVariables |
| | 30 | |
|
| | 31 | | internal IExploreV2MenuComponentView view; |
| | 32 | |
|
| 174 | 33 | | internal UserProfile ownUserProfile => UserProfile.GetOwnUserProfile(); |
| 58 | 34 | | internal RectTransform topMenuTooltipReference => view.currentTopMenuTooltipReference; |
| 58 | 35 | | internal RectTransform placesAndEventsTooltipReference => view.currentPlacesAndEventsTooltipReference; |
| 58 | 36 | | internal RectTransform backpackTooltipReference => view.currentBackpackTooltipReference; |
| 58 | 37 | | internal RectTransform mapTooltipReference => view.currentMapTooltipReference; |
| 58 | 38 | | internal RectTransform builderTooltipReference => view.currentBuilderTooltipReference; |
| 58 | 39 | | internal RectTransform questTooltipReference => view.currentQuestTooltipReference; |
| 58 | 40 | | internal RectTransform settingsTooltipReference => view.currentSettingsTooltipReference; |
| 58 | 41 | | internal RectTransform profileCardTooltipReference => view.currentProfileCardTooltipReference; |
| | 42 | |
|
| 347 | 43 | | internal BaseVariable<bool> isOpen => DataStore.i.exploreV2.isOpen; |
| 273 | 44 | | internal BaseVariable<int> currentSectionIndex => DataStore.i.exploreV2.currentSectionIndex; |
| 81 | 45 | | internal BaseVariable<bool> profileCardIsOpen => DataStore.i.exploreV2.profileCardIsOpen; |
| 120 | 46 | | internal BaseVariable<bool> isInitialized => DataStore.i.exploreV2.isInitialized; |
| 58 | 47 | | internal BaseVariable<bool> isPlacesAndEventsSectionInitialized => DataStore.i.exploreV2.isPlacesAndEventsSectionIni |
| 65 | 48 | | internal BaseVariable<bool> placesAndEventsVisible => DataStore.i.exploreV2.placesAndEventsVisible; |
| 60 | 49 | | internal BaseVariable<bool> isAvatarEditorInitialized => DataStore.i.HUDs.isAvatarEditorInitialized; |
| 65 | 50 | | internal BaseVariable<bool> avatarEditorVisible => DataStore.i.HUDs.avatarEditorVisible; |
| 60 | 51 | | internal BaseVariable<bool> isNavmapInitialized => DataStore.i.HUDs.isNavMapInitialized; |
| 65 | 52 | | internal BaseVariable<bool> navmapVisible => DataStore.i.HUDs.navmapVisible; |
| 60 | 53 | | internal BaseVariable<bool> isBuilderInitialized => DataStore.i.builderInWorld.isInitialized; |
| 65 | 54 | | internal BaseVariable<bool> builderVisible => DataStore.i.HUDs.builderProjectsPanelVisible; |
| 60 | 55 | | internal BaseVariable<bool> isQuestInitialized => DataStore.i.Quests.isInitialized; |
| 65 | 56 | | internal BaseVariable<bool> questVisible => DataStore.i.HUDs.questsPanelVisible; |
| 60 | 57 | | internal BaseVariable<bool> isSettingsPanelInitialized => DataStore.i.settings.isInitialized; |
| 65 | 58 | | internal BaseVariable<bool> settingsVisible => DataStore.i.settings.settingsPanelVisible; |
| | 59 | |
|
| 58 | 60 | | internal BaseVariable<bool> controlsVisible => DataStore.i.HUDs.controlsVisible; |
| 58 | 61 | | internal BaseVariable<bool> emotesVisible => DataStore.i.HUDs.emotesVisible; |
| 58 | 62 | | internal BaseVariable<bool> chatInputVisible => DataStore.i.HUDs.chatInputVisible; |
| 58 | 63 | | internal BooleanVariable playerInfoCardVisible => CommonScriptableObjects.playerInfoCardVisibleState; |
| 27 | 64 | | internal BaseVariable<bool> isPromoteChannelsToastVisible => DataStore.i.channels.isPromoteToastVisible; |
| | 65 | |
|
| | 66 | | public void Initialize() |
| | 67 | | { |
| 58 | 68 | | sectionsVariables = new Dictionary<ExploreSection, (BaseVariable<bool>, BaseVariable<bool>)> |
| | 69 | | { |
| | 70 | | { ExploreSection.Explore, (isPlacesAndEventsSectionInitialized, placesAndEventsVisible) }, |
| | 71 | | { ExploreSection.Backpack, (isAvatarEditorInitialized, avatarEditorVisible) }, |
| | 72 | | { ExploreSection.Map, (isNavmapInitialized, navmapVisible) }, |
| | 73 | | { ExploreSection.Builder, (isBuilderInitialized, builderVisible) }, |
| | 74 | | { ExploreSection.Quest, (isQuestInitialized, questVisible) }, |
| | 75 | | { ExploreSection.Settings, (isSettingsPanelInitialized, settingsVisible) }, |
| | 76 | | }; |
| 754 | 77 | | sectionsByInitVar = sectionsVariables.ToDictionary(pair => pair.Value.initVar, pair => pair.Key); |
| 754 | 78 | | sectionsByVisiblityVar = sectionsVariables.ToDictionary(pair => pair.Value.visibilityVar, pair => pair.Key); |
| | 79 | |
|
| 58 | 80 | | mouseCatcher = SceneReferences.i?.mouseCatcher; |
| 58 | 81 | | exploreV2Analytics = CreateAnalyticsController(); |
| 58 | 82 | | view = CreateView(); |
| 58 | 83 | | SetVisibility(false); |
| | 84 | |
|
| 58 | 85 | | DataStore.i.realm.playerRealm.OnChange += UpdateRealmInfo; |
| 58 | 86 | | UpdateRealmInfo(DataStore.i.realm.playerRealm.Get(), null); |
| | 87 | |
|
| 58 | 88 | | DataStore.i.realm.realmsInfo.OnSet += UpdateAvailableRealmsInfo; |
| 58 | 89 | | UpdateAvailableRealmsInfo(DataStore.i.realm.realmsInfo.Get()); |
| | 90 | |
|
| 58 | 91 | | ownUserProfile.OnUpdate += UpdateProfileInfo; |
| 58 | 92 | | UpdateProfileInfo(ownUserProfile); |
| 58 | 93 | | view.currentProfileCard.onClick?.AddListener(() => { profileCardIsOpen.Set(!profileCardIsOpen.Get()); }); |
| 58 | 94 | | view.currentRealmViewer.onLogoClick?.AddListener(view.ShowRealmSelectorModal); |
| 58 | 95 | | view.OnCloseButtonPressed += OnCloseButtonPressed; |
| 58 | 96 | | view.OnAfterShowAnimation += OnAfterShowAnimation; |
| | 97 | |
|
| 58 | 98 | | DataStore.i.exploreV2.topMenuTooltipReference.Set(topMenuTooltipReference); |
| 58 | 99 | | DataStore.i.exploreV2.placesAndEventsTooltipReference.Set(placesAndEventsTooltipReference); |
| 58 | 100 | | DataStore.i.exploreV2.backpackTooltipReference.Set(backpackTooltipReference); |
| 58 | 101 | | DataStore.i.exploreV2.mapTooltipReference.Set(mapTooltipReference); |
| 58 | 102 | | DataStore.i.exploreV2.builderTooltipReference.Set(builderTooltipReference); |
| 58 | 103 | | DataStore.i.exploreV2.questTooltipReference.Set(questTooltipReference); |
| 58 | 104 | | DataStore.i.exploreV2.settingsTooltipReference.Set(settingsTooltipReference); |
| 58 | 105 | | DataStore.i.exploreV2.profileCardTooltipReference.Set(profileCardTooltipReference); |
| | 106 | |
|
| 58 | 107 | | view.OnSectionOpen += OnSectionOpen; |
| | 108 | |
|
| 58 | 109 | | isOpen.OnChange += SetVisibilityOnOpenChanged; |
| 58 | 110 | | SetVisibilityOnOpenChanged(isOpen.Get()); |
| | 111 | |
|
| 58 | 112 | | currentSectionIndex.OnChange += CurrentSectionIndexChanged; |
| 58 | 113 | | CurrentSectionIndexChanged(currentSectionIndex.Get(), 0); |
| | 114 | |
|
| 812 | 115 | | foreach (var sectionsVariables in sectionsVariables.Values) |
| | 116 | | { |
| 348 | 117 | | sectionsVariables.initVar.OnChangeWithSenderInfo += OnSectionInitializedChanged; |
| 348 | 118 | | OnSectionInitializedChanged(sectionsVariables.initVar, sectionsVariables.initVar.Get()); |
| | 119 | |
|
| 348 | 120 | | sectionsVariables.visibilityVar.OnChangeWithSenderInfo += OnSectionVisiblityChanged; |
| 348 | 121 | | OnSectionVisiblityChanged(sectionsVariables.visibilityVar, sectionsVariables.visibilityVar.Get()); |
| | 122 | | } |
| | 123 | |
|
| 58 | 124 | | ConfigureOtherUIDependencies(); |
| | 125 | |
|
| 58 | 126 | | isInitialized.Set(true); |
| | 127 | |
|
| 58 | 128 | | currentSectionIndex.Set((int)DEFAULT_SECTION, false); |
| | 129 | |
|
| | 130 | | //view.ConfigureEncapsulatedSection(ExploreSection.Backpack, DataStore.i.exploreV2.configureBackpackInFullscreen |
| 58 | 131 | | view.ConfigureEncapsulatedSection(ExploreSection.Map, DataStore.i.exploreV2.configureMapInFullscreenMenu); |
| 58 | 132 | | view.ConfigureEncapsulatedSection(ExploreSection.Builder, DataStore.i.exploreV2.configureBuilderInFullscreenMenu |
| 58 | 133 | | view.ConfigureEncapsulatedSection(ExploreSection.Quest, DataStore.i.exploreV2.configureQuestInFullscreenMenu); |
| 58 | 134 | | view.ConfigureEncapsulatedSection(ExploreSection.Settings, DataStore.i.exploreV2.configureSettingsInFullscreenMe |
| 58 | 135 | | } |
| | 136 | |
|
| | 137 | | public void Dispose() |
| | 138 | | { |
| 58 | 139 | | DataStore.i.realm.playerRealm.OnChange -= UpdateRealmInfo; |
| 58 | 140 | | DataStore.i.realm.realmsInfo.OnSet -= UpdateAvailableRealmsInfo; |
| | 141 | |
|
| 58 | 142 | | ownUserProfile.OnUpdate -= UpdateProfileInfo; |
| 58 | 143 | | view?.currentProfileCard.onClick?.RemoveAllListeners(); |
| | 144 | |
|
| 58 | 145 | | isOpen.OnChange -= SetVisibilityOnOpenChanged; |
| 58 | 146 | | currentSectionIndex.OnChange -= CurrentSectionIndexChanged; |
| | 147 | |
|
| 812 | 148 | | foreach (var sectionsVariables in sectionsVariables.Values) |
| | 149 | | { |
| 348 | 150 | | sectionsVariables.initVar.OnChangeWithSenderInfo -= OnSectionInitializedChanged; |
| 348 | 151 | | sectionsVariables.visibilityVar.OnChangeWithSenderInfo -= OnSectionVisiblityChanged; |
| | 152 | | } |
| | 153 | |
|
| 58 | 154 | | if (placesAndEventsSectionController != null) |
| | 155 | | { |
| 1 | 156 | | placesAndEventsSectionController.OnCloseExploreV2 -= OnCloseButtonPressed; |
| 1 | 157 | | placesAndEventsSectionController.Dispose(); |
| | 158 | | } |
| | 159 | |
|
| 58 | 160 | | if (view != null) |
| | 161 | | { |
| 58 | 162 | | view.currentProfileCard.onClick?.RemoveAllListeners(); |
| 58 | 163 | | view.currentRealmViewer.onLogoClick?.RemoveAllListeners(); |
| 58 | 164 | | view.OnCloseButtonPressed -= OnCloseButtonPressed; |
| 58 | 165 | | view.OnAfterShowAnimation -= OnAfterShowAnimation; |
| 58 | 166 | | view.OnSectionOpen -= OnSectionOpen; |
| 58 | 167 | | view.Dispose(); |
| | 168 | | } |
| 58 | 169 | | } |
| | 170 | |
|
| 84 | 171 | | public void SetVisibility(bool visible) => isOpen.Set(visible); |
| | 172 | |
|
| | 173 | | private void OnSectionInitializedChanged(BaseVariable<bool> initVar, bool initialized, bool _ = false) => |
| 353 | 174 | | SectionInitializedChanged(sectionsByInitVar[initVar], initialized); |
| | 175 | |
|
| | 176 | | internal void SectionInitializedChanged(ExploreSection section, bool initialized, bool _ = false) |
| | 177 | | { |
| 363 | 178 | | view.SetSectionActive(section, initialized); |
| | 179 | |
|
| 363 | 180 | | if (section == ExploreSection.Explore && initialized) |
| 0 | 181 | | InitializePlacesAndEventsSection(); |
| 363 | 182 | | } |
| | 183 | |
|
| | 184 | | private void OnSectionVisiblityChanged(BaseVariable<bool> visibilityVar, bool visible, bool previous = false) |
| | 185 | | { |
| 360 | 186 | | ExploreSection section = sectionsByVisiblityVar[visibilityVar]; |
| 360 | 187 | | BaseVariable<bool> initVar = section == ExploreSection.Explore ? isInitialized : sectionsVariables[section].init |
| | 188 | |
|
| 360 | 189 | | if (!initVar.Get() || DataStore.i.common.isSignUpFlow.Get()) |
| 151 | 190 | | return; |
| | 191 | |
|
| 209 | 192 | | SetMenuTargetVisibility(sectionsByVisiblityVar[visibilityVar], visible); |
| 209 | 193 | | } |
| | 194 | |
|
| | 195 | | internal void InitializePlacesAndEventsSection() |
| | 196 | | { |
| 1 | 197 | | if (placesAndEventsSectionController != null) |
| 0 | 198 | | return; |
| | 199 | |
|
| 1 | 200 | | placesAndEventsSectionController = new PlacesAndEventsSectionComponentController(view.currentPlacesAndEventsSect |
| 1 | 201 | | placesAndEventsSectionController.OnCloseExploreV2 += OnCloseButtonPressed; |
| 1 | 202 | | } |
| | 203 | |
|
| | 204 | | internal void OnSectionOpen(ExploreSection section) |
| | 205 | | { |
| 12 | 206 | | if (section != currentOpenSection) |
| 11 | 207 | | exploreV2Analytics.SendStartMenuSectionVisibility(currentOpenSection, false); |
| | 208 | |
|
| 12 | 209 | | currentOpenSection = section; |
| | 210 | |
|
| 12 | 211 | | if (currentOpenSection == ExploreSection.Backpack) |
| 2 | 212 | | view.ConfigureEncapsulatedSection(ExploreSection.Backpack, DataStore.i.exploreV2.configureBackpackInFullscre |
| | 213 | |
|
| 168 | 214 | | foreach (var visibilityVar in sectionsByVisiblityVar.Keys) |
| 72 | 215 | | visibilityVar.Set(currentOpenSection == sectionsByVisiblityVar[visibilityVar]); |
| | 216 | |
|
| 12 | 217 | | profileCardIsOpen.Set(false); |
| 12 | 218 | | } |
| | 219 | |
|
| 89 | 220 | | internal void SetVisibilityOnOpenChanged(bool open, bool _ = false) => SetVisibility_Internal(open); |
| | 221 | |
|
| | 222 | | internal void CurrentSectionIndexChanged(int current, int previous) |
| | 223 | | { |
| 499 | 224 | | if (DataStore.i.exploreV2.isInShowAnimationTransiton.Get()) |
| 0 | 225 | | return; |
| | 226 | |
|
| 499 | 227 | | if (Enum.IsDefined(typeof(ExploreSection), current)) |
| | 228 | | { |
| 409 | 229 | | if (!view.IsSectionActive((ExploreSection)current)) |
| 409 | 230 | | CurrentSectionIndexChanged(current + 1, current); |
| | 231 | | else |
| 0 | 232 | | view.GoToSection((ExploreSection)current); |
| 0 | 233 | | } |
| | 234 | | else |
| 90 | 235 | | view.GoToSection(0); |
| 90 | 236 | | } |
| | 237 | |
|
| | 238 | | internal void SetVisibility_Internal(bool visible) |
| | 239 | | { |
| 89 | 240 | | if (view == null || DataStore.i.common.isSignUpFlow.Get()) |
| 0 | 241 | | return; |
| | 242 | |
|
| 89 | 243 | | if (visible) |
| | 244 | | { |
| 27 | 245 | | mouseCatcher?.UnlockCursor(); |
| | 246 | |
|
| 27 | 247 | | if (DataStore.i.common.isTutorialRunning.Get()) |
| 1 | 248 | | view.GoToSection(DEFAULT_SECTION); |
| | 249 | |
|
| 27 | 250 | | isPromoteChannelsToastVisible.Set(false); |
| 27 | 251 | | } |
| | 252 | | else |
| | 253 | | { |
| 62 | 254 | | CommonScriptableObjects.isFullscreenHUDOpen.Set(false); |
| | 255 | |
|
| 868 | 256 | | foreach (var sectionsVariables in sectionsVariables.Values) |
| 372 | 257 | | sectionsVariables.visibilityVar.Set(false); |
| | 258 | |
|
| 62 | 259 | | profileCardIsOpen.Set(false); |
| | 260 | | } |
| | 261 | |
|
| 89 | 262 | | view.SetVisible(visible); |
| 89 | 263 | | } |
| | 264 | |
|
| 0 | 265 | | internal void OnAfterShowAnimation() => CommonScriptableObjects.isFullscreenHUDOpen.Set(true); |
| | 266 | |
|
| | 267 | | internal void SetMenuTargetVisibility(ExploreSection section, bool toVisible, bool _ = false) |
| | 268 | | { |
| 227 | 269 | | if (toVisible) |
| | 270 | | { |
| 22 | 271 | | if (currentSectionIndex.Get() != (int)section) |
| 19 | 272 | | currentSectionIndex.Set((int)section); |
| | 273 | |
|
| 22 | 274 | | SetSectionTargetVisibility(section, toVisible: true); |
| 22 | 275 | | view.GoToSection(section); |
| 22 | 276 | | } |
| 205 | 277 | | else if (currentOpenSection == section) |
| | 278 | | { |
| 63 | 279 | | SetSectionTargetVisibility(section, toVisible: false); |
| | 280 | | } |
| 205 | 281 | | } |
| | 282 | |
|
| | 283 | | private void SetSectionTargetVisibility(ExploreSection section, bool toVisible) |
| | 284 | | { |
| 85 | 285 | | bool wasInTargetVisibility = toVisible ^ isOpen.Get(); |
| | 286 | |
|
| 85 | 287 | | if (wasInTargetVisibility) |
| | 288 | | { |
| 22 | 289 | | SetVisibility(toVisible); |
| 22 | 290 | | exploreV2Analytics.SendStartMenuVisibility(toVisible, ExploreUIVisibilityMethod.FromShortcut); |
| | 291 | | } |
| 85 | 292 | | exploreV2Analytics.SendStartMenuSectionVisibility(section, toVisible); |
| 85 | 293 | | } |
| | 294 | |
|
| | 295 | | internal void UpdateRealmInfo(CurrentRealmModel currentRealm, CurrentRealmModel previousRealm) |
| | 296 | | { |
| 60 | 297 | | if (currentRealm == null) |
| 58 | 298 | | return; |
| | 299 | |
|
| | 300 | | // Get the name of the current realm |
| 2 | 301 | | view.currentRealmViewer.SetRealm(currentRealm.serverName); |
| 2 | 302 | | view.currentRealmSelectorModal.SetCurrentRealm(currentRealm.serverName); |
| | 303 | |
|
| | 304 | | // Calculate number of users in the current realm |
| 2 | 305 | | List<RealmModel> realmList = DataStore.i.realm.realmsInfo.Get()?.ToList(); |
| 3 | 306 | | RealmModel currentRealmModel = realmList?.FirstOrDefault(r => r.serverName == currentRealm.serverName); |
| 2 | 307 | | int realmUsers = 0; |
| 2 | 308 | | if (currentRealmModel != null) |
| 1 | 309 | | realmUsers = currentRealmModel.usersCount; |
| | 310 | |
|
| 2 | 311 | | view.currentRealmViewer.SetNumberOfUsers(realmUsers); |
| 2 | 312 | | } |
| | 313 | |
|
| | 314 | | internal void UpdateAvailableRealmsInfo(IEnumerable<RealmModel> currentRealmList) |
| | 315 | | { |
| 60 | 316 | | if (!NeedToRefreshRealms(currentRealmList)) |
| 58 | 317 | | return; |
| | 318 | |
|
| 2 | 319 | | currentAvailableRealms.Clear(); |
| 2 | 320 | | CurrentRealmModel currentRealm = DataStore.i.realm.playerRealm.Get(); |
| | 321 | |
|
| 2 | 322 | | if (currentRealmList != null) |
| | 323 | | { |
| 12 | 324 | | foreach (RealmModel realmModel in currentRealmList) |
| | 325 | | { |
| 4 | 326 | | RealmRowComponentModel realmToAdd = new RealmRowComponentModel |
| | 327 | | { |
| | 328 | | name = realmModel.serverName, |
| | 329 | | players = realmModel.usersCount, |
| | 330 | | isConnected = realmModel.serverName == currentRealm?.serverName |
| | 331 | | }; |
| | 332 | |
|
| 4 | 333 | | currentAvailableRealms.Add(realmToAdd); |
| | 334 | | } |
| | 335 | | } |
| | 336 | |
|
| 2 | 337 | | view.currentRealmSelectorModal.SetAvailableRealms(currentAvailableRealms); |
| 2 | 338 | | } |
| | 339 | |
|
| | 340 | | internal bool NeedToRefreshRealms(IEnumerable<RealmModel> newRealmList) |
| | 341 | | { |
| 60 | 342 | | if (newRealmList == null) |
| 0 | 343 | | return true; |
| | 344 | |
|
| 60 | 345 | | bool needToRefresh = false; |
| 60 | 346 | | if (newRealmList.Count() == currentAvailableRealms.Count) |
| | 347 | | { |
| 116 | 348 | | foreach (RealmModel realm in newRealmList) |
| | 349 | | { |
| 0 | 350 | | if (!currentAvailableRealms.Exists(x => x.name == realm.serverName && x.players == realm.usersCount)) |
| | 351 | | { |
| 0 | 352 | | needToRefresh = true; |
| 0 | 353 | | break; |
| | 354 | | } |
| | 355 | | } |
| | 356 | | } |
| | 357 | | else |
| 2 | 358 | | needToRefresh = true; |
| | 359 | |
|
| 60 | 360 | | return needToRefresh; |
| | 361 | | } |
| | 362 | |
|
| | 363 | | internal void UpdateProfileInfo(UserProfile profile) |
| | 364 | | { |
| 59 | 365 | | view.currentProfileCard.SetIsClaimedName(profile.hasClaimedName); |
| 59 | 366 | | view.currentProfileCard.SetProfileName(profile.userName); |
| 59 | 367 | | view.currentProfileCard.SetProfileAddress(profile.ethAddress); |
| 59 | 368 | | view.currentProfileCard.SetProfilePicture(profile.face256SnapshotURL); |
| 59 | 369 | | } |
| | 370 | |
|
| | 371 | | internal void OnCloseButtonPressed(bool fromShortcut) |
| | 372 | | { |
| 2 | 373 | | if (DataStore.i.builderInWorld.areShortcutsBlocked.Get() || !isOpen.Get() ) |
| 0 | 374 | | return; |
| | 375 | |
|
| 2 | 376 | | SetVisibility(false); |
| 2 | 377 | | exploreV2Analytics.SendStartMenuVisibility(false, fromShortcut ? ExploreUIVisibilityMethod.FromShortcut : Explor |
| 2 | 378 | | } |
| | 379 | |
|
| | 380 | | internal void ConfigureOtherUIDependencies() |
| | 381 | | { |
| 58 | 382 | | controlsHUDCloseTime = Time.realtimeSinceStartup; |
| 58 | 383 | | controlsVisible.OnChange += (current, _) => |
| | 384 | | { |
| 0 | 385 | | if (!current) |
| 0 | 386 | | controlsHUDCloseTime = Time.realtimeSinceStartup; |
| 0 | 387 | | }; |
| | 388 | |
|
| 58 | 389 | | emotesHUDCloseTime = Time.realtimeSinceStartup; |
| 58 | 390 | | emotesVisible.OnChange += (current, _) => |
| | 391 | | { |
| 0 | 392 | | if (!current) |
| 0 | 393 | | emotesHUDCloseTime = Time.realtimeSinceStartup; |
| 0 | 394 | | }; |
| | 395 | |
|
| 58 | 396 | | chatInputHUDCloseTime = Time.realtimeSinceStartup; |
| 58 | 397 | | chatInputVisible.OnChange += (current, _) => |
| | 398 | | { |
| 0 | 399 | | if (!current) |
| 0 | 400 | | chatInputHUDCloseTime = Time.realtimeSinceStartup; |
| 0 | 401 | | }; |
| | 402 | |
|
| 58 | 403 | | playerInfoCardHUDCloseTime = Time.realtimeSinceStartup; |
| 58 | 404 | | playerInfoCardVisible.OnChange += (current, _) => |
| | 405 | | { |
| 0 | 406 | | if (!current) |
| 0 | 407 | | playerInfoCardHUDCloseTime = Time.realtimeSinceStartup; |
| 0 | 408 | | }; |
| 58 | 409 | | } |
| | 410 | |
|
| 0 | 411 | | internal virtual IExploreV2Analytics CreateAnalyticsController() => new ExploreV2Analytics.ExploreV2Analytics(); |
| | 412 | |
|
| 0 | 413 | | protected internal virtual IExploreV2MenuComponentView CreateView() => ExploreV2MenuComponentView.Create(); |
| | 414 | | } |