예제 #1
0
 private void GraphicsSet_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _world.TileTableIndex = int.Parse(GraphicsSet.SelectedValue.ToString());
     _graphicsAccessor.SetBottomTable(_graphicsService.GetTileSection(_world.TileTableIndex));
     TileSelector.Update();
     Update();
 }
예제 #2
0
 private void _graphicsService_GraphicsUpdated()
 {
     _graphicsAccessor.SetTopTable(_graphicsService.GetTileSection(_world.AnimationTileTableIndex));
     _graphicsAccessor.SetBottomTable(_graphicsService.GetTileSection(_world.TileTableIndex));
     TileSelector.Update();
     Update();
 }
예제 #3
0
        private void PaletteIndex_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (PaletteIndex.SelectedItem != null)
            {
                _world.PaletteId = ((Palette)PaletteIndex.SelectedItem).Id;

                Palette palette = _palettesService.GetPalette(_world.PaletteId);
                _worldRenderer.Update(palette: palette);
                TileSelector.Update(palette: palette);
                Update();
            }
        }
예제 #4
0
 private void _palettesService_PalettesChanged()
 {
     PaletteIndex.ItemsSource = _palettesService.GetPalettes();
     if (PaletteIndex.SelectedItem == null)
     {
         PaletteIndex.SelectedIndex = 0;
     }
     else
     {
         _worldRenderer.Update(palette: (Palette)PaletteIndex.SelectedItem);
         TileSelector.Update(palette: (Palette)PaletteIndex.SelectedItem);
         Update();
     }
 }
예제 #5
0
        public void Update(GameTime gameTime)
        {
            currentMousePosition = camera.CurrentMousePosition;
            Vector2 previousMousePosition = camera.PreviousMousePosition;

            mouseTravel = currentMousePosition - previousMousePosition;

            // Update all DrawingArea components.
            camera.Update();

            tileSelector.Update(!tileSelection.Hidden, tileSelection.IsHoveredByMouse, tileDrawer.DrawTileSelectionCurrentTileOnMouse, tileMover.MovingSelectedTilesWithMouse,
                                tiles, currentMousePosition, gameTime);

            tileMover.Update(!tileSelection.Hidden, tileSelection.IsHoveredByMouse, tileSelector.SelectionBoxHasStartPoint, false, tileSelector.SelectedTiles, tiles,
                             ref tileSelector.SelectedTilesMinimalBoundingBox, currentMousePosition, mouseTravel, gameTime, grid, tileHistory);

            tileDrawer.Update(tileSelection.CurrentTile, !tileSelection.IsHoveredByMouse, tileSelection.Hidden, tiles, tileSelector.SelectedTiles, currentMousePosition,
                              ref tileSelector.SelectedTilesMinimalBoundingBox, grid, tileHistory);

            grid.Update();
            tileHistory.Update(tiles);
        }
예제 #6
0
 private void ShowInteraction_Click(object sender, RoutedEventArgs e)
 {
     TileSelector.Update(withMapInteractionOverlay: ShowInteraction.IsChecked.Value);
     Update();
 }
예제 #7
0
 private void _tileService_TileSetUpdated(int index, TileSet tileSet)
 {
     Update();
     TileSelector.Update(_tileSet);
 }