summaryrefslogtreecommitdiff
path: root/internal_rewrite/ui_text_input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite/ui_text_input.cpp')
-rw-r--r--internal_rewrite/ui_text_input.cpp16
1 files changed, 15 insertions, 1 deletions
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