mail[Wesnoth-commits] r44726 - /trunk/data/scenario-test.cfg


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 26, 2010 - 23:21:
Author: silene
Date: Mon Jul 26 23:21:33 2010
New Revision: 44726

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44726&view=rev
Log:
Added a test for custom dialogs.

Modified:
    trunk/data/scenario-test.cfg

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=44726&r1=44725&r2=44726&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Mon Jul 26 23:21:33 2010
@@ -272,6 +272,36 @@
         [/message]
     [/event]
 #endif
+
+    [label]
+        x,y=14,7
+        text="Custom dialog"
+    [/label]
+    [event]
+        name=moveto
+        [filter]
+            x,y=14,7
+        [/filter]
+        [lua]
+            code=<<
+local helper = wesnoth.require "lua/helper.lua"
+local T = helper.set_wml_tag_metatable {}
+local _ = wesnoth.textdomain "wesnoth"
+local t = {
+  T.grid {
+    T.row { T.column { T.image { label = 
"portraits/woses/transparent/ancient-wose.png" } } },
+    T.row { T.column { T.grid { T.row {
+      T.column { T.button { id = "ok", label = _"OK" } },
+      T.column { T.button { id = "cancel", label = _"Cancel" } }
+    } } } }
+  }
+}
+local result = wesnoth.show_dialog(t)
+wesnoth.message(string.format("Button %d pressed.", result))
+            >>
+        [/lua]
+    [/event]
+
 
     [event]
         name=moveto




Related Messages


Powered by MHonArc, Updated Mon Jul 26 23:40:14 2010