Ejemplo n.º 1
0
    public void Insert(int index, Line child)
    {
        Line oldParent = child.parent_;

        if (oldParent == this)
        {
            children_.Move(child.Index, index);
        }
        else
        {
            children_.Insert(index, child);
            child.Tree    = Tree;
            child.parent_ = this;
            if (oldParent != null)
            {
                oldParent.children_.Remove(child);
            }
        }

        child.OnFoundParent();

        if (child.Tree is LogTree == false)
        {
            foreach (string tag in child.Tags)
            {
                bool      add       = (child.IsDone == false);
                TagParent tagParent = GameContext.TagList.GetTagParent(tag);
                if (tagParent == null)
                {
                    // Doneしてないタグなら生成する
                    if (add)
                    {
                        tagParent = GameContext.TagList.InstantiateTagParent(tag);
                    }
                }
                else
                {
                    // DoneしててもRepeatなら追加してよい
                    add |= tagParent.IsRepeat;
                }
                add &= tagParent != null && tagParent.FindBindedLine(child) == null;
                if (add)
                {
                    tagParent.InstantiateTaggedLine(child);
                }
            }

            if (child.Field != null)
            {
                child.Field.SetHashTags(child.tags_);
            }
        }
    }
Ejemplo n.º 2
0
 void ApplyTextToTaggedLine()
 {
     if (Tree is LogTree == false)
     {
         foreach (string tag in Tags)
         {
             TagParent tagParent = GameContext.TagList.GetTagParent(tag);
             if (tagParent != null)
             {
                 TaggedLine taggedline = tagParent.FindBindedLine(this);
                 if (taggedline != null)
                 {
                     taggedline.Text = TextWithoutHashTags;
                 }
             }
         }
     }
 }