1.2.0 update
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Yariazen.PlateUp.ModBuildUtilities" Version="1.10.21" />
|
<PackageReference Include="Yariazen.PlateUp.ModBuildUtilities" Version="1.11.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Kitchen;
|
|||||||
using KitchenLib.Event;
|
using KitchenLib.Event;
|
||||||
using KitchenLib.Preferences;
|
using KitchenLib.Preferences;
|
||||||
using MMOKitchen.Menus;
|
using MMOKitchen.Menus;
|
||||||
|
using KitchenLogger = KitchenLib.Logging.KitchenLogger;
|
||||||
|
|
||||||
namespace MMOKitchen
|
namespace MMOKitchen
|
||||||
{
|
{
|
||||||
@@ -13,9 +14,9 @@ namespace MMOKitchen
|
|||||||
{
|
{
|
||||||
public const string MOD_GUID = "com.starfluxgames.mmokitchen";
|
public const string MOD_GUID = "com.starfluxgames.mmokitchen";
|
||||||
public const string MOD_NAME = "MMO Kitchen";
|
public const string MOD_NAME = "MMO Kitchen";
|
||||||
public const string MOD_VERSION = "0.3.0";
|
public const string MOD_VERSION = "0.3.1";
|
||||||
public const string MOD_AUTHOR = "StarFluxGames";
|
public const string MOD_AUTHOR = "StarFluxGames";
|
||||||
public const string MOD_GAMEVERSION = ">=1.1.9";
|
public const string MOD_GAMEVERSION = ">=1.2.0";
|
||||||
|
|
||||||
public static KitchenLogger Logger;
|
public static KitchenLogger Logger;
|
||||||
public static PreferenceManager manager;
|
public static PreferenceManager manager;
|
||||||
@@ -42,18 +43,15 @@ namespace MMOKitchen
|
|||||||
manager.RegisterPreference(new PreferenceFloat("scaleAbove4PlayersMultiplier", 0.1f));
|
manager.RegisterPreference(new PreferenceFloat("scaleAbove4PlayersMultiplier", 0.1f));
|
||||||
manager.Load();
|
manager.Load();
|
||||||
|
|
||||||
ModsPreferencesMenu<PauseMenuAction>.RegisterMenu(MOD_NAME, typeof(PreferenceMenu<PauseMenuAction>), typeof(PauseMenuAction));
|
ModsPreferencesMenu<MenuAction>.RegisterMenu("MMO Kitchen", typeof(PreferenceMenu<MenuAction>), typeof(MenuAction));
|
||||||
|
ModsPreferencesMenu<MenuAction>.RegisterMenu("MMO Kitchen", typeof(PreferenceMenu<MenuAction>), typeof(MenuAction));
|
||||||
Events.PreferenceMenu_PauseMenu_CreateSubmenusEvent += (s, args) =>
|
Events.MainMenuView_SetupMenusEvent += (s, args) =>
|
||||||
{
|
{
|
||||||
args.Menus.Add(typeof(PreferenceMenu<PauseMenuAction>), new PreferenceMenu<PauseMenuAction>(args.Container, args.Module_list));
|
args.addMenu.Invoke(args.instance, new object[] { typeof(PreferenceMenu<MenuAction>), new PreferenceMenu<MenuAction>(args.instance.ButtonContainer, args.module_list) });
|
||||||
};
|
};
|
||||||
|
Events.PlayerPauseView_SetupMenusEvent += (s, args) =>
|
||||||
ModsPreferencesMenu<MainMenuAction>.RegisterMenu(MOD_NAME, typeof(PreferenceMenu<MainMenuAction>), typeof(MainMenuAction));
|
|
||||||
|
|
||||||
Events.PreferenceMenu_MainMenu_CreateSubmenusEvent += (s, args) =>
|
|
||||||
{
|
{
|
||||||
args.Menus.Add(typeof(PreferenceMenu<MainMenuAction>), new PreferenceMenu<MainMenuAction>(args.Container, args.Module_list));
|
args.addMenu.Invoke(args.instance, new object[] { typeof(PreferenceMenu<MenuAction>), new PreferenceMenu<MenuAction>(args.instance.ButtonContainer, args.module_list) });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,33 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Kitchen.NetworkSupport;
|
using Kitchen.NetworkSupport;
|
||||||
using Steamworks;
|
|
||||||
using Steamworks.Data;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Reflection.Emit;
|
||||||
|
|
||||||
namespace MMOKitchen.Patches
|
namespace MMOKitchen.Patches
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This patch is used to change how many players can join the lobby using Steam.
|
* This patch is used to change how many players can join the lobby using Steam.
|
||||||
*/
|
*/
|
||||||
|
[HarmonyPatch(typeof(SteamPlatform))]
|
||||||
[HarmonyPatch(typeof(SteamPlatform), "CreateNewLobby")]
|
|
||||||
public class SteamPlatformPatch
|
public class SteamPlatformPatch
|
||||||
{
|
{
|
||||||
public static bool Prefix(SteamPlatform __instance, Action<bool, Lobby> callback)
|
private static MethodBase TargetMethod()
|
||||||
{
|
{
|
||||||
if (__instance.IsReady)
|
Type type = AccessTools.FirstInner(typeof(SteamPlatform), t => t.Name.Contains("<CreateNewLobby>d__26"));
|
||||||
|
return AccessTools.FirstMethod(type, method => method.Name.Contains("MoveNext"));
|
||||||
|
}
|
||||||
|
[HarmonyTranspiler]
|
||||||
|
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
||||||
{
|
{
|
||||||
SteamMatchmaking.CreateLobbyAsync(Mod.MaxPlayers).ContinueWith(delegate (Task<Lobby?> task)
|
CodeMatcher matcher = new(instructions);
|
||||||
{
|
|
||||||
if (task.IsCompleted && task.Result != null)
|
|
||||||
{
|
|
||||||
Lobby valueOrDefault = task.Result.GetValueOrDefault();
|
|
||||||
__instance.CurrentInviteLobby = valueOrDefault;
|
|
||||||
|
|
||||||
MethodInfo performSetPermissions = AccessTools.Method(typeof(SteamPlatform), "PerformSetPermissions");
|
matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4_2), new CodeMatch(OpCodes.Bne_Un), new CodeMatch(OpCodes.Ldc_I4_4))
|
||||||
performSetPermissions.Invoke(__instance, new object[] { __instance.Permissions });
|
.Advance(2)
|
||||||
callback(true, valueOrDefault);
|
.Set(OpCodes.Ldc_I4, Mod.MaxPlayers);
|
||||||
}
|
|
||||||
else
|
return matcher.InstructionEnumeration();
|
||||||
{
|
|
||||||
callback(false, default(Lobby));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,6 @@ namespace MMOKitchen.Systems
|
|||||||
SetComponent(data.Target, Editor);
|
SetComponent(data.Target, Editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CTriggerProfileEditor Editor;
|
private CTriggerPlayerSpecificUI Editor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user