Skip to content

Commit

Permalink
Merge pull request #1 from denisabt/multi_buddy_version
Browse files Browse the repository at this point in the history
not sure if this is 'old'
  • Loading branch information
denisabt authored May 29, 2021
2 parents 61d5ba9 + 9102a71 commit 4ab2ce4
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 29 deletions.
33 changes: 33 additions & 0 deletions ClippyVSPackage/AssistantBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.IO;
using System.Text;

namespace Recoding.ClippyVSPackage
{
public class AssistantBase
{

/// <summary>
/// Seconds between a random idle animation and another
/// </summary>
protected const int IdleAnimationTimeout = 45;

/// <summary>
/// When is true it means an animation is actually running
/// </summary>
public bool IsAnimating { get; set; }

/// <summary>
/// Reads the content of a stream into a string
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
public static string StreamToString(Stream stream)
{
stream.Position = 0;
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
}
}
30 changes: 1 addition & 29 deletions ClippyVSPackage/Clippy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
using Recoding.ClippyVSPackage.Configurations;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
Expand All @@ -20,7 +17,7 @@ namespace Recoding.ClippyVSPackage
/// <summary>
/// The core object that represents Clippy and its animations
/// </summary>
public class Clippy
public class Clippy : AssistantBase
{
/// <summary>
/// The URI for the sprite with all the animation stages for Clippy
Expand Down Expand Up @@ -57,15 +54,6 @@ public class Clippy
/// </summary>
private static int clipHeight = 93;

/// <summary>
/// Seconds between a random idle animation and another
/// </summary>
private const int IdleAnimationTimeout = 45;

/// <summary>
/// When is true it means an animation is actually running
/// </summary>
public bool IsAnimating { get; set; }
public static int ClipHeight { get => clipHeight; set => clipHeight = value; }
public static int ClipWidth { get => clipWidth; set => clipWidth = value; }
public List<ClippyAnimation> AllAnimations { get => allAnimations; }
Expand Down Expand Up @@ -234,21 +222,5 @@ public async System.Threading.Tasks.Task StartAnimationAsync(ClippyAnimation ani
}

}



/// <summary>
/// Reads the content of a stream into a string
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
private static string StreamToString(Stream stream)
{
stream.Position = 0;
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
}
}
5 changes: 5 additions & 0 deletions ClippyVSPackage/ClippyVSPackage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssistantBase.cs" />
<Compile Include="Clippy.cs" />
<Compile Include="ClippyVSSettings.cs" />
<Compile Include="Command1.cs" />
Expand Down Expand Up @@ -150,6 +151,10 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Command1.png" />
<Content Include="Resources\Merlin\agent.js" />
<Resource Include="Resources\Merlin\map.png" />
<Content Include="Resources\Merlin\sounds-mp3.js" />
<Content Include="Resources\Merlin\sounds-ogg.js" />
<Content Include="Resources\preview.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down
1 change: 1 addition & 0 deletions ClippyVSPackage/Resources/Merlin/agent.js

Large diffs are not rendered by default.

Binary file added ClippyVSPackage/Resources/Merlin/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ClippyVSPackage/Resources/Merlin/sounds-mp3.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ClippyVSPackage/Resources/Merlin/sounds-ogg.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ClippyVSPackage/Resources/Merlin/tempanimfile.js

Large diffs are not rendered by default.

0 comments on commit 4ab2ce4

Please sign in to comment.