Ejemplo n.º 1
0
        // see ApparelGraphicRecordGetter
        private static Graphic TryGetGraphicApparel(ThingDef def, BodyType bodyType, Color color)
        {
            if (def == null)
            {
                return(null);
            }

            string path = def.apparel.wornGraphicPath;

            if (path.NullOrEmpty())
            {
                return(null);
            }

            if (def.apparel.LastLayer != ApparelLayer.Overhead)
            {
                path = string.Format("{0}_{1}", path, bodyType.ToString());
            }

            Graphic graphic = GraphicDatabase.Get <Graphic_Multi>(path,
                                                                  ShaderDatabase.Cutout, def.graphicData.drawSize,
                                                                  color);

            return(graphic);
        }
Ejemplo n.º 2
0
        // Verse.GraphicGetter_NakedHumanlike
        public static Graphic GetNakedBodyGraphic(Pawn pawn, BodyType bodyType, Shader shader, Color skinColor)
        {
            //Log.Message(pawn.ToString());
            //Log.Message(bodyType.ToString());
            //Log.Message(shader.ToString());
            //Log.Message(skinColor.ToString());
            //Log.Message("1");



            if (pawn?.VampComp() is CompVampire v && v.IsVampire && v.Bloodline != null &&
                v?.Bloodline?.nakedBodyGraphicsPath != "")
            {
                //Log.Message("2");


                if (v.Transformed)
                {
                    return(null);
                }
                //Log.Message("3");

                string str = "Naked_" + bodyType.ToString();
                //Log.Message("4");

                string path = v.Bloodline.nakedBodyGraphicsPath + str;
                //Log.Message("5");

                Graphic result = GraphicDatabase.Get <Graphic_Multi>(path, shader, Vector2.one, skinColor);
                //Log.Message("6");
                return(result);
            }
            return(null);
        }
Ejemplo n.º 3
0
        internal void ToXml(XmlWriter writer)
        {
            writer.WriteStartElement("LogEntry");
            writer.WriteAttributeString("timeUtc", time.ToString("s", CultureInfo.InvariantCulture));
            writer.WriteAttributeString("type", type.ToString());
            writer.WriteAttributeString("bodyType", bodyType.ToString());

            if (verbosity != EntryVerbosity.Normal)
            {
                writer.WriteAttributeString("verbosity", verbosity.ToString());
            }

            if (link != null)
            {
                writer.WriteAttributeString("link", link);
            }

            writer.WriteStartElement("Message");
            writer.WriteString(message);
            writer.WriteEndElement();

            if (!string.IsNullOrEmpty(ext))
            {
                writer.WriteStartElement("Details");
                writer.WriteString(ext);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Ejemplo n.º 4
0
        public static bool TryGetGraphicApparelModded(Apparel apparel, BodyType bodyType, out ApparelGraphicRecord rec)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting apparel graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            if (apparel.def.apparel.wornGraphicPath.NullOrEmpty())
            {
                rec = new ApparelGraphicRecord(null, null);
                return(false);
            }
            string path;

            if (apparel.def.apparel.LastLayer == ApparelLayer.Overhead)
            {
                path = apparel.def.apparel.wornGraphicPath;
            }
            else
            {
                path = apparel.def.apparel.wornGraphicPath + "_" + bodyType.ToString();
            }

            Graphic graphic = new Graphic();

            graphic = GraphicDatabase.Get <Graphic_Multi>(path, ShaderDatabase.CutoutComplex, apparel.def.graphicData.drawSize, apparel.DrawColor, apparel.DrawColorTwo);

            rec = new ApparelGraphicRecord(graphic, apparel);
            return(true);
        }
Ejemplo n.º 5
0
        public static Graphic GetBodyOverlay(BodyType bodyType, string patronname)
        {
            if (bodyType == BodyType.Undefined)
            {
                bodyType = BodyType.Male;
            }
            string str  = patronname + "_" + bodyType.ToString();
            string path = "Things/Chaos/BodyOverlays/" + str;

            return(GraphicDatabase.Get <Graphic_Multi>(path, ShaderDatabase.CutoutComplex, Vector2.one, Color.white));
        }
Ejemplo n.º 6
0
        public Graphic BackpackGraphic(BodyType bodyType, string graphicPath)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting naked body graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            string path = graphicPath + bodyType.ToString();

            return(GraphicDatabase.Get <Graphic_Multi>(path, ShaderDatabase.CutoutComplex, Vector2.one, this.DrawColor, this.DrawColorTwo));
        }
