// 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); }
// 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); }
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(); }
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); }
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)); }
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)); }
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); }
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)); }
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); }
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); }
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("_", " "); }
public static string GetNakedPath(BodyType bodyType, string userpath, string gender) => userpath + (!gender.NullOrEmpty() ? gender + "_" : "") + "Naked_" + bodyType.ToString();
public static string GetNakedPath(BodyType bodyType, string userpath) => userpath + "Naked_" + bodyType.ToString();
public virtual void End() { actor.basicBody.ResetTrigger(string.Format("{0}_{1}Body", actionType.ToString(), bodyType.ToString())); }
internal RequestBody SetType(BodyType type) { this["type"] = type.ToString().ToUpper(); return(this); }
private Body(BodyType type) { Add("type", type.ToString().ToUpper()); }
protected string GetBoolName() { return(string.Format("{0}_{1}Body", actor.GetStateType(bodyType), bodyType.ToString())); }
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>"); }
public override string ToString() { return(string.Format(" {0,-15}| {1,-12}| {2,-11}| {3,-2}| {4,-5}|", Manufacturer, Model, BodyType.ToString(), Class.ToString(), ProductionYear)); }
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())); } }
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())); } }
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())); }
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); }