コード例 #1
0
        public override void Load()
        {
            base.Load();

            // setting general plugin globals
            m_statTracker = m_core.GetStatTracker();
            m_guinan = m_core.GetGuinan();
            m_d3d = m_core.GetD3D();
            m_componentManager = GlobalVariables.componentManager;
            m_mainForm = m_core.GetMainForm();
            m_tray = m_core.GetTrayIcon();

            // specific globals
            m_directoryLocation = "CustomAchievements";

            List<ImageFile> ImageFileList = FindImageFilenames();
            SetAchievementImages(ImageFileList);
        }
コード例 #2
0
        // Plugin Override Methods
        public override void Load()
        {
            base.Load();
            try
            {
                m_statTracker = m_core.GetStatTracker();
                m_d3d = m_core.GetD3D();
                m_guinan = m_core.GetGuinan();

                m_achievementComponent = (AchievementComponents)GlobalVariables.componentManager.GetComponent(new Guid("37ea2da1-63d7-4526-844c-9c4d0eda22b9"));

                //Setup the appServer
                if (!m_appServer.Setup(2100)) //Setup with listening port
                {
                    m_core.GetTrayIcon().DisplayToolTip("ERROR", "Error While Loading WS Server");
                    return;
                }

                m_appServer.NewMessageReceived += (appServer_NewMessageReceived);
                m_appServer.NewSessionConnected += m_appServer_NewSessionConnected;
                m_appServer.SessionClosed += m_appServer_SessionClosed;
                //Try to start the appServer
                if (!m_appServer.Start())
                {
                    m_core.GetTrayIcon().DisplayToolTip("ERROR", "Error While Starting WS Server");
                    return;
                }
                m_statTracker.GetEventLog().ListChanged += EventLogChanged;
            }
            catch(Exception e)
            {
                m_core.GetTrayIcon().DisplayToolTip("ERROR WHILE LOADING: ",e.Message);
            }
        }