Exemplo n.º 1
0
 public override void OnReleased()
 {
     refreshtimer.Stop();
     m_initialized = false;
     StatusWindowInterface.destroy();
     base.OnReleased();
 }
Exemplo n.º 2
0
 public override void OnReleased()
 {
     if (ThreadingCSLStatsMod.instance != null)
     {
         ThreadingCSLStatsMod.instance.refreshtimer.Stop();
     }
     StatusWindowInterface.destroy();
     base.OnReleased();
 }
Exemplo n.º 3
0
        public bool init()
        {
            if (m_initialized == true)
            {
                return(true);
            }
            StatusWindowInterface.init();
            m_initialized = true;
            settimer();
            loadConfigFile();



            return(true);
        }
Exemplo n.º 4
0
        //handles loading the threading mod
        //seems to avoid the "load game" problem while in-game
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);

            if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame)
            {
                return;
            }
            StatusWindowInterface.destroy();
            if (ThreadingCSLStatsMod.instance != null)
            {
                ThreadingCSLStatsMod.instance.refreshtimer.Stop();
                ThreadingCSLStatsMod.instance.m_initialized = false;
            }
        }
Exemplo n.º 5
0
        //called about ~60 times per second. (or max frame rate user is getting atm imagine)
        public override void OnUpdate(float realTimeDelta, float simulationTimeDelta)
        {
            if (!m_initialized)
            {
                init();
            }
            numberofcalls++;
            m_realTimeDelta += realTimeDelta;
            framespersecond  = numberofcalls / m_realTimeDelta;

            int myrefreshrate = CSLStatsPanelConfigSettings.PanelRefreshRate,
                myminframes   = minimumFramesBetweenCalls;

            if (CSLStatsPanelConfigSettings.m_ConfigChanged.value)
            {
                StatusWindowInterface.cacheddata = null;
                CSLStatsPanelConfigSettings.m_ConfigChanged.value = false;
                loadConfigFile();
                StatusWindowInterface.resetstatswindow();
                StatusWindowInterface.doReset = true;
                myrefreshrate = 0; myminframes = 2;
            }
            //if (StatusWindowInterface.configChanged) myrefreshrate = 1; // temporarily change update rate to 1sec after config change
            //if (StatusWindowInterface.doReset) myrefreshrate = 1;
            if (StatusWindowInterface.running)
            {
                return;
            }

            if (m_realTimeDelta < myrefreshrate || numberofcalls < myminframes)
            {
                return;
            }
            numberofcalls   = 0;
            m_realTimeDelta = 0.0f;
            try
            {
                StatusWindowInterface.updateText();
            }
            catch (Exception ex) { statlog.log("statuswindowinterface.updatetext: " + ex.Message); }
        }