mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 02:29:19 +02:00
virtual slider mouse input mode, minor refactoring, minor bug fixes
This commit is contained in:
10
uilayer.cpp
10
uilayer.cpp
@@ -109,7 +109,7 @@ ui_layer::on_key( int const Key, int const Action ) {
|
||||
EditorModeFlag = ( Key == GLFW_KEY_F11 );
|
||||
if( ( true == EditorModeFlag )
|
||||
&& ( false == Global.ControlPicking ) ) {
|
||||
glfwSetInputMode( m_window, GLFW_CURSOR, GLFW_CURSOR_NORMAL );
|
||||
set_cursor( GLFW_CURSOR_NORMAL );
|
||||
Global.ControlPicking = true;
|
||||
}
|
||||
}
|
||||
@@ -1113,6 +1113,13 @@ ui_layer::render() {
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
void
|
||||
ui_layer::set_cursor( int const Mode ) {
|
||||
|
||||
glfwSetInputMode( m_window, GLFW_CURSOR, Mode );
|
||||
m_cursorvisible = ( Mode != GLFW_CURSOR_DISABLED );
|
||||
}
|
||||
|
||||
void
|
||||
ui_layer::set_progress( float const Progress, float const Subtaskprogress ) {
|
||||
|
||||
@@ -1214,6 +1221,7 @@ void
|
||||
ui_layer::render_tooltip() {
|
||||
|
||||
if( m_tooltip.empty() ) { return; }
|
||||
if( false == m_cursorvisible ) { return; }
|
||||
|
||||
glm::dvec2 mousepos;
|
||||
glfwGetCursorPos( m_window, &mousepos.x, &mousepos.y );
|
||||
|
||||
Reference in New Issue
Block a user