本文整理汇总了C#中LiveSplit.Model.LiveSplitState.SetGameTime方法的典型用法代码示例。如果您正苦于以下问题:C# LiveSplitState.SetGameTime方法的具体用法?C# LiveSplitState.SetGameTime怎么用?C# LiveSplitState.SetGameTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiveSplit.Model.LiveSplitState
的用法示例。
在下文中一共展示了LiveSplitState.SetGameTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public override void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
if (state.CurrentPhase == TimerPhase.NotRunning)
{
if (AutoSplitter.ShouldStart(state))
{
Model.Start();
}
}
else if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
{
if (AutoSplitter.ShouldReset(state))
{
Model.Reset();
return;
}
else if (AutoSplitter.ShouldSplit(state))
{
Model.Split();
}
state.IsGameTimePaused = AutoSplitter.IsGameTimePaused(state);
var gameTime = AutoSplitter.GetGameTime(state);
if (gameTime != null)
state.SetGameTime(gameTime);
}
}
示例2: Update
public void Update(LiveSplitState lsState)
{
if (Game != null && !Game.HasExited)
{
OldState = State.RefreshValues(Game);
if (lsState.CurrentPhase == TimerPhase.Running || lsState.CurrentPhase == TimerPhase.Paused)
{
var isPaused = IsLoading.Run(lsState, OldState, State);
if (isPaused != null)
lsState.IsGameTimePaused = isPaused;
var gameTime = GameTime.Run(lsState, OldState, State);
if (gameTime != null)
lsState.SetGameTime(gameTime);
if (Reset.Run(lsState, OldState, State) ?? false)
{
Model.Reset();
}
else if (Split.Run(lsState, OldState, State) ?? false)
{
Model.Split();
}
}
if (lsState.CurrentPhase == TimerPhase.NotRunning)
{
if (Start.Run(lsState, OldState, State) ?? false)
{
Model.Start();
}
}
}
else
{
if (Model == null)
{
Model = new TimerModel() { CurrentState = lsState };
}
TryConnect();
}
}
示例3: RunUpdate
public void RunUpdate(LiveSplitState lsState)
{
if (Game != null && !Game.HasExited)
{
OldState = State.RefreshValues(Game);
string ver = Version;
runMethod(Update, lsState, ref ver);
if (lsState.CurrentPhase == TimerPhase.Running || lsState.CurrentPhase == TimerPhase.Paused)
{
if (UsesGameTime && !lsState.IsGameTimeInitialized)
Model.InitializeGameTime();
var isPaused = runMethod(IsLoading, lsState, ref ver);
if (isPaused != null)
lsState.IsGameTimePaused = isPaused;
var gameTime = runMethod(GameTime, lsState, ref ver);
if (gameTime != null)
lsState.SetGameTime(gameTime);
if (runMethod(Reset, lsState, ref ver) ?? false)
{
Model.Reset();
}
else if (runMethod(Split, lsState, ref ver) ?? false)
{
Model.Split();
}
}
if (lsState.CurrentPhase == TimerPhase.NotRunning)
{
if (runMethod(Start, lsState, ref ver) ?? false)
{
Model.Start();
}
}
}
else
{
if (Model == null)
{
Model = new TimerModel() { CurrentState = lsState };
}
TryConnect(lsState);
}
}
示例4: DoUpdate
// This is executed repeatedly as long as the game is connected and initialized.
private void DoUpdate(LiveSplitState state)
{
_old_state = _state.RefreshValues(_game);
if (!(RunMethod(_methods.update, state) ?? true))
{
// If Update explicitly returns false, don't run anything else
return;
}
if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
{
if (_uses_game_time && !state.IsGameTimeInitialized)
_timer.InitializeGameTime();
var is_paused = RunMethod(_methods.isLoading, state);
if (is_paused != null)
state.IsGameTimePaused = is_paused;
var game_time = RunMethod(_methods.gameTime, state);
if (game_time != null)
state.SetGameTime(game_time);
if (RunMethod(_methods.reset, state) ?? false)
{
if (_settings.GetBasicSettingValue("reset"))
_timer.Reset();
}
else if (RunMethod(_methods.split, state) ?? false)
{
if (_settings.GetBasicSettingValue("split"))
_timer.Split();
}
}
if (state.CurrentPhase == TimerPhase.NotRunning)
{
if (RunMethod(_methods.start, state) ?? false)
{
if (_settings.GetBasicSettingValue("start"))
_timer.Start();
}
}
}
示例5: Update
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);
}