コード例 #1
0
        void NewUIEvent(UIEvent u)
        {
            Debug.Assert(System.Windows.Forms.Application.MessageLoop);
            //System.Diagnostics.Debug.WriteLine("Dispatch from controller UI event " + u.EventTypeStr);

            OnNewUIEvent?.Invoke(u);
        }
コード例 #2
0
        void ActionEntry(JournalEntry je) // issue the JE to the system
        {
            if (je.IsUIEvent)             // give windows time to set up for OnNewEvent, and tell them if its coming via showuievents
            {
                if (je is EliteDangerousCore.JournalEvents.JournalMusic)
                {
                    //System.Diagnostics.Debug.WriteLine("Dispatch from controller Journal UI event ");
                    OnNewUIEvent?.Invoke(new EliteDangerousCore.UIEvents.UIJournalMusic((je as EliteDangerousCore.JournalEvents.JournalMusic).MusicTrack, EDDConfig.Instance.ShowUIEvents, DateTime.UtcNow, false));
                }
            }

            OnNewJournalEntry?.Invoke(je);          // Always call this on all entries...

            // filter out commanders, and filter out any UI events
            if (je.CommanderId == history.CommanderId && (!je.IsUIEvent || EDDConfig.Instance.ShowUIEvents))
            {
                HistoryEntry he = history.AddJournalEntry(je, h => LogLineHighlight(h)); // add a new one on top
                //System.Diagnostics.Debug.WriteLine("Add HE " + he.EventSummary);
                OnNewEntry?.Invoke(he, history);                                         // major hook
                OnNewEntrySecond?.Invoke(he, history);                                   // secondary hook..
            }

            if (je.EventTypeID == JournalTypeEnum.LoadGame) // and issue this on Load game
            {
                OnRefreshCommanders?.Invoke();
            }
        }
コード例 #3
0
        // New UI event. SR will be null if programatically made

        void NewUIEventFromScanner(UIEvent u, StatusReader sr)                  // UI thread new event
        {
            Debug.Assert(System.Windows.Forms.Application.MessageLoop);
            //System.Diagnostics.Debug.WriteLine("Dispatch from controller UI event " + u.EventTypeStr);

            BaseUtils.AppTicks.TickCountLapDelta("CTUI", true);

            var uifuel = u as EliteDangerousCore.UIEvents.UIFuel;       // UI Fuel has information on fuel level - update it.

            if (uifuel != null && history != null)
            {
                history.ShipInformationList.UIFuel(uifuel);                                          // update the SI global value
                if (history.ShipInformationList.CurrentShip != null)                                 // just to be paranoid
                {
                    history.GetLast?.UpdateShipInformation(history.ShipInformationList.CurrentShip); // and make the last entry have this updated info.
                }
            }

            OnNewUIEvent?.Invoke(u);

            var t = BaseUtils.AppTicks.TickCountLapDelta("CTUI");

            if (t.Item2 > 25)
            {
                System.Diagnostics.Debug.WriteLine(t.Item1 + " Controller UI !!!");
            }
        }
コード例 #4
0
        public void NewEntry(JournalEntry je)          // hooked into journal monitor and receives new entries.. Also call if you programatically add an entry
        {
            if (je.CommanderId == history.CommanderId) // we are only interested at this point accepting ones for the display commander
            {
                bool uievent = je.IsUIEvent;

                if (!je.IsUIEvent || EDDConfig.Instance.ShowUIEvents)              // filter out any UI events
                {
                    foreach (HistoryEntry he in history.AddJournalEntry(je, h => LogLineHighlight(h)))
                    {
                        OnNewEntry?.Invoke(he, history);            // major hook
                        OnNewEntrySecond?.Invoke(he, history);      // secondary hook..
                    }
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("**** Filter out " + je.EventTypeStr);
                }

                if (uievent)
                {
                    if (je is EliteDangerousCore.JournalEvents.JournalMusic)
                    {
                        OnNewUIEvent?.Invoke((je as EliteDangerousCore.JournalEvents.JournalMusic).MusicTrack);
                    }
                }
            }

            OnNewJournalEntry?.Invoke(je);

            if (je.EventTypeID == JournalTypeEnum.LoadGame)
            {
                OnRefreshCommanders?.Invoke();
            }
        }
コード例 #5
0
        void NewUIEvent(UIEvent u)
        {
            Debug.Assert(System.Windows.Forms.Application.MessageLoop);
            //System.Diagnostics.Debug.WriteLine("Dispatch from controller UI event " + u.EventTypeStr);

            var uifuel = u as EliteDangerousCore.UIEvents.UIFuel;       // UI Fuel has information on fuel level - update it.

            if (uifuel != null && history != null)
            {
                history.shipinformationlist.UIFuel(uifuel);                                      // update the SI global value
                history.GetLast?.UpdateShipInformation(history.shipinformationlist.CurrentShip); // and make the last entry have this updated info.
            }

            OnNewUIEvent?.Invoke(u);
        }