Skip to content

Commit

Permalink
Update gitignore, add more text templates
Browse files Browse the repository at this point in the history
  • Loading branch information
FragileDeviations committed Mar 16, 2024
1 parent 3357a81 commit 448acae
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# My stuff
Links/
Scripts/Lists/TheBeeMovie.cs
.idea/

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
4 changes: 1 addition & 3 deletions BoneMenu/BoneMenu.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using WeatherElectric.SplashText.Scripts;

namespace WeatherElectric.SplashText.Menu;
namespace WeatherElectric.SplashText.Menu;

internal static class BoneMenu
{
Expand Down
5 changes: 4 additions & 1 deletion GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
global using BoneLib.BoneMenu;
global using BoneLib.BoneMenu.Elements;
global using UnityEngine;
global using WeatherElectric.SplashText.Menu;
global using WeatherElectric.SplashText.Menu;
global using WeatherElectric.SplashText.Scripts;
global using WeatherElectric.SplashText.Scripts.Helpers;
global using WeatherElectric.SplashText.Scripts.Lists;
12 changes: 3 additions & 9 deletions Main.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using System.Linq;
using HarmonyLib;
using HarmonyLib;
using SLZ.Marrow.SceneStreaming;
using SLZ.Marrow.Warehouse;
using TMPro;
using UnityEngine.SceneManagement;
using WeatherElectric.SplashText.Scripts;
using Object = UnityEngine.Object;

namespace WeatherElectric.SplashText;

Expand All @@ -15,8 +9,8 @@ public class Main : MelonMod
internal const string Description = "Adds splash text to Void G114's menu.";
internal const string Author = "SoulWithMae";
internal const string Company = "Weather Electric";
internal const string Version = "0.0.1";
internal const string DownloadLink = null;
internal const string Version = "1.0.0";
internal const string DownloadLink = "https://bonelab.thunderstore.io/package/SoulWithMae/SplashText/";

public override void OnInitializeMelon()
{
Expand Down
24 changes: 19 additions & 5 deletions Scripts/Helpers/EntryHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace WeatherElectric.SplashText.Scripts.Helpers;
using SLZ.Marrow.Warehouse;

namespace WeatherElectric.SplashText.Scripts.Helpers;

internal static class EntryHelper
{
Expand All @@ -7,11 +9,23 @@ public static string GetRandomEntry()
var rnd = new System.Random();
var lines = File.ReadAllLines(UserData.EntriesPath);
var r = rnd.Next(lines.Length);
var line = lines[r];
if (line.Contains("{UserName}"))
var randomSplash = lines[r];

if (randomSplash.Contains("{UserName}"))
{
randomSplash = randomSplash.Replace("{UserName}", Environment.UserName);
}

if (randomSplash.Contains("{PalletCount}"))
{
randomSplash = randomSplash.Replace("{PalletCount}", AssetWarehouse.Instance.GetPallets().Count.ToString());
}

if (randomSplash.Contains("{CurrentAvatar}"))
{
line = line.Replace("{UserName}", Environment.UserName);
randomSplash = randomSplash.Replace("{CurrentAvatar}", Player.rigManager.AvatarCrate.Crate.Title);
}
return line;

return randomSplash;
}
}
2 changes: 0 additions & 2 deletions Scripts/TextManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Linq;
using TMPro;
using UnityEngine.SceneManagement;
using WeatherElectric.SplashText.Scripts.Helpers;
using WeatherElectric.SplashText.Scripts.Lists;
using Object = UnityEngine.Object;

namespace WeatherElectric.SplashText.Scripts;
Expand Down

0 comments on commit 448acae

Please sign in to comment.