-
-
Notifications
You must be signed in to change notification settings - Fork 388
New functions: gui.set_layout()
and gui.get_layouts()
#11218
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
Conversation
(g/defnode DisplayProfilesNode | ||
(inherits resource-node/ResourceNode) | ||
(property auto-layout-selection g/Bool (default true) | ||
(dynamic visible (g/constantly false))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I started, I was sure that there should be a way to avoid property creation and operate directly with protobuf. But I didn't figure out how to do so. Please let me know if it can be simlified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can't be simplified; we typically assign all protobuf fields to node properties.
* @name gui.get_layouts | ||
* @return [type:table] layout_id_hash -> vmath.vector3(width, height, 0) | ||
*/ | ||
static int LuaGetLayouts(lua_State* L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project contains many GUIs, and it might be hard to write a universal logic, that switches layouts without an ability to get all the layouts of the GUI component.
scene->m_DestroyRenderConstantsCallback = params->m_DestroyRenderConstantsCallback; | ||
scene->m_CloneRenderConstantsCallback = params->m_CloneRenderConstantsCallback; | ||
scene->m_OnWindowResizeCallback = params->m_OnWindowResizeCallback; | ||
scene->m_ApplyLayoutCallback = params->m_ApplyLayoutCallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all of these called something with Callback? Seems strange... Shouldn't it be ApplyLayoutFn, SetMaterialPropertyFn etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't communicate gui
<->gamesys
another way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean naming: I agree it should be Fn
, but I in this PR I just adapt to what we already have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was only referring to naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename all the functions all over the code, ofc. but I'm not sure if we should do that as part of that PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editor changes look good!
(g/defnode DisplayProfilesNode | ||
(inherits resource-node/ResourceNode) | ||
(property auto-layout-selection g/Bool (default true) | ||
(dynamic visible (g/constantly false))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can't be simplified; we typically assign all protobuf fields to node properties.
Added new functions
gui.set_layout()
andgui.get_layouts()
:A new checkbox,
Auto Layout Selection
, has been added to Display Profiles. It disables automatic layout detection in the project:Fix #5889