Skip to content

Commit 8033a1a

Browse files
Merge pull request #6 from PolyTech-Modding/author_credits_addition
added authors and credits patch and version bump
2 parents 82ef139 + 97fce67 commit 8033a1a

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

PolyTechFramework.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
<Reference Include="UnityEngine.UI">
3939
<HintPath>Libraries\UnityEngine.UI.dll</HintPath>
4040
</Reference>
41+
<Reference Include="Unity.TextMeshPro">
42+
<HintPath>Libraries\Unity.TextMeshPro.dll</HintPath>
43+
</Reference>
4144
<Reference Include="UnityEngine.AnimationModule">
4245
<HintPath>Libraries\UnityEngine.AnimationModule.dll</HintPath>
4346
</Reference>

PolyTechMain.cs

+31-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Text;
1313
using System.Timers;
1414
using UnityEngine;
15+
using TMPro;
1516
using Logger = BepInEx.Logging.Logger;
1617
namespace PolyTechFramework
1718
{
@@ -23,7 +24,7 @@ public class PolyTechMain : PolyTechMod
2324
public new const string
2425
PluginGuid = "polytech.polytechframework",
2526
PluginName = "PolyTech Framework",
26-
PluginVersion = "0.9.2";
27+
PluginVersion = "0.9.3";
2728
private static BindingList<PolyTechMod>
2829
noncheatMods = new BindingList<PolyTechMod> { },
2930
cheatMods = new BindingList<PolyTechMod> { };
@@ -117,6 +118,8 @@ public void Awake()
117118
this.isEnabled = modEnabled.Value;
118119
ptfInstance = this;
119120

121+
this.authors = new string[] {"MoonlitJolty", "Conqu3red", "Razboy20", "Tran Fox", "nitsuga5124"};
122+
120123
registerMod(this);
121124
}
122125

@@ -844,14 +847,41 @@ private static void PatchMainAwake()
844847
{
845848
string cosmetics = "";
846849
string cheats = "";
850+
851+
// load credit values
852+
TMPro.TextMeshProUGUI titleCredits = GameUI.m_Instance.m_Settings.m_CreditsPanel.transform
853+
.Find("Mask/Credits/Titles")
854+
.GetComponent<TMPro.TextMeshProUGUI>();
855+
856+
TMPro.TextMeshProUGUI nameCredits = GameUI.m_Instance.m_Settings.m_CreditsPanel.transform
857+
.Find("Mask/Credits/Names")
858+
.GetComponent<TMPro.TextMeshProUGUI>();
859+
860+
// aligning things properly
861+
titleCredits.text = titleCredits.text + "\n\n\n\n\n";
862+
nameCredits.text = nameCredits.text.TrimEnd('\n') + "\nArglin Kampling\n\n";
863+
847864
foreach (PolyTechMod mod in PolyTechMain.noncheatMods)
848865
{
849866
cosmetics += $"\n{mod.Info.Metadata.Name} - v{mod.Info.Metadata.Version}";
867+
if (mod.authors != null){
868+
titleCredits.text += $"{mod.Info.Metadata.Name}\n";
869+
nameCredits.text += String.Join("\n", mod.authors) + "\n\n";
870+
titleCredits.text += new string('\n', mod.authors.Length);
871+
}
850872
}
851873
foreach (PolyTechMod mod in PolyTechMain.cheatMods)
852874
{
853875
cheats += $"\n{mod.Info.Metadata.Name} - v{mod.Info.Metadata.Version}";
876+
if (mod.authors != null){
877+
titleCredits.text += $"{mod.Info.Metadata.Name}\n";
878+
nameCredits.text += String.Join("\n", mod.authors) + "\n\n";
879+
titleCredits.text += new string('\n', mod.authors.Length);
880+
}
854881
}
882+
titleCredits.text += "\n\n";
883+
nameCredits.text += "\n\n";
884+
855885
ptfInstance.ptfLogger.LogMessage($"Game Started with the following Cosmetic mods: {cosmetics}");
856886
ptfInstance.ptfLogger.LogMessage($"Game Started with the following Cheat mods: {cheats}");
857887
}

PolyTechMod.cs

+1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ public virtual void setSettings(string settings)
4141
public bool isEnabled;
4242
public bool isCheat;
4343
public string repositoryUrl;
44+
public string[] authors;
4445
}
4546
}

0 commit comments

Comments
 (0)