Ejemplo n.º 7
0
        public static Graphic GetNakedBodyGraphic(BodyType bodyType, Shader shader, Color skinColor)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting naked body graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            string str  = "Naked_" + bodyType.ToString();
            string path = "Things/Pawn/Humanlike/Bodies/" + str;

            return(GraphicDatabase.Get <Graphic_Multi>(path, shader, Vector2.one, skinColor));
        }
        public static Graphic GetNakedBodyGraphicAlien(BodyType bodyType, Shader shader, Color skinColor, string userpath, Vector2 drawsize)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting naked body graphic with undefined body type.");
                bodyType = BodyType.Male;
            }

            string str = "Naked_" + bodyType.ToString();

            string path = userpath + str;

            return(GraphicDatabase.Get <Graphic_Multi>(path, shader, drawsize, skinColor));
        }
 // Verse.GraphicGetter_NakedHumanlike
 public static Graphic GetNakedBodyGraphic(Pawn pawn, BodyType bodyType, Shader shader, Color skinColor)
 {
     if (pawn?.VampComp() is CompVampire v && v.IsVampire &&
         v?.Bloodline?.nakedBodyGraphicsPath != "")
     {
         if (v.Transformed)
         {
             return(null);
         }
         string str  = "Naked_" + bodyType.ToString();
         string path = v.Bloodline.nakedBodyGraphicsPath + str;
         return(GraphicDatabase.Get <Graphic_Multi>(path, shader, Vector2.one, skinColor));
     }
     return(null);
 }
Ejemplo n.º 10
0
        public static Graphic GetNakedBodyGraphicAlien(Shader shader, Color skinColor, Gender gender, String userpath)
        {
            if (gender == Gender.Male)
            {
                bodyType = BodyType.Male;
            }
            else
            {
                bodyType = BodyType.Female;
            }

            string str  = "Naked_" + bodyType.ToString();
            string path = userpath + str;

            return(GraphicDatabase.Get <Graphic_Multi>(path, shader, Vector2.one, skinColor));
        }
Ejemplo n.º 11
0
 protected Graphic CreateGraphic(ThingDef def, BodyType bodyType)
 {
     if (def.apparel != null)
     {
         if (String.IsNullOrEmpty(def.apparel.wornGraphicPath))
         {
             return(null);
         }
         string graphicPath;
         if (def.apparel.LastLayer == ApparelLayer.Overhead)
         {
             graphicPath = def.apparel.wornGraphicPath;
         }
         else
         {
             graphicPath = def.apparel.wornGraphicPath + "_" + bodyType.ToString();
         }
         return(GraphicDatabase.Get <Graphic_Multi>(graphicPath, ShaderDatabase.Cutout, new Vector2(38, 38), Color.white, Color.white));
     }
     return(null);
 }
