示例#1
0
        public bool LoadWindow(string wndType, int x, int y, int width, int height, Color wndcolor, define_sprite_struct[] spritedefs)
        {
            CWindow aWindow = null;
            bool bRetVal = false;

            switch (wndType)
            {
                case "CPDAWindow":
                    aWindow = new CPDAWindow(x, y, width, height, wndcolor);
                    break;
                case "CTitleWindow":
                    aWindow = new CTitleWindow(x, y, width, height, wndcolor);
                    break;
                case "COptionsWindow":
                    aWindow = new COptionsWindow(x, y, width, height, wndcolor);
                    break;
                case "CmsgWindow":
                    aWindow = new CMsgWindow(x, y, width, height, wndcolor);
                    break;
                case "CstatusWindow":
                    aWindow = new CstatusWindow(x, y, width, height, wndcolor);
                    break;
                case "CStarportWindow":
                    aWindow = new CStarportWindow(x, y, width, height, wndcolor);
                    break;
                case "CScanWindow":
                    aWindow = new CScanWindow(x, y, width, height, wndcolor);
                    break;
                case "CAnalysisWindow":
                    aWindow = new CAnalysisWindow(x, y, width, height, wndcolor);
                    break;
                case "CMenuWindow":
                    aWindow = new CMenuWindow(x, y, width, height, wndcolor);
                    break;
            }

            if (spritedefs != null)
            {
                for (int i = 0; i < (spritedefs.GetUpperBound(0) + 1); i++)
                {
                    aWindow.LoadSprite(spritedefs[i].number, spritedefs[i].file, spritedefs[i].width,
                        spritedefs[i].height, spritedefs[i].Colorkey);
                }
            }

            if (aWindow != null)
            {
                AddWindow(aWindow);
                bRetVal = true;
            }

            return bRetVal;
        }
示例#2
0
        public bool LoadWindow(string wndType, int x, int y, int width, int height, Color wndcolor, define_sprite_struct[] spritedefs)
        {
            CWindow aWindow = null;
            bool    bRetVal = false;

            switch (wndType)
            {
            case "CPDAWindow":
                aWindow = new CPDAWindow(x, y, width, height, wndcolor);
                break;

            case "CTitleWindow":
                aWindow = new CTitleWindow(x, y, width, height, wndcolor);
                break;

            case "COptionsWindow":
                aWindow = new COptionsWindow(x, y, width, height, wndcolor);
                break;

            case "CmsgWindow":
                aWindow = new CMsgWindow(x, y, width, height, wndcolor);
                break;

            case "CstatusWindow":
                aWindow = new CstatusWindow(x, y, width, height, wndcolor);
                break;

            case "CStarportWindow":
                aWindow = new CStarportWindow(x, y, width, height, wndcolor);
                break;

            case "CScanWindow":
                aWindow = new CScanWindow(x, y, width, height, wndcolor);
                break;

            case "CAnalysisWindow":
                aWindow = new CAnalysisWindow(x, y, width, height, wndcolor);
                break;

            case "CMenuWindow":
                aWindow = new CMenuWindow(x, y, width, height, wndcolor);
                break;
            }

            if (spritedefs != null)
            {
                for (int i = 0; i < (spritedefs.GetUpperBound(0) + 1); i++)
                {
                    aWindow.LoadSprite(spritedefs[i].number, spritedefs[i].file, spritedefs[i].width,
                                       spritedefs[i].height, spritedefs[i].Colorkey);
                }
            }

            if (aWindow != null)
            {
                AddWindow(aWindow);
                bRetVal = true;
            }

            return(bRetVal);
        }