예제 #1
0
 /// <summary>
 /// Called when the <see cref="Tileset"/> selection changed.
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
 }
예제 #2
0
 protected override void OnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
     this.currentAutoTile = null;
     this.UpdateTreeModel();
 }
 protected override void OnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
     this.UpdateTreeModel();
 }
예제 #4
0
 internal void RaiseOnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
     this.OnTilesetSelectionChanged(args);
 }
예제 #5
0
 private void OnTilesetSelectionChanging(TilesetSelectionChangedEventArgs args)
 {
     // When switching to a different tileset, either apply or revert what we did to the current one
     if (args.ChangeReason != SelectionChangeReason.ObjectDisposing)
         this.AskApplyOrResetTilesetChanges(false);
 }
예제 #6
0
        private void OnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
        {
            Tileset nextTileset = args.Next.Res;

            this.StartRecordTilesetChanges();

            // Update the label that tells us which tileset is selected
            this.labelSelectedTileset.Text = (nextTileset != null) ?
                string.Format(TilemapsRes.TilesetEditor_SelectedTileset, nextTileset.Name) :
                TilemapsRes.TilesetEditor_NoTilesetSelected;

            // Update the displayed visual layer index
            if (nextTileset == null)
                this.tilesetView.DisplayedConfigIndex = 0;
            else if (nextTileset.RenderConfig.Count <= this.tilesetView.DisplayedConfigIndex)
                this.tilesetView.DisplayedConfigIndex = 0;

            // Inform the currently active editing mode of this change
            if (this.activeMode != null)
                this.activeMode.RaiseOnTilesetSelectionChanged(args);

            // Update the enabled state of Add and Remove buttons
            this.buttonAddLayer.Enabled = (nextTileset != null);
            this.buttonRemoveLayer.Enabled = (nextTileset != null && this.layerView.SelectedNode != null);
        }
예제 #7
0
 private void ApplyGlobalTilesetSelection(SelectionChangeReason changeReason)
 {
     Tileset tileset = TilemapsEditorSelectionParser.QuerySelectedTileset().Res;
     if (this.tilesetView.TargetTileset != tileset)
     {
         TilesetSelectionChangedEventArgs args = new TilesetSelectionChangedEventArgs(
             this.tilesetView.TargetTileset,
             tileset,
             changeReason);
         this.OnTilesetSelectionChanging(args);
         this.tilesetView.TargetTileset = tileset;
         this.OnTilesetSelectionChanged(args);
     }
 }
예제 #8
0
 /// <summary>
 /// Called when the <see cref="Tileset"/> selection changed.
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
 }
예제 #9
0
 internal void RaiseOnTilesetSelectionChanged(TilesetSelectionChangedEventArgs args)
 {
     this.OnTilesetSelectionChanged(args);
 }