Esempio n. 1
0
        private void Save(String filePath = "")
        {
            if (filePath == "")
            {
                filePath = GetSaveDestination();

                if (filePath == "")
                {
                    return;
                }
            }

            ChunkConnector[][] connectors = new ChunkConnector[4][];

            for (int i = 0; i < 4; ++i)
            {
                connectors[i] = new ChunkConnector[myConArrows[i].Count];
                for (int j = 0; j < myConArrows[i].Count; ++j)
                {
                    connectors[i][j] = myConArrows[i][j].ConnectorInfo;
                }
            }

            ChunkTemplate temp = new ChunkTemplate(myCurrentMap.Chunk, connectors, myMapTypes);

            temp.SaveToFile(filePath);

            myLastSavePath = filePath;
            Text           = "Lewt Chunk Editor - " + filePath;
        }
Esempio n. 2
0
        public ConnectorArrow(int x, int y, bool horizontal, int size = 1)
            : base(ArrowTexture, MapRenderer.CameraScale)
        {
            ConnectorInfo = new ChunkConnector
            {
                X             = x,
                Y             = y,
                Size          = size,
                Horizontal    = horizontal,
                BottomOrRight = x != 0 && y != 0
            };

            UseCentreAsOrigin = true;

            if (horizontal)
            {
                if (x == 0)
                {
                    Rotation = 3.0f * (float)Math.PI / 2.0f;
                }
                else
                {
                    Rotation = (float)Math.PI / 2.0f;
                }
            }
            else
            {
                if (y == 0)
                {
                    Rotation = 0.0f;
                }
                else
                {
                    Rotation = (float)Math.PI;
                }
            }
        }