Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea784d0
commit 5ec2dfc
Showing
27 changed files
with
382 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,62 @@ | ||
using System; | ||
using BepInEx; | ||
using HarmonyLib; | ||
using KKAPI.Chara; | ||
using KKAPI.MainGame; | ||
using KKAPI.Maker; | ||
using KKAPI.Studio; | ||
using Manager; | ||
using UnityEngine; | ||
|
||
namespace KKAPI | ||
{ | ||
[BepInPlugin(GUID, "Modding API", VersionConst)] | ||
public partial class KoikatuAPI : BaseUnityPlugin | ||
{ | ||
private void Awake() | ||
{ | ||
BaseAwake(); | ||
|
||
var insideStudio = Application.productName == "CharaStudio"; | ||
MakerAPI.Init(insideStudio); | ||
StudioAPI.Init(insideStudio); | ||
CharacterApi.Init(); | ||
//todo GameAPI.Init(insideStudio); | ||
} | ||
|
||
private void Start() | ||
{ | ||
// Needs to be called after moreaccessories has a chance to load | ||
AccessoriesApi.Init(); | ||
} | ||
|
||
/// <summary> | ||
/// Get current game mode. | ||
/// </summary> | ||
public static GameMode GetCurrentGameMode() | ||
{ | ||
if (StudioAPI.InsideStudio) return GameMode.Studio; | ||
if (MakerAPI.InsideMaker) return GameMode.Maker; | ||
if (Game.initialized) return GameMode.MainGame; | ||
return GameMode.Unknown; | ||
} | ||
|
||
/// <summary> | ||
/// Get current version of the game. | ||
/// </summary> | ||
public static Version GetGameVersion() | ||
{ | ||
return Game.Version; | ||
} | ||
|
||
/// <summary> | ||
/// Check if the game is the Steam release instead of the original Japanese release. | ||
/// <remarks>It's best to not rely on this and instead make the same code work in both versions (if possible).</remarks> | ||
/// </summary> | ||
[Obsolete("Not implemented yet, always false")] | ||
public static bool IsSteamRelease() | ||
{ | ||
return false; //typeof(DownloadScene).GetProperty("isSteam", AccessTools.all) != null; //todo | ||
} | ||
} | ||
} |
This file contains 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,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace KKAPI.Maker | ||
{ | ||
/// <summary> | ||
/// Event args for accessory copy events. | ||
/// </summary> | ||
public class AccessoryCopyEventArgs : EventArgs | ||
{ | ||
/// <inheritdoc /> | ||
public AccessoryCopyEventArgs(IEnumerable<int> copiedSlotIndexes, | ||
ChaFileDefine.CoordinateType copySource, ChaFileDefine.CoordinateType copyDestination) | ||
{ | ||
CopiedSlotIndexes = copiedSlotIndexes ?? throw new ArgumentNullException(nameof(copiedSlotIndexes)); | ||
CopySource = copySource; | ||
CopyDestination = copyDestination; | ||
} | ||
|
||
/// <summary> | ||
/// Indexes of accessories that were selected to be copied. | ||
/// </summary> | ||
public IEnumerable<int> CopiedSlotIndexes { get; } | ||
|
||
/// <summary> | ||
/// Coordinate the accessories are copied from. | ||
/// </summary> | ||
public ChaFileDefine.CoordinateType CopySource { get; } | ||
|
||
/// <summary> | ||
/// Coordinate the accessories are copied into. | ||
/// </summary> | ||
public ChaFileDefine.CoordinateType CopyDestination { get; } | ||
} | ||
} |
This file contains 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,33 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
using KKAPI; | ||
|
||
// 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("KKSAPI")] | ||
[assembly: AssemblyDescription("Modding API for Koikatsu Sunshine")] | ||
[assembly: AssemblyCompany("ManlyMarco")] | ||
[assembly: AssemblyProduct("KKSAPI")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
|
||
// 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("74c2db86-55bb-47b4-9805-51b5b992ef35")] | ||
|
||
// 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: AssemblyFileVersion(KoikatuAPI.VersionConst)] | ||
[assembly: AssemblyVersion(KoikatuAPI.VersionConst)] |
This file contains 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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="IllusionLibs.BepInEx" version="5.4.8" targetFramework="net46" /> | ||
<package id="IllusionLibs.BepInEx.Harmony" version="2.3.2" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.Assembly-CSharp" version="2021.5.28" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.Assembly-CSharp-firstpass" version="2021.5.28" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UniRx" version="2021.5.28" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.Unity.TextMeshPro" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.AudioModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.CoreModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.ImageConversionModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.TextRenderingModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.UI" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.UIModule" version="2019.4.9" targetFramework="net46" /> | ||
<package id="IllusionLibs.XUnity.AutoTranslator.Plugin.Core" version="4.16.0" targetFramework="net46" /> | ||
</packages> |
This file contains 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#if KK || AI || HS2 | ||
#if KK || KKS || AI || HS2 | ||
#define TMP | ||
#endif | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#if KK || AI || HS2 | ||
#if KK || KKS || AI || HS2 | ||
#define TMP | ||
#endif | ||
|
||
|
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#if AI || HS2 | ||
#if AI || HS2 || KKS | ||
using System; | ||
#endif | ||
using BepInEx; | ||
|
This file contains 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 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.