1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 15:23:01 +01:00

Add text box widget

This commit is contained in:
Ted John
2021-01-23 14:28:07 +00:00
parent be350f7e2e
commit c0d8786af8
7 changed files with 127 additions and 4 deletions

View File

@@ -2003,12 +2003,18 @@ void window_cancel_textbox()
if (gUsingWidgetTextBox)
{
rct_window* w = window_find_by_number(gCurrentTextBox.window.classification, gCurrentTextBox.window.number);
window_event_textinput_call(w, gCurrentTextBox.widget_index, nullptr);
if (w != nullptr)
{
window_event_textinput_call(w, gCurrentTextBox.widget_index, nullptr);
}
gCurrentTextBox.window.classification = WC_NULL;
gCurrentTextBox.window.number = 0;
context_stop_text_input();
gUsingWidgetTextBox = false;
widget_invalidate(w, gCurrentTextBox.widget_index);
if (w != nullptr)
{
widget_invalidate(w, gCurrentTextBox.widget_index);
}
gCurrentTextBox.widget_index = static_cast<uint16_t>(WindowWidgetType::Last);
}
}