stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/ui ccl_ui.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/ui ccl_ui.c
Date: 17 Dec 2003 06:55:15 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       03/12/17 06:55:15

Modified files:
        src/ui         : ccl_ui.c 

Log message:
        Fixed transparent flag for Lua

Patches:
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.171 stratagus/src/ui/ccl_ui.c:1.172
--- stratagus/src/ui/ccl_ui.c:1.171     Wed Dec 17 06:30:55 2003
+++ stratagus/src/ui/ccl_ui.c   Wed Dec 17 06:55:14 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_ui.c,v 1.171 2003/12/16 19:30:55 mohydine Exp $
+//     $Id: ccl_ui.c,v 1.172 2003/12/16 19:55:14 jsalmon3 Exp $
 
 //@{
 
@@ -4530,9 +4530,8 @@
            item->xofs = gh_scm2int(gh_car(value));
            value = gh_cdr(value);
            item->yofs = gh_scm2int(gh_car(value));
-       // Addition of the transparent flag
        } else if (gh_eq_p(value, gh_symbol2scm("transparent"))) {
-               item->transparent = 1;
+           item->transparent = 1;
        } else if (gh_eq_p(value, gh_symbol2scm("menu"))) {
            value = gh_car(list);
            list = gh_cdr(list);
@@ -5169,9 +5168,33 @@
            lua_pop(l, 1);
        } else if (!strcmp(value, "menu")) {
            name = strdup(LuaToString(l, j + 1));
-    } else if (!strcmp(value, "flags")) {
-        item->transparent = 1 Coucou Jim4
+       } else if (!strcmp(value, "transparent")) {
+           item->transparent = 1;
+           --j;
        } else if (!strcmp(value, "flags")) {
+           if (!lua_istable(l, j + 1)) {
+               lua_pushstring(l, "incorrect argument");
+               lua_error(l);
+           }
+           subargs = luaL_getn(l, j + 1);
+           for (k = 0; k < subargs; ++k) {
+               lua_rawgeti(l, j + 1, k + 1);
+               value = LuaToString(l, -1);
+               lua_pop(l, 1);
+
+               if (!strcmp(value, "active")) {
+                   item->flags |= MenuButtonActive;
+               } else if (!strcmp(value, "clicked")) {
+                   item->flags |= MenuButtonClicked;
+               } else if (!strcmp(value, "selected")) {
+                   item->flags |= MenuButtonSelected;
+               } else if (!strcmp(value, "disabled")) {
+                   item->flags |= MenuButtonDisabled;
+               } else {
+                   lua_pushfstring(l, "Unknown flag: %s", value);
+                   lua_error(l);
+               }
+           }
        } else if (!strcmp(value, "font")) {
            item->font = CclFontByIdentifier(LuaToString(l, j + 1));
        } else if (!strcmp(value, "init")) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]