Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Robinson committed Aug 30, 2014
2 parents 80453db + 1295fbb commit 6e20f69
Show file tree
Hide file tree
Showing 14 changed files with 614 additions and 385 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sublime-workspace
Binary file modified Components/LiveSplit.Skyrim.dll
Binary file not shown.
10 changes: 10 additions & 0 deletions Components/update.LiveSplit.Skyrim.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<updates>
<update version="1.3.0">
<files>
<file path="Components/LiveSplit.Skyrim.dll" status="changed"/>
</files>
<changelog>
<change>
Added automatic reset / start / end and Helgen split.
</change>
</changelog>
</update>
<update version="1.2.0">
<files>
<file path="Components/LiveSplit.Skyrim.dll" status="changed"/>
Expand Down
210 changes: 147 additions & 63 deletions GameMemory.cs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions LiveSplit.Skyrim.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
</ItemGroup>
<ItemGroup>
<None Include="license.txt" />
<None Include="readme.txt" />
<None Include="README.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

[assembly: ComponentFactory(typeof(SkyrimFactory))]
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
LiveSplit.Skyrim v1.3
=====================

LiveSplit.Skyrim is a [LiveSplit](http://livesplit.org/) component for The Elder Scrolls V: Skyrim.

Features
--------
* Keeps track of Game Time to get rid of loading times.
* Auto start/stop/reset the timer.
* Splits when you finish Helgen and default Alduin 2. (configurable)

Install
-------
Starting with LiveSplit 1.4, you can download and install LiveSplit.Skyrim automatically from within the Splits Editor with just one click. Just type in "The Elder Scrolls V: Skyrim" and click Activate. This downloads LiveSplit.Skyrim to the Components folder.

Configure
---------
Due to bugs in LiveSplit 1.4.0, it's recommended to deactivate LiveSplit.Skyrim in the Splits Editor after activating (downloading) it the first time. Instead, you should activate it in the Layout Editor, under the "Control" category. Double-click "Skyrim" after adding it to your layout to bring up the settings.

After configuring everything you'll most likely want to turn on game time as primary timing, so that your splits will run off game time. You can do this by right-clicking LiveSplit and going to Compare Against->Game Time.

#### Auto Split
The default settings are to automatically reset, start, and end the splits (the first and last splits). You can enable Helgen autosplitting here.

#### Alternate Timing Method
This makes it show Real Time when comparing against Game Time, and vice versa. Doesn't work when LiveSplit.Skyrim is activated via the Splits Editor.

Change Log
----------
https://github.com/drtchops/LiveSplit.Skyrim/releases

Credits
-------
* [DrTChops](http://twitch.tv/drtchops)
* [Dalleth](http://twitch.tv/dalleth_)
* Plugin is based off [LiveSplit.Dishonored](https://github.com/fatalis/LiveSplit.Dishonored) by [Fatalis](http://twitch.tv/fatalis_).
74 changes: 47 additions & 27 deletions SkyrimComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,36 @@ public SkyrimComponent(LiveSplitState state)
_state = state;

_gameMemory = new GameMemory();
// _gameMemory.OnFirstLevelLoading += gameMemory_OnFirstLevelLoading;
// _gameMemory.OnPlayerGainedControl += gameMemory_OnPlayerGainedControl;
_gameMemory.OnFirstLevelLoading += gameMemory_OnFirstLevelLoading;
_gameMemory.OnPlayerGainedControl += gameMemory_OnPlayerGainedControl;
_gameMemory.OnLoadStarted += gameMemory_OnLoadStarted;
_gameMemory.OnLoadFinished += gameMemory_OnLoadFinished;
_gameMemory.OnLoadScreenStarted += gameMemory_OnLoadScreenStarted;
_gameMemory.OnLoadScreenFinished += gameMemory_OnLoadScreenFinished;
_gameMemory.OnAlduinDefeated += gameMemory_OnAlduinDefeated;
// _gameMemory.OnLoadScreenStarted += gameMemory_OnLoadScreenStarted;
// _gameMemory.OnLoadScreenFinished += gameMemory_OnLoadScreenFinished;
_gameMemory.OnSplitCompleted += gameMemory_OnSplitCompleted;
state.OnReset += state_OnReset;
_gameMemory.StartMonitoring();
}

public void Dispose()
{
if (_gameMemory != null)
{
_gameMemory.Stop();
}
}

void state_OnReset(object sender, TimerPhase e)
{
_gameMemory.resetSplitStates();
}

public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
{
if (!this.Settings.DrawWithoutLoads)
{
return;
}

this.InternalComponent.TimeValue =
state.CurrentTime[state.CurrentTimingMethod == TimingMethod.GameTime
Expand All @@ -68,7 +78,9 @@ public void Update(IInvalidator invalidator, LiveSplitState state, float width,
_cache["TimeValue"] = this.InternalComponent.ValueLabel.Text;
_cache["TimingMethod"] = state.CurrentTimingMethod;
if (invalidator != null && _cache.HasChanged)
{
invalidator.Invalidate(0f, 0f, width, height);
}
}

public void DrawVertical(Graphics g, LiveSplitState state, float width, Region region)
Expand All @@ -90,17 +102,21 @@ void PrepareDraw(LiveSplitState state)
this.InternalComponent.NameLabel.HasShadow = this.InternalComponent.ValueLabel.HasShadow = state.LayoutSettings.DropShadows;
}

// void gameMemory_OnFirstLevelLoading(object sender, EventArgs e)
// {
// if (this.Settings.AutoStartEnd)
// _timer.Reset();
// }
void gameMemory_OnFirstLevelLoading(object sender, EventArgs e)
{
if (this.Settings.AutoStartEnd)
{
_timer.Reset();
}
}

// void gameMemory_OnPlayerGainedControl(object sender, EventArgs e)
// {
// if (this.Settings.AutoStartEnd)
// _timer.Start();
// }
void gameMemory_OnPlayerGainedControl(object sender, EventArgs e)
{
if (this.Settings.AutoStartEnd)
{
_timer.Start();
}
}

void gameMemory_OnLoadStarted(object sender, EventArgs e)
{
Expand All @@ -112,20 +128,24 @@ void gameMemory_OnLoadFinished(object sender, EventArgs e)
_state.IsGameTimePaused = false;
}

void gameMemory_OnLoadScreenStarted(object sender, EventArgs e)
{
// TODO
}
// void gameMemory_OnLoadScreenStarted(object sender, EventArgs e)
// {
// // Nothing to do
// }

// void gameMemory_OnLoadScreenFinished(object sender, EventArgs e)
// {
// // Nothing to do
// }

void gameMemory_OnLoadScreenFinished(object sender, EventArgs e)
void gameMemory_OnSplitCompleted(object sender, GameMemory.SplitArea split)
{
// TODO
}

void gameMemory_OnAlduinDefeated(object sender, EventArgs e)
{
if (this.Settings.AutoStartEnd)
_timer.Split();
if ((split == GameMemory.SplitArea.Helgen && this.Settings.Helgen) ||
(split == GameMemory.SplitArea.AlduinDefeated && this.Settings.AutoStartEnd))
{
_timer.Split();
_gameMemory.setSplitState(split, true);
}
}

public XmlNode GetSettings(XmlDocument document)
Expand Down
Loading

0 comments on commit 6e20f69

Please sign in to comment.