Example #1
0
 public override void Draw(SmartRect rect, Locale locale)
 {
     string[] labels = locale.GetArray("humanLabels");
     for (int i = 0; i < labels.Length; i++)
     {
         SkinData[i] = UI.GUI.TextField(rect, SkinData[i], labels[i], Style.LabelOffset, true);
     }
 }
Example #2
0
        public string ToStringLocal()
        {
            List <object> args = new List <object>();

            if (nextSelection >= 0)
            {
                args.Add(Lang.GetArray(key + "Selection")[nextSelection]);
            }
            if (nextFloats != null)
            {
                for (int i = 0; i < nextFloats.Length; i++)
                {
                    args.Add(GetFloat(i).ToString("F2"));
                }
            }
            if (nextIntegers != null)
            {
                for (int i = 0; i < nextIntegers.Length; i++)
                {
                    args.Add(GetInt(i).ToString());
                }
            }
            string format = Lang.Get(key + "Info" + (state ? "Enabled" : "Disabled")).Replace(@"\n", System.Environment.NewLine);

            if (state)
            {
                if (GameModes.EnabledColor.Value.Length != 6)
                {
                    GameModes.EnabledColor.Value = "CCFFCC";
                }
                format = format.Replace("$eColor$", GameModes.EnabledColor.Value);
            }
            else
            {
                if (GameModes.DisabledColor.Value.Length != 6)
                {
                    GameModes.DisabledColor.Value = "FFAACC";
                }
                format = format.Replace("$dColor$", GameModes.DisabledColor.Value);
            }
            return(string.Format(format, args.ToArray()));
        }
Example #3
0
 public string[] GetAcceptableNames(string language = "full")
 {
     return(Locale.GetArray("buildings." + Name + ".names", language));
 }
Example #4
0
 private void DrawSelection(SmartRect rect, Locale loc)
 {
     string[] labels = loc.GetArray(key + "Selection");
     nextSelection = SelectionGrid(rect, nextSelection, labels, labels.Length, true);
 }
Example #5
0
 private string GenerateName(string lang)
 {
     return(Locale.GetArray(lang + ".firstnames", "names").RandomChoice() + " " + Locale.GetArray(lang + ".lastnames", "names").RandomChoice());
 }