Ejemplo n.º 12
0
        public static bool TryGetGraphicApparelModded(Apparel apparel, BodyType bodyType, out ApparelGraphicRecord rec)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting apparel graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            if (apparel.def.apparel.wornGraphicPath.NullOrEmpty())
            {
                rec = new ApparelGraphicRecord(null, null);
                return(false);
            }
            string path;

            path = apparel.def.apparel.wornGraphicPath;
            CompFactionColor compF = apparel.TryGetComp <CompFactionColor>();

            if (compF != null)
            {
                if (compF.CProps.IsRandomMultiGraphic)
                {
                    path += "/" + compF.randomGraphicPath + "/" + compF.randomGraphicPath;
                }
            }

            if (apparel.def.apparel.LastLayer != ApparelLayer.Overhead)
            {
                path += "_" + bodyType.ToString();
            }

            Graphic graphic = new Graphic();

            graphic = GraphicDatabase.Get <Graphic_Multi>(path, ShaderDatabase.CutoutComplex, apparel.def.graphicData.drawSize, apparel.DrawColor, apparel.DrawColorTwo);
            //       Log.Message(apparel.DrawColor.ToString());
            //       Log.Message(apparel.DrawColorTwo.ToString());
            rec = new ApparelGraphicRecord(graphic, apparel);
            return(true);
        }
Ejemplo n.º 13
0
        private void UpdateTexts()
        {
            _laneLabel.text = "Lane " + (_laneIndex + 1);

            _interpolationPanel.gameObject.SetActive(_methodType == MethodType.FixedUpdate && _physicsSyncType == PhysicsSyncType.Default);
            _bodyPanel.gameObject.SetActive(_movementType != MovementType.CharacterController_Move);


            if (_physicsSyncType == PhysicsSyncType.Default)
            {
                _methodText.text           = _methodType.ToString();
                _methodButton.interactable = true;
            }
            else
            {
                _methodText.text           = MethodType.Update.ToString();
                _methodButton.interactable = false;
            }

            _bodyText.text          = _bodyType.ToString();
            _movementText.text      = _movementType.ToString().Replace("_", ".");
            _interpolationText.text = _interpolationType.ToString().Replace("_", " ");
        }
Ejemplo n.º 14
0
 public static string GetNakedPath(BodyType bodyType, string userpath, string gender) => userpath + (!gender.NullOrEmpty() ? gender + "_" : "") + "Naked_" + bodyType.ToString();
Ejemplo n.º 15
0
 public static string GetNakedPath(BodyType bodyType, string userpath) => userpath + "Naked_" + bodyType.ToString();
Ejemplo n.º 16
0
 public virtual void End()
 {
     actor.basicBody.ResetTrigger(string.Format("{0}_{1}Body", actionType.ToString(), bodyType.ToString()));
 }
Ejemplo n.º 17
0
 internal RequestBody SetType(BodyType type)
 {
     this["type"] = type.ToString().ToUpper();
     return(this);
 }
Ejemplo n.º 18
0
 private Body(BodyType type)
 {
     Add("type", type.ToString().ToUpper());
 }
Ejemplo n.º 19
0
 protected string GetBoolName()
 {
     return(string.Format("{0}_{1}Body", actor.GetStateType(bodyType), bodyType.ToString()));
 }
Ejemplo n.º 20
0
 public override string ToString()
 {
     //return "Make: " + Make.ToString() + ". Model: " + Model + ". Transmission: " + Transmission + ". Engine: " + Engine + ". Body: " + Body.ToString() + ". Price: " + Price + ". Kilometers: " + KilometersDriven;
     return("<tr><td>" + Make.ToString() + "</td><td>" + Model + "</td><td>" + Transmission + "</td><td>" + Engine + "</td><td>" + Body.ToString() + "</td><td>" + string.Format("{0:n0}", Price) + "</td><td>" + string.Format("{0:n0}", KilometersDriven) + "</td><td>" + string.Format("{0:n0}", RegistrationNumber) + "</td><td><a target='_blank' href='" + URL + "'>Details...</a></td>");
 }
Ejemplo n.º 21
0
 public override string ToString()
 {
     return(string.Format(" {0,-15}| {1,-12}| {2,-11}| {3,-2}| {4,-5}|",
                          Manufacturer, Model, BodyType.ToString(), Class.ToString(), ProductionYear));
 }
