Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benrick committed May 23, 2019
1 parent 62173c8 commit 1ca1721
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/InteractiveSeven.Core/InteractiveSeven.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
21 changes: 21 additions & 0 deletions src/InteractiveSeven.Twitch/Commands/MenuCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using InteractiveSeven.Core.Models;
using InteractiveSeven.Core.Settings;
using InteractiveSeven.Twitch.Model;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
Expand All @@ -15,6 +16,7 @@ public class MenuCommand : BaseCommand
{
private readonly IMenuColorAccessor _menuColorAccessor;
private readonly ITwitchClient _twitchClient;
private static readonly Random Rand = new Random();

private string ProcessName => ApplicationSettings.Instance.ProcessName;
private MenuColorSettings MenuSettings => ApplicationSettings.Instance.MenuSettings;
Expand Down Expand Up @@ -83,6 +85,8 @@ private static MenuColors GetSpecialColor(string firstArg)
{
switch (firstArg.ToLower())
{
case "random":
return RandomPalette();
case "tsunamods":
case "tsunamix":
case "tsuna":
Expand All @@ -102,5 +106,22 @@ private static MenuColors GetSpecialColor(string firstArg)
return null;
}
}

private static MenuColors RandomPalette()
{
return new MenuColors
{
TopLeft = GetRandomColor(),
TopRight = GetRandomColor(),
BotLeft = GetRandomColor(),
BotRight = GetRandomColor()
};
Color GetRandomColor()
{
byte[] b = new byte[3];
Rand.NextBytes(b);
return Color.FromArgb(b[0], b[1], b[2]);
}
}
}
}
16 changes: 16 additions & 0 deletions src/InteractiveSeven.UI/InteractiveSeven.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Configuration.ConfigurationManager.4.5.0\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Drawing.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll</HintPath>
<Private>True</Private>
Expand All @@ -106,6 +110,7 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
Expand All @@ -122,6 +127,9 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.4.5.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
Expand All @@ -142,6 +150,14 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Permissions, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Permissions.4.5.0\lib\net461\System.Security.Permissions.dll</HintPath>
</Reference>
<Reference Include="System.Security.Principal.Windows, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Principal.Windows.4.5.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Transactions" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
Expand Down
4 changes: 4 additions & 0 deletions src/InteractiveSeven.UI/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@
<package id="Serilog.Extensions.Logging" version="2.0.2" targetFramework="net472" />
<package id="Splat" version="7.0.8" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="4.4.1" targetFramework="net472" />
<package id="System.Configuration.ConfigurationManager" version="4.5.0" targetFramework="net472" />
<package id="System.Drawing.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Http" version="4.3.3" targetFramework="net472" />
<package id="System.Reactive" version="4.0.0" targetFramework="net472" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.4.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="4.5.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Permissions" version="4.5.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="4.5.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="TwitchLib" version="3.0.1" targetFramework="net472" />
<package id="TwitchLib.Api" version="3.0.0" targetFramework="net472" />
Expand Down
5 changes: 2 additions & 3 deletions src/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>

<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit 1ca1721

Please sign in to comment.