Exemple #1
0
        // Constructor, copy from existing PLM.
        public Plm(Plm source) : base()
        {
            PlmID        = source.PlmID;
            PosX         = source.PosX;
            PosY         = source.PosY;
            MainVariable = source.MainVariable;

            MyPlmType       = source.MyPlmType;
            MyScrollPlmData = null;
        }
Exemple #2
0
        // Constructor.
        public Plm() : base()
        {
            PlmID        = 0;
            PosX         = 0;
            PosY         = 0;
            MainVariable = 0;

            MyPlmType       = null;
            MyScrollPlmData = null;
        }
Exemple #3
0
 private void ForceSelectPlmType(int index)
 {
     if (index >= 0 && index < PlmTypes.Count)
     {
         PlmTypeIndex  = index;
         ActivePlmType = PlmTypes [PlmTypeIndex];
     }
     else
     {
         PlmTypeIndex  = IndexNone;
         ActivePlmType = null;
     }
 }
Exemple #4
0
 public ActiveItems(Project p)
 {
     ActiveArea        = p.AreaIndex;
     ActiveRoom        = p.ActiveRoom;
     ActiveRoomState   = p.ActiveRoomState;
     ActiveTileSet     = p.ActiveTileSet;
     ActiveDoor        = p.ActiveDoor;
     ActiveLevelData   = p.ActiveLevelData;
     ActivePlm         = p.ActivePlm;
     ActivePlmType     = p.ActivePlmType;
     ActiveEnemy       = p.ActiveEnemy;
     ActiveEnemyGfx    = p.ActiveEnemyGfx;
     ActiveEnemyType   = p.ActiveEnemyType;
     ActiveScrollData  = p.ActiveScrollData;
     ActiveScrollColor = p.ActiveScrollColor;
     ActiveFx          = p.ActiveFx;
     ActiveFxData      = p.ActiveFxData;
     ActiveBackground  = p.ActiveBackground;
 }
Exemple #5
0
 // Read all PLM types from PLM folder.
 private void ReadPlmTypes()
 {
     string [] paths = Directory.GetFiles(Environment.CurrentDirectory +
                                          PlmFolder);
     for (int i = 0; i < paths.Length; i++)
     {
         var    newPlm   = new PlmType();
         string filename = Tools.FilenameFromPath(paths [i]);
         Tools.TrimFileExtension(ref filename, out string extension);
         if (extension.ToLower() == ".png" && filename.Length > 5)
         {
             newPlm.PlmID    = Tools.HexToInt(filename.Substring(0, 4));
             newPlm.Name     = filename.Substring(5, filename.Length - 5);
             newPlm.Graphics = new BlitImage(GraphicsIO.LoadBitmap(paths [i]));
             PlmTypes.Add(newPlm);
         }
     }
     PlmTypes.Sort((x, y) => x.PlmID - y.PlmID);
     for (int i = 0; i < PlmTypes.Count; i++)
     {
         PlmTypes [i].Index = i;
     }
 }
Exemple #6
0
        public bool Connect(List <Data> ScrollPlmDatas, List <PlmType> PlmTypes)
        {
            MyPlmType = PlmTypes.Find(x => x.PlmID == PlmID);
            if (MyPlmType == null)
            {
                MyPlmType = PlmTypes [0];
            }

            if (PlmID == ScrollID)
            {
                MyScrollPlmData =
                    (ScrollPlmData)ScrollPlmDatas.Find(x => x.StartAddressLR == MainVariable);
                if (MyScrollPlmData != null)
                {
                    MyScrollPlmData.MyPlms.Add(this);
                }
                return(MyScrollPlmData != null);
            }
            else
            {
                MyScrollPlmData = null;
            }
            return(true);
        }