Skip to content

Commit

Permalink
Source upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasonleh99 committed Nov 16, 2022
1 parent b9fd2ec commit 200d05c
Show file tree
Hide file tree
Showing 38 changed files with 294 additions and 0 deletions.
Binary file added .vs/PlateupPrepGhost/v16/.suo
Binary file not shown.
57 changes: 57 additions & 0 deletions GhostPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using BepInEx.Logging;
using Kitchen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace PlateupPrepGhost
{
class GhostPatch
{
private const string PLAYERS_COLLISION_LAYER_NAME = "Players";
private const string DYNAMIC_OBJECT_COLLISION_LAYER_NAME = "Default";
private const string STATIC_OBJECT_COLLISION_LAYER_NAME = "Statics";

private static readonly ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("GhostPatch");
private static bool GhostModeActivated = false;

public static bool Update_CheckPrepState(PlayerView __instance, Rigidbody ___Rigidbody)
{
if (GameInfo.IsPreparationTime && !GhostModeActivated)
{
logger.LogInfo("Activating Ghost Mode");
SetGhostMode(true);
GhostModeActivated = true;
} else if (!GameInfo.IsPreparationTime && GhostModeActivated)
{
logger.LogInfo("Deactivating Ghost Mode");
SetGhostMode(false);
GhostModeActivated = false;
}

return true;
}

public static void SetGhostMode(bool enable)
{
Physics.IgnoreLayerCollision(
LayerMask.NameToLayer(PLAYERS_COLLISION_LAYER_NAME)
, LayerMask.NameToLayer(DYNAMIC_OBJECT_COLLISION_LAYER_NAME)
, enable);
Physics.IgnoreLayerCollision(
LayerMask.NameToLayer(PLAYERS_COLLISION_LAYER_NAME)
, LayerMask.NameToLayer(STATIC_OBJECT_COLLISION_LAYER_NAME)
, enable);
}
}
}
/***
*
*
*
*
*
*/
31 changes: 31 additions & 0 deletions PlateupPrepGhost.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using BepInEx;
using HarmonyLib;
using Kitchen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlateupPrepGhost
{
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
public class PlateupPrepGhost : BaseUnityPlugin
{
public const string pluginGuid = "happening.plateup.plateupprepghost";
public const string pluginName = "Plateup Prep Ghost";
public const string pluginVersion = "1.0";

public void Awake()
{
Harmony harmony = new Harmony(pluginGuid);

harmony.Patch(AccessTools.Method(typeof(PlayerView), "Update"),
prefix:
new HarmonyMethod(
AccessTools.Method(typeof(GhostPatch), "Update_CheckPrepState")));
}


}
}
103 changes: 103 additions & 0 deletions PlateupPrepGhost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PlateupPrepGhost</RootNamespace>
<AssemblyName>PlateupPrepGhost</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>E:\Program Files\Steam\steamapps\common\PlateUp\PlateUp\BepInEx\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>Libraries\BepInEx.dll</HintPath>
</Reference>
<Reference Include="ChefConnector">
<HintPath>Libraries\ChefConnector.dll</HintPath>
</Reference>
<Reference Include="Kitchen.Common">
<HintPath>Libraries\Kitchen.Common.dll</HintPath>
</Reference>
<Reference Include="Kitchen.FranchiseBuilderMode">
<HintPath>Libraries\Kitchen.FranchiseBuilderMode.dll</HintPath>
</Reference>
<Reference Include="Kitchen.FranchiseMode">
<HintPath>Libraries\Kitchen.FranchiseMode.dll</HintPath>
</Reference>
<Reference Include="Kitchen.GameData">
<HintPath>Libraries\Kitchen.GameData.dll</HintPath>
</Reference>
<Reference Include="Kitchen.Layouts">
<HintPath>Libraries\Kitchen.Layouts.dll</HintPath>
</Reference>
<Reference Include="Kitchen.Networking">
<HintPath>Libraries\Kitchen.Networking.dll</HintPath>
</Reference>
<Reference Include="Kitchen.Persistence">
<HintPath>Libraries\Kitchen.Persistence.dll</HintPath>
</Reference>
<Reference Include="Kitchen.PostgameMode">
<HintPath>Libraries\Kitchen.PostgameMode.dll</HintPath>
</Reference>
<Reference Include="Kitchen.ResearchMode">
<HintPath>Libraries\Kitchen.ResearchMode.dll</HintPath>
</Reference>
<Reference Include="Kitchen.RestaurantMode">
<HintPath>Libraries\Kitchen.RestaurantMode.dll</HintPath>
</Reference>
<Reference Include="Kitchen.TutorialMode">
<HintPath>Libraries\Kitchen.TutorialMode.dll</HintPath>
</Reference>
<Reference Include="KitchenMode">
<HintPath>Libraries\KitchenMode.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>Libraries\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>Libraries\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>Libraries\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="GhostPatch.cs" />
<Compile Include="PlateupPrepGhost.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
8 changes: 8 additions & 0 deletions PlateupPrepGhost.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>E:\Program Files\Steam\steamapps\common\PlateUp\PlateUp\PlateUp.exe</StartProgram>
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>
25 changes: 25 additions & 0 deletions PlateupPrepGhost.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlateupPrepGhost", "PlateupPrepGhost.csproj", "{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C4037DE-AE6B-4F0B-8A29-64C0836C0A6D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C535D784-1FCC-440B-AA10-F0755E270F70}
EndGlobalSection
EndGlobal
36 changes: 36 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PlateupPrepGhost")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PlateupPrepGhost")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0c4037de-ae6b-4f0b-8a29-64c0836c0a6d")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file added bin/Debug/0Harmony.dll
Binary file not shown.
Binary file added bin/Debug/BepInEx.dll
Binary file not shown.
Binary file added bin/Debug/ChefConnector.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.Common.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.FranchiseBuilderMode.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.FranchiseMode.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.GameData.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.Layouts.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.Networking.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.Persistence.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.PostgameMode.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.ResearchMode.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.RestaurantMode.dll
Binary file not shown.
Binary file added bin/Debug/Kitchen.TutorialMode.dll
Binary file not shown.
Binary file added bin/Debug/KitchenMode.dll
Binary file not shown.
Binary file added bin/Debug/PlateupPrepGhost.dll
Binary file not shown.
Binary file added bin/Debug/PlateupPrepGhost.pdb
Binary file not shown.
Binary file added bin/Debug/System.Buffers.dll
Binary file not shown.
Binary file added bin/Debug/System.Memory.dll
Binary file not shown.
Binary file added bin/Debug/System.Numerics.Vectors.dll
Binary file not shown.
Binary file added bin/Debug/UnityEngine.CoreModule.dll
Binary file not shown.
Binary file added bin/Debug/UnityEngine.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
Binary file added obj/Debug/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions obj/Debug/PlateupPrepGhost.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6b2babafb7f399447b2c87ce9d01211a1f44cc35
29 changes: 29 additions & 0 deletions obj/Debug/PlateupPrepGhost.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\PlateupPrepGhost.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\PlateupPrepGhost.pdb
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\0Harmony.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\BepInEx.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\ChefConnector.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.Common.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.FranchiseBuilderMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.FranchiseMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.GameData.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.Layouts.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.Networking.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.Persistence.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.PostgameMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.ResearchMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.RestaurantMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\Kitchen.TutorialMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\KitchenMode.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\UnityEngine.CoreModule.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\UnityEngine.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\System.Memory.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\System.Numerics.Vectors.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\bin\Debug\System.Buffers.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\obj\Debug\PlateupPrepGhost.csprojAssemblyReference.cache
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\obj\Debug\PlateupPrepGhost.csproj.CoreCompileInputs.cache
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\obj\Debug\PlateupPrepGhost.csproj.CopyComplete
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\obj\Debug\PlateupPrepGhost.dll
C:\Users\jason\Documents\PlateupModProjects\PlateupPrepGhost\obj\Debug\PlateupPrepGhost.pdb
E:\Program Files\Steam\steamapps\common\PlateUp\PlateUp\BepInEx\plugins\PlateupPrepGhost.dll
E:\Program Files\Steam\steamapps\common\PlateUp\PlateUp\BepInEx\plugins\PlateupPrepGhost.pdb
Binary file not shown.
Binary file added obj/Debug/PlateupPrepGhost.dll
Binary file not shown.
Binary file added obj/Debug/PlateupPrepGhost.pdb
Binary file not shown.

0 comments on commit 200d05c

Please sign in to comment.