Beispiel #1
0
 public bool FindActor(string name, out ActorInfo actor)
 {
     foreach (ActorInfo info in m_actorlist)
     {
         if (info.Name == name)
         {
             actor = info;
             return true;
         }
     }
     actor = null;
     return false;
 }
Beispiel #2
0
        public ActorInfo Add(SpriteInfo info)
        {
            if (info == null)
                return null;

            ActorInfo newActor = new ActorInfo();
            newActor.Name = info.Name;
            newActor.SpriteInfo = info;

            newActor.Anchors.Add(new AnchorInfo(0));

            m_actorlist.Add(newActor);

            m_bModify = true;

            return newActor;
        }
Beispiel #3
0
        public void Read(Stream stream)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(stream);

            XmlNode rootNode = doc.SelectSingleNode("ActorList");
            _version = GenericXmlReader.ReadIntAttribute(rootNode, "version");

            XmlNodeList actorNode = rootNode.SelectNodes("actor");
            foreach (XmlNode snode in actorNode)
            {
                ActorInfo actor = new ActorInfo();
                actor.Read(snode);

                m_actorlist.Add(actor);
            }
        }
Beispiel #4
0
        public void Delete(ActorInfo unit)
        {
            m_actorlist.Remove(unit);

            m_bModify = true;
        }
Beispiel #5
0
        public void SelectActor( string name )
        {
            if (m_selectActor != null)
            {
                if (m_selectActor.Name == name)
                    return;
            }
            ActorInfo selectActor;
            m_main.Actors.FindActor(name, out selectActor);

            if (selectActor != null)
            {
                prevPictrue.SetActor(selectActor);
                m_selectActor = selectActor;
            }

            UpdateList();
            UpdateRegion();
        }
Beispiel #6
0
 private void listActor_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ( listActor.SelectedIndex < 0 )
     {
         m_selectActor = null;
         return;
     }
     string selectName = listActor.Items[listActor.SelectedIndex].ToString();
     SelectActor(selectName);
 }
Beispiel #7
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            if (listActor.SelectedIndex < 0)
                return;

            if (m_selectActor == null)
                return;

            m_main.Actors.Delete(m_selectActor);
            m_selectActor = null;

            UpdateList();
            UpdateRegion();
        }
Beispiel #8
0
        public void SetActor( ActorInfo info )
        {
            m_actorInfo = info;

            if (info.SpriteInfo == null)
            {
                SpriteInfo spriteInfo;
                m_main.SpritesMap.FindSpriteUnit(info.Name, out spriteInfo,(int)SpriteMap.E_Entity.Actor);
                info.SpriteInfo = spriteInfo;
            }

            UpdateAnchor();
        }