Improved the proof-of-concept of the new dialogs.

- added left and right side image support and added them to the test
  scenario.

- allow images the 200 x 200 image to be 250 x 250.

- added a mutulated shyde.

- mirrored the arch mage.
This commit is contained in:
Mark de Wever 2008-07-03 16:19:35 +00:00
parent a6a7cd9a3a
commit d6d65f485f
5 changed files with 243 additions and 75 deletions

View file

@ -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]

View file

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

BIN
images/shyde200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View file

@ -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<gui2::tcontrol*>(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<gui2::tcontrol*>(window.find_widget("message", false));
assert(label);