Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framemodel features #41

Open
PRGfx opened this issue May 16, 2017 · 1 comment
Open

Framemodel features #41

PRGfx opened this issue May 16, 2017 · 1 comment
Milestone

Comments

@PRGfx
Copy link

PRGfx commented May 16, 2017

The framemodel is represented incorrectly:
in most aspects a framemodel is exactly like a frame, which means it can has any attribute a frame can have (pos, size, id, class, data-, hidden, scale, rot, halign, valign).
A frameinstance will override these values[1] (or merge them as in the case of classes and data-attributes), so additionally FrameInstance objects should represent this behaviour for consistency. (The data-
and class-behaviour is new in MLv3.)

To allow for the feature above I would suggest some sort of mechanism to retrieve a framemodel by its modelid (as you don't require the object instance in a FrameInstance object). Keep in mind that framemodels can be nested so unfortunately something as Manialink::children.filter(instanceof FrameModel) would be insufficient.

On a side-note I would expect the FrameInstance to get a model in the constructor, as it would encourage the more OO approach on this matter rather than optionally setting the model later. I suppose you want to keep the modelId feature for compatibility reasons.

[1] size and alignment affect the frame-clipping and are currently not overridden by frameinstance which I believe to be a bug (https://forum.maniaplanet.com/viewtopic.php?f=559&t=41195&p=283702#p283702)

@steeffeen-zz steeffeen-zz added this to the Controls milestone May 17, 2017
@steeffeen-zz
Copy link
Owner

Many thanks for the comments! I will implement this stuff in FML v3.
(FML v2 still supports PHP 5.3 which doesn't have Traits that make sharing features between classes easier. Beginning with FML v3 I will only support PHP 5.4 to start using Traits. Furthermore the changes sound like being incompatible so we need a major version increase to implement them.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants