Exemplo n.º 1
0
 public UserSettings(LiveSplitState state, LogManager log)
 {
     InitializeComponent();
     Settings = new SplitterSettings();
     State    = state;
     Log      = log;
     Dock     = DockStyle.Fill;
 }
Exemplo n.º 2
0
 private string GetCurrentSplit(LogicManager logic, SplitterSettings settings)
 {
     if (logic.CurrentSplit >= settings.Autosplits.Count)
     {
         return("N/A");
     }
     return(settings.Autosplits[logic.CurrentSplit].ToString());
 }
Exemplo n.º 3
0
        public void Update(LogicManager logic, SplitterSettings settings)
        {
            if (!EnableLogging)
            {
                return;
            }

            lock (currentValues) {
                DateTime date      = DateTime.Now;
                bool     updateLog = true;

                foreach (LogObject key in Enum.GetValues(typeof(LogObject)))
                {
                    string previous = currentValues[key];
                    string current  = null;

                    switch (key)
                    {
                    case LogObject.CurrentSplit: current = $"{logic.CurrentSplit} ({GetCurrentSplit(logic, settings)})"; break;

                    case LogObject.Pointers: current = logic.Memory.GamePointers(); break;

                    case LogObject.Version: current = MemoryManager.Version.ToString(); break;

                    case LogObject.Loading: current = logic.Memory.IsLoading().ToString(); break;

                    case LogObject.IsValid: current = updateLog ? logic.Memory.IsValid().ToString() : previous; break;

                    case LogObject.Disc: current = updateLog ? logic.Memory.Disc().ToString() : previous; break;

                    case LogObject.Level: current = updateLog ? logic.Memory.Level().ToString() : previous; break;

                    case LogObject.FloorNumber: current = updateLog ? logic.Memory.FloorNumber().ToString() : previous; break;

                    case LogObject.Kills: current = updateLog ? logic.Memory.Kills().ToString() : previous; break;

                    case LogObject.Health: current = updateLog ? logic.Memory.Health().ToString() : previous; break;

                    case LogObject.Paused: current = updateLog ? logic.Memory.Paused().ToString() : previous; break;

                    case LogObject.Dead: current = updateLog ? logic.Memory.Dead().ToString() : previous; break;

                    case LogObject.Uncaged: current = updateLog ? logic.Memory.Uncaged().ToString() : previous; break;

                    case LogObject.DiscComplete: current = updateLog ? logic.Memory.DiscComplete().ToString() : previous; break;

                    case LogObject.NewGame: current = updateLog ? (logic.Memory.PlayerPosition() == Vector2.ZERO).ToString() : previous; break;
                    }

                    if (previous != current)
                    {
                        AddEntryUnlocked(new ValueLogEntry(date, key, previous, current));
                        currentValues[key] = current;
                    }
                }
            }
        }
Exemplo n.º 4
0
 public LogicManager(SplitterSettings settings)
 {
     Memory    = new MemoryManager();
     Settings  = settings;
     splitLate = DateTime.MaxValue;
 }