| | 1 | | using AvatarSystem; |
| | 2 | | using DCL; |
| | 3 | | using DCL.Browser; |
| | 4 | | using DCL.Chat; |
| | 5 | | using DCL.Chat.HUD; |
| | 6 | | using DCL.HelpAndSupportHUD; |
| | 7 | | using DCL.Huds.QuestsPanel; |
| | 8 | | using DCL.Huds.QuestsTracker; |
| | 9 | | using DCL.ProfanityFiltering; |
| | 10 | | using DCL.SettingsCommon; |
| | 11 | | using DCL.SettingsPanelHUD; |
| | 12 | | using DCL.Social.Chat; |
| | 13 | | using DCL.Social.Friends; |
| | 14 | | using DCl.Social.Passports; |
| | 15 | | using DCL.Social.Passports; |
| | 16 | | using SignupHUD; |
| | 17 | | using SocialFeaturesAnalytics; |
| | 18 | | using UnityEngine; |
| | 19 | | using DCLServices.Lambdas.NamesService; |
| | 20 | | using DCLServices.Lambdas.LandsService; |
| | 21 | |
|
| | 22 | | public class HUDFactory : IHUDFactory |
| | 23 | | { |
| | 24 | | private readonly DataStoreRef<DataStore_LoadingScreen> dataStoreLoadingScreen; |
| | 25 | |
|
| | 26 | | public virtual IHUD CreateHUD(HUDElementID hudElementId) |
| | 27 | | { |
| 27 | 28 | | IHUD hudElement = null; |
| | 29 | | switch (hudElementId) |
| | 30 | | { |
| | 31 | | case HUDElementID.NONE: |
| | 32 | | break; |
| | 33 | | case HUDElementID.MINIMAP: |
| 1 | 34 | | hudElement = new MinimapHUDController(MinimapMetadataController.i, new WebInterfaceHomeLocationControlle |
| 1 | 35 | | break; |
| | 36 | | case HUDElementID.PROFILE_HUD: |
| 1 | 37 | | hudElement = new ProfileHUDController(new UserProfileWebInterfaceBridge(), |
| | 38 | | new SocialAnalytics( |
| | 39 | | Environment.i.platform.serviceProviders.analytics, |
| | 40 | | new UserProfileWebInterfaceBridge())); |
| 1 | 41 | | break; |
| | 42 | | case HUDElementID.NOTIFICATION: |
| 1 | 43 | | hudElement = new NotificationHUDController(); |
| 1 | 44 | | break; |
| | 45 | | case HUDElementID.AVATAR_EDITOR: |
| 1 | 46 | | hudElement = new AvatarEditorHUDController(DataStore.i.featureFlags, |
| | 47 | | Environment.i.platform.serviceProviders.analytics); |
| 1 | 48 | | break; |
| | 49 | | case HUDElementID.SETTINGS_PANEL: |
| 1 | 50 | | hudElement = new SettingsPanelHUDController(); |
| 1 | 51 | | break; |
| | 52 | | case HUDElementID.AIRDROPPING: |
| 1 | 53 | | hudElement = new AirdroppingHUDController(); |
| 1 | 54 | | break; |
| | 55 | | case HUDElementID.TERMS_OF_SERVICE: |
| 1 | 56 | | hudElement = new TermsOfServiceHUDController(); |
| 1 | 57 | | break; |
| | 58 | | case HUDElementID.FRIENDS: |
| 1 | 59 | | hudElement = new FriendsHUDController(DataStore.i, |
| | 60 | | FriendsController.i, |
| | 61 | | new UserProfileWebInterfaceBridge(), |
| | 62 | | new SocialAnalytics( |
| | 63 | | Environment.i.platform.serviceProviders.analytics, |
| | 64 | | new UserProfileWebInterfaceBridge()), |
| | 65 | | ChatController.i, |
| | 66 | | SceneReferences.i.mouseCatcher); |
| 1 | 67 | | break; |
| | 68 | | case HUDElementID.WORLD_CHAT_WINDOW: |
| 1 | 69 | | hudElement = new WorldChatWindowController( |
| | 70 | | new UserProfileWebInterfaceBridge(), |
| | 71 | | FriendsController.i, |
| | 72 | | ChatController.i, |
| | 73 | | DataStore.i, |
| | 74 | | SceneReferences.i.mouseCatcher, |
| | 75 | | new SocialAnalytics( |
| | 76 | | Environment.i.platform.serviceProviders.analytics, |
| | 77 | | new UserProfileWebInterfaceBridge()), |
| | 78 | | Environment.i.serviceLocator.Get<IChannelsFeatureFlagService>(), |
| | 79 | | new WebInterfaceBrowserBridge(), |
| | 80 | | CommonScriptableObjects.rendererState); |
| 1 | 81 | | break; |
| | 82 | | case HUDElementID.PRIVATE_CHAT_WINDOW: |
| 1 | 83 | | hudElement = new PrivateChatWindowController( |
| | 84 | | DataStore.i, |
| | 85 | | new UserProfileWebInterfaceBridge(), |
| | 86 | | ChatController.i, |
| | 87 | | FriendsController.i, |
| | 88 | | new SocialAnalytics( |
| | 89 | | Environment.i.platform.serviceProviders.analytics, |
| | 90 | | new UserProfileWebInterfaceBridge()), |
| | 91 | | SceneReferences.i.mouseCatcher, |
| | 92 | | Resources.Load<InputAction_Trigger>("ToggleWorldChat")); |
| 1 | 93 | | break; |
| | 94 | | case HUDElementID.PUBLIC_CHAT: |
| 1 | 95 | | hudElement = new PublicChatWindowController( |
| | 96 | | ChatController.i, |
| | 97 | | new UserProfileWebInterfaceBridge(), |
| | 98 | | DataStore.i, |
| | 99 | | Environment.i.serviceLocator.Get<IProfanityFilter>(), |
| | 100 | | SceneReferences.i.mouseCatcher, |
| | 101 | | Resources.Load<InputAction_Trigger>("ToggleWorldChat")); |
| 1 | 102 | | break; |
| | 103 | | case HUDElementID.CHANNELS_CHAT: |
| 1 | 104 | | hudElement = new ChatChannelHUDController( |
| | 105 | | DataStore.i, |
| | 106 | | new UserProfileWebInterfaceBridge(), |
| | 107 | | ChatController.i, |
| | 108 | | SceneReferences.i.mouseCatcher, |
| | 109 | | Resources.Load<InputAction_Trigger>("ToggleWorldChat"), |
| | 110 | | new SocialAnalytics( |
| | 111 | | Environment.i.platform.serviceProviders.analytics, |
| | 112 | | new UserProfileWebInterfaceBridge()), |
| | 113 | | Environment.i.serviceLocator.Get<IProfanityFilter>()); |
| 1 | 114 | | break; |
| | 115 | | case HUDElementID.CHANNELS_SEARCH: |
| 1 | 116 | | hudElement = new SearchChannelsWindowController( |
| | 117 | | ChatController.i, |
| | 118 | | SceneReferences.i.mouseCatcher, |
| | 119 | | DataStore.i, |
| | 120 | | new SocialAnalytics( |
| | 121 | | Environment.i.platform.serviceProviders.analytics, |
| | 122 | | new UserProfileWebInterfaceBridge()), |
| | 123 | | Environment.i.serviceLocator.Get<IChannelsFeatureFlagService>()); |
| 1 | 124 | | break; |
| | 125 | | case HUDElementID.CHANNELS_CREATE: |
| 1 | 126 | | hudElement = new CreateChannelWindowController(ChatController.i, DataStore.i); |
| 1 | 127 | | break; |
| | 128 | | case HUDElementID.CHANNELS_LEAVE_CONFIRMATION: |
| 1 | 129 | | hudElement = new LeaveChannelConfirmationWindowController(ChatController.i); |
| 1 | 130 | | break; |
| | 131 | | case HUDElementID.TASKBAR: |
| 1 | 132 | | hudElement = new TaskbarHUDController(ChatController.i, FriendsController.i); |
| 1 | 133 | | break; |
| | 134 | | case HUDElementID.OPEN_EXTERNAL_URL_PROMPT: |
| 1 | 135 | | hudElement = new ExternalUrlPromptHUDController(); |
| 1 | 136 | | break; |
| | 137 | | case HUDElementID.NFT_INFO_DIALOG: |
| 1 | 138 | | hudElement = new NFTPromptHUDController(); |
| 1 | 139 | | break; |
| | 140 | | case HUDElementID.TELEPORT_DIALOG: |
| 1 | 141 | | hudElement = new TeleportPromptHUDController(); |
| 1 | 142 | | break; |
| | 143 | | case HUDElementID.CONTROLS_HUD: |
| 1 | 144 | | hudElement = new ControlsHUDController(); |
| 1 | 145 | | break; |
| | 146 | | case HUDElementID.HELP_AND_SUPPORT_HUD: |
| 1 | 147 | | hudElement = new HelpAndSupportHUDController(); |
| 1 | 148 | | break; |
| | 149 | | case HUDElementID.USERS_AROUND_LIST_HUD: |
| 1 | 150 | | hudElement = new VoiceChatWindowController( |
| | 151 | | new UserProfileWebInterfaceBridge(), |
| | 152 | | FriendsController.i, |
| | 153 | | new SocialAnalytics( |
| | 154 | | Environment.i.platform.serviceProviders.analytics, |
| | 155 | | new UserProfileWebInterfaceBridge()), |
| | 156 | | DataStore.i, |
| | 157 | | Settings.i, |
| | 158 | | SceneReferences.i.mouseCatcher); |
| 1 | 159 | | break; |
| | 160 | | case HUDElementID.GRAPHIC_CARD_WARNING: |
| 1 | 161 | | hudElement = new GraphicCardWarningHUDController(); |
| 1 | 162 | | break; |
| | 163 | | case HUDElementID.BUILDER_IN_WORLD_MAIN: |
| | 164 | | break; |
| | 165 | | case HUDElementID.QUESTS_PANEL: |
| 1 | 166 | | hudElement = new QuestsPanelHUDController(); |
| 1 | 167 | | break; |
| | 168 | | case HUDElementID.QUESTS_TRACKER: |
| 1 | 169 | | hudElement = new QuestsTrackerHUDController(); |
| 1 | 170 | | break; |
| | 171 | | case HUDElementID.SIGNUP: |
| 1 | 172 | | var analytics = Environment.i.platform.serviceProviders.analytics; |
| 1 | 173 | | hudElement = new SignupHUDController(analytics, dataStoreLoadingScreen.Ref); |
| 1 | 174 | | break; |
| | 175 | | case HUDElementID.BUILDER_PROJECTS_PANEL: |
| | 176 | | break; |
| | 177 | | case HUDElementID.LOADING: |
| 1 | 178 | | hudElement = new LoadingHUDController(); |
| | 179 | | break; |
| | 180 | | } |
| | 181 | |
|
| 27 | 182 | | return hudElement; |
| | 183 | | } |
| | 184 | |
|
| | 185 | | public void Dispose() |
| | 186 | | { |
| 493 | 187 | | } |
| | 188 | |
|
| | 189 | | public void Initialize() |
| | 190 | | { |
| 493 | 191 | | } |
| | 192 | | } |