コード例 #1
0
ファイル: AMTActionPlayer.cs プロジェクト: r1cebank/AmiMat
 public AMTActionPlayer(AMTPackage Pak, AMTAction Act)
 {
     this.Package = Pak;
     this.Action = AMTUtil.ExpandFrame(Pak.Animation, Act);
     this.CurrentFrame = 0;
     this.LoopTimes = 0;
     this.RandomGenerator = new Random();
 }
コード例 #2
0
ファイル: ActionPreview.cs プロジェクト: r1cebank/AmiMat
 public ActionPreview(AMTPackage Package, AMTAction Action)
 {
     InitializeComponent();
     PreviewPackage = Package;
     PreviewAction = Action;
     ExpandedActionPlayer = new AMTActionPlayer(Package, Action);
     this.Text = this.Text + " " + Action.Name;
     PlayTimer.Enabled = true;
 }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: r1cebank/AmiMat
 public MainWindow()
 {
     InitializeComponent();
     Package = new AMTPackage();
     bool result = AMTUtil.OpenPackage(Package, AMTUtil.GetAbsPath(Directory.GetCurrentDirectory(), "AMT.apkg"));
     if (result)
     {
         //Set current action
         Default = new AMTActionPlayer(Package.Animation, AMTUtil.GetDefaultAction(Package.Animation));
         CurrentAction = Default;
         Timer = new DispatcherTimer();
         Timer.Interval = TimeSpan.FromMilliseconds(10);
         Timer.Tick += Timer_Tick;
         Timer.Start();
         this.MouseDoubleClick += MainWindow_MouseDoubleClick;
         MEAudio.Play();
     }
     else
     {
         this.Close();
         System.Environment.Exit(0);
     }
     this.MouseDown += Window_MouseDown;
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: r1cebank/AmiMat
 private void InitData()
 {
     Package = new AMTPackage();
     tAutoSave.Interval = 1000 * 60 * 2; //2min autosave cycle
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: r1cebank/AmiMat
 private void btnOpenExisting_Click(object sender, EventArgs e)
 {
     OpenFileDialog OpenFileDialog = new OpenFileDialog();
     OpenFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
     OpenFileDialog.Filter = AMTConfig.PackageExtension + " files (*" +
                           AMTConfig.PackageExtension + ")|*" + AMTConfig.PackageExtension;
     OpenFileDialog.FilterIndex = 2;
     OpenFileDialog.RestoreDirectory = true;
     if (OpenFileDialog.ShowDialog() == DialogResult.OK)
     {
         //Clear UI Before this and Data
         Package.PackageState = AMTUtil.State.LOADED;
         ClearElements();
         InitData();
         //File Loading
         if (!AMTUtil.OpenPackage(Package, OpenFileDialog.FileName))
         {
             MessageBox.Show("Project Load Error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Package = new AMTPackage();
             Package.PackageState = AMTUtil.State.EMPTY;
         }
         else
         {
             PopulateResources();
             lbAssets.SelectedIndex = 0;
             PopulateAssetFrames();
             lbGifFrames.SelectedIndex = 0;
             PopulateUI();
         }
     }
 }