Skip to content

Commit

Permalink
Merge branch 'livesplit14'
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalis committed Aug 14, 2014
2 parents db6c691 + 81b71c4 commit e0ef481
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
5 changes: 1 addition & 4 deletions GameMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ public void StartReading()

public void Stop()
{
if (_cancelSource == null || _thread == null)
throw new InvalidOperationException();

if (_thread.Status != TaskStatus.Running)
if (_cancelSource == null || _thread == null || _thread.Status != TaskStatus.Running)
return;

_cancelSource.Cancel();
Expand Down
8 changes: 4 additions & 4 deletions HaloSplitComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public HaloSplitComponent(LiveSplitState state)
_gameMemory.StartReading();
}

~HaloSplitComponent()
public void Dispose()
{
// TODO: in LiveSplit 1.4, components will be IDisposable
//_gameMemory.Stop();
if (_gameMemory != null)
_gameMemory.Stop();
}

public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
Expand Down Expand Up @@ -89,7 +89,7 @@ void PrepareDraw(LiveSplitState state)
_deathCounter.NameLabel.HasShadow = _deathCounter.ValueLabel.HasShadow = state.LayoutSettings.DropShadows;
}

void state_OnReset(object sender, EventArgs e)
void state_OnReset(object sender, TimerPhase t)
{
_deaths = 0;
}
Expand Down
18 changes: 11 additions & 7 deletions HaloSplitFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ namespace LiveSplit.HaloSplit
{
public class HaloSplitFactory : IComponentFactory
{
private HaloSplitComponent _instance;

public string ComponentName
{
get { return "HaloSplit"; }
}

public IComponent Create(LiveSplitState state)
public string Description
{
get { return "Auto-splitter for Halo PC"; }
}

public ComponentCategory Category
{
// TODO: in LiveSplit 1.4, components will be IDisposable
// this assumes the passed state is always the same one, until then
return _instance ?? (_instance = new HaloSplitComponent(state));
get { return ComponentCategory.Control; }
}

// return new HaloSplitComponent(state);
public IComponent Create(LiveSplitState state)
{
return new HaloSplitComponent(state);
}

public string UpdateName
Expand Down
8 changes: 4 additions & 4 deletions LiveSplit.HaloSplit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="LiveSplit.Core">
<HintPath>C:\Files\Apps\Gaming\LiveSplit 1.3\LiveSplit.Core.dll</HintPath>
<HintPath>C:\Files\Apps\Gaming\LiveSplit 1.4\LiveSplit.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="UpdateManager">
<HintPath>C:\Files\Apps\Gaming\LiveSplit 1.3\UpdateManager.dll</HintPath>
<HintPath>C:\Files\Apps\Gaming\LiveSplit 1.4\UpdateManager.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down

0 comments on commit e0ef481

Please sign in to comment.