From b4d88e9d921062be3ae633c01ca848137620d392 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Tue, 2 Jun 2015 16:11:17 +0100 Subject: [PATCH] fix returning of text fields in twitch window --- src/interface/window.h | 3 +++ src/windows/multi_text_input.c | 6 +++--- src/windows/twitch.c | 11 +++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/interface/window.h b/src/interface/window.h index 0206913dbb..97b031306a 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -447,6 +447,9 @@ extern rct_window* g_window_list; // rct2: 0x00F635EE extern ride_list_item _window_track_list_item; +extern char multi_text_input[512]; +extern char multi_text_input2[512]; + void window_dispatch_update_all(); void window_update_all(); rct_window *window_create(int x, int y, int width, int height, uint32 *event_handlers, rct_windowclass cls, uint16 flags); diff --git a/src/windows/multi_text_input.c b/src/windows/multi_text_input.c index b281a7c8a6..ea505429af 100644 --- a/src/windows/multi_text_input.c +++ b/src/windows/multi_text_input.c @@ -296,7 +296,7 @@ static void window_multi_text_input_mouseup(){ // Pass back the text that has been entered. // ecx when zero means text input failed if (calling_w != NULL) - window_event_textinput_call(calling_w, multi_calling_widget, NULL, NULL); + window_event_textinput_call(calling_w, multi_calling_widget, NULL); window_close(w); break; case WIDX_OKAY: @@ -304,7 +304,7 @@ static void window_multi_text_input_mouseup(){ // Pass back the text that has been entered. // ecx when none zero means text input success if (calling_w != NULL) - window_event_textinput_call(calling_w, multi_calling_widget, multi_text_input, multi_text_input2); + window_event_textinput_call(calling_w, multi_calling_widget, multi_text_input); window_close(w); break; case WIDX_USERNAME: @@ -497,7 +497,7 @@ static void window_multi_text_input_text(int key, rct_window* w){ // Pass back the text that has been entered. // ecx when none zero means text input success if (calling_w) - window_event_textinput_call(calling_w, multi_calling_widget, multi_text_input, multi_text_input2); + window_event_textinput_call(calling_w, multi_calling_widget, multi_text_input); } } diff --git a/src/windows/twitch.c b/src/windows/twitch.c index 4be14e916a..3ca160e90c 100644 --- a/src/windows/twitch.c +++ b/src/windows/twitch.c @@ -159,19 +159,18 @@ static void window_twitch_paint() static void window_twitch_text_input(){ short widgetIndex; rct_window *w; - char _cl; + uint8 result; char* text; - //just a stub + window_textinput_get_registers(w, widgetIndex, result, text); + + char *userName = multi_text_input; + char *password = multi_text_input2; } static void window_twitch_invalidate() { rct_window *w; - int i; - sint32 currentSoundDevice; - - //just a stub window_get_register(w);