-
Notifications
You must be signed in to change notification settings - Fork 54
[+] BepInEx support #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Menci
wants to merge
16
commits into
MuNET-OSS:main
Choose a base branch
from
Menci:bepinex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
66e3aae
bepinex
Menci 10afaf1
net48
Menci 0850c4c
Migrate sln to slnx
Menci a26a4a8
Move common bootstrap logic to AquaMai.Common
Menci 769a2ca
Move
Menci 37ec129
try fix pr ci
clansty 75ad59b
try fix pr ci
clansty 1a62a0f
fix build
clansty c540d43
fix assembly name, AquaMai.MelonLoader.dll -> AquaMai.dll
clansty 3de08cb
fix: buildinfo
clansty 1316ae8
Update comment
Menci 01f07ba
UseTargetName
Menci e47be12
Merge branch 'main' into fork/Menci/bepinex
clansty 48b01db
Fix version
Menci 123db0b
Remove extra
Menci 16af6da
_isInitialized
Menci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -372,5 +372,5 @@ MigrationBackup/ | |
|
|
||
| Output | ||
| tools | ||
| AquaMai/BuildInfo.g.cs | ||
| AquaMai.Common/BuildInfo.g.cs | ||
| .idea | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
| <OutputType>Library</OutputType> | ||
| <RootNamespace>AquaMai.BepInEx</RootNamespace> | ||
| <AssemblyName>AquaMai.BepInEx</AssemblyName> | ||
| <TargetFramework>net48</TargetFramework> | ||
| <FileAlignment>512</FileAlignment> | ||
| <Deterministic>true</Deterministic> | ||
| <LangVersion>12</LangVersion> | ||
| <NoWarn>414</NoWarn> | ||
| <AssemblySearchPaths>$(ProjectDir)../Libs/;$(AssemblySearchPaths)</AssemblySearchPaths> | ||
| <OutputPath>$(ProjectDir)../Output/</OutputPath> | ||
| <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
| <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
| <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
| <DebugSymbols>false</DebugSymbols> | ||
| <DebugType>None</DebugType> | ||
| <Optimize>true</Optimize> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
| <Prefer32Bit>false</Prefer32Bit> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
| <DefineConstants>DEBUG</DefineConstants> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="../AquaMai.Config.Interfaces/AquaMai.Config.Interfaces.csproj" /> | ||
| <ProjectReference Include="../AquaMai.Config/AquaMai.Config.csproj" /> | ||
| <ProjectReference Include="../AquaMai.Core/AquaMai.Core.csproj" /> | ||
| <ProjectReference Include="../AquaMai.Mods/AquaMai.Mods.csproj" /> | ||
| <ProjectReference Include="../AquaMai.Common/AquaMai.Common.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Reference Include="mscorlib" /> | ||
| <Reference Include="0Harmony" /> | ||
| <Reference Include="BepInEx" /> | ||
| <Reference Include="UnityEngine" /> | ||
| <Reference Include="UnityEngine.CoreModule" /> | ||
| <Reference Include="Assembly-CSharp" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Fody" Version="6.9.1"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="ILMerge.Fody" Version="1.24.0" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> | ||
| <ILMerge> | ||
| <IncludeAssemblies>AquaMai.Common</IncludeAssemblies> | ||
| </ILMerge> | ||
| </Weavers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
| <!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> | ||
| <xs:element name="Weavers"> | ||
| <xs:complexType> | ||
| <xs:all> | ||
| <xs:element name="ILMerge" minOccurs="0" maxOccurs="1"> | ||
| <xs:complexType> | ||
| <xs:all> | ||
| <xs:element name="IncludeAssemblies" type="xs:string" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the assembly names to include in merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="ExcludeAssemblies" type="xs:string" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the assembly names to exclude from merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="IncludeResources" type="xs:string" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the resource names to include in merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="ExcludeResources" type="xs:string" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the resource names to exclude from merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="HideImportedTypes" type="xs:boolean" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to control whether the imported types are hidden (made private) or keep their visibility unchanged. Default is 'true'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="NamespacePrefix" type="xs:string" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A string that is used as prefix for the namespace of the imported types.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="FullImport" type="xs:boolean" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to control whether to import the full assemblies or only the referenced types. Default is 'false'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element name="CompactMode" type="xs:boolean" minOccurs="0" maxOccurs="1"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to enable compacting of the target assembly by skipping properties, events and unused methods. Default is 'false'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:element> | ||
| </xs:all> | ||
| <xs:attribute name="IncludeAssemblies" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the assembly names to include in merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="ExcludeAssemblies" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the assembly names to exclude from merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="IncludeResources" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the resource names to include in merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="ExcludeResources" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A regular expression matching the resource names to exclude from merging.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="HideImportedTypes" type="xs:boolean"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to control whether the imported types are hidden (made private) or keep their visibility unchanged. Default is 'true'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="NamespacePrefix" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A string that is used as prefix for the namespace of the imported types.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="FullImport" type="xs:boolean"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to control whether to import the full assemblies or only the referenced types. Default is 'false'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="CompactMode" type="xs:boolean"> | ||
| <xs:annotation> | ||
| <xs:documentation>A switch to enable compacting of the target assembly by skipping properties, events and unused methods. Default is 'false'</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| </xs:complexType> | ||
| </xs:element> | ||
| </xs:all> | ||
| <xs:attribute name="VerifyAssembly" type="xs:boolean"> | ||
| <xs:annotation> | ||
| <xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="VerifyIgnoreCodes" type="xs:string"> | ||
| <xs:annotation> | ||
| <xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="GenerateXsd" type="xs:boolean"> | ||
| <xs:annotation> | ||
| <xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> | ||
| </xs:annotation> | ||
| </xs:attribute> | ||
| </xs:complexType> | ||
| </xs:element> | ||
| </xs:schema> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| using System; | ||
| using System.Reflection; | ||
| using AquaMai.Common; | ||
| using BepInEx; | ||
| using BepInEx.Logging; | ||
| using Manager; | ||
|
|
||
| namespace AquaMai.BepInEx; | ||
|
|
||
| [BepInPlugin(PluginName, BuildInfo.Name, BuildInfo.GitVersion)] | ||
| public class Plugin : BaseUnityPlugin | ||
| { | ||
| public const string PluginName = "net.aquadx.aquamai"; | ||
|
|
||
| public readonly static ManualLogSource LogSource = global::BepInEx.Logging.Logger.CreateLogSource(BuildInfo.Name); | ||
|
|
||
| public void Awake() | ||
Menci marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| var harmony = new HarmonyLib.Harmony(PluginName); | ||
|
|
||
| Common.AquaMai.Bootstrap(new BootstrapOptions | ||
| { | ||
| CurrentAssembly = Assembly.GetExecutingAssembly(), | ||
| Harmony = harmony, | ||
| MsgStringAction = LogSource.LogMessage, | ||
| MsgObjectAction = LogSource.LogMessage, | ||
| ErrorStringAction = LogSource.LogError, | ||
| ErrorObjectAction = LogSource.LogError, | ||
| WarningStringAction = LogSource.LogWarning, | ||
| WarningObjectAction = LogSource.LogWarning, | ||
| }); | ||
| } | ||
|
|
||
| public void OnGUI() | ||
| { | ||
| Common.AquaMai.OnGUI(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| using System.Reflection; | ||
| using AquaMai.Common; | ||
|
|
||
| [assembly: AssemblyTitle(BuildInfo.Description)] | ||
| [assembly: AssemblyDescription(BuildInfo.Description)] | ||
| [assembly: AssemblyCompany(BuildInfo.Company)] | ||
| [assembly: AssemblyProduct(BuildInfo.Name)] | ||
| [assembly: AssemblyCopyright("Created by " + BuildInfo.Author)] | ||
| [assembly: AssemblyTrademark(BuildInfo.Company)] | ||
| [assembly: AssemblyVersion(BuildInfo.Version)] | ||
| [assembly: AssemblyFileVersion(BuildInfo.GitVersion)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.