Beispiel #1
0
        public HAMEditor(EditorHAMFile data, StandardUI host, PIGFile piggyFile, Palette palette, SaveHandler saveHandler)
        {
            InitializeComponent();

            this.palette   = palette;
            this.piggyFile = piggyFile;

            datafile         = data;
            this.host        = host;
            this.saveHandler = saveHandler;

            texturePanel        = new TMAPInfoPanel(transactionManager); components.Add(texturePanel);
            texturePanel.Dock   = DockStyle.Fill;
            vclipPanel          = new VClipPanel(transactionManager); components.Add(vclipPanel);
            vclipPanel.Dock     = DockStyle.Fill;
            eclipPanel          = new EClipPanel(transactionManager); components.Add(eclipPanel);
            eclipPanel.Dock     = DockStyle.Fill;
            wclipPanel          = new WClipPanel(transactionManager); components.Add(wclipPanel);
            wclipPanel.Dock     = DockStyle.Fill;
            robotPanel          = new RobotPanel(transactionManager, 4); components.Add(robotPanel);
            robotPanel.Dock     = DockStyle.Fill;
            weaponPanel         = new WeaponPanel(transactionManager, 5); components.Add(weaponPanel);
            weaponPanel.Dock    = DockStyle.Fill;
            polymodelPanel      = new PolymodelPanel(transactionManager, 6, piggyFile, palette, data); components.Add(polymodelPanel);
            polymodelPanel.Dock = DockStyle.Fill;
            soundPanel          = new SoundPanel(transactionManager, 7, datafile, host.DefaultSoundFile); components.Add(soundPanel);
            soundPanel.Dock     = DockStyle.Fill;
            reactorPanel        = new ReactorPanel(transactionManager, 8); components.Add(reactorPanel);
            reactorPanel.Dock   = DockStyle.Fill;
            TextureTabPage.Controls.Add(texturePanel);
            VClipTabPage.Controls.Add(vclipPanel);
            EffectsTabPage.Controls.Add(eclipPanel);
            DoorTabPage.Controls.Add(wclipPanel);
            RobotTabPage.Controls.Add(robotPanel);
            WeaponTabPage.Controls.Add(weaponPanel);
            ModelTabPage.Controls.Add(polymodelPanel);
            SoundTabPage.Controls.Add(soundPanel);
            ReactorTabPage.Controls.Add(reactorPanel);

            string currentFilename = "Untitled";

            if (saveHandler != null)
            {
                currentFilename = saveHandler.GetUIName();
            }

            this.Text = string.Format("{0} - HAM Editor", currentFilename);

            transactionManager.undoEvent += DoUndoEvent;

            datafile.CompatObjBitmaps = StandardUI.options.GetOption("CompatObjBitmaps", bool.FalseString) == bool.TrueString;
        }
    public void Awake()
    {
        if(sp == null)
        {
            sp = this;
        }
        else if (sp != this)
        {
            DestroyObject(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }