| | 1 | | using DCL; |
| | 2 | | using DCL.HelpAndSupportHUD; |
| | 3 | | using DCL.Huds.QuestsPanel; |
| | 4 | | using DCL.Huds.QuestsTracker; |
| | 5 | | using DCL.Interface; |
| | 6 | | using DCL.SettingsCommon; |
| | 7 | | using DCL.SettingsPanelHUD; |
| | 8 | | using SignupHUD; |
| | 9 | | using SocialFeaturesAnalytics; |
| | 10 | | using UnityEngine; |
| | 11 | |
|
| | 12 | | public class HUDFactory : IHUDFactory |
| | 13 | | { |
| | 14 | | public virtual IHUD CreateHUD(HUDElementID hudElementId) |
| | 15 | | { |
| 24 | 16 | | IHUD hudElement = null; |
| | 17 | | switch (hudElementId) |
| | 18 | | { |
| | 19 | | case HUDElementID.NONE: |
| | 20 | | break; |
| | 21 | | case HUDElementID.MINIMAP: |
| 1 | 22 | | hudElement = new MinimapHUDController(MinimapMetadataController.i, new WebInterfaceHomeLocationControlle |
| 1 | 23 | | break; |
| | 24 | | case HUDElementID.PROFILE_HUD: |
| 1 | 25 | | hudElement = new ProfileHUDController(new UserProfileWebInterfaceBridge()); |
| 1 | 26 | | break; |
| | 27 | | case HUDElementID.NOTIFICATION: |
| 1 | 28 | | hudElement = new NotificationHUDController(); |
| 1 | 29 | | break; |
| | 30 | | case HUDElementID.AVATAR_EDITOR: |
| 1 | 31 | | hudElement = new AvatarEditorHUDController(DataStore.i.featureFlags, |
| | 32 | | Environment.i.platform.serviceProviders.analytics); |
| 1 | 33 | | break; |
| | 34 | | case HUDElementID.SETTINGS_PANEL: |
| 1 | 35 | | hudElement = new SettingsPanelHUDController(); |
| 1 | 36 | | break; |
| | 37 | | case HUDElementID.PLAYER_INFO_CARD: |
| 1 | 38 | | hudElement = new PlayerInfoCardHUDController( |
| | 39 | | FriendsController.i, |
| | 40 | | Resources.Load<StringVariable>("CurrentPlayerInfoCardId"), |
| | 41 | | new UserProfileWebInterfaceBridge(), |
| | 42 | | new WearablesCatalogControllerBridge(), |
| | 43 | | new SocialAnalytics( |
| | 44 | | Environment.i.platform.serviceProviders.analytics, |
| | 45 | | new UserProfileWebInterfaceBridge()), |
| | 46 | | ProfanityFilterSharedInstances.regexFilter, |
| | 47 | | DataStore.i, |
| | 48 | | CommonScriptableObjects.playerInfoCardVisibleState); |
| 1 | 49 | | break; |
| | 50 | | case HUDElementID.AIRDROPPING: |
| 1 | 51 | | hudElement = new AirdroppingHUDController(); |
| 1 | 52 | | break; |
| | 53 | | case HUDElementID.TERMS_OF_SERVICE: |
| 1 | 54 | | hudElement = new TermsOfServiceHUDController(); |
| 1 | 55 | | break; |
| | 56 | | case HUDElementID.FRIENDS: |
| 1 | 57 | | hudElement = new FriendsHUDController(DataStore.i, |
| | 58 | | FriendsController.i, |
| | 59 | | new UserProfileWebInterfaceBridge(), |
| | 60 | | new SocialAnalytics( |
| | 61 | | Environment.i.platform.serviceProviders.analytics, |
| | 62 | | new UserProfileWebInterfaceBridge()), |
| | 63 | | ChatController.i); |
| 1 | 64 | | break; |
| | 65 | | case HUDElementID.WORLD_CHAT_WINDOW: |
| 1 | 66 | | hudElement = new WorldChatWindowController( |
| | 67 | | new UserProfileWebInterfaceBridge(), |
| | 68 | | FriendsController.i, |
| | 69 | | ChatController.i); |
| 1 | 70 | | break; |
| | 71 | | case HUDElementID.PRIVATE_CHAT_WINDOW: |
| 1 | 72 | | hudElement = new PrivateChatWindowController( |
| | 73 | | DataStore.i, |
| | 74 | | new UserProfileWebInterfaceBridge(), |
| | 75 | | ChatController.i, |
| | 76 | | FriendsController.i, |
| | 77 | | Resources.Load<InputAction_Trigger>("CloseWindow"), |
| | 78 | | new SocialAnalytics( |
| | 79 | | Environment.i.platform.serviceProviders.analytics, |
| | 80 | | new UserProfileWebInterfaceBridge()), |
| | 81 | | SceneReferences.i.mouseCatcher, |
| | 82 | | Resources.Load<InputAction_Trigger>("ToggleWorldChat")); |
| 1 | 83 | | break; |
| | 84 | | case HUDElementID.PUBLIC_CHAT_CHANNEL: |
| 1 | 85 | | hudElement = new PublicChatChannelController( |
| | 86 | | ChatController.i, |
| | 87 | | new UserProfileWebInterfaceBridge(), |
| | 88 | | DataStore.i, |
| | 89 | | ProfanityFilterSharedInstances.regexFilter, |
| | 90 | | SceneReferences.i.mouseCatcher, |
| | 91 | | Resources.Load<InputAction_Trigger>("ToggleWorldChat")); |
| 1 | 92 | | break; |
| | 93 | | case HUDElementID.TASKBAR: |
| 1 | 94 | | hudElement = new TaskbarHUDController(); |
| 1 | 95 | | break; |
| | 96 | | case HUDElementID.OPEN_EXTERNAL_URL_PROMPT: |
| 1 | 97 | | hudElement = new ExternalUrlPromptHUDController(); |
| 1 | 98 | | break; |
| | 99 | | case HUDElementID.NFT_INFO_DIALOG: |
| 1 | 100 | | hudElement = new NFTPromptHUDController(); |
| 1 | 101 | | break; |
| | 102 | | case HUDElementID.TELEPORT_DIALOG: |
| 1 | 103 | | hudElement = new TeleportPromptHUDController(); |
| 1 | 104 | | break; |
| | 105 | | case HUDElementID.CONTROLS_HUD: |
| 1 | 106 | | hudElement = new ControlsHUDController(); |
| 1 | 107 | | break; |
| | 108 | | case HUDElementID.HELP_AND_SUPPORT_HUD: |
| 1 | 109 | | hudElement = new HelpAndSupportHUDController(); |
| 1 | 110 | | break; |
| | 111 | | case HUDElementID.USERS_AROUND_LIST_HUD: |
| 1 | 112 | | hudElement = new VoiceChatWindowController( |
| | 113 | | new UserProfileWebInterfaceBridge(), |
| | 114 | | FriendsController.i, |
| | 115 | | new SocialAnalytics( |
| | 116 | | Environment.i.platform.serviceProviders.analytics, |
| | 117 | | new UserProfileWebInterfaceBridge()), |
| | 118 | | DataStore.i, |
| | 119 | | Settings.i); |
| 1 | 120 | | break; |
| | 121 | | case HUDElementID.GRAPHIC_CARD_WARNING: |
| 1 | 122 | | hudElement = new GraphicCardWarningHUDController(); |
| 1 | 123 | | break; |
| | 124 | | case HUDElementID.BUILDER_IN_WORLD_MAIN: |
| | 125 | | break; |
| | 126 | | case HUDElementID.QUESTS_PANEL: |
| 1 | 127 | | hudElement = new QuestsPanelHUDController(); |
| 1 | 128 | | break; |
| | 129 | | case HUDElementID.QUESTS_TRACKER: |
| 1 | 130 | | hudElement = new QuestsTrackerHUDController(); |
| 1 | 131 | | break; |
| | 132 | | case HUDElementID.SIGNUP: |
| 1 | 133 | | var analytics = Environment.i.platform.serviceProviders.analytics; |
| 1 | 134 | | hudElement = new SignupHUDController(analytics); |
| 1 | 135 | | break; |
| | 136 | | case HUDElementID.BUILDER_PROJECTS_PANEL: |
| | 137 | | break; |
| | 138 | | case HUDElementID.LOADING: |
| 1 | 139 | | hudElement = new LoadingHUDController(); |
| | 140 | | break; |
| | 141 | | } |
| | 142 | |
|
| 24 | 143 | | return hudElement; |
| | 144 | | } |
| | 145 | |
|
| | 146 | | public void Dispose() |
| | 147 | | { |
| 665 | 148 | | } |
| | 149 | |
|
| | 150 | | public void Initialize() |
| | 151 | | { |
| 665 | 152 | | } |
| | 153 | | } |