Example #1
0
        public void apply()
        {
            string fName     = Path.GetFileNameWithoutExtension(mData.Texture);
            string dir       = Path.GetDirectoryName(mData.Texture);
            string themeName = dir.Substring(dir.LastIndexOf("\\") + 1);

            TerrainTextureDef SelectedDef = SimTerrainType.getFromTypeName(themeName + "_" + fName);

            TerrainGlobals.getTexturing().addActiveTexture(SimTerrainType.getWorkingTexName(SelectedDef));
            SimTerrainType.addActiveSetDef(SelectedDef);
            TerrainGlobals.getTerrainFrontEnd().SelectedTextureIndex = SimTerrainType.getActiveSetIndex(SelectedDef);


            TerrainGlobals.getEditor().applyTextureToMask();
        }