コード例 #1
0
    public static int _bind_getFullName(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 1 ||
            Luna.get_uniqueid(L, 1) != 8952431)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:getFullName(LWF.Button self)");
        }

        LWF.Button self = Luna_LWF_Button.check(L, 1);
        try {
            string ret = self.GetFullName();
            Lua.lua_pushstring(L, ret);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(1);
    }
コード例 #2
0
        public ButtonEventHandlers GetButtonEventHandlers(Button b)
        {
            if (m_buttonEventHandlersByFullName != null)
            {
                string fullName = b.GetFullName();
                if (fullName != null)
                {
                    ButtonEventHandlers handlers;
                    if (m_buttonEventHandlersByFullName.TryGetValue(
                            fullName, out handlers))
                    {
                        return(handlers);
                    }
                }
            }

            int instId = b.instanceId;

            if (instId < 0 || instId >= m_instances.Length)
            {
                return(null);
            }
            return(m_buttonEventHandlers[instId]);
        }
コード例 #3
0
ファイル: LWFObjectInspector.cs プロジェクト: yongma/lwf-demo
    void DrawInspector(ObjectContainer container)
    {
        EditorGUI.indentLevel = container.hierarchy + 1;

        LWF.Object obj = container.obj;
        LWF.LWF    lwf = obj.lwf;
        if (obj.type == Type.MOVIE)
        {
            LWF.Movie movie = (LWF.Movie)obj;

            string movieName = "Movie: " +
                               (movie.name == null ? "(null)" : movie.name);
            if (!visibilities.ContainsKey(movie))
            {
                visibilities[movie] = true;
            }
            visibilities[movie] =
                EditorGUILayout.Foldout(visibilities[movie], movieName);

            if (!visibilities[movie])
            {
                return;
            }

            EditorGUI.indentLevel = container.hierarchy + 2;
            string fullName = movie.GetFullName();
            if (fullName == null)
            {
                fullName = "(null)";
            }
            EditorGUILayout.LabelField("Fullname:", fullName);
            EditorGUILayout.LabelField("Visible:", movie.visible.ToString());
            EditorGUILayout.LabelField("Playing:", movie.playing.ToString());
            EditorGUILayout.LabelField("Frame:", movie.currentFrame.ToString());
            DrawInfo(container, movie);

            // TODO
            EditorGUILayout.Space();

            foreach (KeyValuePair <int, ObjectContainer>
                     kvp in container.objects)
            {
                DrawInspector(kvp.Value);
            }
        }
        else
        {
            EditorGUILayout.LabelField("Depth:", container.depth.ToString());
            EditorGUI.indentLevel = container.hierarchy + 2;

            switch (obj.type)
            {
            case Type.BUTTON:
                LWF.Button button     = (LWF.Button)obj;
                string     buttonName =
                    (button.name == null ? "(null)" : button.name);
                string buttonFullName = button.GetFullName();
                if (buttonFullName == null)
                {
                    buttonFullName = "(null)";
                }
                EditorGUILayout.LabelField("Button:", buttonName);

                EditorGUI.indentLevel = container.hierarchy + 3;
                EditorGUILayout.LabelField("Fullname:", buttonFullName);
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.GRAPHIC:
                EditorGUILayout.LabelField("Graphic:", "");
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.BITMAP:
                LWF.Bitmap bitmap      = (LWF.Bitmap)obj;
                int        tFId        = lwf.data.bitmaps[bitmap.objectId].textureFragmentId;
                string     textureName = (tFId == -1 ? "(null)" :
                                          lwf.data.textureFragments[tFId].filename);
                EditorGUILayout.LabelField("Bitmap:", textureName);
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.BITMAPEX:
                LWF.BitmapEx bitmapEx = (LWF.BitmapEx)obj;
                int          tFIdEx   =
                    lwf.data.bitmapExs[bitmapEx.objectId].textureFragmentId;
                string textureNameEx = (tFIdEx == -1 ? "(null)" :
                                        lwf.data.textureFragments[tFIdEx].filename);
                EditorGUILayout.LabelField("BitmapEx:", textureNameEx);
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.TEXT:
                LWF.Text text     = (LWF.Text)obj;
                string   textName = lwf.data.strings[
                    lwf.data.texts[text.objectId].nameStringId];
                EditorGUILayout.LabelField("Text:", textName);
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.PARTICLE:
                EditorGUILayout.LabelField("Particle:", "");
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;

            case Type.PROGRAMOBJECT:
                LWF.ProgramObject pObject     = (LWF.ProgramObject)obj;
                string            pObjectName = lwf.data.strings[
                    lwf.data.programObjects[pObject.objectId].stringId];
                EditorGUILayout.LabelField("ProgramObject:", pObjectName);
                EditorGUI.indentLevel = container.hierarchy + 3;
                DrawInfo(container, obj);
                // TODO
                break;
            }
        }
    }
コード例 #4
0
ファイル: lwf_core.cs プロジェクト: 99corps/lwf
        public ButtonEventHandlers GetButtonEventHandlers(Button b)
        {
            if (m_buttonEventHandlersByFullName != null) {
            string fullName = b.GetFullName();
            if (fullName != null) {
                ButtonEventHandlers handlers;
                if (m_buttonEventHandlersByFullName.TryGetValue(
                        fullName, out handlers)) {
                    return handlers;
                }
            }
            }

            int instId = b.instanceId;
            if (instId < 0 || instId >= m_instances.Length)
            return null;
            return m_buttonEventHandlers[instId];
        }