Exemple #1
0
        public override void Initialize()
        {
            World.Instance.ActiveMapRenderer.Visible = true;
            if (!Game.Components.Contains(World.Instance.ActiveMapRenderer))
            {
                Game.Components.Add(World.Instance.ActiveMapRenderer);
            }
            World.Instance.ActiveCharacterRenderer.Visible = true;

            DateTime usageTracking = DateTime.Now;

            clockTimer = new Timer(threadState =>
            {
                if ((DateTime.Now - usageTracking).TotalMinutes >= 1)
                {
                    World.Instance.MainPlayer.ActiveCharacter.Stats.SetUsage(World.Instance.MainPlayer.ActiveCharacter.Stats.usage + 1);
                    usageTracking = DateTime.Now;
                }

                string fmt = string.Format("{0,2:D2}:{1,2:D2}:{2,2:D2}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
                lock (clockLock) clockLabel.Text = fmt;

                if (statusStartTime.HasValue && (DateTime.Now - statusStartTime.Value).TotalMilliseconds > 3000)
                {
                    SetStatusLabel("");
                    m_statusRecentlySet = false;
                    statusStartTime     = null;
                }
            }, null, 0, 1000);

            //the draw orders are adjusted for child items in the constructor.
            //calling SetParent will break this.
            inventory = new EOInventory(pnlInventory, m_packetAPI);

            stats = new EOCharacterStats(pnlStats);
            stats.Initialize();

            for (int i = 0; i < mainBtn.Length; ++i)
            {
                int offset = i;                 //prevent access to modified closure warning
                mainBtn[i].OnMouseOver += (o, e) =>
                {
                    if (!m_statusRecentlySet)
                    {
                        SetStatusLabel(DATCONST2.STATUS_LABEL_TYPE_BUTTON, DATCONST2.STATUS_LABEL_HUD_BUTTON_HOVER_FIRST + offset);
                        m_statusRecentlySet = false;
                    }
                };
            }

            SessionStartTime = DateTime.Now;

            m_fnListener = new FunctionKeyListener();
            Game.Components.Add(m_fnListener);

            base.Initialize();
        }
Exemple #2
0
        public override void Initialize()
        {
            World.Instance.ActiveMapRenderer.Visible = true;
            if (!Game.Components.Contains(World.Instance.ActiveMapRenderer))
                Game.Components.Add(World.Instance.ActiveMapRenderer);
            World.Instance.ActiveCharacterRenderer.Visible = true;

            DateTime usageTracking = DateTime.Now;
            clockTimer = new Timer(threadState =>
            {
                if ((DateTime.Now - usageTracking).TotalMinutes >= 1)
                {
                    World.Instance.MainPlayer.ActiveCharacter.Stats.SetUsage(World.Instance.MainPlayer.ActiveCharacter.Stats.usage + 1);
                    usageTracking = DateTime.Now;
                }

                string fmt = string.Format("{0,2:D2}:{1,2:D2}:{2,2:D2}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
                lock(clockLock) clockLabel.Text = fmt;

                if (statusStartTime.HasValue && (DateTime.Now - statusStartTime.Value).TotalMilliseconds > 3000)
                {
                    SetStatusLabel("");
                    m_statusRecentlySet = false;
                    statusStartTime = null;
                }

            }, null, 0, 1000);

            //the draw orders are adjusted for child items in the constructor.
            //calling SetParent will break this.
            inventory = new EOInventory(pnlInventory, m_packetAPI);

            stats = new EOCharacterStats(pnlStats);
            stats.Initialize();

            for (int i = 0; i < mainBtn.Length; ++i)
            {
                int offset = i; //prevent access to modified closure warning
                mainBtn[i].OnMouseOver += (o, e) =>
                {
                    if (!m_statusRecentlySet)
                    {
                        SetStatusLabel(DATCONST2.STATUS_LABEL_TYPE_BUTTON, DATCONST2.STATUS_LABEL_HUD_BUTTON_HOVER_FIRST + offset);
                        m_statusRecentlySet = false;
                    }
                };
            }

            SessionStartTime = DateTime.Now;

            m_fnListener = new FunctionKeyListener();
            Game.Components.Add(m_fnListener);

            base.Initialize();
        }