Ejemplo n.º 1
0
        public override void Print(SectionLayer layer)
        {
            Rand.PushState();
            Rand.Seed = ThingID.GetHashCode();

            // Get location
            Vector3 center = this.TrueCenter();

            if (def.graphicData.drawSize.y > 1)
            {
                center.z += (def.graphicData.drawSize.y - 1) / 2;
            }

            // Print image
            Material matSingle = Graphic.MatSingle;

            Printer_Plane.PrintPlane(layer, center, def.graphicData.drawSize, matSingle, 0, Rand.Bool, null, null, 0.01f, 0f);

            Rand.PopState();
        }
 private void LoadText()
 {
     try
     {
         Encoding encoding = Encoding.Unicode;
         char[]   base64   = encoding.GetChars(
             CompressUtility.Decompress(Convert.FromBase64String(savedata))
             );
         text = new string(base64);
     }
     catch (Exception E)
     {
         Log.ErrorOnce("Unable to decode memorial data for " + ThingID + ": " + E.ToString(), ThingID.GetHashCode());
     }
 }
 //
 // Methods
 //
 public void SaveText()
 {
     try
     {
         Encoding encoding = Encoding.Unicode;
         savedata = Convert.ToBase64String(
             CompressUtility.Compress(encoding.GetBytes(text))
             );
     }
     catch (Exception E)
     {
         Log.ErrorOnce("Unable to encode memorial data for " + ThingID + ": " + E.ToString(), ThingID.GetHashCode());
     }
 }