Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: controls panel #3151

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Explorer/Assets/AddressableAssetsData/AssetGroups/UI.asset
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 542424588a68b46f688ef5c667aa0c68
m_Address: ControlsPanel
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 5af318126b38647fea34ff22fba4ef17
m_Address: Assets/DCL/UI/ColorPicker/BodyShapeColors.asset
m_ReadOnly: 0
Expand Down
30 changes: 30 additions & 0 deletions Explorer/Assets/DCL/Input/UnityInputSystem/DCLInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,15 @@ public @DCLInput()
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Controls"",
""type"": ""Button"",
""id"": ""ff9cdfbe-b880-4633-aaae-c5b3849d7f08"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
Expand Down Expand Up @@ -2296,6 +2305,17 @@ public @DCLInput()
""action"": ""OpenChatCommandLine"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""a2b44e8b-33bb-4468-9439-8836ae0a5796"",
""path"": ""<Keyboard>/h"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Controls"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
Expand Down Expand Up @@ -3620,6 +3640,7 @@ public @DCLInput()
m_Shortcuts_ToggleSceneDebugConsoleLarger = m_Shortcuts.FindAction("ToggleSceneDebugConsoleLarger", throwIfNotFound: true);
m_Shortcuts_OpenChat = m_Shortcuts.FindAction("OpenChat", throwIfNotFound: true);
m_Shortcuts_OpenChatCommandLine = m_Shortcuts.FindAction("OpenChatCommandLine", throwIfNotFound: true);
m_Shortcuts_Controls = m_Shortcuts.FindAction("Controls", throwIfNotFound: true);
// Emotes
m_Emotes = asset.FindActionMap("Emotes", throwIfNotFound: true);
m_Emotes_Slot1 = m_Emotes.FindAction("Slot 1", throwIfNotFound: true);
Expand Down Expand Up @@ -4254,6 +4275,7 @@ public void SetCallbacks(IUIActions instance)
private readonly InputAction m_Shortcuts_ToggleSceneDebugConsoleLarger;
private readonly InputAction m_Shortcuts_OpenChat;
private readonly InputAction m_Shortcuts_OpenChatCommandLine;
private readonly InputAction m_Shortcuts_Controls;
public struct ShortcutsActions
{
private @DCLInput m_Wrapper;
Expand All @@ -4271,6 +4293,7 @@ public struct ShortcutsActions
public InputAction @ToggleSceneDebugConsoleLarger => m_Wrapper.m_Shortcuts_ToggleSceneDebugConsoleLarger;
public InputAction @OpenChat => m_Wrapper.m_Shortcuts_OpenChat;
public InputAction @OpenChatCommandLine => m_Wrapper.m_Shortcuts_OpenChatCommandLine;
public InputAction @Controls => m_Wrapper.m_Shortcuts_Controls;
public InputActionMap Get() { return m_Wrapper.m_Shortcuts; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
Expand Down Expand Up @@ -4319,6 +4342,9 @@ public void AddCallbacks(IShortcutsActions instance)
@OpenChatCommandLine.started += instance.OnOpenChatCommandLine;
@OpenChatCommandLine.performed += instance.OnOpenChatCommandLine;
@OpenChatCommandLine.canceled += instance.OnOpenChatCommandLine;
@Controls.started += instance.OnControls;
@Controls.performed += instance.OnControls;
@Controls.canceled += instance.OnControls;
}

private void UnregisterCallbacks(IShortcutsActions instance)
Expand Down Expand Up @@ -4362,6 +4388,9 @@ private void UnregisterCallbacks(IShortcutsActions instance)
@OpenChatCommandLine.started -= instance.OnOpenChatCommandLine;
@OpenChatCommandLine.performed -= instance.OnOpenChatCommandLine;
@OpenChatCommandLine.canceled -= instance.OnOpenChatCommandLine;
@Controls.started -= instance.OnControls;
@Controls.performed -= instance.OnControls;
@Controls.canceled -= instance.OnControls;
}

