Skip to content

Commit e7f5a93

Browse files
committed
v2.5.0
1 parent 902ef90 commit e7f5a93

File tree

4 files changed

+10
-113
lines changed

4 files changed

+10
-113
lines changed

BaboonAPI/BaboonAPI.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PropertyGroup>
2525
<PackageId>TromboneChamp.BaboonAPI</PackageId>
2626
<Title>BaboonAPI</Title>
27-
<Version>2.4.1</Version>
27+
<Version>2.5.0</Version>
2828
<Authors>offbeatwitch</Authors>
2929
<Company>TromboneChamps</Company>
3030
<PackageTags>Trombone Champ</PackageTags>

BaboonAPI/Library.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open BaboonAPI.Patch
77
open BepInEx
88
open HarmonyLib
99

10-
[<BepInPlugin("ch.offbeatwit.baboonapi.plugin", "BaboonAPI", "2.4.1.0")>]
10+
[<BepInPlugin("ch.offbeatwit.baboonapi.plugin", "BaboonAPI", "2.5.0.0")>]
1111
type BaboonPlugin() =
1212
inherit BaseUnityPlugin()
1313

README.md

Lines changed: 7 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# BaboonAPI
22

3+
[![download counter](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Ftrombone-champ.thunderstore.io%2Fapi%2Fexperimental%2Fpackage%2FTromboneChamps%2FBaboonAPI%2F&query=%24.total_downloads&label=downloads)](https://trombone-champ.thunderstore.io/package/TromboneChamps/BaboonAPI/)
4+
35
Trombone Champ modding API, aiming to provide nicer hooks to
46
promote compatibility & improve the base game code
57

68
## Installing
79

10+
You can find the mod on [Thunderstore](https://trombone-champ.thunderstore.io/package/TromboneChamps/BaboonAPI/).
11+
12+
### Manual installation
13+
814
1. Install BepInEx over the base game
915
2. Install FSharp.Core - `FSharp.Core.dll` gets put in `bin/Release/net472`
1016
by the build process, I usually put it in `BepInEx/core`
@@ -13,113 +19,4 @@ promote compatibility & improve the base game code
1319

1420
## Developer Usage
1521

16-
A quick-and-dirty example plugin for the track registration API:
17-
18-
```csharp
19-
using System.Collections.Generic;
20-
using BaboonAPI.Hooks.Tracks;
21-
using BepInEx;
22-
using UnityEngine;
23-
24-
namespace Chimpanzee
25-
{
26-
[BepInPlugin("ch.offbeatwit.chimpanzee", "Chimpanzee", "1.0.0.0")]
27-
[BepInDependency("ch.offbeatwit.baboonapi.plugin")]
28-
public class ChimpanzeePlugin : BaseUnityPlugin
29-
{
30-
private void Awake()
31-
{
32-
// Register a listener for the track registration event
33-
TrackRegistrationEvent.EVENT.Register(new ChimpanzeeTrackCallback());
34-
}
35-
}
36-
37-
public class ChimpanzeeTrackCallback : TrackRegistrationEvent.Listener
38-
{
39-
public IEnumerable<TromboneTrack> OnRegisterTracks()
40-
{
41-
// Load and return your tracks here.
42-
yield return new ChimpTrack("chimps", "Chimps Forever", "Chimps", "2022", "Me", "A cool track!",
43-
"Weirdcore", 2, 120, 140);
44-
}
45-
}
46-
47-
public class ChimpTrack : TromboneTrack
48-
{
49-
public ChimpTrack(string trackref, string tracknameLong, string tracknameShort, string year, string artist,
50-
string desc, string genre, int difficulty, int tempo, int length)
51-
{
52-
this.trackref = trackref;
53-
trackname_long = tracknameLong;
54-
trackname_short = tracknameShort;
55-
this.year = year;
56-
this.artist = artist;
57-
this.desc = desc;
58-
this.genre = genre;
59-
this.difficulty = difficulty;
60-
this.tempo = tempo;
61-
this.length = length;
62-
}
63-
64-
public LoadedTromboneTrack LoadTrack()
65-
{
66-
var bundle = AssetBundle.LoadFromFile("MyCoolBundle");
67-
return new LoadedChimpTrack(trackref, bundle);
68-
}
69-
70-
public SavedLevel LoadChart()
71-
{
72-
// Load the actual chart data
73-
return new SavedLevel();
74-
}
75-
76-
public bool IsVisible()
77-
{
78-
return true;
79-
}
80-
81-
public string trackref { get; }
82-
public string trackname_long { get; }
83-
public string trackname_short { get; }
84-
public string year { get; }
85-
public string artist { get; }
86-
public string desc { get; }
87-
public string genre { get; }
88-
public int difficulty { get; }
89-
public int tempo { get; }
90-
public int length { get; }
91-
}
92-
93-
public class LoadedChimpTrack : LoadedTromboneTrack
94-
{
95-
private readonly AssetBundle _assetBundle;
96-
97-
public LoadedChimpTrack(string trackref, AssetBundle assetBundle)
98-
{
99-
this.trackref = trackref;
100-
_assetBundle = assetBundle;
101-
}
102-
103-
public void Dispose()
104-
{
105-
// Clean up any bundles you loaded, etc.
106-
_assetBundle.Unload(true);
107-
}
108-
109-
public AudioSource LoadAudio()
110-
{
111-
// Load an audio source from somewhere!
112-
var obj = _assetBundle.LoadAsset<GameObject>($"music_{trackref}");
113-
return obj.GetComponent<AudioSource>();
114-
}
115-
116-
public GameObject LoadBackground(BackgroundContext ctx)
117-
{
118-
// Load or create a background GameObject
119-
return _assetBundle.LoadAsset<GameObject>($"BGCam_{trackref}");
120-
}
121-
122-
public string trackref { get; }
123-
}
124-
}
125-
```
22+
We have documentation over at https://baboonapi.trombone.wiki

thunderstore/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "BaboonAPI",
33
"description": "Trombone Champ modding API",
4-
"version_number": "2.4.1",
4+
"version_number": "2.5.0",
55
"dependencies": [
66
"BepInEx-BepInExPack_TromboneChamp-5.4.21",
77
"TromboneChamps-FSharp_Core-6.0.6",

0 commit comments

Comments
 (0)