예제 #1
0
파일: PLM.cs 프로젝트: DJuttmann/SM3E
        // 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;
        }
예제 #2
0
파일: PLM.cs 프로젝트: DJuttmann/SM3E
        // Constructor.
        public Plm() : base()
        {
            PlmID        = 0;
            PosX         = 0;
            PosY         = 0;
            MainVariable = 0;

            MyPlmType       = null;
            MyScrollPlmData = null;
        }
예제 #3
0
 private void ForceSelectPlmType(int index)
 {
     if (index >= 0 && index < PlmTypes.Count)
     {
         PlmTypeIndex  = index;
         ActivePlmType = PlmTypes [PlmTypeIndex];
     }
     else
     {
         PlmTypeIndex  = IndexNone;
         ActivePlmType = null;
     }
 }
예제 #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;
 }
예제 #5
0
파일: LoadSave.cs 프로젝트: DJuttmann/SM3E
 // 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;
     }
 }
예제 #6
0
파일: PLM.cs 프로젝트: DJuttmann/SM3E
        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);
        }