-
Notifications
You must be signed in to change notification settings - Fork 5
Develop
Schwarzer edited this page Jul 30, 2018
·
6 revisions
As you are reading this page, i assume you have gain the ability to program. That means you have the ability to read English, so i will not translate this.
- I use
Visual Studio 2017
, i don't care what are you using. - Create a new
Class Library (.NET Framework)
project, use.NET Framework 4.6
, save to anywhere you like. - Change the default filename
Class1
to your plugin's name. - You need to add some reference to Lanotalium's libraries:
- In project hierarchy, right click to
Reference
and selectAdd Reference
- Navigate to
Lanotalium_Data/Managed
- Select
Schwarzer.Lanotalium.dll
,Schwarzer.Dialogs.dll
and add them.- Please note, every Lanotalium's update you have to reselect the binaries.
- In project hierarchy, right click to
- In the
.cs
file, using these namespaces
using EasyRequest;
using Lanotalium.Chart;
using Lanotalium.Plugin;
- Create a class that use interface
ILanotaliumPlugin
public class MyPlugin : ILanotaliumPlugin
{
...
}
- Implement the methods.
- Compile and put it in
Lanotalium_Data/StreamingAssets/Plugins
- Create a request class
public class MyPluginRequest
{
public float MyRequestData1;
}
- Use
Name
Attribute to display the name you set instead of field name.
[Name("Your field name")]
public float MyRequestData1;
- Use
Default
Attribute to set an default value to the field.
[Default(5.5)]
public float MyRequestData1;
- Use
Range
Attribute to validate user's input when field isint
andfloat
.
[Range(1,10)]
public float MyRequestData1;
- Call the request
Request<MyPluginRequest> request = new Request<MyPluginRequest>();
yield return context.UserRequest.Request(request, "Your description");
- A dialog will popup.
- If the user click on
Confirm
,request.Succeed
will betrue
, vice versa. - Check the
request.Succeed
, iftrue
, then user's data will be filled inrequest.Object
.
context.MessageBox.ShowMessage("Your message");
- Please note, although you can directly visit chart data via
context.TunerManager.TapNoteManager.TapNote
context.TunerManager.HoldNoteManager.HoldNote
context.TunerManager.BpmManager.Bpm
context.TunerManager.CameraManager.Horizontal
context.TunerManager.CameraManager.Vertical
context.TunerManager.CameraManager.Rotation
context.TunerManager.ScrollManager.Scroll
- You are not recommend to change value directly, although the game logic changes directly, the UI may not update and display old data.
- You are recommend to call methods in
context.OperationManager
to modify chart safe and sound. - Add Element
[ElementClass] element = new [ElementClass]()
{
Time = 100 (Example)
};
context.OperationManager.Add[ElementClass](element);
For example:
Lanotalium.Chart.LanotaTapNote New = new Lanotalium.Chart.LanotaTapNote()
{
Type = 0,
Time = 10,
Degree = 30,
Size = 0
};
OperationManager.AddTapNote(New);
- Modify Element
context.OperationManager.Set[ElementClass][ElementField](element, value);
For example:
foreach (LanotaTapNote tap in context.TunerManager.TapNoteManager.TapNote)
{
context.OperationManager.SetTapNoteTime(tap, tap.Time + 1);
}
- Delete Element
context.OperationManager.Delete[ElementClass](element);
For example:
context.OperationManager.DeleteTapNote(tap);
- Special Properties
context.OperationManager.SelectedTapNote
context.OperationManager.SelectedHoldNote
context.OperationManager.SelectedMotions
These can be used to get current selected objects.