summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-09-11 18:52:56 +0000
committeralberth <alberth@openttd.org>2009-09-11 18:52:56 +0000
commit669b7d01acb603ebea3071b347f7b0cec8b9f505 (patch)
tree9bd9e851b4f2301fe2a880f229e76a0f63781d77 /src/osk_gui.cpp
parent4cb6451507a4ec63a7efc356ee0843f1a952e7b4 (diff)
downloadopenttd-669b7d01acb603ebea3071b347f7b0cec8b9f505.tar.xz
(svn r17502) -Codechange [FS#3184]: Extend QueryStringBaseWindow to support windows with nested widgets (by Terkhen with a few tweaks).
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r--src/osk_gui.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp
index 7858c7f46..4aa4285f7 100644
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -75,7 +75,13 @@ struct OskWindow : public Window {
this->parent = parent;
assert(parent != NULL);
- this->caption = (parent->widget[button].data != STR_NULL) ? parent->widget[button].data : parent->caption;
+ if (parent->widget != NULL) {
+ this->caption = (parent->widget[button].data != STR_NULL) ? parent->widget[button].data : parent->caption;
+ }
+ if (parent->nested_array != NULL) {
+ assert(parent->nested_array[button] != NULL);
+ this->caption = (parent->nested_array[button]->widget_data != STR_NULL) ? parent->nested_array[button]->widget_data : parent->caption;
+ }
this->qs = parent;
this->text_btn = button;