Author: mordante
Date: Tue Jun 24 22:40:33 2008
New Revision: 27496
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27496&view=rev
Log:
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.
Added:
trunk/data/gui/default/window/message.cfg (with props)
trunk/images/arch_fem200.png (with props)
Modified:
trunk/data/scenario-test.cfg
trunk/src/game_events.cpp
Added: trunk/data/gui/default/window/message.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/window/message.cfg?rev=27496&view=auto
==============================================================================
--- trunk/data/gui/default/window/message.cfg (added)
+++ trunk/data/gui/default/window/message.cfg Tue Jun 24 22:40:33 2008
@@ -1,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]
+
+
Propchange: trunk/data/gui/default/window/message.cfg
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/data/scenario-test.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=27496&r1=27495&r2=27496&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Tue Jun 24 22:40:33 2008
@@ -126,6 +126,23 @@
x,y=17,7
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
Added: trunk/images/arch_fem200.png
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/images/arch_fem200.png?rev=27496&view=auto
==============================================================================
Binary file - no diff available.
Propchange: trunk/images/arch_fem200.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=27496&r1=27495&r2=27496&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Tue Jun 24 22:40:33 2008
@@ -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"
@@ -1873,6 +1875,23 @@
// Note: no need to translate the string, since only used for
deprecated things.
const std::string message = cfg["message"];
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)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits