Skip to content

Commit

Permalink
.NETFX 4.6.2 and support for V19+ (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlitchyPSIX committed Nov 20, 2022
1 parent 0d72d12 commit 0d59c71
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
28 changes: 27 additions & 1 deletion VEGAS4Discord/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,35 @@ public void resetPresence(ref DiscordRpc.RichPresence pres, Vegas vegas, string
if (!PresenceEnabled)
return;

int vegasVersion = int.Parse(vegas.Version.Split(' ')[1].Split('.')[0]);
string verKey;

switch (vegasVersion) {
case >= 13 and < 15:
{
verKey = $"v{vegasVersion}";
break;
}
case >= 15 and <= 18:
{
verKey = "v15";
break;
}
case >18:
{
verKey = "v19";
break;
}
default:
{
verKey = "v13";
break;
}
}

pres = new DiscordRpc.RichPresence
{
largeImageKey = (int.Parse(vegas.Version.Split(' ')[1].Split('.')[0]) > 14 ? "v15" : "v" + vegas.Version.Split(' ')[1].Split('.')[0]),
largeImageKey = verKey,
largeImageText = vegas.Version
};
if (smallKey != "")
Expand Down
2 changes: 1 addition & 1 deletion VEGAS4Discord/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion VEGAS4Discord/VEGASDiscordRPC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VegasDiscordRPC</RootNamespace>
<AssemblyName>VegasDiscordRPC</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>9</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>9</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,6 +41,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Optimize>false</Optimize>
<LangVersion>9</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
Expand All @@ -48,6 +51,7 @@
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>9</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -57,6 +61,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>9</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
Expand All @@ -66,6 +71,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>9</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="ScriptPortal.Vegas, Version=15.0.0.416, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc, processorArchitecture=MSIL">
Expand Down

0 comments on commit 0d59c71

Please sign in to comment.