예제 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="M59ResourceManager">Will be used to resolve/load resources</param>
        /// <param name="ServerConnection">Reads incoming messages from this ServerConnection</param>
        public MessageEnrichment(ResourceManager M59ResourceManager, ServerConnection ServerConnection)
        {
            // init output queue
            OutputQueue = new LockingQueue<GameMessage>();

            // save references
            resourceManager = M59ResourceManager;
            serverConnection = ServerConnection;
            
            // mark running
            IsRunning = true;

            // start own workthread
            workThread = new Thread(ThreadProc);
            workThread.IsBackground = true;
            workThread.Start();
        }
예제 #2
0
        private void btnGO_Click(object sender, EventArgs e)
        {
            // check
            if (!File.Exists(txtRoomFile.Text) ||
                !Directory.Exists(txtBGFFolder.Text) ||
                !Directory.Exists(txtOutputFolder.Text))
                return;

            // init a resourcemanager with room bgfs only
            ResourceManager resMan = new ResourceManager();
            resMan.InitConfig(new ResourceManagerConfig(
                0, false, false, false, false,
                null, null, null, txtBGFFolder.Text, null, null));

            // load room and resolve resources
            RooFile rooFile = new RooFile(txtRoomFile.Text);
            rooFile.ResolveResources(resMan);

            // make output subfolder
            string subfolder = Path.Combine(txtOutputFolder.Text, rooFile.Filename);
            if (!Directory.Exists(subfolder))
                Directory.CreateDirectory(subfolder);
                
            // extract textures
            Bitmap bmp;
            string filename;
            foreach (RooFile.TextureInfo texInfo in rooFile.Textures)
            {
                filename = Path.Combine(
                    subfolder, 
                    texInfo.Container.Filename + "-" + texInfo.Container.Frames.IndexOf(texInfo.Texture) + ".png");
                
                bmp = texInfo.Texture.GetBitmap();
                bmp.MakeTransparent(System.Drawing.Color.Cyan);
                bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
                
                bmp.Dispose();
                bmp = null;
            }
        }
예제 #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            PalettesGDI.Initialize();

            // init resources
            ResourceManager = new ResourceManager();
            ResourceManager.Init(
                "",
                "",
                "",
                Properties.Settings.Default.PathTextures,
                "",
                "",
                "");

            // create ui
            MainForm = new MainForm();

            // run
            Application.Run(MainForm);
        }
        public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
        {
            if (OverlayFile != String.Empty)
            {
                if (RaiseChangedEvent)
                {
                    Resource = M59ResourceManager.GetObject(OverlayFile);

                    if (resource != null)
                        animation.GroupMax = resource.FrameSets.Count;
                }
                else
                {
                    resource = M59ResourceManager.GetObject(OverlayFile);

                    if (resource != null)
                        animation.GroupMax = resource.FrameSets.Count;
                }
            }
        }
예제 #5
0
        public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
        {
            if (OverlayFile != String.Empty)
            {
                if (RaiseChangedEvent)
                {
                    Resource = M59ResourceManager.GetObject(OverlayFile);

                    if (resource != null)
                    {
                        animation.GroupMax = resource.FrameSets.Count;
                        motionAnimation.GroupMax = resource.FrameSets.Count;
                    }
                }
                else
                {
                    resource = M59ResourceManager.GetObject(OverlayFile);

                    if (resource != null)
                    {
                        animation.GroupMax = resource.FrameSets.Count;
                        motionAnimation.GroupMax = resource.FrameSets.Count;
                    }
                }
            }

            foreach (SubOverlay obj in subOverlays)
                obj.ResolveResources(M59ResourceManager, false);

            foreach (SubOverlay obj in motionSubOverlays)
                obj.ResolveResources(M59ResourceManager, false);  
        }
 public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
 {
     if (ResourceName != String.Empty)
     {
         if (RaiseChangedEvent)
         {
             Resource = M59ResourceManager.GetWavFile(ResourceName);
         }
         else
         {
             resource = M59ResourceManager.GetWavFile(ResourceName);
         }
     }
 }
예제 #7
0
 public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
 {          
     if (RaiseChangedEvent)
     {
         Resource = M59ResourceManager.GetRoomTexture(textureNum);
     }
     else
     {
         resource = M59ResourceManager.GetRoomTexture(textureNum);
     }            
 }
예제 #8
0
        public virtual void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
        {
            if (OverlayFile != String.Empty)
            {
                if (RaiseChangedEvent)
                {
                    Resource = M59ResourceManager.GetObject(OverlayFile);
                }
                else
                {
                    resource = M59ResourceManager.GetObject(OverlayFile);
                }

                if (resource != null)                
                    animation.GroupMax = resource.FrameSets.Count;
            }

            foreach (SubOverlay obj in subOverlays)
                obj.ResolveResources(M59ResourceManager, false);

            // appearance update
            ProcessAppearance(true);
        }