public void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode) { State = state; if (bSettingsShouldInit) { SettingsInit(); } if (Settings.bStatusIconsEnabled) { if (Settings.IconFrameSize != VerticalHeight || Settings.IconFrameSize != HorizontalWidth) { VerticalHeight = Settings.IconFrameSize; HorizontalWidth = Settings.IconFrameSize; } StatusIcons.Update(); Cache.Restart(); Cache["IconFrameSize"] = Settings.IconFrameSize; Cache["IconPadding"] = Settings.IconPadding; Cache["IconMargin"] = Settings.IconMargin; Cache["ConnectionIconColor"] = Settings.ConnectionIconColor; Cache["IncomingDataIconColor"] = Settings.IncomingDataIconColor; Cache["OutgoingDataIconColor"] = Settings.OutgoingDataIconColor; Cache["WarningIconColor"] = Settings.WarningIconColor; Cache["ErrorIconColor"] = Settings.ErrorIconColor; Cache["InactiveIconColor"] = Settings.InactiveIconColor; } /* * if( invalidator != null && ( Cache.HasChanged || Settings.bStatusIconsEnabled && StatusIcons.CacheHasChanged() ) ) * { * invalidator.Invalidate(0, 0, width, height); * } */ if (invalidator != null) { if (Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } else if (Settings.bStatusIconsEnabled) { if (StatusIcons.CacheHasChanged()) { invalidator.Invalidate(0, 0, width, height); } } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { List <Area> areas = memory.GetMapCompletion(); decimal total = 0; Area currentArea = default(Area); for (int i = 0; i < areas.Count; i++) { Area area = areas[i]; total += area.Progress; if (area.Current) { currentArea = area; } } if (areas.Count > 0) { total /= areas.Count; } textInfo.InformationName = "Total Map: " + total.ToString("0.00") + "%"; textInfo.InformationValue = currentArea.Name + " - " + currentArea.Progress.ToString("0.00") + "%"; textInfo.LongestString = "Valley Of The Wind - 100.00%"; textInfo.Update(invalidator, state, width, height, mode); if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { HeaderText = PusherClient.InfoText; if (Settings.RaceActive) { HeaderText = Settings.RaceName; } else { HeaderText = "No Active Race"; } RaceMode = Settings.RaceMode; PlayerCount = Settings.PlayerCount; invalidator.Invalidate(0, 0, width, height); //InternalComponent.Update(invalidator, state, width, height, mode); if (state.Run.HasChanged) { Settings.CurrentSplits.Clear(); foreach (Segment s in state.Run) { Settings.CurrentSplits.Add(s.Name); } } }
public void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode) { try { if (Settings.Hook != null) { Settings.Hook.Poll(); } } catch { } this.state = state; CounterNameLabel.Text = Settings.CounterText; CounterValueLabel.Text = Counter.Count.ToString(); Cache.Restart(); Cache["CounterNameLabel"] = CounterNameLabel.Text; Cache["CounterValueLabel"] = CounterValueLabel.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode) { int completedExitCount = 0; if (Settings.AutoTotalCount) { completedExitCount = Math.Max(completedExitCount, state.CurrentSplitIndex); ExitCounterLabel.Text = Settings.ExitCounterText + " " + completedExitCount.ToString() + "/" + state.Run.Count; } else { try { completedExitCount = int.Parse(state.CurrentSplit.Name) - 1; } catch { try { completedExitCount = Math.Max(completedExitCount, state.CurrentSplitIndex); } catch { } } ExitCounterLabel.Text = Settings.ExitCounterText + " " + completedExitCount.ToString() + "/" + Settings.TotalExitCount.ToString(); } Cache.Restart(); Cache["ExitCounterLabel"] = ExitCounterLabel.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (SplitsAreDifferent(state)) { settings.ChangeAutoSplitSettingsToGameName(GameName, GameCategory); ReloadLogFile(); } if (loading) { framesSinceStartOfLoad++; } if (loading && !doneLoading && framesSinceStartOfLoad >= settings.MaxFramesToWaitForSwirl) /*Arbitrary number of frames to wait*/ { var currentGameTime = timer.CurrentState.CurrentTime.GameTime; currentGameTime += timer.CurrentState.CurrentTime.RealTime - loadStartTime; framesSinceStartOfLoad = 0; UpdateLoadingState(1, 0, true); timer.CurrentState.SetGameTime(currentGameTime); UpdateGameTimerState(); loadStartTime = null; } liveSplitState = state; UpdateMemoryRead(); if (memory.ProcessHooked) { invalidator?.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { UpdateAll(state); if (Item != null) { Cache.Restart(); Cache["Icon"] = Item.Icon; Cache["DisplayIcon"] = DisplayIcon; Cache["ShowGoal"] = ShowGoal; Cache["NameLabel"] = NameLabel.Text; Cache["CountLabel"] = CountLabel.Text; Cache["GoalLabel"] = GoalLabel.Text; Cache["NameFont"] = NameFont; Cache["CountFont"] = CountFont; Cache["GoalFont"] = GoalFont; Cache["NameColor"] = NameLabel.ForeColor.ToArgb(); Cache["CountColor"] = CountLabel.ForeColor.ToArgb(); Cache["GoalColor"] = GoalLabel.ForeColor.ToArgb(); Cache["BackColor"] = Settings.BackgroundColor.ToArgb(); if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (Model == null) { Model = new TimerModel() { CurrentState = state }; state.OnReset += OnReset; state.OnPause += OnPause; state.OnResume += OnResume; state.OnStart += OnStart; state.OnSplit += OnSplit; state.OnUndoSplit += OnUndoSplit; state.OnSkipSplit += OnSkipSplit; } oriState.Loop(); oriState.oriTriggers.timerRunning = (Model.CurrentState.CurrentPhase == TimerPhase.Running); if (Settings.showMapDisplay) { textInfo.InformationName = "Total Map: " + oriState.sMapCompletion.ToString("0.00") + "%"; textInfo.InformationValue = oriState.sCurrentArea.ToString(); textInfo.LongestString = "Valley Of The Wind - 100.00%"; textInfo.Update(invalidator, state, width, height, mode); if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (invalidator != null && (_stateChanged || _ready_timer.IsRunning)) { _stateChanged = false; invalidator.Invalidate(0, 0, width, height); } }
public virtual void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (!HasInvalidated && invalidator != null) { invalidator.Invalidate(0, 0, width, height); HasInvalidated = true; } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["LockToBottom"] = LockToBottom; if (invalidator != null && Cache.HasChanged) { if (mode == LayoutMode.Vertical) { invalidator.Invalidate(0, -1, width, height + 2); } else { invalidator.Invalidate(-1, 0, width + 2, height); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (invalidator != null && _stateChanged) { _stateChanged = false; invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["LockToBottom"] = LockToBottom; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { string deaths = _deaths.ToString(CultureInfo.InvariantCulture); if (invalidator != null && this.InternalComponent.InformationValue != deaths) { this.InternalComponent.InformationValue = deaths; invalidator.Invalidate(0f, 0f, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { string textPercentage = (tracker.IsRunning) ? PercentageFormatter.Format(progress.Percentage, Settings.Accuracy) : "-"; if (invalidator != null && this.InternalComponent.InformationValue != textPercentage) { this.InternalComponent.InformationValue = textPercentage; invalidator.Invalidate(0f, 0f, width, height); InternalComponent.Update(invalidator, state, width, height, mode); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { CurrentColor = state.Settings.GlobalHotkeysEnabled ? Settings.HotkeysOnColor : Settings.HotkeysOffColor; Cache.Restart(); Cache["IndicatorColor"] = CurrentColor.ToArgb(); if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["NameText"] = InformationName; Cache["ValueText"] = InformationValue; Cache["NameColor"] = NameLabel.ForeColor.ToArgb(); Cache["ValueColor"] = ValueLabel.ForeColor.ToArgb(); if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { UpdateAll(state); Cache.Restart(); Cache["RacerName"] = RacerName.Text; Cache["RacerSplit"] = RacerSplit.Text; Cache["RacerTime"] = RacerTime.Text; Cache["RacerDelta"] = RacerDelta.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { UpdateAll(state); Cache.Restart(); Cache["ColumnsCount"] = ColumnsList.Count(); foreach (var label in LabelsList) { Cache["Columns" + LabelsList.IndexOf(label) + "Text"] = label.Text; } if (invalidator != null && Cache.HasChanged || FrameCount > 1) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState lvstate, float width, float height, LayoutMode mode) { if (Model == null) { Model = new TimerModel() { CurrentState = lvstate }; lvstate.OnReset += OnReset; lvstate.OnPause += OnPause; lvstate.OnResume += OnResume; lvstate.OnStart += OnStart; lvstate.OnSplit += OnSplit; lvstate.OnUndoSplit += OnUndoSplit; lvstate.OnSkipSplit += OnSkipSplit; } GetValues(); if (settings.ShowMapDisplay) { List <Area> areas = mem.GetMapCompletion(); decimal total = 0; Area currentArea = default(Area); for (int i = 0; i < areas.Count; i++) { Area area = areas[i]; total += area.Progress; if (area.Current) { currentArea = area; } } if (areas.Count > 0) { total /= areas.Count; } textInfo.InformationName = "Total Map: " + total.ToString("0.00") + "%"; textInfo.InformationValue = currentArea.Name + " - " + currentArea.Progress.ToString("0.00") + "%"; textInfo.LongestString = "Valley Of The Wind - 100.00%"; textInfo.Update(invalidator, lvstate, width, height, mode); if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { var timingMethod = state.CurrentTimingMethod; if (Settings.TimingMethod == "Real Time") { timingMethod = TimingMethod.RealTime; } else if (Settings.TimingMethod == "Game Time") { timingMethod = TimingMethod.GameTime; } var formatter = new AlternateTimeFormatter(Settings.AlternateTimeAccuracy); TimeSpan?altTime = null; if (AlternateTimer != null) { altTime = AlternateTimer.GetTime(state, timingMethod); } AlternateTimer.Settings.TimingMethod = Settings.TimingMethod; InternalComponent.Settings.TimingMethod = Settings.TimingMethod; AlternateTimer.Update(null, state, width, height, mode); InternalComponent.Update(null, state, width, height, mode); Cache.Restart(); Cache["AlternateTimerText"] = AlternateTimer.BigTextLabel.Text + AlternateTimer.SmallTextLabel.Text; Cache["InternalComponentText"] = InternalComponent.BigTextLabel.Text + InternalComponent.SmallTextLabel.Text; if (InternalComponent.BigTextLabel.Brush != null && invalidator != null) { if (InternalComponent.BigTextLabel.Brush is LinearGradientBrush) { Cache["TimerColor"] = ((LinearGradientBrush)InternalComponent.BigTextLabel.Brush).LinearColors.First().ToArgb(); } else { Cache["TimerColor"] = InternalComponent.BigTextLabel.ForeColor.ToArgb(); } } if (invalidator != null && (Cache.HasChanged)) //|| FrameCount > 1)) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { var componentName = Settings.LoadTimeText; InternalComponent.LongestString = componentName; InternalComponent.NameLabel.Text = componentName; InternalComponent.TimeValue = state.CurrentTime[TimingMethod.RealTime] - state.CurrentTime[TimingMethod.GameTime]; Cache.Restart(); Cache["NameValue"] = InternalComponent.NameLabel.Text; Cache["TimeValue"] = InternalComponent.ValueLabel.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Calculate(state); Cache.Restart(); Cache["FinalSplit"] = FinalSplit.ToString(); Cache["IsLiveDeltaActive"] = IsLiveDeltaActive; Cache["DeltasCount"] = Deltas.Count; for (var ind = 0; ind < Deltas.Count; ind++) { Cache["Deltas" + ind] = Deltas[ind] == null ? "null" : Deltas[ind].ToString(); } if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { // hack to prevent flicker, doesn't actually pause anything state.IsGameTimePaused = true; // Update is called every 25ms, so up to 25ms IGT can be lost if using delay and no auto-start if (_waitingForDelay) { if (state.CurrentTime.RealTime >= TimeSpan.Zero) { _sessionTicksOffset = _sessionTicks; _waitingForDelay = false; } else { state.SetGameTime(state.CurrentTime.RealTime); } } if (!_waitingForDelay) { // update game time, don't show negative time due to tick adjusting state.SetGameTime(this.GameTime >= TimeSpan.Zero ? this.GameTime : TimeSpan.Zero); } if (!this.Settings.ShowGameTime) { return; } this.InternalComponent.TimeValue = state.CurrentTime[state.CurrentTimingMethod == TimingMethod.GameTime ? TimingMethod.RealTime : TimingMethod.GameTime]; this.InternalComponent.InformationName = state.CurrentTimingMethod == TimingMethod.GameTime ? "Real Time" : "Game Time"; _cache.Restart(); _cache["TimeValue"] = this.InternalComponent.ValueLabel.Text; _cache["TimingMethod"] = state.CurrentTimingMethod; if (invalidator != null && _cache.HasChanged) { invalidator.Invalidate(0f, 0f, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { var now = DateTimeOffset.Now.ToUnixTimeMilliseconds(); if (now - Timestamp <= 100) { return; } if (RE3RSRT.UpdateValues(Values)) { Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(); } else { Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds() + 2000; } invalidator.Invalidate(0, 0, width, height); }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { this.state = state; int currentSplitIndex = state.CurrentSplitIndex; // Create Header String header = "Odds ("; header += Settings.ValueToString(Settings.ValueOneIndex); if (Settings.DisplayTwoValues) { header += " / " + Settings.ValueToString(Settings.ValueTwoIndex); } header += ")"; OddsNameLabel.Text = header; // Display the odds if (currentSplitIndex == -1 || currentSplitIndex >= completeCurrentSplit.Count) { OddsValueLabel.Text = "-- / --"; } else { String values = RetrieveOdds(Settings.ValueOneIndex, currentSplitIndex); if (Settings.DisplayTwoValues) { values += " / " + RetrieveOdds(Settings.ValueTwoIndex, currentSplitIndex); } OddsValueLabel.Text = values; } Cache.Restart(); Cache["OddsNameLabel"] = OddsNameLabel.Text; Cache["OddsValueLabel"] = OddsValueLabel.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (state.CurrentPhase == TimerPhase.Ended) { state.SetGameTime(_endTime.HasValue ? _endTime.Value : TimeSpan.Zero); } else { if (state.CurrentTime.RealTime >= TimeSpan.Zero) { // Update is called every 25ms, so up to 25ms can be lost if using delay if (_waitingForDelay) { _removeTime = _mapTime; _waitingForDelay = false; } state.SetGameTime(state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused ? this.GameTime : TimeSpan.Zero); } } if (!this.Settings.ShowGameTime) { return; } this.InternalComponent.TimeValue = state.CurrentTime[state.CurrentTimingMethod == TimingMethod.GameTime ? TimingMethod.RealTime : TimingMethod.GameTime]; this.InternalComponent.InformationName = state.CurrentTimingMethod == TimingMethod.GameTime ? "Real Time" : "Game Time"; _cache.Restart(); _cache["TimeValue"] = this.InternalComponent.ValueLabel.Text; _cache["TimingMethod"] = state.CurrentTimingMethod; if (invalidator != null && _cache.HasChanged) { invalidator.Invalidate(0f, 0f, width, height); } }
/// <summary> /// Updates the component. This is where most of the actual autosplitting work is done. /// </summary> public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (timer == null) { timer = new TimerModel { CurrentState = state }; state.OnSplit += OnSplit; state.OnUndoSplit += OnUndoSplit; state.OnSkipSplit += OnSkipSplit; state.OnReset += OnReset; } bool processPreviouslyHooked = processHooked; Autosplit(); if (processHooked) { // If someone keeps the timer running after exiting to the menu, it's probably also useful to keep display death count for // that run until the timer is reset. deathCount = memory.CheckInGame() || timer.CurrentState.CurrentPhase == TimerPhase.Running ? Math.Max(deathCount, memory.GetDeathCount()) : 0; } // The death count should reset to zero when the game exits. if (!processHooked && processPreviouslyHooked) { deathCount = 0; } if (processHooked || processPreviouslyHooked) { textComponent.InformationValue = deathCount.ToString(); textComponent.Update(invalidator, state, width, height, mode); invalidator?.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode) { TimeSpan?tq = state.CurrentTime[state.CurrentTimingMethod]; if (tq.HasValue) { TimeSpan t = tq.Value; int H = ((int)(t.TotalMinutes + 8.25)); int M = ((int)t.TotalSeconds + 495) - H * 60; H = H % 24; M = M % 60; SetTime(H, M); } if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } }
private void possiblySwapOutComponent(IInvalidator invalidator, float width, float height) { if (queuedComponents.Count > 1 && (TimeStamp.Now - (lastSwap ?? TimeStamp.Now) > TimeSpan.FromSeconds(8) || TimeStamp.Now - (lastInvalidation ?? TimeStamp.Now) > TimeSpan.FromSeconds(3))) { lastSwap = TimeStamp.Now; var dequeuedComponent = queuedComponents.Dequeue(); var slideshowComponent = slideshowComponents.FirstOrDefault(x => x.Component == dequeuedComponent); if (slideshowComponent != null) { slideshowComponent.LastDequeue = lastSwap; } if (invalidator != null) { lastInvalidation = TimeStamp.Now; invalidator.Invalidate(0, 0, width, height); } } }
private void invalidateComponent(IInvalidator invalidator, float x, float y, float w, float h, IComponent currentComponent) { if (currentComponent != null) { enqueueComponent(currentComponent); if (invalidator != null && queuedComponents.FirstOrDefault() == currentComponent) { lastInvalidation = TimeStamp.Now; invalidator.Invalidate(x, y, w, h); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["SingleLine"] = Settings.SingleLine; Cache["GameName"] = state.Run.GameName; Cache["CategoryName"] = state.Run.CategoryName; Cache["LayoutMode"] = mode; if (Cache.HasChanged) { if (Settings.SingleLine) { var text = string.Format("{0} - {1}", state.Run.GameName, state.Run.CategoryName); GameNameLabel.Text = text; GameNameLabel.AlternateText = mode == LayoutMode.Vertical ? text.GetAbbreviations().ToList() : new List<string>(); CategoryNameLabel.Text = ""; } else { GameNameLabel.Text = state.Run.GameName; GameNameLabel.AlternateText = mode == LayoutMode.Vertical ? state.Run.GameName.GetAbbreviations().ToList() : new List<string>(); CategoryNameLabel.Text = state.Run.CategoryName; } } Cache.Restart(); Cache["AttemptHistoryCount"] = state.Run.AttemptHistory.Count; Cache["Run"] = state.Run; if (Cache.HasChanged) FinishedRunsCount = state.Run.AttemptHistory.Where(x => x.Time.RealTime != null).Count(); if (Settings.ShowAttemptCount && Settings.ShowFinishedRunsCount) AttemptCountLabel.Text = string.Format("{0}/{1}", FinishedRunsCount, state.Run.AttemptCount); else if (Settings.ShowAttemptCount) AttemptCountLabel.Text = state.Run.AttemptCount.ToString(); else if (Settings.ShowFinishedRunsCount) AttemptCountLabel.Text = FinishedRunsCount.ToString(); Cache.Restart(); Cache["GameIcon"] = state.Run.GameIcon; if (Cache.HasChanged) { if (state.Run.GameIcon == null) FrameCount = 0; else FrameCount = state.Run.GameIcon.GetFrameCount(new FrameDimension(state.Run.GameIcon.FrameDimensionsList[0])); } Cache["GameNameLabel"] = GameNameLabel.Text; Cache["CategoryNameLabel"] = CategoryNameLabel.Text; Cache["AttemptCountLabel"] = AttemptCountLabel.Text; if (invalidator != null && Cache.HasChanged || FrameCount > 1) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { CurrentColor = state.Settings.GlobalHotkeysEnabled ? Settings.HotkeysOnColor : Settings.HotkeysOffColor; Cache.Restart(); Cache["IndicatorColor"] = CurrentColor.ToArgb(); if (invalidator != null && Cache.HasChanged) invalidator.Invalidate(0, 0, width, height); }
public void Update(IInvalidator Invalidator,LiveSplitState State,float Width,float Height,LayoutMode Mode){ if(GameProcess == null || GameProcess.HasExited) GameProcess = GetGameProcess(); if(CurrentSplitIndex == -1 && State.CurrentSplitIndex != -1 && Settings.p_GraphShow){ OnRunStart(null,null); CurrentSplitIndex = State.CurrentSplitIndex; RunStartTime = (TimeSpan)State.CurrentTime[TimingMethod.RealTime]; } if(GameProcess != null && !GameProcess.HasExited){ int NewMana,NewRegen,NewPotions; if(ReadManaValues(out NewMana,out NewRegen,out NewPotions)){ if(Settings.p_GraphShow && State.CurrentSplitIndex != -1){ var SecondTenths = GetTimeSecondTenths(); if(State.IsGameTimePaused){//loading if(IsInLoadingScreen){ int Index = SpecialEvents.FindLastIndex(e => e.Type == SpecialEventType.Load); if(Index == -1){ IsInLoadingScreen = false; }else{ var Event = SpecialEvents[Index]; Event.Length = SecondTenths-Event.Time; SpecialEvents[Index] = Event; } } if(!IsInLoadingScreen){ SpecialEvents.Add(new SpecialEvent(SpecialEventType.Load,SecondTenths)); IsInLoadingScreen = true; } }else{ if(IsInLoadingScreen){ IsInLoadingScreen = false; var Event = SpecialEvents[SpecialEvents.Count-1]; Event.Length = SecondTenths-Event.Time; SpecialEvents[SpecialEvents.Count-1] = Event; }else{ if(NewMana<Mana){//blink (maybe other power) SpecialEvents.Add(new SpecialEvent(SpecialEventType.Blink,SecondTenths)); }else if(NewPotions>Potions){//pickup potion(s) for(var i = NewPotions;i>Potions;--i){ SpecialEvents.Add(new SpecialEvent(SpecialEventType.Pickup,SecondTenths)); } }else if(NewPotions<Potions){//drink potion(s) for(var i = NewPotions;i<Potions;++i){ SpecialEvents.Add(new SpecialEvent(SpecialEventType.Drink,SecondTenths)); } } } } if(SecondTenths >= ManaSnapshots.Count){ //make sure the structure is filled for(int i = ManaSnapshots.Count;i<SecondTenths;++i){ ManaSnapshots.Add(new ManaSnapshot(Mana,Regen,Potions)); } //add the current mana values to the structure ManaSnapshots.Add(new ManaSnapshot(NewMana,NewRegen,NewPotions)); } } //only update if game time is running, as we are in a loading screen otherwise wherein the values may fluctuate if(!State.IsGameTimePaused){ Mana = NewMana; Regen = NewRegen; Potions = NewPotions; } } } if(Settings.p_HeaderShow){ HeaderLabel.Text = Settings.p_HeaderText; if(Settings.p_HeaderManaShow) HeaderLabel.Text += Mana+Settings.p_HeaderManaText; if(Settings.p_HeaderRegenShow) HeaderLabel.Text += Regen+Settings.p_HeaderRegenText; if(Settings.p_HeaderPotionsShow) HeaderLabel.Text += Potions+Settings.p_HeaderPotionsText; if(Invalidator != null) Invalidator.Invalidate(0,0,Width,Height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { invalidator.Invalidate(0, 0, width, height); }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["LockToBottom"] = LockToBottom; if (invalidator != null && Cache.HasChanged) invalidator.Invalidate(0, 0, width, height); }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Calculate(state); Cache.Restart(); Cache["FinalSplit"] = FinalSplit.ToString(); Cache["IsBestSegment"] = IsBestSegment; Cache["DeltasCount"] = Deltas.Count; for (var ind = 0; ind < Deltas.Count; ind++) { Cache["Deltas" + ind] = Deltas[ind] == null ? "null" : Deltas[ind].ToString(); } if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { var lastSplitOffset = state.CurrentSplitIndex == state.Run.Count ? -1 : 0; var timingMethod = state.CurrentTimingMethod; if (Settings.TimingMethod == "Real Time") timingMethod = TimingMethod.RealTime; else if (Settings.TimingMethod == "Game Time") timingMethod = TimingMethod.GameTime; var formatter = new SegmentTimesFormatter(Settings.SegmentTimesAccuracy); if (state.CurrentSplitIndex >= 0) { Comparison = Settings.Comparison == "Current Comparison" ? state.CurrentComparison : Settings.Comparison; Comparison2 = Settings.Comparison2 == "Current Comparison" ? state.CurrentComparison : Settings.Comparison2; HideComparison = Settings.HideComparison; if (HideComparison || !state.Run.Comparisons.Contains(Comparison2) || Comparison2 == "None") { HideComparison = true; if (!state.Run.Comparisons.Contains(Comparison) || Comparison == "None") Comparison = state.CurrentComparison; } else if (!state.Run.Comparisons.Contains(Comparison) || Comparison == "None") { HideComparison = true; Comparison = Comparison2; } else if (Comparison == Comparison2) HideComparison = true; ComparisonName = CompositeComparisons.GetShortComparisonName(Comparison); ComparisonName2 = CompositeComparisons.GetShortComparisonName(Comparison2); TimeSpan? segmentTime = null; if (Comparison == BestSegmentsComparisonGenerator.ComparisonName) segmentTime = state.Run[state.CurrentSplitIndex + lastSplitOffset].BestSegmentTime[timingMethod]; else { if (state.CurrentSplitIndex == 0 || (state.CurrentSplitIndex == 1 && lastSplitOffset == -1)) segmentTime = state.Run[0].Comparisons[Comparison][timingMethod]; else if (state.CurrentSplitIndex > 0) segmentTime = state.Run[state.CurrentSplitIndex + lastSplitOffset].Comparisons[Comparison][timingMethod] - state.Run[state.CurrentSplitIndex - 1 + lastSplitOffset].Comparisons[Comparison][timingMethod]; } LabelSegment.Text = ComparisonName + ":"; LabelBest.Text = ComparisonName2 + ":"; if (Comparison != "None") { if (segmentTime != null) SegmentTime.Text = formatter.Format(segmentTime); else SegmentTime.Text = "-"; } if (!HideComparison) { TimeSpan? bestSegmentTime = null; if (Comparison2 == BestSegmentsComparisonGenerator.ComparisonName) bestSegmentTime = state.Run[state.CurrentSplitIndex + lastSplitOffset].BestSegmentTime[timingMethod]; else { if (state.CurrentSplitIndex == 0 || (state.CurrentSplitIndex == 1 && lastSplitOffset == -1)) bestSegmentTime = state.Run[0].Comparisons[Comparison2][timingMethod]; else if (state.CurrentSplitIndex > 0) bestSegmentTime = state.Run[state.CurrentSplitIndex + lastSplitOffset].Comparisons[Comparison2][timingMethod] - state.Run[state.CurrentSplitIndex - 1 + lastSplitOffset].Comparisons[Comparison2][timingMethod]; } if (bestSegmentTime != null) BestSegmentTime.Text = formatter.Format(bestSegmentTime); else BestSegmentTime.Text = "-"; } if (state.CurrentSplitIndex >= 0) SplitName.Text = state.Run[state.CurrentSplitIndex + lastSplitOffset].Name; else SplitName.Text = ""; } SegmentTimer.Settings.TimingMethod = Settings.TimingMethod; InternalComponent.Settings.TimingMethod = Settings.TimingMethod; SegmentTimer.Update(null, state, width, height, mode); InternalComponent.Update(null, state, width, height, mode); var icon = state.CurrentSplitIndex >= 0 ? state.Run[state.CurrentSplitIndex + lastSplitOffset].Icon : null; Cache.Restart(); Cache["SplitIcon"] = icon; if (Cache.HasChanged) { if (icon == null) FrameCount = 0; else FrameCount = icon.GetFrameCount(new FrameDimension(icon.FrameDimensionsList[0])); } Cache["SplitName"] = SplitName.Text; Cache["LabelSegment"] = LabelSegment.Text; Cache["LabelBest"] = LabelBest.Text; Cache["SegmentTime"] = SegmentTime.Text; Cache["BestSegmentTime"] = BestSegmentTime.Text; Cache["SegmentTimerText"] = SegmentTimer.BigTextLabel.Text + SegmentTimer.SmallTextLabel.Text; Cache["InternalComponentText"] = InternalComponent.BigTextLabel.Text + InternalComponent.SmallTextLabel.Text; if (InternalComponent.BigTextLabel.Brush != null && invalidator != null) { if (InternalComponent.BigTextLabel.Brush is LinearGradientBrush) Cache["TimerColor"] = ((LinearGradientBrush)InternalComponent.BigTextLabel.Brush).LinearColors.First().ToArgb(); else Cache["TimerColor"] = InternalComponent.BigTextLabel.ForeColor.ToArgb(); } if (invalidator != null && Cache.HasChanged || FrameCount > 1) { invalidator.Invalidate(0, 0, width, height); } }
private void GetValues(IInvalidator invalidator, LiveSplitState lvstate, float width, float height, LayoutMode mode) { if (!GetKTANE()) { return; } if (Model != null && Model.CurrentState != null) { ReadData(); foreach (LogLine line in logLines) { if (Model.CurrentState.CurrentPhase != TimerPhase.Running && line.Message.Equals("[BombGenerator] Generator settings: Time: 300, NumStrikes: 3, FrontFaceOnly: True\r3 Pools:\r[Wires] Count: 1\r[BigButton] Count: 1\r[Keypad] Count: 1")) { Model.Start(); continue; } if (currentSplit <= 0 || currentSplit >= 33 || Model.CurrentState.CurrentPhase != TimerPhase.Running || line.Time < DateTime.Now - Model.CurrentState.CurrentTime.RealTime.Value) { continue; } if (line.Message.IndexOf("[Bomb] A winner is you!!") >= 0) { if (Model.CurrentState.Run.Count < 8) { switch (currentSplit) { case 1: case 5: case 12: case 16: case 22: case 26: case 32: Model.Split(); break; default: currentSplit++; break; } } else { Model.Split(); } endOfBomb = line.Time; } else if (line.Message.IndexOf("[BombGenerator] Generator settings: Time: ") >= 0) { int index = line.Message.IndexOf("Time: ") + 6; bestTime = decimal.Parse(line.Message.Substring(index, line.Message.IndexOf(",", index) - index)); } else if (line.Message.IndexOf("[BombGenerator] Generating Widgets") >= 0) { startOfBomb = line.Time; endOfBomb = DateTime.MinValue; XDocument x = XDocument.Load(BestTimes); var xmlList = x.Descendants("dictionary").Elements().ToList(); if (xmlList.Count >= currentSplit) { foreach (XElement ele in xmlList) { if (ele.Element("key").Element("string").Value == missions[currentSplit - 1]) { bestTimeRTA = decimal.Parse(ele.Element("value").Element("GameRecord").Element("RealTimeElapsed").Value); bestTime -= decimal.Parse(ele.Element("value").Element("GameRecord").Element("TimeElapsed").Value); break; } } } else { bestTimeRTA = 0; } } else if (line.Message.IndexOf("[Bomb] Boom") >= 0) { startOfBomb = DateTime.MinValue; endOfBomb = DateTime.MinValue; } } } //textInfo.InformationName = "Best Time" + (bestTime > 0 ? " (" + TimeSpan.FromSeconds((double)bestTime).ToString(@"m\:") + (bestTime % 60).ToString("00.000") + ")" : ""); textInfo.InformationName = "Best Time"; textInfo.InformationValue = (startOfBomb > DateTime.MinValue ? ((endOfBomb > DateTime.MinValue ? endOfBomb : DateTime.Now) - startOfBomb).TotalSeconds.ToString("0.000") : "0.000") + " / " + bestTimeRTA.ToString("0.000"); textInfo.Update(invalidator, lvstate, width, height, mode); if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); var timingMethod = state.CurrentTimingMethod; if (Settings.TimingMethod == "Real Time") timingMethod = TimingMethod.RealTime; else if (Settings.TimingMethod == "Game Time") timingMethod = TimingMethod.GameTime; var timeValue = GetTime(state, timingMethod); if (timeValue != null) { var timeString = Formatter.Format(timeValue, CurrentTimeFormat); int dotIndex = timeString.IndexOf("."); BigTextLabel.Text = timeString.Substring(0, dotIndex); if (CurrentAccuracy == TimeAccuracy.Hundredths) SmallTextLabel.Text = timeString.Substring(dotIndex); else if (CurrentAccuracy == TimeAccuracy.Tenths) SmallTextLabel.Text = timeString.Substring(dotIndex, 2); else SmallTextLabel.Text = ""; } else { SmallTextLabel.Text = "-"; BigTextLabel.Text = ""; } if (Settings.OverrideSplitColors) { BigTextLabel.ForeColor = Settings.TimerColor; SmallTextLabel.ForeColor = Settings.TimerColor; } else if (state.CurrentPhase == TimerPhase.NotRunning || state.CurrentTime[timingMethod] < TimeSpan.Zero) { BigTextLabel.ForeColor = state.LayoutSettings.NotRunningColor; SmallTextLabel.ForeColor = state.LayoutSettings.NotRunningColor; } else if (state.CurrentPhase == TimerPhase.Paused) { BigTextLabel.ForeColor = SmallTextLabel.ForeColor = state.LayoutSettings.PausedColor; } else if (state.CurrentPhase == TimerPhase.Ended) { if (state.Run.Last().Comparisons[state.CurrentComparison][timingMethod] == null || state.CurrentTime[timingMethod] < state.Run.Last().Comparisons[state.CurrentComparison][timingMethod]) { BigTextLabel.ForeColor = state.LayoutSettings.PersonalBestColor; SmallTextLabel.ForeColor = state.LayoutSettings.PersonalBestColor; } else { BigTextLabel.ForeColor = state.LayoutSettings.BehindLosingTimeColor; SmallTextLabel.ForeColor = state.LayoutSettings.BehindLosingTimeColor; } } else if (state.CurrentPhase == TimerPhase.Running) { Color timerColor; if (state.CurrentSplit.Comparisons[state.CurrentComparison][timingMethod] != null) { timerColor = LiveSplitStateHelper.GetSplitColor(state, state.CurrentTime[timingMethod] - state.CurrentSplit.Comparisons[state.CurrentComparison][timingMethod], state.CurrentSplitIndex, true, false, state.CurrentComparison, timingMethod).Value; } else timerColor = state.LayoutSettings.AheadGainingTimeColor; BigTextLabel.ForeColor = timerColor; SmallTextLabel.ForeColor = timerColor; } Cache["TimerText"] = BigTextLabel.Text + SmallTextLabel.Text; if (BigTextLabel.Brush != null && invalidator != null) { Cache["TimerColor"] = BigTextLabel.ForeColor.ToArgb(); } if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { // hack to prevent flicker, doesn't actually pause anything state.IsGameTimePaused = true; // Update is called every 25ms, so up to 25ms IGT can be lost if using delay and no auto-start if (_waitingForDelay) { if (state.CurrentTime.RealTime >= TimeSpan.Zero) { _sessionTimeOffset = _sessionTime; _waitingForDelay = false; } else { state.SetGameTime(state.CurrentTime.RealTime); } } if (!_waitingForDelay) // update game time, don't show negative time due to tick adjusting state.SetGameTime(this.GameTime >= TimeSpan.Zero ? this.GameTime : TimeSpan.Zero); if (!this.Settings.ShowGameTime) return; this.InternalComponent.TimeValue = state.CurrentTime[state.CurrentTimingMethod == TimingMethod.GameTime ? TimingMethod.RealTime : TimingMethod.GameTime]; this.InternalComponent.InformationName = state.CurrentTimingMethod == TimingMethod.GameTime ? "Real Time" : "Game Time"; _cache.Restart(); _cache["TimeValue"] = this.InternalComponent.ValueLabel.Text; _cache["TimingMethod"] = state.CurrentTimingMethod; if (invalidator != null && _cache.HasChanged) invalidator.Invalidate(0f, 0f, width, height); }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (process != null && settings.Pointer != null && !process.HasExited && process.ProcessName == settings.ProcessName) { switch (settings.ValueType) { case MemoryType.Float: currentValue = settings.Pointer.Deref<float>(process); break; case MemoryType.Int: currentValue = settings.Pointer.Deref<int>(process); break; case MemoryType.FloatVec2: currentValue = (float)settings.Pointer.Deref<FloatVec2>(process).Norm; break; case MemoryType.FloatVec3: currentValue = (float)settings.Pointer.Deref<FloatVec3>(process).Norm; break; case MemoryType.IntVec2: currentValue = (float)settings.Pointer.Deref<IntVec2>(process).Norm; break; case MemoryType.IntVec3: currentValue = (float)settings.Pointer.Deref<IntVec3>(process).Norm; break; case MemoryType.FloatVec2XZY: currentValue = (float)settings.Pointer.Deref<FloatVec2XZY>(process).Norm; break; case MemoryType.IntVec2XZY: currentValue = (float)settings.Pointer.Deref<IntVec2XZY>(process).Norm; break; } if (invalidator != null) { invalidator.Invalidate(0, 0, width, height); } } else { process = System.Diagnostics.Process.GetProcessesByName(settings.ProcessName).FirstOrDefault(); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { if (Split != null) { UpdateAll(state); NeedUpdateAll = false; IsActive = (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused) && state.CurrentSplit == Split; Cache.Restart(); Cache["Icon"] = Split.Icon; if (Cache.HasChanged) { if (Split.Icon == null) FrameCount = 0; else FrameCount = Split.Icon.GetFrameCount(new FrameDimension(Split.Icon.FrameDimensionsList[0])); } Cache["DisplayIcon"] = DisplayIcon; Cache["SplitName"] = NameLabel.Text; Cache["IsActive"] = IsActive; Cache["NameColor"] = NameLabel.ForeColor.ToArgb(); Cache["ColumnsCount"] = ColumnsList.Count(); foreach (var label in LabelsList) { Cache["Columns" + LabelsList.IndexOf(label) + "Text"] = label.Text; Cache["Columns" + LabelsList.IndexOf(label) + "Color"] = label.ForeColor.ToArgb(); } if (invalidator != null && Cache.HasChanged || FrameCount > 1) { invalidator.Invalidate(0, 0, width, height); } } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { UpdateAll(state); Cache.Restart(); Cache["ColumnsCount"] = ColumnsList.Count(); foreach (var label in LabelsList) Cache["Columns" + LabelsList.IndexOf(label) + "Text"] = label.Text; if (invalidator != null && Cache.HasChanged || FrameCount > 1) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["DisplayedSize"] = DisplayedSize; Cache["UseSeparatorColor"] = UseSeparatorColor; Cache["LockToBottom"] = LockToBottom; if (invalidator != null && Cache.HasChanged) invalidator.Invalidate(0, 0, width, height); }
public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode) { Cache.Restart(); Cache["NameText"] = InformationName; Cache["ValueText"] = InformationValue; Cache["NameColor"] = NameLabel.ForeColor.ToArgb(); Cache["ValueColor"] = ValueLabel.ForeColor.ToArgb(); Cache["DisplayTwoRows"] = DisplayTwoRows; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }
public void Update(IInvalidator invalidator, Model.LiveSplitState state, float width, float height, LayoutMode mode) { try { if (Settings.Hook != null) Settings.Hook.Poll(); } catch { } this.state = state; CounterNameLabel.Text = Settings.CounterText; CounterValueLabel.Text = Counter.Count.ToString(); Cache.Restart(); Cache["CounterNameLabel"] = CounterNameLabel.Text; Cache["CounterValueLabel"] = CounterValueLabel.Text; if (invalidator != null && Cache.HasChanged) { invalidator.Invalidate(0, 0, width, height); } }