{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/10755","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/10755/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/10755/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/10755/events","html_url":"https://github.com/godotengine/godot/issues/10755","id":253651361,"number":10755,"title":"Add multiple UI focus groups","user":{"login":"Faless","id":1687918,"avatar_url":"https://avatars2.githubusercontent.com/u/1687918?v=4","gravatar_id":"","url":"https://api.github.com/users/Faless","html_url":"https://github.com/Faless","followers_url":"https://api.github.com/users/Faless/followers","following_url":"https://api.github.com/users/Faless/following{/other_user}","gists_url":"https://api.github.com/users/Faless/gists{/gist_id}","starred_url":"https://api.github.com/users/Faless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faless/subscriptions","organizations_url":"https://api.github.com/users/Faless/orgs","repos_url":"https://api.github.com/users/Faless/repos","events_url":"https://api.github.com/users/Faless/events{/privacy}","received_events_url":"https://api.github.com/users/Faless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-29T13:03:24Z","updated_at":"2017-08-29T13:59:14Z","closed_at":null,"body":"Supporting split screen multiplayer is right now quite tricky when it comes to the UI.\r\nAs of the current way focus works, only one element can be focused at any given time (so player specific UI in split screen is nearly impossible).\r\nMy proposal it the following:\r\n- allow specifying a focus group on the viewport (default empty).\r\n- focus inside the viewport is tied to the given group (i.e. if a node grab the focus it will not affect nodes inside viewports with a different group)\r\n- UI elements that handle ui actions (`ui_*`) will handle `[GROUP]ui_*` (eg. `p1_ui_up`) instead, which means when assigning new focus groups you will have to add the appropriate UI actions to the `InputMap`.\r\n\r\nI have implemented this method in `2.1` (see screenshot) but before doing more work to ready it for PR (on `master`) I'd like to hear opinions on this proposal (especially @reduz @akien-mga and other devs).\r\nI thought about separating `focus_group` and `ui_action_group` but I'm not sure it makes sense. Additionally we might add a function `InputMap.add_group_ui_actions(String focus_group)` to add all the `[GROUP]ui_*` actions in bulk.\r\n\r\n![focus_groups](https://user-images.githubusercontent.com/1687918/29822016-489f0190-8cca-11e7-8d06-5661d727c4c3.gif)\r\n\r\n\r\nThoughts? Suggestions?"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/325672799","html_url":"https://github.com/godotengine/godot/issues/10755#issuecomment-325672799","issue_url":"https://api.github.com/repos/godotengine/godot/issues/10755","id":325672799,"user":{"login":"groud","id":6093119,"avatar_url":"https://avatars0.githubusercontent.com/u/6093119?v=4","gravatar_id":"","url":"https://api.github.com/users/groud","html_url":"https://github.com/groud","followers_url":"https://api.github.com/users/groud/followers","following_url":"https://api.github.com/users/groud/following{/other_user}","gists_url":"https://api.github.com/users/groud/gists{/gist_id}","starred_url":"https://api.github.com/users/groud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groud/subscriptions","organizations_url":"https://api.github.com/users/groud/orgs","repos_url":"https://api.github.com/users/groud/repos","events_url":"https://api.github.com/users/groud/events{/privacy}","received_events_url":"https://api.github.com/users/groud/received_events","type":"User","site_admin":false},"created_at":"2017-08-29T13:59:13Z","updated_at":"2017-08-29T13:59:13Z","body":"More like, in control.cpp:\r\n```\r\nvoid grab_focus(int layer = 0);\r\nvoid release_focus(int layer = 0);\r\nvoid set_focus_mode(int mode, int layer = 0);\r\nvoid has_focus(int layer = 0);\r\n```\r\nand:\r\n```\r\nvoid set_focus_filter(int layers_flags = 1);\r\n```\r\n\r\nAnd this will also need an id affected to input events, to check from which player they come from."}}
{"actor":{"display_login":"groud"}}