Ejemplo n.º 22
0
        public XAttribute ToXAttribute(BodyType entity, XName xName)
        {
            switch (entity)
            {
            case BodyType.Dynamic:
                return(new XAttribute(xName, STR_Dynamic));

            case BodyType.Kinematic:
                return(new XAttribute(xName, STR_Kinematic));

            case BodyType.Static:
                return(new XAttribute(xName, STR_Static));

            default:
                throw new NotSupportedException(String.Format("BodyType '{0}' is not supported.", entity.ToString()));
            }
        }
Ejemplo n.º 23
0
        public XAttribute ToXAttribute(BodyType entity, XName xName)
        {
            switch (entity)
            {
                case BodyType.Dynamic:
                    return new XAttribute(xName, STR_Dynamic);
                case BodyType.Kinematic:
                    return new XAttribute(xName, STR_Kinematic);
                case BodyType.Static:
                    return new XAttribute(xName, STR_Static);
                default:
                    throw new NotSupportedException(String.Format("BodyType '{0}' is not supported.", entity.ToString()));

            }
        }
Ejemplo n.º 24
0
    public virtual void Initialize(BodyType bodyType, params object[] extraData)
    {
        this.bodyType  = bodyType;
        this.extraData = extraData;

        actor.basicBody.SetTrigger(string.Format("{0}_{1}Body", actionType.ToString(), bodyType.ToString()));
    }
Ejemplo n.º 25
0
        public string GetFormattedLog(int maxWidth)
        {
            var hWidth  = maxWidth / 2;
            var symLen  = _entries.Count;
            var instLen = Instructions.Inst.Count;

            var headerSymbol   = "Symbol |";
            var headerInstruct = "Instruction |";
            var symId          = "ID |";
            var symType        = "Type |";
            var InstOp         = "Op |";
            var InstArg0       = "Arg0 |";
            var InstArg1       = "Arg1 |";
            var InstMod        = "Mod |";
            var header         = ('<' + _header?.Id + ">::(" + Id + ' ' + BodyType.ToString() + ')' + $" ${_stackWidth} B").PadLeft(hWidth / 2) + headerSymbol.PadLeft(hWidth / 2) + headerInstruct.PadLeft(hWidth);
            var subHeader      = symId.PadLeft(hWidth / 2) + symType.PadLeft(hWidth / 2) +
                                 InstOp.PadLeft(hWidth / 4) + InstArg0.PadLeft(hWidth / 4) + InstArg1.PadLeft(hWidth / 4) +
                                 InstMod.PadLeft(hWidth / 4);


            string id, type, op, arg0, arg1, mod;
            string underscore      = Environment.NewLine + (new string('_', maxWidth)) + Environment.NewLine;
            string scopeUnderscore = Environment.NewLine + (new string('+', maxWidth)) + Environment.NewLine;
            string ret             = header + underscore + subHeader + underscore;


            for (int i = 0; (i < symLen) || (i < instLen); ++i)
            {
                id = type = op = arg0 = arg1 = mod = "";

                if (i < instLen)
                {
                    var inst = Instructions.Inst[i];
                    op   = inst.Op.ToString() + " |";
                    arg0 = inst.Arg0 + " |";
                    arg1 = inst.Arg1 + " |";
                    mod  = inst.OpModifier.ToString() + " |";
                }

                if (i < symLen)
                {
                    var entry = _entries.Values.ElementAt(i);
                    id   = entry.Id + " |";
                    type = entry.Type.SymbolId + " |";
                }

                ret += id.PadLeft(hWidth / 2) + type.PadLeft(hWidth / 2) +
                       op.PadLeft(hWidth / 4) + arg0.PadLeft(hWidth / 4) + arg1.PadLeft(hWidth / 4) +
                       mod.PadLeft(hWidth / 4) + Environment.NewLine;
            }

            ret += scopeUnderscore;

            foreach (var e in _entries.Values)
            {
                if (e.Target == null)
                {
                    continue;
                }
                ret += underscore;
                ret += e?.Target.GetFormattedLog(maxWidth) + Environment.NewLine;
            }

            return(ret);
        }