コード例 #1
0
        // This copies textures to another sidedef
        // And possibly also the offsets
        public void AddTexturesTo(Sidedef s)
        {
            int copyoffsets = 0;

            // s cannot be null
            if (s == null)
            {
                return;
            }

            s.BeforePropsChange();

            // Upper texture set?
            if ((texnamehigh.Length > 0) && (texnamehigh[0] != '-'))
            {
                // Copy upper texture
                s.texnamehigh     = texnamehigh;
                s.longtexnamehigh = longtexnamehigh;

                // Counts as a half coice for copying offsets
                copyoffsets += 1;
            }

            // Middle texture set?
            if ((texnamemid.Length > 0) && (texnamemid[0] != '-'))
            {
                // Copy middle texture
                s.texnamemid     = texnamemid;
                s.longtexnamemid = longtexnamemid;

                // Counts for copying offsets
                copyoffsets += 2;
            }

            // Lower texture set?
            if ((texnamelow.Length > 0) && (texnamelow[0] != '-'))
            {
                // Copy middle texture
                s.texnamelow     = texnamelow;
                s.longtexnamelow = longtexnamelow;

                // Counts as a half coice for copying offsets
                copyoffsets += 1;
            }

            // Copy offsets also?
            if (copyoffsets >= 2)
            {
                // Copy offsets
                s.offsetx = offsetx;
                s.offsety = offsety;
            }

            General.Map.IsChanged = true;
        }
コード例 #2
0
        // This copies all properties to another sidedef
        public void CopyPropertiesTo(Sidedef s)
        {
            s.BeforePropsChange();

            // Copy properties
            s.offsetx         = offsetx;
            s.offsety         = offsety;
            s.texnamehigh     = texnamehigh;
            s.texnamemid      = texnamemid;
            s.texnamelow      = texnamelow;
            s.longtexnamehigh = longtexnamehigh;
            s.longtexnamemid  = longtexnamemid;
            s.longtexnamelow  = longtexnamelow;
            base.CopyPropertiesTo(s);
        }
コード例 #3
0
        // This copies all properties to another sidedef
        public void CopyPropertiesTo(Sidedef s)
        {
            s.BeforePropsChange();

            // Copy properties
            s.offsetx         = offsetx;
            s.offsety         = offsety;
            s.texnamehigh     = texnamehigh;
            s.texnamemid      = texnamemid;
            s.texnamelow      = texnamelow;
            s.longtexnamehigh = longtexnamehigh;
            s.longtexnamemid  = longtexnamemid;
            s.longtexnamelow  = longtexnamelow;
            s.flags           = new Dictionary <string, bool>(flags);  //mxd
            base.CopyPropertiesTo(s);
        }
コード例 #4
0
        // This copies textures to another sidedef
        // And possibly also the offsets
        public void AddTexturesTo(Sidedef s)
        {
            int copyoffsets = 0;

            // s cannot be null
            if (s == null)
            {
                return;
            }

            s.BeforePropsChange();

            // Upper texture set?
            if ((texnamehigh.Length > 0) && (texnamehigh != "-"))
            {
                // Copy upper texture
                s.texnamehigh     = texnamehigh;
                s.longtexnamehigh = longtexnamehigh;

                // Counts as a half coice for copying offsets
                copyoffsets += 1;

                //mxd. Also copy UDMF offsets and scale
                if (General.Map.UDMF)
                {
                    UniFields.SetFloat(s.Fields, "offsetx_top", Fields.GetValue("offsetx_top", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "offsety_top", Fields.GetValue("offsety_top", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "scalex_top", Fields.GetValue("scalex_top", 1.0), 1.0);
                    UniFields.SetFloat(s.Fields, "scaley_top", Fields.GetValue("scaley_top", 1.0), 1.0);
                }
            }

            // Middle texture set?
            if ((texnamemid.Length > 0) && (texnamemid != "-"))
            {
                // Copy middle texture
                s.texnamemid     = texnamemid;
                s.longtexnamemid = longtexnamemid;

                // Counts for copying offsets
                copyoffsets += 2;

                //mxd. Also copy UDMF offsets and scale
                if (General.Map.UDMF)
                {
                    UniFields.SetFloat(s.Fields, "offsetx_mid", Fields.GetValue("offsetx_mid", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "offsety_mid", Fields.GetValue("offsety_mid", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "scalex_mid", Fields.GetValue("scalex_mid", 1.0), 1.0);
                    UniFields.SetFloat(s.Fields, "scaley_mid", Fields.GetValue("scaley_mid", 1.0), 1.0);
                }
            }

            // Lower texture set?
            if ((texnamelow.Length > 0) && (texnamelow != "-"))
            {
                // Copy middle texture
                s.texnamelow     = texnamelow;
                s.longtexnamelow = longtexnamelow;

                // Counts as a half coice for copying offsets
                copyoffsets += 1;

                //mxd. Also copy UDMF offsets and scale
                if (General.Map.UDMF)
                {
                    UniFields.SetFloat(s.Fields, "offsetx_bottom", Fields.GetValue("offsetx_bottom", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "offsety_bottom", Fields.GetValue("offsety_bottom", 0.0), 0.0);
                    UniFields.SetFloat(s.Fields, "scalex_bottom", Fields.GetValue("scalex_bottom", 1.0), 1.0);
                    UniFields.SetFloat(s.Fields, "scaley_bottom", Fields.GetValue("scaley_bottom", 1.0), 1.0);
                }
            }

            // Copy offsets also?
            if (copyoffsets >= 2)
            {
                // Copy offsets
                s.offsetx = offsetx;
                s.offsety = offsety;
            }

            General.Map.IsChanged = true;
        }