Skip to content

Can mark the working property as invalidate by stage info type if edit the target property in the lyric. #1921

Open
@andy840119

Description

@andy840119

Demo:
We should invalidate the stage element working property and re-calculate the timing in the preview stage info if edit the time-tag, but those things will not happened in the classic stage info

Not really sure how to auto invalidate the property by type, maybe:

public void SetTimeTagTime(TimeTag timeTag, double time)
{
    CheckExactlySelectedOneHitObject();

    PerformOnSelection(lyric =>
    {
        bool containsInLyric = lyric.TimeTags.Contains(timeTag);
        if (!containsInLyric)
            throw new InvalidOperationException($"{nameof(timeTag)} is not in the lyric");

        timeTag.Time = time;

        // Add this one:
        InvalidateAllHitObjectWorkingProperty<PreviewStageInfo>(LyricWorkingProperty.StageElements)

        // Or
        InvalidateAllHitObjectWorkingProperty<IStageInfoAffectedByTime>(LyricWorkingProperty.StageElements)

        // Or maybe there's no need to give it a enum because we already know which property need to be invalid by interface?
        InvalidateAllHitObjectWorkingProperty<IStageInfoAffectedByTime>()
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions