Ejemplo n.º 1
0
 private bool ShouldActorBeListed(bool isOffstageList, VoosActor actor)
 {
     return((actor.GetIsOffstageEffective() == isOffstageList) &&
            !actor.GetWasClonedByScript() &&
            (showCopiesToggle.isOn || actor.GetCloneParentActor() == null) &&
            actor.GetDisplayName().ToLower().Contains(searchInput.text.ToLower()));
 }
Ejemplo n.º 2
0
    public virtual string GetInvalidActorReason(VoosActor actor)
    {
        if (actor == null)
        {
            return("Actor does not exist anymore!");
        }

        // True, this doesn't prevent the race condition if two players try to
        // request-lock the same actor. Basically one will win, and the other will
        // forever *think* they have it, but not really. And with copy-groups, this
        // problem becomes more likely. We'll ignore it for now, but in the future
        // possible solutions are: 1) make all tools poll for lock (and self-close
        // if they didn't actually get it), 2) have a centralized lock arbiter and
        // hopefully hide any edit latency, if possible.
        if (actor.IsLockedByAnother())
        {
            if (actor.IsCloneParentLockedByAnother())
            {
                VoosActor parent = actor.GetCloneParentActor();
                return($"LOCKED\nThis is a copy, and {parent.GetOwnerNickName()} is editing the original");
            }
            else
            {
                return($"LOCKED\n{actor.GetOwnerNickName()} is editing this");
            }
        }
        return(null);
    }