Skip to content

Commit 3967b7c

Browse files
committed
Minor stuff
1 parent 7774308 commit 3967b7c

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

PolyMod.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
https://polymod.dev/nuget/v3/index.json;
1111
</RestoreAdditionalProjectSources>
1212
<Configurations>IL2CPP</Configurations>
13-
<Version>1.1.8</Version>
13+
<Version>1.3.0-pre</Version>
1414
<PolytopiaVersion>2.13.0.14218</PolytopiaVersion>
1515
<Authors>PolyModdingTeam</Authors>
1616
<Description>The Battle of Polytopia's mod loader.</Description>

src/Managers/Multiplayer.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using HarmonyLib;
6+
7+
namespace PolyMod.Managers
8+
{
9+
public static class Multiplayer
10+
{
11+
internal static void Init()
12+
{
13+
Harmony.CreateAndPatchAll(typeof(Multiplayer));
14+
BuildConfigHelper.GetSelectedBuildConfig().buildServerURL = BuildServerURL.Custom;
15+
BuildConfigHelper.GetSelectedBuildConfig().customServerURL = Plugin.config.backendUrl;
16+
}
17+
18+
[HarmonyPostfix]
19+
[HarmonyPatch(typeof(MultiplayerScreen), nameof(MultiplayerScreen.Show))]
20+
public static void MultiplayerScreen_Show(MultiplayerScreen __instance)
21+
{
22+
__instance.multiplayerSelectionScreen.TournamentsButton.gameObject.SetActive(false);
23+
}
24+
25+
26+
[HarmonyPostfix]
27+
[HarmonyPatch(typeof(ProfileScreen), nameof(ProfileScreen.Start))]
28+
public static void ProfileScreen_Start(ProfileScreen __instance)
29+
{
30+
}
31+
32+
[HarmonyPostfix]
33+
[HarmonyPatch(typeof(StartScreen), nameof(StartScreen.Start))]
34+
private static void StartScreen_Start(StartScreen __instance)
35+
{
36+
__instance.highscoreButton.gameObject.SetActive(false);
37+
__instance.weeklyChallengesButton.gameObject.SetActive(false);
38+
}
39+
}
40+
}

src/Plugin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace PolyMod;
1010
public partial class Plugin : BepInEx.Unity.IL2CPP.BasePlugin
1111
{
1212
internal record PolyConfig(
13-
bool debug = false
13+
bool debug = false,
14+
string backendUrl = "http://127.0.0.1:8090"
1415
);
1516

1617
internal const int AUTOIDX_STARTS_FROM = 1000;
@@ -59,6 +60,7 @@ public override void Load()
5960
Hub.Init();
6061

6162
Main.Init();
63+
Multiplayer.Init();
6264
}
6365

6466
internal static Stream GetResource(string id)

0 commit comments

Comments
 (0)