Example #1
0
 public Component(LiveSplitState state)
 {
     Settings = new ComponentSettings(state);
     Model    = new PreciseSplitTimerModel {
         CurrentState = state
     };
 }
        private void Init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _usb2snes     = usb2snesw;
            _mystate      = MyState.NONE;
            _proto_state  = ProtocolState.NONE;
            _stateChanged = false;

            _state    = state;
            _settings = new ComponentSettings();
            _model    = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;
            _fs_watcher           = new FileSystemWatcher();
            _fs_watcher.Changed  += async(sender, args) => {
                await Task.Delay(200);

                _do_reload = true;
            };
            _splits  = new List <Split>();
            _inTimer = false;

            HorizontalWidth = 3;
            VerticalHeight  = 3;
        }
        public USB2SNESComponent(LiveSplitState state)
        {
            _state    = state;
            _settings = new ComponentSettings();
            _model    = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);

            _splits  = null;
            _inTimer = false;
            _error   = false;

            _update_timer = new Timer()
            {
                Interval = 33
            };
            _update_timer.Tick   += (sender, args) => UpdateSplits();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            _usb2snes       = new USB2SnesW.USB2SnesW();
        }
Example #4
0
        public ASLComponent(LiveSplitState state)
        {
            _state = state;

            _settings = new ComponentSettings();

            _fs_watcher = new FileSystemWatcher();

            async void handler <T>(object sender, T args)
            {
                await Task.Delay(200);

                _do_reload = true;
            };

            _fs_watcher.Changed += handler;
            _fs_watcher.Renamed += handler;

            // -try- to run a little faster than 60hz
            // note: Timer isn't very reliable and quite often takes ~30ms
            // we need to switch to threading
            _update_timer = new Timer()
            {
                Interval = 15
            };
            _update_timer.Tick   += (sender, args) => UpdateScript();
            _update_timer.Enabled = true;
        }
 public Component(String scriptPath)
 {
     Settings = new ComponentSettings()
     {
         ScriptPath = scriptPath
     };
 }
Example #6
0
        private void init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _state           = state;
            _config_state    = ConfigState.NONE;
            _proto_state     = ProtocolState.NONE;
            _ready_timer     = new Stopwatch();
            _attached_device = string.Empty;
            _settings        = new ComponentSettings(_state)
            {
                Dock = DockStyle.Fill,
            };
            _model = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _stateChanged = false;
            _splits       = new List <string>();
            _inTimer      = false;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            HorizontalWidth = 3;
            VerticalHeight  = 3;
            _usb2snes       = usb2snesw;
        }
 public Component(String scriptPath)
 {
     Settings = new ComponentSettings()
     {
         ScriptPath = scriptPath
     };
 }
        private void init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _state       = state;
            _mystate     = MyState.NONE;
            _proto_state = ProtocolState.NONE;
            _settings    = new ComponentSettings();
            _model       = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _stateChanged   = false;
            _splits         = null;
            _inTimer        = false;
            _config_checked = false;
            _valid_config   = false;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            HorizontalWidth = 3;
            VerticalHeight  = 3;
            _usb2snes       = usb2snesw;
        }
 public Component(LiveSplitState state, string scriptPath)
     : this(state)
 {
     Settings = new ComponentSettings()
     {
         ScriptPath = scriptPath
     };
 }
 public Component(LiveSplitState state)
 {
     Settings = new ComponentSettings();
     FSWatcher = new FileSystemWatcher();
     FSWatcher.Changed += (sender, args) => DoReload = true;
     UpdateTimer = new Timer() { Interval = 15 }; // run a little faster than 60hz
     UpdateTimer.Tick += (sender, args) => UpdateScript(state);
     UpdateTimer.Enabled = true;
 }
        // Constructor
        public Component()
        {
            //Settings = new ComponentSettings();

            //ContextMenuControls = new Dictionary<String, Action>();

            fullpath = Environment.GetEnvironmentVariable("USERPROFILE") + "/Documents/My Games/Binding of Isaac Rebirth/log.txt";

            byteNum = (new FileInfo(fullpath)).Length;

            settings = new ComponentSettings();

            //System.Windows.Forms.MessageBox.Show(byteNum.ToString());
        }
        public Component(LiveSplitState state)
        {
            _state = state;

            _settings = new ComponentSettings();

            _fs_watcher = new FileSystemWatcher();
            _fs_watcher.Changed += (sender, args) => _do_reload = true;

            // -try- to run a little faster than 60hz
            // note: Timer isn't very reliable and quite often takes ~30ms
            // we need to switch to threading
            _update_timer = new Timer() { Interval = 15 };
            _update_timer.Tick += (sender, args) => UpdateScript();
            _update_timer.Enabled = true;
        }
Example #13
0
 public ASLComponent(LiveSplitState state, string script_path)
     : this(state)
 {
     _settings = new ComponentSettings(script_path);
 }
 public Component()
 {
     Settings = new ComponentSettings();
     FSWatcher = new FileSystemWatcher();
     FSWatcher.Changed += (sender, args) => DoReload = true;
 }
 public Component()
 {
     Settings = new ComponentSettings();
 }
Example #16
0
        public Component()
        {
            Settings = new ComponentSettings();

            //ContextMenuControls = new Dictionary<String, Action>();
        }
Example #17
0
 public Component()
 {
     settings = new ComponentSettings();
     JazzLoadRemover.JazzpunkFinder.InstallAssembly();
 }