Example #1
0
 public static void ConsoleVerText(IConsole console, string ver, string build)
 {
     console.WriteLine(Config.VersionText + " " + Config.BuildText);
     Config.VersionText = ver?.ToString();
     Config.BuildText   = build?.ToString();
     UIModuleBuildRevision_SetRevisionNumber.RefreshText();
 }
Example #2
0
        /* Modnix API extension, registered in MainMod.
         * Default: set version text.  With "build" specifier: set build text.
         * Returns old text. Send null to get and refresh text, no set. */
        private static string ApiVerText(string type, object arg)
        {
            string old;

            if ("build".Equals(type?.ToLowerInvariant()))
            {
                old = Config.BuildText;
                if (arg != null)
                {
                    Config.BuildText = arg?.ToString();
                }
            }
            else
            {
                old = Config.VersionText;
                if (arg != null)
                {
                    Config.VersionText = arg?.ToString();
                }
            }
            UIModuleBuildRevision_SetRevisionNumber.RefreshText();
            return(old);
        }