Beispiel #1
0
 public void Dispose()
 {
     o.Remove2D(container);
     o.Dispose();
     container.Dispose();
     textElements.Clear();
 }
        public void ClearGUI()
        {
            closing = true;

            if (hudOverlay != null)
            {
                hudOverlay.Hide();
                hudOverlay.Dispose();
            }
            if (!EngineConfig.DisplayMinimap)
            {
                return;
            }

            try
            {
                ammoContainer.Hide();
                livesContainer.Hide();
                scoreContainer.Hide();
                hiscoreContainer.Hide();
                infoContainer.Hide();

                OverlayManager.Singleton.DestroyOverlayElement(ammoElement);
                OverlayManager.Singleton.DestroyOverlayElement(livesElement);
                OverlayManager.Singleton.DestroyOverlayElement(scoreElement);
                OverlayManager.Singleton.DestroyOverlayElement(hiscoreElement);
                OverlayManager.Singleton.DestroyOverlayElement(infoElement);

                ammoContainer.Dispose();
                livesContainer.Dispose();
                hiscoreContainer.Dispose();
                scoreContainer.Dispose();
                infoContainer.Dispose();


                // sceneMgr.DestroyAllEntities();

                hudNode.Dispose();
                hudNode = null;
                fuelArrowNode.Dispose();
                fuelArrowNode = null;
                oilArrowNode.Dispose();
                oilArrowNode = null;

                /*
                 * ammoElement.Hide();
                 * ammoElement.Dispose();
                 * livesElement.Hide();
                 * livesElement.Dispose();
                 * scoreElement.Hide();
                 * scoreElement.Dispose();
                 * hiscoreElement.Hide();
                 * hiscoreElement.Dispose();*/
            }
            catch (Exception ex)
            {
                LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Exception while cleaning up indicator control (" + ex.Message + ") " + ex.StackTrace);
            }
        }
Beispiel #3
0
        private void DisposeFullfilledImageContainer()
        {
            if (imageContainerFulfilled != null)
            {
                imageContainerFulfilled.Hide();
                achievementsWindow.mI.Remove(imageContainerFulfilled);
                achievementsWindow.mO.RemoveChild(imageContainerFulfilled.Name);
                OverlayManager.Singleton.DestroyOverlayElement(imageContainerFulfilled);

                imageContainerFulfilled.Dispose();
                imageContainerFulfilled = null;
            }
        }
Beispiel #4
0
        private void DisposeTextContainer()
        {
            if (textContainer != null)
            {
                textContainer.Hide();
                achievementsWindow.mO.RemoveChild(textContainer.Name);
                OverlayManager.Singleton.DestroyOverlayElement(textContainer);


                textContainer.Dispose();
                textContainer = null;
            }
        }
Beispiel #5
0
        public void killWindow()
        {
            for (int i = 0; i < mB.Count; i++)
            {
                mB[i].killButton();
            }
            for (int i = 0; i < mT.Count; i++)
            {
                mT[i].killTextInput();
            }

            try
            {
                for (int i = 0; i < mI.Count; i++)
                {
                    //foreach (OverlayContainer container in mI[i].GetChildContainerIterator())
                    // foreach (OverlayElement element in container.GetChildIterator())
                    //     OverlayManager.Singleton.DestroyOverlayElement(element);

                    OverlayManager.Singleton.DestroyOverlayElement(mI[i]);
                }

                /*foreach (OverlayElement element in mO.GetChildIterator())
                 * {
                 *   OverlayManager.Singleton.DestroyOverlayElement(element);
                 * }*/

                foreach (OverlayContainer container in mO.GetChildContainerIterator())
                {
                    foreach (OverlayElement element in container.GetChildIterator())
                    {
                        OverlayManager.Singleton.DestroyOverlayElement(element);
                    }
                }

                mO.Hide();
                mO.Dispose();
                mO = null;
            }
            catch (Exception ex)
            {
                LogManager.Singleton.LogMessage("Error while disposing GUI: " + ex.Message + ". Stack: " + ex.StackTrace);
            }
        }
Beispiel #6
0
        public void DestroyMessageContainer()
        {
            try
            {
                MaterialPtr mat = MaterialManager.Singleton.GetByName("MessageBarIcon");
                mat.GetBestTechnique().GetPass(0).GetTextureUnitState(0).SetTextureName("radio.png");
            }
            catch (Exception)
            {
            }

            if (messageOverlay != null)
            {
                messageOverlay.Hide();
                messageOverlay.Dispose();
                messageOverlay = null;
            }

            if (backgroundElement != null)
            {
                backgroundElement.Hide();
                backgroundElement.Dispose();
                backgroundElement = null;
            }

            messageContainer.Hide();

            OverlayManager.Singleton.DestroyOverlayElement(messageElement);
            messageElement = null;
            messageContainer.Dispose();
            messageContainer = null;

            if (iconOverlay != null)
            {
                iconElement.Hide();
                iconElement.Dispose();
                iconElement = null;
                iconOverlay.Hide();
                iconOverlay.Dispose();
                iconOverlay = null;
            }
        }