private string SegmentTranslate(WorkshopBuilder builder, string segmentTitle)
 {
     if (LanguageInfo.IsKeyword(Title))
     {
         return(builder.Translate(Title).RemoveStructuralChars());
     }
     return(builder.Translate(segmentTitle).Replace("%1$s", builder.Translate(AbilityName)).RemoveStructuralChars());
 }
Esempio n. 2
0
 public override string GetValue(WorkshopBuilder builder, object value)
 {
     if (SwitchType == SwitchType.OnOff)
     {
         return(builder.Translate((bool)value ? "On" : "Off"));
     }
     else if (SwitchType == SwitchType.YesNo)
     {
         return(builder.Translate((bool)value ? "Yes" : "No"));
     }
     else if (SwitchType == SwitchType.EnabledDisabled)
     {
         return(builder.Translate((bool)value ? "Enabled" : "Disabled"));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
 /// <summary>Resolves the actual name of the setting that will be used in the workshop output.</summary>
 public string ResolveName(WorkshopBuilder builder)
 {
     if (TitleResolver == null)
     {
         return(builder.Translate(Name));
     }
     else
     {
         return(TitleResolver.ResolveName(builder));
     }
 }
        public static void WriteList(WorkshopBuilder builder, string[] maps)
        {
            builder.AppendLine("{");
            builder.Indent();

            foreach (string map in maps)
            {
                builder.AppendLine(builder.Translate(map).RemoveStructuralChars());
            }

            builder.Outdent();
            builder.AppendLine("}");
        }
 public override string GetValue(WorkshopBuilder builder, object value) => builder.Translate(value.ToString());
 public override string GetValue(WorkshopBuilder builder, object value) => builder.Translate((bool)value ? EnabledKey() : DisabledKey());
 public virtual string ResolveName(WorkshopBuilder builder) => builder.Translate(Title);
 public override string GetValue(WorkshopBuilder builder, object value) => builder.Translate((bool)value ? "On" : "Off");