Author: mordante
Date: Thu Jul  3 18:19:35 2008
New Revision: 27682

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27682&view=rev
Log:
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.

Added:
    trunk/images/shyde200.png   (with props)
Modified:
    trunk/data/gui/default/window/message.cfg
    trunk/data/scenario-test.cfg
    trunk/images/arch_fem200.png
    trunk/src/game_events.cpp

Modified: trunk/data/gui/default/window/message.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/window/message.cfg?rev=27682&r1=27681&r2=27682&view=diff
==============================================================================
--- trunk/data/gui/default/window/message.cfg (original)
+++ trunk/data/gui/default/window/message.cfg Thu Jul  3 18:19:35 2008
@@ -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]
@@ -35,6 +68,7 @@
        [/resolution]
 
 [/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,13 +147,14 @@
 
                                [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"
+
+                                                                       # This 
spacer makes sure the panel has a minimum width.
                                                                        [spacer]
-                                                                               
id = "image_place_holder"
-
-                                                                               
width = 200
+                                                                               
width = 658
                                                                                
height = 0
                                                                        
[/spacer]
 
                                                                [/column]
 
+                                                       [/row]
+
+                                                       [row]
+
                                                                [column]
-                                                                       
grow_factor = 1
-                                                                       border 
= "all"
-                                                                       
border_size = 5
-                                                                       
horizontal_alignment = "left"
-
-                                                                       [label]
-                                                                               
id = "message"
-                                                                               
definition = "default"
-                                                                       [/label]
+
+                                                                       [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]
+

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=27682&r1=27681&r2=27682&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Thu Jul  3 18:19:35 2008
@@ -129,7 +129,7 @@
 
        [label]
                x,y=12,7
-               text="show me more"
+               text="left"
        [/label]
 
        [event]
@@ -139,11 +139,27 @@
             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
 

Modified: trunk/images/arch_fem200.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/arch_fem200.png?rev=27682&r1=27681&r2=27682&view=diff
==============================================================================
Binary files - no diff available.

Added: trunk/images/shyde200.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/shyde200.png?rev=27682&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/images/shyde200.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=27682&r1=27681&r2=27682&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Thu Jul  3 18:19:35 2008
@@ -1889,11 +1889,25 @@
        // 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);


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to