v0.1.7
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# Release Notes v0.1.7
|
||||
|
||||
- Lobby is nolonger larger than normal.
|
||||
- Players can now interact with eachother's Outfit/Cosmetic/Color selectors.
|
||||
- Democratic Voting is now host dependent.
|
||||
- Difficulty now scales above 4 players.
|
||||
- Possible fix for more than 4 local players.
|
||||
@@ -1,81 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<Configurations>BepInEx;Workshop</Configurations>
|
||||
<AssemblyName>$(MSBuildProjectName)-$(Configuration)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\..\..\..\Libraries\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Discord">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Discord.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Facepunch.Steamworks.Win64">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Facepunch.Steamworks.Win64.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.Common">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.FranchiseBuilderMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.FranchiseBuilderMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.FranchiseMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.FranchiseMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.GameData">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.GameData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.Layouts">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.Layouts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.Networking">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.Networking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.Persistence">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.Persistence.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.PostgameMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.PostgameMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.ResearchMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.ResearchMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.RestaurantMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.RestaurantMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kitchen.TutorialMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Kitchen.TutorialMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KitchenLib-Workshop" Condition="'$(Configuration)'=='Workshop'">
|
||||
<HintPath>..\..\..\..\Libraries\KitchenLib\KitchenLib-Workshop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KitchenLib-BepInEx" Condition="'$(Configuration)'=='BepInEx'">
|
||||
<HintPath>..\..\..\..\Libraries\KitchenLib\KitchenLib-BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\..\..\..\Libraries\BepInEx\core\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KitchenMode">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\KitchenMode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KitchenMods">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\KitchenMods.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Entities">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\Unity.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\..\Libraries\PlateUp_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Yariazen.PlateUp.ModBuildUtilities" Version="1.6.16" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Discord">
|
||||
<HintPath>H:\SteamLibrary\steamapps\common\PlateUp\PlateUp\PlateUp_Data\Managed\Discord.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Facepunch.Steamworks.Win64">
|
||||
<HintPath>H:\SteamLibrary\steamapps\common\PlateUp\PlateUp\PlateUp_Data\Managed\Facepunch.Steamworks.Win64.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KitchenLib-Workshop">
|
||||
<HintPath>..\..\..\..\Libraries\KitchenLib\KitchenLib-Workshop.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
+36
-63
@@ -1,90 +1,63 @@
|
||||
using KitchenLib;
|
||||
using System.Reflection;
|
||||
using KitchenLib.Utils;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using Kitchen;
|
||||
using Kitchen;
|
||||
using KitchenLib;
|
||||
using KitchenLib.Event;
|
||||
using MMOKitchen.Menus;
|
||||
|
||||
#if BEPINEX
|
||||
using BepInEx;
|
||||
#endif
|
||||
#if WORKSHOP
|
||||
using KitchenLib.Preferences;
|
||||
using KitchenMods;
|
||||
#endif
|
||||
using MMOKitchenReborn.Menus;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MMOKitchen
|
||||
namespace MMOKitchenReborn
|
||||
{
|
||||
#if BEPINEX
|
||||
[BepInProcess("PlateUp.exe")]
|
||||
[BepInPlugin(MOD_ID, MOD_NAME, MOD_VERSION)]
|
||||
#endif
|
||||
public class Main : BaseMod
|
||||
{
|
||||
public const string MOD_ID = "mmokitchen";
|
||||
public const string MOD_NAME = "MMO Kitchen";
|
||||
public const string MOD_AUTHOR = "StarFluxGames";
|
||||
public const string MOD_VERSION = "0.1.6";
|
||||
public const string MOD_COMPATIBLE_VERSIONS = "1.1.2";
|
||||
public const string MOD_VERSION = "0.1.7";
|
||||
public const string MOD_COMPATIBLE_VERSIONS = "=<1.1.4";
|
||||
|
||||
public const string CONSENT_REQUIRED_ID = "requiredConsent";
|
||||
|
||||
public int RequiredConsentPercentage;
|
||||
public static PreferenceManager manager;
|
||||
public Main() : base(MOD_ID, MOD_NAME, MOD_AUTHOR, MOD_VERSION, MOD_COMPATIBLE_VERSIONS, Assembly.GetExecutingAssembly()) { }
|
||||
|
||||
#if BEPINEX
|
||||
protected override void OnInitialise()
|
||||
#endif
|
||||
#if WORKSHOP
|
||||
protected override void OnPostActivate(Mod mod)
|
||||
#endif
|
||||
{
|
||||
KitchenLib.IntPreference requiredConsent = PreferenceUtils.Register<KitchenLib.IntPreference>(MOD_ID, CONSENT_REQUIRED_ID, "Required Consent Percentage");
|
||||
requiredConsent.Value = 50;
|
||||
PreferenceUtils.Load();
|
||||
RequiredConsentPercentage = PreferenceUtils.Get<KitchenLib.IntPreference>(MOD_ID, CONSENT_REQUIRED_ID).Value;
|
||||
SetupPreferences();
|
||||
}
|
||||
manager = new PreferenceManager(MOD_ID);
|
||||
manager.RegisterPreference(new PreferenceInt("requiredConsentPercentage", 100));
|
||||
manager.Load();
|
||||
|
||||
public static Texture2D LoadImage(string base64)
|
||||
{
|
||||
byte[] bytes = Convert.FromBase64String(base64);
|
||||
ModsPreferencesMenu<PauseMenuAction>.RegisterMenu("MMO Kitchen", typeof(PreferenceMenu<PauseMenuAction>), typeof(PauseMenuAction));
|
||||
|
||||
Texture2D image = ResourceUtils.LoadTextureRaw(bytes);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
private void SetupPreferences()
|
||||
{
|
||||
Events.PreferenceMenu_MainMenu_SetupEvent += (s, args) =>
|
||||
Events.PreferenceMenu_PauseMenu_CreateSubmenusEvent += (s, args) =>
|
||||
{
|
||||
Type type = args.instance.GetType().GetGenericArguments()[0];
|
||||
args.mInfo.Invoke(args.instance, new object[] { MOD_NAME, typeof(MMOKitchenPreferences<>).MakeGenericType(type), false });
|
||||
args.Menus.Add(typeof(PreferenceMenu<PauseMenuAction>), new PreferenceMenu<PauseMenuAction>(args.Container, args.Module_list));
|
||||
};
|
||||
|
||||
ModsPreferencesMenu<MainMenuAction>.RegisterMenu("MMO Kitchen", typeof(PreferenceMenu<MainMenuAction>), typeof(MainMenuAction));
|
||||
|
||||
Events.PreferenceMenu_MainMenu_CreateSubmenusEvent += (s, args) =>
|
||||
{
|
||||
args.Menus.Add(typeof(MMOKitchenPreferences<MainMenuAction>), new MMOKitchenPreferences<MainMenuAction>(args.Container, args.Module_list));
|
||||
args.Menus.Add(typeof(PreferenceMenu<MainMenuAction>), new PreferenceMenu<MainMenuAction>(args.Container, args.Module_list));
|
||||
};
|
||||
}
|
||||
|
||||
//Setting Up For Pause Menu
|
||||
Events.PreferenceMenu_PauseMenu_SetupEvent += (s, args) =>
|
||||
{
|
||||
Type type = args.instance.GetType().GetGenericArguments()[0];
|
||||
args.mInfo.Invoke(args.instance, new object[] { MOD_NAME, typeof(MMOKitchenPreferences<>).MakeGenericType(type), false });
|
||||
};
|
||||
Events.PreferenceMenu_PauseMenu_CreateSubmenusEvent += (s, args) =>
|
||||
{
|
||||
args.Menus.Add(typeof(MMOKitchenPreferences<PauseMenuAction>), new MMOKitchenPreferences<PauseMenuAction>(args.Container, args.Module_list));
|
||||
};
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static void LogInfo(string message)
|
||||
{
|
||||
Debug.Log($"[{MOD_NAME}] " + message);
|
||||
}
|
||||
|
||||
Events.PreferencesSaveEvent += (s, args) =>
|
||||
{
|
||||
int consentPercentage = PreferenceUtils.Get<KitchenLib.IntPreference>(MOD_ID, CONSENT_REQUIRED_ID).Value;
|
||||
RequiredConsentPercentage = consentPercentage;
|
||||
};
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static void LogWarning(string message)
|
||||
{
|
||||
Debug.LogWarning($"[{MOD_NAME}] " + message);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static void LogError(string message)
|
||||
{
|
||||
Debug.LogError($"[{MOD_NAME}] " + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
using Kitchen.Modules;
|
||||
using Kitchen;
|
||||
using KitchenLib.Utils;
|
||||
using KitchenLib;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MMOKitchen.Menus
|
||||
{
|
||||
public class MMOKitchenPreferences<T> : KLMenu<T>
|
||||
{
|
||||
public MMOKitchenPreferences(Transform container, ModuleList module_list) : base(container, module_list)
|
||||
{
|
||||
}
|
||||
public override void Setup(int player_id)
|
||||
{
|
||||
this.Percentage = new Option<int>(
|
||||
new List<int>
|
||||
{
|
||||
25, 50, 75, 100
|
||||
},
|
||||
PreferenceUtils.Get<KitchenLib.IntPreference>(Main.MOD_ID, Main.CONSENT_REQUIRED_ID).Value,
|
||||
new List<string>
|
||||
{
|
||||
"25%", "50%", "75%", "100%"
|
||||
});
|
||||
|
||||
AddLabel("Required Consent Percentage");
|
||||
Add<int>(this.Percentage).OnChanged += delegate (object _, int f)
|
||||
{
|
||||
PreferenceUtils.Get<KitchenLib.IntPreference>(Main.MOD_ID, Main.CONSENT_REQUIRED_ID).Value = f;
|
||||
};
|
||||
|
||||
New<SpacerElement>();
|
||||
New<SpacerElement>();
|
||||
|
||||
AddButton("Apply", delegate
|
||||
{
|
||||
PreferenceUtils.Save();
|
||||
});
|
||||
|
||||
AddButton(base.Localisation["MENU_BACK_SETTINGS"], delegate
|
||||
{
|
||||
RequestPreviousMenu();
|
||||
});
|
||||
}
|
||||
|
||||
private Option<int> Percentage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Kitchen;
|
||||
using Kitchen.Modules;
|
||||
using KitchenLib;
|
||||
using KitchenLib.Preferences;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MMOKitchenReborn.Menus
|
||||
{
|
||||
public class PreferenceMenu<T> : KLMenu<T>
|
||||
{
|
||||
public PreferenceMenu(Transform container, ModuleList module_list) : base(container, module_list)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Setup(int player_id)
|
||||
{
|
||||
AddLabel("Required Consent Percentage");
|
||||
AddSelect<int>(requiredPercentage);
|
||||
requiredPercentage.OnChanged += delegate (object _, int result)
|
||||
{
|
||||
Main.manager.GetPreference<PreferenceInt>("requiredConsentPercentage").Set(result);
|
||||
};
|
||||
|
||||
New<SpacerElement>(true);
|
||||
New<SpacerElement>(true);
|
||||
|
||||
AddButton(base.Localisation["MENU_BACK_SETTINGS"], delegate (int i)
|
||||
{
|
||||
Main.manager.Save();
|
||||
this.RequestPreviousMenu();
|
||||
}, 0, 1f, 0.2f);
|
||||
}
|
||||
private Option<int> requiredPercentage = new Option<int>(new List<int> { 25, 50, 75, 100 }, Main.manager.GetPreference<PreferenceInt>("requiredConsentPercentage").Get(), new List<string> { "25%", "50%", "75%", "100%" });
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
using Kitchen.Modules;
|
||||
using KitchenLib.Preferences;
|
||||
using KitchenLib.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MMOKitchen.Patches
|
||||
namespace MMOKitchenReborn.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(ConsentElement), "Update")]
|
||||
public class ConsentElement_Patch
|
||||
@@ -18,6 +15,12 @@ namespace MMOKitchen.Patches
|
||||
public static bool Prefix(ConsentElement __instance)
|
||||
{
|
||||
|
||||
PlayerManager pm = Unity.Entities.World.DefaultGameObjectInjectionWorld.GetExistingSystem<PlayerManager>();
|
||||
if (pm == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
MethodInfo updateBar = ReflectionUtils.GetMethod<ConsentElement>("UpdateBar");
|
||||
MethodInfo getProgressSpeed = ReflectionUtils.GetMethod<ConsentElement>("GetProgressSpeed");
|
||||
FieldInfo progress = ReflectionUtils.GetField<ConsentElement>("Progress");
|
||||
@@ -34,14 +37,14 @@ namespace MMOKitchen.Patches
|
||||
|
||||
float progressSpeed = (float)getProgressSpeed.Invoke(__instance, new object[] { });
|
||||
|
||||
if ((((float)counter / (float)x.Count) * 100) >= PreferenceUtils.Get<KitchenLib.IntPreference>(Main.MOD_ID, Main.CONSENT_REQUIRED_ID).Value)
|
||||
if ((((float)counter / (float)x.Count) * 100) >= Main.manager.GetPreference<PreferenceInt>("requiredConsentPercentage").Value)
|
||||
progressSpeed = 1f;
|
||||
|
||||
|
||||
if (progressSpeed <= 0f)
|
||||
progress.SetValue(__instance, (float)progress.GetValue(__instance) - (2f * Time.unscaledDeltaTime));
|
||||
else
|
||||
progress.SetValue(__instance, (float)progress.GetValue(__instance) + (progressSpeed * Time.unscaledDeltaTime));
|
||||
|
||||
|
||||
isCompleted.SetValue(__instance, ((float)progress.GetValue(__instance) >= 1f));
|
||||
progress.SetValue(__instance, Mathf.Clamp01((float)progress.GetValue(__instance)));
|
||||
updateBar.Invoke(__instance, new object[] { });
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
using Unity.Entities;
|
||||
using System.Reflection;
|
||||
using KitchenLib.Utils;
|
||||
using UnityEngine;
|
||||
using KitchenData;
|
||||
using Unity.Collections;
|
||||
|
||||
namespace MMOKitchen
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(CreateBedrooms), "OnUpdate")]
|
||||
public class CreateBedrooms_Patch
|
||||
{
|
||||
public static bool Prefix(CreateBedrooms __instance)
|
||||
{
|
||||
MethodInfo createAssigned = ReflectionUtils.GetMethod<CreateBedrooms>("CreateAssigned");
|
||||
MethodInfo placeSpawnMarker = ReflectionUtils.GetMethod<CreateBedrooms>("PlaceSpawnMarker");
|
||||
MethodInfo getComponent = ReflectionUtils.GetMethod<CreateBedrooms>("GetComponent").MakeGenericMethod(typeof(CPlayer));
|
||||
FieldInfo players = ReflectionUtils.GetField<CreateBedrooms>("Players");
|
||||
NativeArray<Entity> nativeArray = ((EntityQuery)players.GetValue(__instance)).ToEntityArray(Allocator.Temp);
|
||||
Vector3[] array = new Vector3[]
|
||||
{
|
||||
new Vector3(9f, 0f, 5f),
|
||||
new Vector3(9f, 0f, 2f),
|
||||
new Vector3(9f, 0f, -3f),
|
||||
new Vector3(9f, 0f, -6f),
|
||||
new Vector3(14f, 0f, 5f),
|
||||
new Vector3(14f, 0f, 2f),
|
||||
new Vector3(14f, 0f, -3f),
|
||||
new Vector3(14f, 0f, -6f),
|
||||
new Vector3(-12f, 0f, 5f),
|
||||
new Vector3(-12f, 0f, 2f),
|
||||
new Vector3(-12f, 0f, -3f),
|
||||
new Vector3(-12f, 0f, -6f)
|
||||
};
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
Entity target = (Entity)createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.Bed), array[i] + new Vector3(0f, 0f, 0f), Vector3.forward });
|
||||
Entity entity = (Entity)createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.InteractionProxy), array[i] + new Vector3(0f, 0f, 0f), Vector3.forward });
|
||||
EntityUtils.GetEntityManager().AddComponentData<CInteractionProxy>(entity, new CInteractionProxy
|
||||
{
|
||||
Target = target,
|
||||
IsActive = true
|
||||
});
|
||||
createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.OutfitStation), array[i] + new Vector3(-2f, 0f, 1f), Vector3.forward });
|
||||
createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.CosmeticStation), array[i] + new Vector3(-2f, 0f, -1f), Vector3.forward });
|
||||
createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.ColourStation), array[i] + new Vector3(-3f, 0f, 1f), Vector3.forward });
|
||||
createAssigned.Invoke(__instance, new object[] { i, GameData.Main.Get<Appliance>(AssetReference.OccupationIndicator), array[i] + new Vector3(1f, 0f, 0f), Vector3.forward });
|
||||
placeSpawnMarker.Invoke(__instance, new object[] { i, array[i] + new Vector3(-1f, 0f, 0f) });
|
||||
foreach (Entity entity2 in nativeArray)
|
||||
{
|
||||
bool flag = i == ((CPlayer)getComponent.Invoke(__instance, new object[] { entity2 })).Index;
|
||||
if (flag)
|
||||
{
|
||||
EntityUtils.GetEntityManager().SetComponentData<CPosition>(entity2, new CPosition(array[i] + new Vector3(-1f, 0f, 0f)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
nativeArray.Dispose();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
using Unity.Entities;
|
||||
using System.Reflection;
|
||||
using KitchenLib.Utils;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using KitchenData;
|
||||
|
||||
namespace MMOKitchen
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(CreateGarage), "OnUpdate")]
|
||||
public class CreateGarage_Patch
|
||||
{
|
||||
public static bool Prefix(CreateGarage __instance)
|
||||
{
|
||||
MethodInfo create = AccessTools.Method(typeof(CreateGarage), "Create", new Type[] {typeof(Appliance), typeof(Vector3), typeof(Vector3)});
|
||||
FieldInfo crates = ReflectionUtils.GetField<CreateGarage>("Crates");
|
||||
|
||||
GameObject garageDecorations = GameObjectUtils.GetChildObject(GameData.Main.Get<Appliance>(AssetReference.GarageDecorations).Prefab, "LoadoutDoor");
|
||||
GameObject doorLight = GameObjectUtils.GetChildObject(GameData.Main.Get<Appliance>(AssetReference.GarageDecorations).Prefab, "Door Light");
|
||||
doorLight.SetActive(false);
|
||||
garageDecorations.SetActive(false);
|
||||
create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.GarageDecorations), new Vector3(-8f, 0f, -2f), Vector3.forward});
|
||||
|
||||
Entity entity = default(Entity);
|
||||
entity = (Entity)create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.LoadoutPedestal), new Vector3(-8.5f, 0f, -4f), Vector3.right});
|
||||
EntityUtils.GetEntityManager().AddComponent<CItemPedestal>(entity);
|
||||
entity = (Entity)create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.LoadoutPedestal), new Vector3(-9.5f, 0f, -4f), Vector3.right});
|
||||
EntityUtils.GetEntityManager().AddComponent<CItemPedestal>(entity);
|
||||
bool isEmpty = ((EntityQuery)crates.GetValue(__instance)).IsEmpty;
|
||||
if (!isEmpty)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
bool flag = i == 2;
|
||||
if (!flag)
|
||||
{
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
Vector3 facing = (j % 2 == 1) ? Vector3.forward : Vector3.back;
|
||||
Entity entity2 = (Entity)create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.GarageShelf), new Vector3((float)(-5 - i), 0f, (float)(1 - j)), facing});
|
||||
EntityUtils.GetEntityManager().AddComponentData<CPersistentItemStorageLocation>(entity2, new CPersistentItemStorageLocation
|
||||
{
|
||||
Type = PersistentStorageType.Crate
|
||||
});
|
||||
bool flag2 = j % 2 == 1;
|
||||
if (flag2)
|
||||
{
|
||||
create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.GarageDivider), new Vector3((float)(-5 - i), 0f, (float)(1 - j)), Vector3.forward});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
|
||||
namespace MMOKitchenReborn.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(DifficultyHelpers))]
|
||||
public class DifficultyHelpers_Patch
|
||||
{
|
||||
[HarmonyPatch("CustomerPlayersRateModifier")]
|
||||
[HarmonyPostfix]
|
||||
static void CustomerPlayersRateModifier_Postfix(ref float __result, int player_count)
|
||||
{
|
||||
__result = 1 + (player_count * 0.25f);
|
||||
}
|
||||
|
||||
[HarmonyPatch("FireSpreadModifier")]
|
||||
[HarmonyPostfix]
|
||||
static void FireSpreadModifier_Postfix(ref float __result, int player_count)
|
||||
{
|
||||
__result = 0.75f + (player_count * 0.25f);
|
||||
}
|
||||
|
||||
[HarmonyPatch("PatiencePlayerCountModifier")]
|
||||
[HarmonyPostfix]
|
||||
static void PatiencePlayerCountModifier_Postfix(ref float __result, int player_count)
|
||||
{
|
||||
__result = 0.75f + (player_count * 0.25f);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,14 +1,15 @@
|
||||
using HarmonyLib;
|
||||
using Discord;
|
||||
using HarmonyLib;
|
||||
using Kitchen.NetworkSupport;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
namespace MMOKitchen
|
||||
namespace MMOKitchenReborn.Patches
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(DiscordPlatform))]
|
||||
[HarmonyPatch("CreateNewLobby")]
|
||||
/*
|
||||
* This patch is used to change how many players can join the lobby using Discord.
|
||||
*/
|
||||
|
||||
[HarmonyPatch(typeof(DiscordPlatform), "CreateNewLobby")]
|
||||
public static class DiscordPlatform_Patch
|
||||
{
|
||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
||||
@@ -21,5 +22,4 @@ namespace MMOKitchen
|
||||
return codes;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using KitchenLib.Utils;
|
||||
using UnityEngine;
|
||||
using Kitchen.Layouts.Modules;
|
||||
using System.IO;
|
||||
|
||||
namespace MMOKitchen
|
||||
{
|
||||
|
||||
|
||||
[HarmonyPatch(typeof(FeaturesFromTexture), "ActOn")]
|
||||
public class FeaturesFromTexture_Patch
|
||||
{
|
||||
public static void Prefix(NewFromTexture __instance)
|
||||
{
|
||||
__instance.SourceTexture = Main.LoadImage("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAQCAMAAAA25D/gAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAMUExURQD/ACQA/+nKIQAAAOiZT8gAAAAEdFJOU////wBAKqn0AAAACXBIWXMAAA6/AAAOvwE4BVMkAAAAS0lEQVQoU52MUQ4AIAhCU+9/5yzLbFJb8YGOJxa56geXlpqBixBkTLRjtRH0QXR6vrapDWe9tCE2RcQ8zdu52eRYJ7iAJfAc64pFKggsBTc0VJH0AAAAAElFTkSuQmCC");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
using KitchenLib.Utils;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MMOKitchen
|
||||
{
|
||||
|
||||
|
||||
[HarmonyPatch(typeof(LayoutBuilder), "BuildWallBetween")]
|
||||
public class LayoutBuilder_Patch
|
||||
{
|
||||
public static bool Prefix(LayoutBuilder __instance, Vector2 tile1, Vector2 tile2)
|
||||
{
|
||||
if (__instance.Blueprint.ID == 4771956)
|
||||
{
|
||||
if ((tile1 == new Vector2(-11, -5) && tile2 == new Vector2(-10, -5))
|
||||
|| (tile1 == new Vector2(-11, -6) && tile2 == new Vector2(-10, -6))
|
||||
|| (tile1 == new Vector2(-11, -7) && tile2 == new Vector2(-10, -7))
|
||||
|| (tile1 == new Vector2(-11, -8) && tile2 == new Vector2(-10, -8)))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
using Kitchen.Layouts.Modules;
|
||||
using Kitchen;
|
||||
using System.Reflection;
|
||||
using Unity.Entities;
|
||||
using KitchenLib.Utils;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace MMOKitchen
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(NewFromTexture), "ActOn")]
|
||||
public class NewFromTexture_Patch
|
||||
{
|
||||
public static void Prefix(NewFromTexture __instance)
|
||||
{
|
||||
PlayerManager playerManager = World.DefaultGameObjectInjectionWorld.GetExistingSystem<PlayerManager>();
|
||||
FieldInfo finfo = typeof(PlayerManager).GetField("MaxPlayers", BindingFlags.Instance | BindingFlags.Public);
|
||||
finfo.SetValue(playerManager, 12);
|
||||
|
||||
__instance.SourceTexture = Main.LoadImage("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAQCAMAAAA25D/gAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAhUExURe0cJIgAFTHf77eA6hbzSv9/J//yAIC66hY68//JDgAAANY41qIAAAALdFJOU/////////////8ASk8B8gAAAAlwSFlzAAAOvwAADr8BOAVTJAAAAF1JREFUKFOl0UkOgDAMQ9Gamdz/wMRuQCVIgOAtIuG/qih2qxA66d1A0KhE3/PoUgY08qSMSiNPm6M5jTxFnzkfnvLkIs87aOR5lReJeMqru2SNPD+zWbyhFb/TbAPTUQgZqLo2tAAAAABJRU5ErkJggg==");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using HarmonyLib;
|
||||
using Kitchen;
|
||||
using KitchenLib.Utils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MMOKitchenReborn.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(PlayerManager), "Initialise")]
|
||||
public class PlayerManager_Patch
|
||||
{
|
||||
static void Prefix(PlayerManager __instance)
|
||||
{
|
||||
FieldInfo maxPlayers = ReflectionUtils.GetField<PlayerManager>("MaxPlayers");
|
||||
maxPlayers.SetValue(__instance, 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,42 @@
|
||||
using HarmonyLib;
|
||||
using System.Reflection;
|
||||
using Steamworks;
|
||||
using HarmonyLib;
|
||||
using Kitchen.NetworkSupport;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using Steamworks;
|
||||
using Steamworks.Data;
|
||||
namespace MMOKitchen
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MMOKitchenReborn.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(SteamPlatform), "CreateNewLobby")]
|
||||
public class SteamPlatform_Patch
|
||||
{
|
||||
public static bool Prefix(SteamPlatform __instance, Action<bool, Lobby> callback)
|
||||
{
|
||||
if (__instance.IsReady)
|
||||
{
|
||||
SteamMatchmaking.CreateLobbyAsync(12).ContinueWith(delegate(Task<Lobby?> task)
|
||||
{
|
||||
if (task.IsCompleted && task.Result != null)
|
||||
{
|
||||
Lobby valueOrDefault = task.Result.GetValueOrDefault();
|
||||
__instance.CurrentInviteLobby = valueOrDefault;
|
||||
|
||||
MethodInfo performSetPermissions = AccessTools.Method(typeof(SteamPlatform), "PerformSetPermissions");
|
||||
performSetPermissions.Invoke(__instance, new object[] { __instance.Permissions });
|
||||
/*
|
||||
* This patch is used to change how many players can join the lobby using Steam.
|
||||
*/
|
||||
|
||||
[HarmonyPatch(typeof(SteamPlatform), "CreateNewLobby")]
|
||||
public class SteamPlatform_Patch
|
||||
{
|
||||
public static bool Prefix(SteamPlatform __instance, Action<bool, Lobby> callback)
|
||||
{
|
||||
if (__instance.IsReady)
|
||||
{
|
||||
SteamMatchmaking.CreateLobbyAsync(12).ContinueWith(delegate (Task<Lobby?> task)
|
||||
{
|
||||
if (task.IsCompleted && task.Result != null)
|
||||
{
|
||||
Lobby valueOrDefault = task.Result.GetValueOrDefault();
|
||||
__instance.CurrentInviteLobby = valueOrDefault;
|
||||
|
||||
MethodInfo performSetPermissions = AccessTools.Method(typeof(SteamPlatform), "PerformSetPermissions");
|
||||
performSetPermissions.Invoke(__instance, new object[] { __instance.Permissions });
|
||||
callback(true, valueOrDefault);
|
||||
}else
|
||||
{
|
||||
callback(false, default(Lobby));
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(false, default(Lobby));
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using Kitchen;
|
||||
using Unity.Collections;
|
||||
using Unity.Entities;
|
||||
|
||||
namespace MMOKitchenReborn.Systems
|
||||
{
|
||||
public class MakeOwnedAppliancesPublic : GenericSystemBase
|
||||
{
|
||||
protected override void Initialise()
|
||||
{
|
||||
base.Initialise();
|
||||
this.query = GetEntityQuery(new EntityQueryDesc
|
||||
{
|
||||
All = new ComponentType[]
|
||||
{
|
||||
typeof(COwnedByPlayer)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
NativeArray<Entity> nativeArray = query.ToEntityArray(Allocator.Temp);
|
||||
|
||||
for (int i = 0; i < nativeArray.Length; i++)
|
||||
{
|
||||
EntityManager.RemoveComponent<COwnedByPlayer>(nativeArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private EntityQuery query;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user