| | 1 | | using DCL; |
| | 2 | | using DCL.Browser; |
| | 3 | | using DCL.Chat; |
| | 4 | | using DCL.Chat.Channels; |
| | 5 | | using DCL.Chat.HUD; |
| | 6 | | using DCL.HelpAndSupportHUD; |
| | 7 | | using DCL.Huds.QuestsPanel; |
| | 8 | | using DCL.Huds.QuestsTracker; |
| | 9 | | using DCL.SettingsCommon; |
| | 10 | | using DCL.SettingsPanelHUD; |
| | 11 | | using SignupHUD; |
| | 12 | | using SocialFeaturesAnalytics; |
| | 13 | | using UnityEngine; |
| | 14 | |
|
| | 15 | | public class HUDFactory : IHUDFactory |
| | 16 | | { |
| | 17 | | public virtual IHUD CreateHUD(HUDElementID hudElementId) |
| | 18 | | { |
| 28 | 19 | | IHUD hudElement = null; |
| | 20 | | switch (hudElementId) |
| | 21 | | { |
| | 22 | | case HUDElementID.NONE: |
| | 23 | | break; |
| | 24 | | case HUDElementID.MINIMAP: |
| 1 | 25 | | hudElement = new MinimapHUDController(MinimapMetadataController.i, new WebInterfaceHomeLocationControlle |
| 1 | 26 | | break; |
| | 27 | | case HUDElementID.PROFILE_HUD: |
| 1 | 28 | | hudElement = new ProfileHUDController(new UserProfileWebInterfaceBridge()); |
| 1 | 29 | | break; |
| | 30 | | case HUDElementID.NOTIFICATION: |
| 1 | 31 | | hudElement = new NotificationHUDController(); |
| 1 | 32 | | break; |
| | 33 | | case HUDElementID.AVATAR_EDITOR: |
| 1 | 34 | | hudElement = new AvatarEditorHUDController(DataStore.i.featureFlags, |
| | 35 | | Environment.i.platform.serviceProviders.analytics); |
| 1 | 36 | | break; |
| | 37 | | case HUDElementID.SETTINGS_PANEL: |
| 1 | 38 | | hudElement = new SettingsPanelHUDController(); |
| 1 | 39 | | break; |
| | 40 | | case HUDElementID.PLAYER_INFO_CARD: |
| 1 | 41 | | hudElement = new PlayerInfoCardHUDController( |
| | 42 | | FriendsController.i, |
| | 43 | | Resources.Load<StringVariable>("CurrentPlayerInfoCardId"), |
| | 44 | | new UserProfileWebInterfaceBridge(), |
| | 45 | | new WearablesCatalogControllerBridge(), |
| | 46 | | new SocialAnalytics( |
| | 47 | | Environment.i.platform.serviceProviders.analytics, |
| | 48 | | new UserProfileWebInterfaceBridge()), |
| | 49 | | ProfanityFilterSharedInstances.regexFilter, |
| | 50 | | DataStore.i, |
| | 51 | | CommonScriptableObjects.playerInfoCardVisibleState); |
| 1 | 52 | | break; |
| | 53 | | case HUDElementID.AIRDROPPING: |
| 1 | 54 | | hudElement = new AirdroppingHUDController(); |
| 1 | 55 | | break; |
| | 56 | | case HUDElementID.TERMS_OF_SERVICE: |
| 1 | 57 | | hudElement = new TermsOfServiceHUDController(); |
| 1 | 58 | | break; |
| | 59 | | case HUDElementID.FRIENDS: |
| 1 | 60 | | hudElement = new FriendsHUDController(DataStore.i, |
| | 61 | | FriendsController.i, |
| | 62 | | new UserProfileWebInterfaceBridge(), |
| | 63 | | new SocialAnalytics( |
| | 64 | | Environment.i.platform.serviceProviders.analytics, |
| | 65 | | new UserProfileWebInterfaceBridge()), |
| | 66 | | ChatController.i, |
| | 67 | | SceneReferences.i.mouseCatcher); |
| 1 | 68 | | break; |
| | 69 | | case HUDElementID.WORLD_CHAT_WINDOW: |
| 1 | 70 | | hudElement = new WorldChatWindowController( |
| | 71 | | new UserProfileWebInterfaceBridge(), |
| | 72 | | FriendsController.i, |
| | 73 | | ChatController.i, |
| | 74 | | DataStore.i, |
| | 75 | | SceneReferences.i.mouseCatcher, |
| | 76 | | new SocialAnalytics( |
| | 77 | | Environment.i.platform.serviceProviders.analytics, |
| | 78 | | new UserProfileWebInterfaceBridge()), |
| | 79 | | Environment.i.serviceLocator.Get<IChannelsFeatureFlagService>(), |
| | 80 | | new WebInterfaceBrowserBridge()); |
| 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 | | ProfanityFilterSharedInstances.regexFilter, |
| | 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 | | ProfanityFilterSharedInstances.regexFilter); |
| 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 | | new UserProfileWebInterfaceBridge(), |
| | 124 | | Environment.i.serviceLocator.Get<IChannelsFeatureFlagService>()); |
| 1 | 125 | | break; |
| | 126 | | case HUDElementID.CHANNELS_CREATE: |
| 1 | 127 | | hudElement = new CreateChannelWindowController(ChatController.i, DataStore.i); |
| 1 | 128 | | break; |
| | 129 | | case HUDElementID.CHANNELS_LEAVE_CONFIRMATION: |
| 1 | 130 | | hudElement = new LeaveChannelConfirmationWindowController(ChatController.i); |
| 1 | 131 | | break; |
| | 132 | | case HUDElementID.TASKBAR: |
| 1 | 133 | | hudElement = new TaskbarHUDController(ChatController.i, FriendsController.i); |
| 1 | 134 | | break; |
| | 135 | | case HUDElementID.OPEN_EXTERNAL_URL_PROMPT: |
| 1 | 136 | | hudElement = new ExternalUrlPromptHUDController(); |
| 1 | 137 | | break; |
| | 138 | | case HUDElementID.NFT_INFO_DIALOG: |
| 1 | 139 | | hudElement = new NFTPromptHUDController(); |
| 1 | 140 | | break; |
| | 141 | | case HUDElementID.TELEPORT_DIALOG: |
| 1 | 142 | | hudElement = new TeleportPromptHUDController(); |
| 1 | 143 | | break; |
| | 144 | | case HUDElementID.CONTROLS_HUD: |
| 1 | 145 | | hudElement = new ControlsHUDController(); |
| 1 | 146 | | break; |
| | 147 | | case HUDElementID.HELP_AND_SUPPORT_HUD: |
| 1 | 148 | | hudElement = new HelpAndSupportHUDController(); |
| 1 | 149 | | break; |
| | 150 | | case HUDElementID.USERS_AROUND_LIST_HUD: |
| 1 | 151 | | hudElement = new VoiceChatWindowController( |
| | 152 | | new UserProfileWebInterfaceBridge(), |
| | 153 | | FriendsController.i, |
| | 154 | | new SocialAnalytics( |
| | 155 | | Environment.i.platform.serviceProviders.analytics, |
| | 156 | | new UserProfileWebInterfaceBridge()), |
| | 157 | | DataStore.i, |
| | 158 | | Settings.i, |
| | 159 | | SceneReferences.i.mouseCatcher); |
| 1 | 160 | | break; |
| | 161 | | case HUDElementID.GRAPHIC_CARD_WARNING: |
| 1 | 162 | | hudElement = new GraphicCardWarningHUDController(); |
| 1 | 163 | | break; |
| | 164 | | case HUDElementID.BUILDER_IN_WORLD_MAIN: |
| | 165 | | break; |
| | 166 | | case HUDElementID.QUESTS_PANEL: |
| 1 | 167 | | hudElement = new QuestsPanelHUDController(); |
| 1 | 168 | | break; |
| | 169 | | case HUDElementID.QUESTS_TRACKER: |
| 1 | 170 | | hudElement = new QuestsTrackerHUDController(); |
| 1 | 171 | | break; |
| | 172 | | case HUDElementID.SIGNUP: |
| 1 | 173 | | var analytics = Environment.i.platform.serviceProviders.analytics; |
| 1 | 174 | | hudElement = new SignupHUDController(analytics); |
| 1 | 175 | | break; |
| | 176 | | case HUDElementID.BUILDER_PROJECTS_PANEL: |
| | 177 | | break; |
| | 178 | | case HUDElementID.LOADING: |
| 1 | 179 | | hudElement = new LoadingHUDController(); |
| | 180 | | break; |
| | 181 | | } |
| | 182 | |
|
| 28 | 183 | | return hudElement; |
| | 184 | | } |
| | 185 | |
|
| | 186 | | public void Dispose() |
| | 187 | | { |
| 667 | 188 | | } |
| | 189 | |
|
| | 190 | | public void Initialize() |
| | 191 | | { |
| 667 | 192 | | } |
| | 193 | | } |