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