public ResetOrNotComponent(LiveSplitState state)
        {
            State                    = state;
            InternalComponent        = new InfoTextComponent("Reset Or Not", "Reset");
            Settings                 = new ResetOrNotSettings();
            Settings.SettingChanged += OnSettingChanged;
            category                 = State.Run.GameName + State.Run.CategoryName;

            resetOrNotCalculator = new ResetOrNotCalculator(State, Settings);

            state.OnSplit             += OnSplit;
            state.OnReset             += OnReset;
            state.OnSkipSplit         += OnSkipSplit;
            state.OnUndoSplit         += OnUndoSplit;
            state.OnStart             += OnStart;
            state.RunManuallyModified += OnRunManuallyModified;

            // Update the "should reset" text every 100 ms (as it's a cheap operation)
            System.Timers.Timer timer = new System.Timers.Timer();
            timer.Interval = 100;
            timer.Elapsed += (sender, e) =>
            {
                UpdateShouldResetText();
            };
            timer.Start();
        }
Example #2
0
 public ResetOrNotCalculator(LiveSplitState state, ResetOrNotSettings settings)
 {
     this.state    = state;
     this.settings = settings;
     #if DEBUG
     AllocConsole();
     #endif
 }