private string GetTitle() { if (thing != null) { return(thing.LabelCapNoCount); } if (worldObject != null) { return(worldObject.LabelCap); } ThingDef thingDef = Def as ThingDef; if (thingDef != null) { return(GenLabel.ThingLabel(thingDef, stuff).CapitalizeFirst()); } AbilityDef abilityDef = Def as AbilityDef; if (abilityDef != null) { return(abilityDef.LabelCap); } if (titleDef != null) { return(titleDef.GetLabelCapForBothGenders()); } if (faction != null) { return(faction.Name); } return(Def.LabelCap); }
public override string GetInspectString() { string text = base.GetInspectString(); if (base.Faction != Faction.OfPlayer) { if (!text.NullOrEmpty()) { text += "\n"; } text += base.Faction.PlayerRelationKind.GetLabel(); if (!base.Faction.def.hidden) { text = text + " (" + base.Faction.PlayerGoodwill.ToStringWithSign() + ")"; } RoyalTitleDef royalTitleDef = TraderKind?.TitleRequiredToTrade; if (royalTitleDef != null) { text += "\n" + "RequiresTradePermission".Translate(royalTitleDef.GetLabelCapForBothGenders()); } } return(text); }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo gizmo in base.GetGizmos()) { yield return(gizmo); } if (TraderKind != null) { Command_Action command_Action = new Command_Action(); command_Action.defaultLabel = "CommandShowSellableItems".Translate(); command_Action.defaultDesc = "CommandShowSellableItemsDesc".Translate(); command_Action.icon = ShowSellableItemsCommand; command_Action.action = delegate { Find.WindowStack.Add(new Dialog_SellableItems(this)); RoyalTitleDef titleRequiredToTrade = TraderKind.TitleRequiredToTrade; if (titleRequiredToTrade != null) { TutorUtility.DoModalDialogIfNotKnown(ConceptDefOf.TradingRequiresPermit, titleRequiredToTrade.GetLabelCapForBothGenders()); } }; yield return(command_Action); } if (base.Faction != Faction.OfPlayer && !PlayerKnowledgeDatabase.IsComplete(ConceptDefOf.FormCaravan)) { Command_Action command_Action2 = new Command_Action(); command_Action2.defaultLabel = "CommandFormCaravan".Translate(); command_Action2.defaultDesc = "CommandFormCaravanDesc".Translate(); command_Action2.icon = FormCaravanCommand; command_Action2.action = delegate { Find.Tutor.learningReadout.TryActivateConcept(ConceptDefOf.FormCaravan); Messages.Message("MessageSelectOwnBaseToFormCaravan".Translate(), MessageTypeDefOf.RejectInput, historical: false); }; yield return(command_Action2); } }