From 78a6e235c3b0006bf29868d5f7ad0628d522fa79 Mon Sep 17 00:00:00 2001 From: navewindre Date: Fri, 31 Aug 2018 18:57:02 +0200 Subject: ah yes --- internal_rewrite/ui_text_input.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'internal_rewrite/ui_text_input.cpp') diff --git a/internal_rewrite/ui_text_input.cpp b/internal_rewrite/ui_text_input.cpp index 44a4ebc..f2c3530 100644 --- a/internal_rewrite/ui_text_input.cpp +++ b/internal_rewrite/ui_text_input.cpp @@ -29,6 +29,11 @@ void ui::c_text_input::render( ) { m_last_key_input[ i ] = current_time; continue; } + + if( i == KEYS_RETURN ) { + m_active = false; + break; + } m_key_states[ i ] = 0xf0; wchar_t pressed_char; @@ -65,5 +70,14 @@ void ui::c_text_input::render( ) { ( is_hovered( ) || m_active ) ? ui_get_text_col( ) : ui_get_accent_col( ) ); ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); - ui_draw_string( x + 2, y + 3, false, ui_get_text_col( ), m_active ? "%s_" : "%s", m_text_ptr ); + if( !m_hidden ) + ui_draw_string( x + 2, y + 3, false, ui_get_text_col( ), m_active ? "%s_" : "%s", m_text_ptr ); + else { + std::string str; + str.append( "*", strlen( m_text_ptr ) ); + if( m_active ) + str += '_'; + + ui_draw_string( x + 2, y + 3, false, ui_get_text_col( ), str.c_str( ) ); + } } \ No newline at end of file -- cgit v1.2.3