Skip to content

Commit

Permalink
moved description to html file
Browse files Browse the repository at this point in the history
added resource helper
  • Loading branch information
drowhunter committed Aug 14, 2024
1 parent fb77f16 commit ab19ec3
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 16 deletions.
1 change: 1 addition & 0 deletions PluginHelper/PluginHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ItemGroup>
<Compile Include="Maths.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceHelper.cs" />
<Compile Include="UdpServer.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
31 changes: 31 additions & 0 deletions PluginHelper/ResourceHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.IO;
using System.Reflection;

namespace PluginHelper
{
public class ResourceHelper
{
public static string LoadEmbeddedResourceString(string resourceName)
{

var result = string.Empty;

try
{
var assembly = Assembly.GetExecutingAssembly();
var name = assembly.GetName().Name;
using (Stream stream = assembly.GetManifestResourceStream($"{name}.Resources.{resourceName}"))
using (StreamReader reader = new StreamReader(stream))
{
result = reader.ReadToEnd(); }
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

return result;
}
}
}
3 changes: 2 additions & 1 deletion Plugins/GT7Plugin/GT7Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class GT7Plugin : Game

public string AUTHOR => "Drowhunter";

public string Description => Resources.description;

public string Description => ResourceHelper.LoadEmbeddedResourceString("description.html");

public Image Logo => Resources.logo;

Expand Down
4 changes: 4 additions & 0 deletions Plugins/GT7Plugin/GT7Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
<ItemGroup>
<EmbeddedResource Include="Profiles\DefaultProfile.yawgeprofile" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Resources\description.html" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)ge.targets" />
</Project>
19 changes: 19 additions & 0 deletions Plugins/GT7Plugin/Resources/description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h2>Instructions</h2>
<p>
<ol>
<li>Start your Playstation<sup>TM</sup></li>
<li>Start the plugin</li>
<li>Enter you Console's IP address, <i>(check it in Console Network Settings)</i> or leave it on <b>autodiscovery</b> <font color="" yellow"">(255.255.255.255)</font>
</ol>
</p>

<h3>Working with External Programs</h3>
<p>If you are using other software that uses telemetry like Simhub, you can have that software forward the telemetry on a different port. In which case you may enter the alternative port when clicking Start Plugin</p>

<h3>UDP Forwarding</h3>
<p>Alternatively, you can also check the UDP Forwarding checkbox to allow Game Engine to forward data on a different port, which can then be used by other software such as Simhub</p>

<h3><font color="red">Notes</font></h3>
<p>When port forwarding you may need to use the ipaddress instead of the autodisovery</p>

<small>version 0.9.4</small>
13 changes: 3 additions & 10 deletions Plugins/OverloadPlugin/OverloadPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
using System.Reflection;
using System.Text;
using System.Threading;
using Quaternion = System.Numerics.Quaternion;
using YawGEAPI;
using PluginHelper;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;

namespace YawVR_Game_Engine.Plugin
{
Expand All @@ -38,12 +38,7 @@ public class OverloadPlugin : Game

public Image Background => Resources.background;

public string Description => @"<font color=""green"">v1.1.1
&quot;Usage:<br>
1. Install OLMOD <a href=""https://olmod.overloadmaps.com/"">click here</a><br>
2. Install GameMod.dll with telemetry into your overload directory (<a href=""https://github.com/drowhunter/olmod/releases/latest"">click here</a>)<br>
3. Launch Olmod.exe to start the game ('Telemetry' must appear on the upper right corner of the game's main menu).&quot;;
</font>";
public string Description => ResourceHelper.LoadEmbeddedResourceString("description.html");


private Thread readThread;
Expand Down Expand Up @@ -244,9 +239,7 @@ public void Init()

public void PatchGame()
{
// should add code to download the olmod and extract it to the game folder
// just like TheCrew2 plugin does


}

public void SetReferences(IProfileManager controller, IMainFormDispatcher dispatcher)
Expand Down
7 changes: 4 additions & 3 deletions Plugins/OverloadPlugin/OverloadPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@
<EmbeddedResource Include="Profiles\DefaultProfile.yawgeprofile" />
<EmbeddedResource Include="Properties\Resources.resx" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\PluginHelper\PluginHelper.csproj">
<Project>{1d53fce9-bfbd-475a-8079-c5ba1b98313c}</Project>
<Name>PluginHelper</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\description.html" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)ge.targets" />
</Project>
4 changes: 2 additions & 2 deletions Plugins/OverloadPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
[assembly: ComVisible(false)]
[assembly: Guid("A3CC01F7-9AA4-4E93-8F79-5A7B10E98ABE")]

[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.4.0")]
[assembly: AssemblyVersion("1.1.4.0")]

10 changes: 10 additions & 0 deletions Plugins/OverloadPlugin/Resources/description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h2>Instructions</h2>
<small>Version (v1.1.4)</small>
<p>
<ol>
<li>Install OLMOD <a href="https: //olmod.overloadmaps.com/">click here</a></li>
<li>Install GameMod.dll with telemetry into your overload directory (<a href="https://github.com/drowhunter/olmod/releases/latest">click here</a>)</li>
<li>Launch Olmod.exe to start the game ('Telemetry' must appear on the upper right corner of the game's main menu).
</ol>
</p>
<small>version 1.1.4</small>
Binary file modified output/OverloadPlugin.dll
Binary file not shown.

0 comments on commit ab19ec3

Please sign in to comment.