public void RemoveCallbacks(IShortcutsActions instance)
Expand Down Expand Up @@ -4847,6 +4876,7 @@ public interface IShortcutsActions
void OnToggleSceneDebugConsoleLarger(InputAction.CallbackContext context);
void OnOpenChat(InputAction.CallbackContext context);
void OnOpenChatCommandLine(InputAction.CallbackContext context);
void OnControls(InputAction.CallbackContext context);
}
public interface IEmotesActions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Controls",
"type": "Button",
"id": "ff9cdfbe-b880-4633-aaae-c5b3849d7f08",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
Expand Down Expand Up @@ -2274,6 +2283,17 @@
"action": "OpenChatCommandLine",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "a2b44e8b-33bb-4468-9439-8836ae0a5796",
"path": "<Keyboard>/h",
"interactions": "",
"processors": "",
"groups": "",
"action": "Controls",
"isComposite": false,
"isPartOfComposite": false
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@ MonoBehaviour:
m_SubObjectType:
m_EditorAssetChanged: 0
<SkyboxSettingsAsset>k__BackingField: {fileID: 11400000, guid: 50aa9483411844942bd409d4b4612221, type: 2}
ControlsPanelPrefab:
m_AssetGUID: 542424588a68b46f688ef5c667aa0c68
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
- rid: 3836309668583964676
type: {class: NftPromptPlugin/NftPromptSettings, ns: DCL.PluginSystem.Global, asm: DCL.Plugins}
data:
Expand Down
11 changes: 11 additions & 0 deletions Explorer/Assets/DCL/PluginSystem/Global/SidebarPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using DCL.Profiles;
using DCL.SidebarBus;
using DCL.StylizedSkybox.Scripts;
using DCL.UI.Controls;
using DCL.UI.MainUI;
using DCL.UI.ProfileElements;
using DCL.UI.Sidebar;
Expand Down Expand Up @@ -41,6 +42,7 @@ public class SidebarPlugin : IDCLGlobalPlugin<SidebarPlugin.SidebarSettings>
private readonly IUserInAppInitializationFlow userInAppInitializationFlow;
private readonly IProfileCache profileCache;
private readonly ISidebarBus sidebarBus;
private readonly DCLInput input;
private readonly ChatEntryConfigurationSO chatEntryConfigurationSo;
private readonly Arch.Core.World world;
private readonly Entity playerEntity;
Expand All @@ -60,6 +62,7 @@ public SidebarPlugin(
IUserInAppInitializationFlow userInAppInitializationFlow,
IProfileCache profileCache,
ISidebarBus sidebarBus,
DCLInput input,
ChatEntryConfigurationSO chatEntryConfigurationSo,
Arch.Core.World world,
Entity playerEntity,
Expand All @@ -78,6 +81,7 @@ public SidebarPlugin(
this.userInAppInitializationFlow = userInAppInitializationFlow;
this.profileCache = profileCache;
this.sidebarBus = sidebarBus;
this.input = input;
this.chatEntryConfigurationSo = chatEntryConfigurationSo;
this.world = world;
this.playerEntity = playerEntity;
Expand All @@ -93,6 +97,9 @@ public async UniTask InitializeAsync(SidebarSettings settings, CancellationToken
NotificationIconTypes notificationIconTypes = (await assetsProvisioner.ProvideMainAssetAsync(settings.NotificationIconTypesSO, ct: ct)).Value;
NftTypeIconSO rarityBackgroundMapping = await assetsProvisioner.ProvideMainAssetValueAsync(settings.RarityColorMappings, ct);

ControlsPanelView panelViewAsset = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.ControlsPanelPrefab, ct: ct)).GetComponent<ControlsPanelView>();
ControlsPanelController.Preallocate(panelViewAsset, null!, out ControlsPanelView controlsPanelView);

mvcManager.RegisterController(new SidebarController(() =>
{
SidebarView view = mainUIView.SidebarView;
Expand All @@ -105,6 +112,7 @@ public async UniTask InitializeAsync(SidebarSettings settings, CancellationToken
new ProfileWidgetController(() => mainUIView.SidebarView.ProfileWidget, web3IdentityCache, profileRepository, webRequestController),
new ProfileMenuController(() => mainUIView.SidebarView.ProfileMenuView, web3IdentityCache, profileRepository, webRequestController, world, playerEntity, webBrowser, web3Authenticator, userInAppInitializationFlow, profileCache, mvcManager, chatEntryConfigurationSo),
new SkyboxMenuController(() => mainUIView.SidebarView.SkyboxMenuView, settings.SkyboxSettingsAsset),
new ControlsPanelController(() => controlsPanelView, mvcManager, input),
sidebarBus,
chatEntryConfigurationSo,
web3IdentityCache,
Expand All @@ -124,6 +132,9 @@ public class SidebarSettings : IDCLPluginSettings

[field: SerializeField]
public StylizedSkyboxSettingsAsset SkyboxSettingsAsset { get; private set; }

[field: SerializeField]
public AssetReferenceGameObject ControlsPanelPrefab;
}
}
}
3 changes: 3 additions & 0 deletions Explorer/Assets/DCL/UI/Controls.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading