private void btnInsertRow_Click(object sender, System.EventArgs e) { int todo = tilesetViewer.TilesWide - (vsp.tileCount % tilesetViewer.TilesWide); if (todo == 0) { todo = tilesetViewer.TilesWide; } int startInsert = vsp.tileCount; Ops.AddRemoveTilesGroup artg = new Ops.AddRemoveTilesGroup(0); Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Insert Row"); for (int i = 0; i < todo; i++) { artg.addRecord(startInsert, 0); } om.addExec(artg); om.endGroup(); updateScrollbar(); tilesetViewer.Invalidate(); }
private void btnInsertTile_Click(object sender, System.EventArgs e) { Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Insert Tile"); Ops.AddRemoveTilesGroup artg = new Ops.AddRemoveTilesGroup(0); artg.addRecord(Global.ActiveVsp.tileCount, 0); om.addExec(artg); om.endGroup(); updateScrollbar(); tilesetViewer.Invalidate(); }
private void btnDeleteRow_Click(object sender, System.EventArgs e) { int toDelete = vsp.tileCount % tilesetViewer.TilesWide; if (toDelete == 0) { toDelete = tilesetViewer.TilesWide; } if (vsp.tileCount == 0) { toDelete = 0; } if (toDelete == 0) { return; } int startDelete = (vsp.tileCount / tilesetViewer.TilesWide) * tilesetViewer.TilesWide; if (toDelete == tilesetViewer.TilesWide) { startDelete -= tilesetViewer.TilesWide; } Ops.AddRemoveTilesGroup artg = new Ops.AddRemoveTilesGroup(0); Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Delete Row"); for (int i = 0; i < toDelete; i++) { artg.addRecord(startDelete, 1); } om.addExec(artg); om.endGroup(); updateScrollbar(); tilesetViewer.Invalidate(); }
private void btnInsertRow_Click(object sender, System.EventArgs e) { int todo = tilesetViewer.TilesWide - (vsp.tileCount % tilesetViewer.TilesWide); if (todo == 0) todo = tilesetViewer.TilesWide; int startInsert = vsp.tileCount; Ops.AddRemoveTilesGroup artg = new Ops.AddRemoveTilesGroup(0); Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Insert Row"); for (int i = 0; i < todo; i++) artg.addRecord(startInsert, 0); om.addExec(artg); om.endGroup(); updateScrollbar(); tilesetViewer.Invalidate(); }
private void btnDeleteRow_Click(object sender, System.EventArgs e) { int toDelete = vsp.tileCount % tilesetViewer.TilesWide; if (toDelete == 0) toDelete = tilesetViewer.TilesWide; if (vsp.tileCount == 0) toDelete = 0; if (toDelete == 0) return; int startDelete = (vsp.tileCount / tilesetViewer.TilesWide) * tilesetViewer.TilesWide; if (toDelete == tilesetViewer.TilesWide) startDelete -= tilesetViewer.TilesWide; Ops.AddRemoveTilesGroup artg = new Ops.AddRemoveTilesGroup(0); Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Delete Row"); for (int i = 0; i < toDelete; i++) artg.addRecord(startDelete, 1); om.addExec(artg); om.endGroup(); updateScrollbar(); tilesetViewer.Invalidate(); }