Folleach/GeometryDashAPI
API for Geometry Dash
**Full Changelog**: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.28...v0.2.29
📋 Changes
- Fix bug with invalid xml characters
- Optimize file loads
📋 What's Changed
- adding macos support to save files by @delynith in https://github.com/Folleach/GeometryDashAPI/pull/33
- Thanks @BotAntony for testing this feature
✨ New Contributors
- @delynith made their first contribution in https://github.com/Folleach/GeometryDashAPI/pull/33
- Full Changelog: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.26...v0.2.27
**Full Changelog**: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.25...v0.2.26
Closes #35 #### Usage ```cs 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**: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.24...v0.2.25
📋 What's Changed
- Add missing properties to SfxTrigger by @ascpixi in https://github.com/Folleach/GeometryDashAPI/pull/32
✨ New Contributors
- @ascpixi made their first contribution in https://github.com/Folleach/GeometryDashAPI/pull/32
- Full Changelog: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.23...v0.2.24
📋 Changes
- Song Trigger
- Edit Music Trigger
- Edit Sfx Trigger
The library version turned out to be symbolic! The first trigger from Geometry Dash `2.2` and the library version is `v0.2.22` ```cs level.Blocks.Add(new SfxTrigger() { PositionX = 30, PositionY = 30, Pitch = 2, Speed = -3 }); ``` 
# Measuring level duration Now you can get the duration of the level in TimeSpan from the `level.Duration` property. See more in #30
📋 Changes
- A lot of settings in game manager
- Improve data loading speed
- `SongEffectVolume` -> `SfxVolume`
📋 Changes
- `ModeratorType` as an enum
- `LocalLevels` now is `IReadOnlyCollection`
TypeDescriptor could not find protected properties. Because of this ignored them
# Hex colors Now you can create add a color like this ```cs level.AddColor(new Color(11) { Rgb = RgbColor.FromHex("#ffa500") // orange }); ``` And convert color to the hex too ```cs 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
I've added `IGameClient` for `GameClient`. This is necessary so that you can write tests, like this ```cs 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](https://fakeiteasy.github.io/docs/7.4.0/quickstart/) if you are interested
📋 Changes
- [SendMessageAsync](https://github.com/Folleach/GeometryDashAPI/wiki/Network#send-message)
- [GetMessagesAsync](https://github.com/Folleach/GeometryDashAPI/wiki/Network#get-messages)
- [ReadMessageAsync](https://github.com/Folleach/GeometryDashAPI/wiki/Network#read-message-content)
learn more in #25
**Full Changelog**: https://github.com/Folleach/GeometryDashAPI/compare/v0.2.8...v0.2.9
📦 Rewritten the serializer
- Now the sterilizer is customizable and faster
- You can create arrays, custom types, and fill them with meta information, such as the default value or order
- This also fix oldest bug with concurrent access #12
- Speed up 3x
- For example, here are 10 iterations of loading the "True Values of Life" level, created by @Relayx
- | Iteration | Load time in `v0.2` | Load time in `v0.1` |
- | --- | --- | --- |
- | 0 | 00:00:02.8696667 | 00:00:07.5174898 |
- + 10 more
✨ Added a bunch of triggers
- Thanks @flightlex
- He added triggers such as
- Alpha trigger
- Animate trigger
- Collision trigger
- Color trigger
- Count trigger
- PickUp trigger
- + 4 more
✨ Added a guidlines in the level
- ```cs
- foreach (var guideline in level.Options.Guidelines)
- Console.WriteLine($"{guideline.Color} in {guideline.Timestamp}");
- ```
- Also thanks @flightlex
- See its contribute in https://github.com/Folleach/GeometryDashAPI/pull/20
🐛 Fixed known bugs
- For stability, we can say thank @Pawday
- His fixes can be found in https://github.com/Folleach/GeometryDashAPI/pull/17
📦 Stored data...
- Saves can now be created from the library from scratch
- ```cs
- var manager = GameManager.CreateNew();
- manager.Save();
- var local = LocalLevels.CreateNew();
- local.Save();
- ```
- Closed by #18
📦 On the way to resources
- Now it is possible to open official levels
- ```cs
- var resources = new GameResources(@"C:\Program Files\Steam\Apps\GeometryDash\Resources");
- var level = await resources.GetLevelAsync(OfficialLevel.Jumper);
- ```
- On request #3
📦 Icon
- Also thanks FaxeL for the library icon
- <img src="https://github.com/Folleach/GeometryDashAPI/blob/93730095a9602181524fa104ef35f5b1d1e5d831/Images/logo.png" width="260px" />
Improve network error handling; `Plist` is now more safer and runs entirely on XDocument; Async methods for Save/Load game data ```cs var local = await LocalLevels.LoadFileAsync(); await local.SaveAsync(); ```
Levels are now saved correctly
