-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerListMod.cs
More file actions
45 lines (38 loc) · 1.4 KB
/
Copy pathPlayerListMod.cs
File metadata and controls
45 lines (38 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Collections.Generic;
using System.IO;
using DearImGuiInjection;
using MelonLoader;
using MelonLoader.Utils;
using PlayerList;
using PlayerList.GUI.Tabs;
using PlayerList.Utils;
using UnityEngine;
using Renderer = PlayerList.GUI.Renderer;
[assembly:
MelonInfo(typeof(PlayerListMod), PlayerListModInfo.MOD_NAME, PlayerListModInfo.MOD_VERSION,
PlayerListModInfo.MOD_AUTHOR, $"{PlayerListModInfo.MOD_LINK}/releases/latest/download/Release.zip")]
[assembly: MelonGame("Landfall Games", "Knightfall")]
namespace PlayerList;
internal class PlayerListMod : MelonMod
{
public override async void OnInitializeMelon()
{
LoggerInstance.Msg($"Plugin {PlayerListModInfo.MOD_GUID} is loaded!");
ConfigManager.Setup();
try
{
PlayersTab.CustomPlayers = await API.FetchCustomPlayers();
}
catch
{
PlayersTab.CustomPlayers = new List<APIPlayer>();
}
var imGuiConfigPath = MelonEnvironment.GameRootDirectory;
var assetsFolder = Path.Join(MelonEnvironment.PluginsDirectory, PlayerListModInfo.MOD_NAME, "Assets");
ImGuiInjector.Init(imGuiConfigPath, assetsFolder, LoggerInstance);
var renderer = new Renderer();
ImGuiInjector.Render += renderer.Render;
var managerGo = new GameObject(PlayerListModInfo.MOD_NAME) { hideFlags = HideFlags.HideAndDontSave };
_ = managerGo.AddComponent<InputsManager>();
}
}