X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fioncore_menudb.lua;h=62cf04a7622ca95d81861f43c3c313d00487e17d;hb=801e83f399c5307749d9a1caa7ca43814bf343a1;hp=0248b14751cc75f233907bb6730cba3c49bec9e3;hpb=ae4260bb64817c11f9a7140324cd3e3ba113e297;p=ion3.git diff --git a/ioncore/ioncore_menudb.lua b/ioncore/ioncore_menudb.lua index 0248b14..62cf04a 100644 --- a/ioncore/ioncore_menudb.lua +++ b/ioncore/ioncore_menudb.lua @@ -1,7 +1,7 @@ -- -- ion/ioncore/ioncore_menudb.lua -- Routines for defining menus. -- --- Copyright (c) Tuomo Valkonen 2004-2007. +-- Copyright (c) Tuomo Valkonen 2004-2008. -- -- See the included file LICENSE for details. -- @@ -45,11 +45,12 @@ end -- of menu entries. function ioncore.defctxmenu(ctx, ...) local tab, add - if #arg>1 and type(arg[1])=="string" then - tab=arg[2] - tab.label=ioncore.gettext(arg[1]) + local a1, a2 = ... + if a2 and type(a1)=="string" then + tab=a2 + tab.label=ioncore.gettext(a1) else - tab=arg[1] + tab=a1 end ioncore.defmenu("ctxmenu-"..ctx, tab) end @@ -260,7 +261,7 @@ local function receive_styles(str) local styles={} local stylemenu={} - for look in string.gfind(data, "(look[-_][^\n]*)%.lua\n") do + for look in string.gmatch(data, "(look[-_][^\n]*)%.lua\n") do if not found[look] then found[look]=true table.insert(styles, look)