Package org.luaj.vm2

Examples of org.luaj.vm2.LuaString


        };
    }

    @Override
    public LuaValue getSetupOptions() {
        LuaTable options = new LuaTable();

        options.set("lang", "en");
        return options;
    }
View Full Code Here


        final LuaString rawMessage;

        Message(LuaValue data) {
            useDB  = data.get("useDB").optboolean(false);
            lang   = data.get("lang").optjstring("en");
            keys   = data.get("keys").opttable(new LuaTable());
            params = data.get("params").opttable(new LuaTable());
            rawMessage = data.get("rawMessage").checkstring();
        }
View Full Code Here

        return "mw.html";
    }

    @Override
    public LuaTable getInterface() {
        LuaTable iface = new LuaTable();
        return iface;

    }
View Full Code Here

        return "mw.title";
    }

    @Override
    public LuaTable getInterface() {
        LuaTable table = new LuaTable();
        table.set("newTitle", newTitle());
        table.set("makeTitle", makeTitle());
        table.set("getUrl", getUrl());
        table.set("getContent", getContent());
        table.set("fileExists", fileExists());
        table.set("protectionLevels", defaultFunction());
        return table;
    }
View Full Code Here

        };
    }

    @Override
    public LuaValue getSetupOptions() {
        LuaTable table = new LuaTable();
        table.set("thisTitle", title());
        table.set("NS_MEDIA", MEDIA_NAMESPACE_KEY.code);
        return table;
    }
View Full Code Here

            LuaValue.valueOf("fragment"),
            LuaValue.valueOf("interwiki"));
    }

    private LuaValue title(LuaValue ns, LuaValue title, LuaValue fragment, LuaValue interwiki) {
        LuaTable table = new LuaTable();
        table.set("isLocal", "");
        table.set("isRedirect", "");
        table.set("subjectNsText", "");
        table.set("interwiki", interwiki);
        table.set("namespace", LuaValue.valueOf(MAIN_NAMESPACE_KEY.code));
        table.set("nsText", "");
        table.set("text", "");
        table.set("id", title);
        table.set("fragment", fragment);
        table.set("contentModel", "");
        table.set("thePartialUrl", "");
        return table;
    }
View Full Code Here

        return "mw.ustring";
    }

    @Override
    public LuaTable getInterface() {
        return new LuaTable();
    }
View Full Code Here

        return new LuaTable();
    }

    @Override
    public LuaValue getSetupOptions() {
        LuaTable table = new LuaTable();
        // https://www.mediawiki.org/wiki/Manual:$wgMaxArticleSize
        // stringLengthLimit = $wgMaxArticleSize * 1024;
        table.set("stringLengthLimit"2048 * 1024);
        table.set("patternLengthLimit", 10000);
        return table;
    }
View Full Code Here

   
    final static String LUADIR = "lua";
   
    public static boolean init () {
    String script = LUADIR + "\\sv_init.lua";
        LuaValue _G = JsePlatform.standardGlobals();
        try {
            _G.get("dofile").call(LuaValue.valueOf(script));
           
        } catch (org.luaj.vm2.LuaError ex) {
            Main.ui.commitln("Error: " + ex.getMessage());
            Main.ui.commitln(sutil.ADVICE.REINSTALL.s());
            return true;
View Full Code Here

                }

                Vector<SpriteAnimationDirection> directions = new Vector<SpriteAnimationDirection>();

                // Traverse the directions table.
                LuaValue key = LuaValue.NIL;
                while (true) {

                    Varargs keyValue = directionsTable.next(key);
                    key = keyValue.arg1();
                    if (key.isnil()) {
                        break;
                    }
                    LuaValue directionTable = keyValue.arg(2);

                    int x = directionTable.get("x").checkint();
                    int y = directionTable.get("y").checkint();
                    int frameWidth = directionTable.get("frame_width").checkint();
                    int frameHeight = directionTable.get("frame_height").checkint();
                    int originX = directionTable.get("origin_x").optint(0);
                    int originY = directionTable.get("origin_y").optint(0);
                    int numFrames = directionTable.get("num_frames").optint(1);
                    int numColumns = directionTable.get("num_columns").optint(numFrames);

                    Rectangle firstFrameRectangle = new Rectangle(x, y, frameWidth, frameHeight);

                    try {
                      SpriteAnimationDirection direction =  new SpriteAnimationDirection(
View Full Code Here

TOP

Related Classes of org.luaj.vm2.LuaString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.