Releases: Folleach/GeometryDashAPI
Hsv properties for IBlock
Closes #35
Usage
level.Blocks.Add(new Block(216)
{
PositionX = 30,
PositionY = 30,
Hsv = new Hsv()
{
Brightness = 0.5f,
DeltaBrightness = true
},
AdditionalHsv = new Hsv()
{
Hue = 120,
Saturation = 0.5f
}
});
// Pay attention: block with id 1887 has only detail color, but hsv isn't additional
// AdditionalHsv used for detail color only when both color (base and detail) are present in the block
level.Blocks.Add(new Block(1887)
{
PositionX = 60,
PositionY = 30,
Hsv = new Hsv()
{
Hue = 60
}
});Full Changelog: v0.2.24...v0.2.25
Fixes for sfx/song triggers
Some fields are missing in classes
This release adds properties from all pages in the trigger window
What's Changed
New Contributors
Full Changelog: v0.2.23...v0.2.24
Add more triggers for song control
Add SfxTrigger from 2.2!
Add Level Duration
Measuring level duration
Now you can get the duration of the level in TimeSpan from the level.Duration property.
See more in #30
More settings in GameManager
Added:
- A lot of settings in game manager
- Improve data loading speed
Renaming:
SongEffectVolume->SfxVolume
See more in PR #29
Some improvements
Changes:
ModeratorTypeas an enumLocalLevelsnow isIReadOnlyCollection
For more internal changes, see #28
Fix bug in serialization: protected properties
TypeDescriptor could not find protected properties.
Because of this ignored them
Add hex for color & naming fixes
Hex colors
Now you can create add a color like this
level.AddColor(new Color(11)
{
Rgb = RgbColor.FromHex("#ffa500") // orange
});And convert color to the hex too
foreach (var color in level.Colors)
Console.WriteLine(RgbColor.ToHex(color.Rgb));Naming fixes
UserPreview.Starts rename to UserPreview.Stars
Account.Starts rename to Starts.Stars
This is my mistake, they meant the stars initially, not the starts
Improvment for your tests
I've added IGameClient for GameClient.
This is necessary so that you can write tests, like this
public static class TestExtensions
{
private static readonly ObjectSerializer serializer = new();
public static Task<ServerResponse<T>> AsSuccessResponse<T>(this T value) where T : IGameObject
{
var data = serializer.Encode(value).ToString();
return Task.FromResult(new ServerResponse<T>(HttpStatusCode.OK, data));
}
}
public class Tests
{
public void MyFavoriteTest()
{
var gameClient = A.Fake<IGameClient>();
A.CallTo(() => gameClient.LoginAsync("test", "123")).Returns(new LoginResponse()
{
AccountId = 111,
UserId = 333
}.AsSuccessResponse());
}
}A.Fake it is FakeItEasy library, see documentation if you are interested