Ejemplo n.º 1
0
        public GameSetViewerContainer()
        {
            InitializeComponent();
            this._gameSetPresenter = new GameSetPresenter();

            this.cbTables.SelectedIndexChanged += CbTables_SelectedIndexChanged;
            this.cbDataSources.SelectedIndexChanged += CbDataSources_SelectedIndexChanged;
            this.GameSetPresenter.PropertyChanged += GameSetPresenter_PropertyChanged;
        }
        public void dbgOpenBallistaSpriteAndStandardGameSet()
        {
            string dataDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\data\\projects\\_test\\basic\\";

            SpriteSprPresenter spr = new SpriteSprPresenter();
            spr.PalettePresenter = new ColorPalettePresenter();
            spr.PalettePresenter.Load(this.dataDir + "pal_std.res", null);
            spr.Load(dataDir + "ballista.spr");

            ProjectManager.OpenSprites.Add(spr);

            if (spr.Frames.Count > 0)
            {
                var doc = (this._dockPanel.ActiveDocument as ImageEditorContainer) ?? OpenNewImageEditorContainerTab();

                if (doc?.ActiveSprite == null) //no sprite is being viewed in the UI
                    SetActiveSprite(spr);
                else
                {
                    OpenNewImageEditorContainerTab();           //open a new document tab
                    SetActiveSprite(spr);
                }
            }

            GameSetPresenter gsp = new GameSetPresenter();
            gsp.Load(dataDir + "std.set", true);
            this._gameSetViewerContainer.GameSetPresenter = gsp;

            SetSpriteDataViews(this._gameSetViewerContainer.GameSetPresenter);
        }
Ejemplo n.º 3
0
        public override bool SetSpriteDataView(GameSetPresenter gsp)
        {
            DataView dv;

            dv = new DataView(gsp.GameObject?.Tables?[this.SpriteId]);
            this.DataView = dv;

            return this.GameObject.SetSpriteDataView(dv);
        }
Ejemplo n.º 4
0
        public override bool SetSpriteDataView(GameSetPresenter gsp)
        {
            DataView dv;

            dv = new DataView(gsp.GameObject?.Tables?["SFRAME"]);
            dv.RowFilter = $"SPRITE = '{this.SpriteId.ToUpper()}'";

            this.DataView = dv;

            var result = this.GameObject.SetSpriteDataView(dv);
            if (result)
                UpdateFrameNamesAndOffsets();
            return result;
        }