Open smoogipoo opened 4 years ago
So in this sense, OML is like a styling language.
Is it possible to define and use custom samples by name, or is it restricted to predefined samples like HoverSample
?
Children:
# New members of the hierarchy can be created.
Does this replace all children or can it only add? If latter, is it possible to remove existing children?
It's feasible for the user to add a Sample
object to their hierarchy then play it.
Removing existing children should not be possible - it should replace.
For the time being, use the hierarchy for samples. I think a further iteration in the layout should allow for retrieval of samples/textures from within the layout.
My only issue is schema validation, and YAML itself in this proposal.
We should provide at least a schema to allow editors like VS Code to validate the YAML to catch issues way before they are even ran, so designers would be aware of type issues that would otherwise error out in compile. Another thing is YAML itself. I myself deal with cloud-native apps (Kubernetes in particular), and YAMLs are pain to write and can get ugly pretty quick (see how Kubelet configurations can get really fugly when dealing with runtime configs). It would be nice if OML could be extended to other known standards like the famous XAML standard on Uno/WinUI3.
For previous discussion, see: https://github.com/ppy/osu-framework/issues/30 .
What is OML
OML is a markup language that is added onto existing Drawable hierarchies to extend the layout and styling.
OML layouts have access to the entire hierarchy of the Drawable they extend, and are able to:
What OML isn't
OML does not provide capabilities to generate executable code or members that are usable by code. Members generated by the code are usable by layouts, however members generated by the layout are only usable within layouts.
Implementation
Although it is highly preferable, the implementation does not need to exactly match the given examples as long as the general structure and syntax remains legible.
OML is best implemented iteratively as new functionality is required. A minimum viable implementation satisfies the following capabilities:
Example: