Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            DataDirectory      = Path.Combine(@"C:\Fernando\Proj\Windows\TileStudio\TileStudio\bin\Debug", "data");
            TilesetFile        = Path.Combine(DataDirectory, "tileset.dat");
            DefaultTilesetFile = Path.Combine(DataDirectory, "default_tileset.dat");
            PaletteFile        = Path.Combine(DataDirectory, "palette.dat");

            ClearLog();
            ClearStatusBar();

            Palette = new Palette();
            Palette.Load(PaletteFile);
            Log("Palette loaded from " + PaletteFile);

            Tileset = new Tileset();
            Tileset.Load(TilesetFile);
            Log("Tileset loaded from " + TilesetFile);
            TilesetBox.EditorWindow = this;
            TilesetBox.Tileset      = Tileset;
            UpdateTilesetPageIndicator();

            Map = new Map();
            MapBox.SetMap(Map);
            MapBox.EditorWindow = this;
            MapBox.Tileset      = Tileset;
            MapBox.Palette      = Palette;

            MouseWheel        += Map_MouseWheel;
            MapBox.MouseWheel += Map_MouseWheel;

            UpdateMapLayerList();

            TileGraphics    = new TileGraphics();
            TxtMapName.Text = Map.Name;
            SetCurrentMapFile(null);

            TxtCommand.Text = "";
        }