Skip to content

Commit

Permalink
fixed sound not playing
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Crook committed Nov 26, 2016
1 parent af800a9 commit e45ad13
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,5 @@ _Pvt_Extensions
.fake/

# custom
dist/
dist/
/BattleCry.zip
8 changes: 7 additions & 1 deletion BattleCry.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BattleCry", "BattleCry\BattleCry.csproj", "{B85B98E9-257F-42E3-988E-BA38EC81E51D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Debug|x86.ActiveCfg = Debug|x86
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Debug|x86.Build.0 = Debug|x86
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Release|Any CPU.Build.0 = Release|Any CPU
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Release|x86.ActiveCfg = Release|x86
{B85B98E9-257F-42E3-988E-BA38EC81E51D}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
28 changes: 24 additions & 4 deletions BattleCry/BattleCry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,34 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hearthstone Deck Tracker">
<HintPath>J:\Program Files\HearthstoneTracker\from github\Hearthstone Deck Tracker\Hearthstone Deck Tracker.exe</HintPath>
<Reference Include="HearthstoneDeckTracker">
<HintPath>C:\Users\go_ha\AppData\Local\HearthstoneDeckTracker\app-1.1.1.2\HearthstoneDeckTracker.exe</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -69,7 +89,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /Y "$(TargetDir)$(ProjectName).dll" "J:\Program Files\HearthstoneTracker\from github\Hearthstone Deck Tracker\Plugins\$(ProjectName).dll"</PostBuildEvent>
<PostBuildEvent>copy /Y "$(TargetDir)$(ProjectName).dll" "C:\Users\go_ha\AppData\Roaming\HearthstoneDeckTracker\Plugins\BattleCry\$(ProjectName).dll"</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
2 changes: 1 addition & 1 deletion BattleCry/Game/GameMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void Initialize()
{
Hearthstone_Deck_Tracker.API.GameEvents.OnOpponentPlay.Add(_playHandler.OnOpponentPlay);
Hearthstone_Deck_Tracker.API.GameEvents.OnPlayerPlay.Add(_playHandler.OnPlayerPlay);
Hearthstone_Deck_Tracker.Logger.WriteLine("Setup BattleCry Event Handlers");
Hearthstone_Deck_Tracker.Utility.Logging.Log.Info("Setup BattleCry Event Handlers");
}

public void Update()
Expand Down
4 changes: 2 additions & 2 deletions BattleCry/Game/PlayHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ private void OnPlay(Card card, CardSource cardSource)
var soundToPlay = _cardSoundPicker.GetBattleCryFor(card, cardSource);
if(soundToPlay == null)
{
Hearthstone_Deck_Tracker.Logger.WriteLine("BattleCry SFX not found");
Hearthstone_Deck_Tracker.Utility.Logging.Log.Info("BattleCry SFX not found");
return;
}

_soundBoard.Play(soundToPlay);
Hearthstone_Deck_Tracker.Logger.WriteLine("BattleCry Sound Effect Triggered");
Hearthstone_Deck_Tracker.Utility.Logging.Log.Info("BattleCry Sound Effect Triggered");
}

public void Update()
Expand Down
3 changes: 2 additions & 1 deletion BattleCry/Sound/SoundBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public void Close()

public void Play(SoundPlaySetting soundPlaySettings)
{
if(soundPlaySettings.Delay <= 0)
Hearthstone_Deck_Tracker.Utility.Logging.Log.Info($"Playing: cardid: ${soundPlaySettings.CardId}, file name: ${soundPlaySettings.FileName}");
if (soundPlaySettings.Delay <= 0)
{
DelayedPlayback(soundPlaySettings);
}
Expand Down

0 comments on commit e45ad13

Please sign in to comment.