Beispiel #1
0
        public void SetSelectedBrush(EditorBrush brush)
        {
            StarboundAsset asset = null;

            if (brush != null && brush.NeedsFrontAsset && brush.FrontAsset != null)
            {
                asset = brush.FrontAsset;
            }
            else if (brush != null && brush.NeedsBackAsset && brush.BackAsset != null)
            {
                asset = brush.BackAsset;
            }
            else
            {
                asset = new StarboundAsset();
                //asset.AssetName = "gridAsset.INTERNAL";
                asset.Image = EditorHelpers.GetGeneratedRectangle(8, 8, 255, 255, 255, 128);
            }

            m_selectedBrush = brush;
            m_selectedAsset = asset;

            Invalidate();
        }
Beispiel #2
0
        public virtual void LoadBrushWithBackAsset(EditorBrush brush, Editor.Editor parent, string name, string type)
        {
            string extension = EditorHelpers.GetExtensionFromBrushType(type);

            // Objects and NPCs must always be a front asset
            if (!brush.NeedsBackAsset || extension == null || type == "object" || type == "npc")
                return;

            // Load the background tile
            StarboundAsset asset = parent.LoadAsset(name, type);
            if ( asset == null )
            {
                // If this is an internal asset - liquids, etc
                // This is a hack to display liquids until liquid parsing has been implemented
                // (low priority)
                if (name == "lava")
                {
                    asset = new StarboundAsset();
                    //asset.AssetName = name;
                    asset.Image = EditorHelpers.GetGeneratedRectangle(8, 8, 207, 16, 32, 255);
                }
                else if (name == "acid")
                {
                    asset = new StarboundAsset();
                    //asset.AssetName = name;
                    asset.Image = EditorHelpers.GetGeneratedRectangle(8, 8, 107, 141, 63, 255);
                }
                else if (name == "water")
                {
                    asset = new StarboundAsset();
                    //asset.AssetName = name;
                    asset.Image = EditorHelpers.GetGeneratedRectangle(8, 8, 0, 78, 111, 255);
                }
                else if (name == "liquidtar" || name == "tentaclejuice")
                {
                    asset = new StarboundAsset();
                    //asset.AssetName = name;
                    asset.Image = EditorHelpers.GetGeneratedRectangle(8, 8, 200, 191, 231, 255);
                }
                //parent.RegisterAsset(name, type, asset);
            }

            if (asset != null)
                brush.BackAsset = asset;
        }