Beispiel #1
0
        // C o n s t r u c t o r

        public TweakViewer(SM64Lib.RomManager rommgr)
        {
            // G u i
            base.Shown += TweakViewer_Shown;
            InitializeComponent();
            base.UpdateAmbientColors();
            Panel1.UpdateAmbientColors();
            Flyout1.BackColor = base.BackColor;
            this.rommgr       = rommgr;
        }
        private void ButtonX_OpenRom_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog()
            {
                Filter = "SM64 ROMs (*.z64)|*.z64|All files (*.*)|*.*"
            };

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                RomFile = ofd.FileName;
                rommgr  = new SM64Lib.RomManager(RomFile);
            }
        }
Beispiel #3
0
 internal static void PatchScript(IWin32Window owner, PatchScript script, PatchProfile profile, SM64Lib.RomManager rommgr)
 {
     try
     {
         TweakBeforeApply?.Invoke();
         var mgr = new PatchingManager();
         mgr.Patch(
             script,
             rommgr,
             owner,
             new Dictionary <string, object>()
         {
             { "romfile", rommgr.RomFile },
             { "rommgr", rommgr },
             { "profilepath", profile?.FileName },
             { "files", profile.EmbeddedFiles },
             { "owner", owner }
         },
             General.GetAdditionalReferencedAssemblied());
         TweakAfterApply?.Invoke();
         MessageBoxEx.Show(owner, "Patched successfully.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception)
     {
         TweakFailedApply?.Invoke();
         MessageBoxEx.Show(owner, "Error while executing the script. It probably contains errors.", "Script Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public ModelImporter(SM64Lib.RomManager rommgr) : this()
 {
     this.rommgr = rommgr;
 }