Skip to content

Commit 2a30bfa

Browse files
Make remove leaves not depend on a server resource
1 parent b998ab4 commit 2a30bfa

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Classes/ServerData.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ public static System.Collections.IEnumerator LoadServerData()
194194
Menu.Main.StumpLeaderboardIndex = int.Parse(Data2[2]);
195195
Menu.Main.ForestLeaderboardIndex = int.Parse(Data2[3]);
196196

197-
Mods.Visuals.leavesName = ResponseData[9];
198-
199197
// Detected mod labels
200198
string[] DetectedMods = null;
201199

Mods/Visuals.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,27 @@ public static void FixRigColors()
11381138
}
11391139
}
11401140

1141-
public static string leavesName = "UnityTempFile-f2bd9d00466e74f4086a76332b98515f";
1141+
public static string _leavesName;
1142+
public static string leavesName
1143+
{
1144+
get
1145+
{
1146+
if (_leavesName == null)
1147+
{
1148+
var matchingObjects = GetObject("Environment Objects/LocalObjects_Prefab/Forest")
1149+
.GetComponentsInChildren<Transform>(true)
1150+
.Where(t => t.name.StartsWith("UnityTempFile"))
1151+
.GroupBy(t => t.name)
1152+
.OrderByDescending(g => g.Count())
1153+
.FirstOrDefault();
1154+
1155+
_leavesName = matchingObjects?.Key ?? "UnityTempFile";
1156+
}
1157+
1158+
return _leavesName;
1159+
}
1160+
}
1161+
11421162
public static List<GameObject> leaves = new List<GameObject> { };
11431163
public static void EnableRemoveLeaves()
11441164
{

PluginInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class PluginInfo
55
public const string GUID = "org.iidk.gorillatag.iimenu";
66
public const string Name = "ii's Stupid Menu";
77
public const string Description = "Created by @goldentrophy with love <3";
8-
public const string BuildTimestamp = "2025-08-08T04:06:44Z";
8+
public const string BuildTimestamp = "2025-08-08T04:30:53Z";
99
public const string Version = "6.8.1";
1010

1111
public const string BaseDirectory = "iisStupidMenu";

0 commit comments

Comments
 (0)