Add the initial proof-of-concept version of Jetryl's new idea for messages...

...in game. See
http://www.allacrost.org/staff/user/jetryl/Wesnoth/DialogueTest.jpg
for a screenshot of the intended idea (which this version doesn't
achive.

Added one of Kitty's new transperant images to test.
This commit is contained in:
Mark de Wever 2008-06-24 20:40:33 +00:00
parent 639b506a0d
commit e9798bf356
4 changed files with 248 additions and 0 deletions

View file

@ -0,0 +1,212 @@
###
### Test window to show messages to the user, test version to test with Jetryl's
### new message dialog and Kitty's portraits.
###
[window_definition]
id = "message_test"
description = "bar"
[resolution]
[background]
[draw]
[/draw]
[/background]
[foreground]
[draw]
[image]
x = 5
y = 5
# NOTE this image can be removed once we move to the final code.
name = "arch_fem200.png"
[/image]
[/draw]
[/foreground]
[/resolution]
[/window_definition]
#define BASE_NAME
"translucent65" #enddef
[panel_definition]
id = "message_test"
description = "bar"
[resolution]
left_border = 10
right_border = 13
top_border = 10
bottom_border = 13
[background]
[draw]
[image]
name = "dialogs/" + {BASE_NAME} + "-border-topleft.png"
[/image]
[image]
x = 5
y = 0
w = "(width - 14)"
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)"
y = "(height - 9)"
name = "dialogs/" + {BASE_NAME} + "-border-botright.png"
[/image]
[image]
x = 5
y = "(height - 9)"
w = "(width - 14)"
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)"
h = "(height - 14)"
name = "dialogs/" + {BASE_NAME} + "-background.png"
[/image]
[/draw]
[/background]
[foreground]
[draw]
[/draw]
[/foreground]
[/resolution]
[/panel_definition]
#unddef BASE_NAME
[window]
id = "message_test"
description = "Test dialog to test Jetryl's new message style and Kitty's portraits."
[resolution]
definition = "message_test"
automatic_placement = "true"
vertical_placement = "bottom"
horizontal_placement = "center"
[grid]
[row]
[column]
# This spacer makes sure the dialog is at least 200 pixels high.
[spacer]
width = 0
height = 200
[/spacer]
[/column]
[column]
vertical_alignment = "bottom"
[panel]
definition = "message_test"
[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[spacer]
id = "image_place_holder"
width = 200
height = 0
[/spacer]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
id = "message"
definition = "default"
[/label]
[/column]
[/row]
[/grid]
[/panel]
[/column]
[/row]
[/grid]
[/resolution]
[/window]

View file

@ -127,6 +127,23 @@ Xu , Xu , Qxu , Qxu , Ql , Ql
text="Open the hell"
[/label]
[label]
x,y=12,7
text="show me more"
[/label]
[event]
name=moveto
first_time_only=no
[filter]
x,y,side=12,7,1
[/filter]
[message_test]
message="Test message."
[/message_test]
[/event]
turns=36
id=test

BIN
images/arch_fem200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -22,6 +22,8 @@
#include "dialogs.hpp"
#include "game_errors.hpp"
#include "game_events.hpp"
#include "gui/widgets/window.hpp"
#include "gui/widgets/window_builder.hpp"
#include "image.hpp"
#include "language.hpp"
#include "log.hpp"
@ -1875,6 +1877,23 @@ namespace {
lg::wml_error << message << '\n';
}
// 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)
{
const std::string message = cfg["message"];
gui2::init();
gui2::twindow window = gui2::build(screen->video(), "message_test");
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(debug_message,/*handler*/,/*event_info*/,cfg)
{
const std::string log_level = cfg["logger"];