diff --git a/data/gui/default/window/message.cfg b/data/gui/default/window/message.cfg index 7c1fce2cf9e..05337f1653f 100644 --- a/data/gui/default/window/message.cfg +++ b/data/gui/default/window/message.cfg @@ -4,7 +4,7 @@ ### [window_definition] - id = "message_test" + id = "message_test_left" description = "bar" [resolution] @@ -22,8 +22,41 @@ [draw] [image] - x = 5 - y = 5 + x = "(255 - image_width)" + y = "(250 - image_height)" + # NOTE this image can be removed once we move to the final code. + name = "shyde200.png" + [/image] + + [/draw] + + [/foreground] + + [/resolution] + +[/window_definition] + +[window_definition] + id = "message_test_right" + description = "bar" + + [resolution] + + [background] + + [draw] + + [/draw] + + [/background] + + [foreground] + + [draw] + + [image] + x = "(width - 255)" + y = "(250 - image_height)" # NOTE this image can be removed once we move to the final code. name = "arch_fem200.png" [/image] @@ -36,6 +69,7 @@ [/window_definition] + #define BASE_NAME "translucent65" #enddef @@ -45,8 +79,8 @@ [resolution] - left_border = 10 - right_border = 13 + left_border = 0 + right_border = 0 top_border = 10 bottom_border = 13 @@ -55,63 +89,25 @@ [draw] [image] - name = "dialogs/" + {BASE_NAME} + "-border-topleft.png" - [/image] - - [image] - x = 5 + x = 0 y = 0 - w = "(width - 14)" + w = "(width)" stretch = "true" name = "dialogs/" + {BASE_NAME} + "-border-top.png" [/image] [image] - x = "(width - 9)" - y = 0 - name = "dialogs/" + {BASE_NAME} + "-border-topright.png" - [/image] - - [image] - x = "(width - 9)" - y = 5 - h = "(height - 14)" - stretch = "true" - name = "dialogs/" + {BASE_NAME} + "-border-right.png" - [/image] - - [image] - x = "(width - 9)" + x = 0 y = "(height - 9)" - name = "dialogs/" + {BASE_NAME} + "-border-botright.png" - [/image] - - [image] - x = 5 - y = "(height - 9)" - w = "(width - 14)" + w = "(width)" stretch = "true" name = "dialogs/" + {BASE_NAME} + "-border-bottom.png" [/image] - [image] - x = 0 - y = "(height - 9)" - name = "dialogs/" + {BASE_NAME} + "-border-botleft.png" - [/image] - [image] x = 0 y = 5 - h = "(height - 14)" - stretch = "true" - name = "dialogs/" + {BASE_NAME} + "-border-left.png" - [/image] - - [image] - x = 5 - y = 5 - w = "(width - 14)" + w = "(width)" h = "(height - 14)" name = "dialogs/" + {BASE_NAME} + "-background.png" [/image] @@ -135,15 +131,15 @@ #unddef BASE_NAME [window] - id = "message_test" + id = "message_test_left" description = "Test dialog to test Jetryl's new message style and Kitty's portraits." [resolution] - definition = "message_test" + definition = "message_test_left" automatic_placement = "true" vertical_placement = "bottom" - horizontal_placement = "center" + horizontal_placement = "left" [grid] @@ -151,14 +147,15 @@ [column] - # This spacer makes sure the dialog is at least 200 pixels high. + # This spacer makes sure the dialog has a minimum height. [spacer] width = 0 - height = 200 + height = 250 [/spacer] [/column] + [column] vertical_alignment = "bottom" @@ -167,29 +164,58 @@ [grid] [row] - [column] - border = "all" - border_size = 5 - horizontal_alignment = "left" - [spacer] - id = "image_place_holder" - width = 200 + [column] + + # This spacer makes sure the panel has a minimum width. + [spacer] + width = 658 height = 0 [/spacer] [/column] - [column] - grow_factor = 1 - border = "all" - border_size = 5 - horizontal_alignment = "left" + [/row] - [label] - id = "message" - definition = "default" - [/label] + [row] + + [column] + + [grid] + + [row] + + [column] + border = "all" + border_size = 5 + horizontal_alignment = "left" + + [spacer] + # reserve place for the image and set a minimum height for the text + id = "image_place_holder" + + width = 250 + height = 75 + [/spacer] + + [/column] + + [column] + grow_factor = 1 + border = "all" + border_size = 5 + horizontal_alignment = "left" + + [label] + id = "message" + definition = "default" + [/label] + + [/column] + + [/row] + + [/grid] [/column] @@ -210,3 +236,115 @@ [/window] + + + + + + + +[window] + id = "message_test_right" + description = "Test dialog to test Jetryl's new message style and Kitty's portraits." + + [resolution] + definition = "message_test_right" + + automatic_placement = "true" + vertical_placement = "bottom" + horizontal_placement = "left" + + [grid] + + [row] + + [column] + + # This spacer makes sure the dialog has a minimum height. + [spacer] + width = 0 + height = 250 + [/spacer] + + [/column] + + + [column] + vertical_alignment = "bottom" + + [panel] + definition = "message_test" + + [grid] + [row] + + [column] + + # This spacer makes sure the panel has a minimum width. + [spacer] + width = 658 + height = 0 + [/spacer] + + [/column] + + [/row] + + [row] + + [column] + + [grid] + + [row] + + [column] + grow_factor = 1 + border = "all" + border_size = 5 + horizontal_alignment = "left" + + [label] + id = "message" + definition = "default" + [/label] + + [/column] + + [column] + border = "all" + border_size = 5 + horizontal_alignment = "left" + + [spacer] + # reserve place for the image and set a minimum height for the text + id = "image_place_holder" + + width = 250 + height = 75 + [/spacer] + + [/column] + + [/row] + + [/grid] + + [/column] + + [/row] + + [/grid] + + [/panel] + + [/column] + + [/row] + + [/grid] + + [/resolution] + +[/window] + diff --git a/data/scenario-test.cfg b/data/scenario-test.cfg index 441d627251e..eb1272ef5de 100644 --- a/data/scenario-test.cfg +++ b/data/scenario-test.cfg @@ -129,7 +129,7 @@ Xu , Xu , Qxu , Qxu , Ql , Ql [label] x,y=12,7 - text="show me more" + text="left" [/label] [event] @@ -139,11 +139,27 @@ Xu , Xu , Qxu , Qxu , Ql , Ql x,y,side=12,7,1 [/filter] - [message_test] - message="Test message." - [/message_test] + [message_test_left] + message="Test foo bar bla bla bla bla bla bla bla bla bla bla bla" + [/message_test_left] [/event] + [label] + x,y=13,7 + text="right" + [/label] + + [event] + name=moveto + first_time_only=no + [filter] + x,y,side=13,7,1 + [/filter] + + [message_test_right] + message="Test foo bar bla bla bla bla bla bla bla bla bla bla bla" + [/message_test_right] + [/event] turns=36 id=test diff --git a/images/arch_fem200.png b/images/arch_fem200.png index ee349940261..206cf9b0239 100644 Binary files a/images/arch_fem200.png and b/images/arch_fem200.png differ diff --git a/images/shyde200.png b/images/shyde200.png new file mode 100644 index 00000000000..f2990df0f6e Binary files /dev/null and b/images/shyde200.png differ diff --git a/src/game_events.cpp b/src/game_events.cpp index e0cb8d80707..4ecc3705afa 100644 --- a/src/game_events.cpp +++ b/src/game_events.cpp @@ -1889,11 +1889,25 @@ namespace { // Test function to show the new message dialog. // NOTE this event is undocumented since it's only added as test hack and will // be removed without further notice. - WML_HANDLER_FUNCTION(message_test,/*handler*/,/*event_info*/,cfg) + WML_HANDLER_FUNCTION(message_test_left,/*handler*/,/*event_info*/,cfg) { const std::string message = cfg["message"]; gui2::init(); - gui2::twindow window = gui2::build((*screen)->video(), "message_test"); + gui2::twindow window = gui2::build((*screen)->video(), "message_test_left"); + + gui2::tcontrol* label = dynamic_cast(window.find_widget("message", false)); + assert(label); + label->set_label(message); + + window.recalculate_size(); + window.show(); + } + + WML_HANDLER_FUNCTION(message_test_right,/*handler*/,/*event_info*/,cfg) + { + const std::string message = cfg["message"]; + gui2::init(); + gui2::twindow window = gui2::build((*screen)->video(), "message_test_right"); gui2::tcontrol* label = dynamic_cast(window.find_widget("message", false)); assert(label);