Exemplo n.º 1
0
 protected override void WindowContent(int win_id)
 {
     if (failed_to_connect)
     {
         error_dialog(() => {
             label("Unable to Connect to KerbalX.com!", "alert.h1");
             label("Check your net connection and that you can reach KerbalX in a browser", "alert.h2");
         });
     }
     else if (upgrade_required)
     {
         error_dialog(() => {
             label("Upgrade Required", "h2");
             label(upgrade_required_message);
             section(() => {
                 section("dialog.section", () => {
                     string url = "/KXAPI";
                     if (api_instance.client != "KerbalXAPI")
                     {
                         url += "/" + api_instance.client;
                     }
                     button("Goto KerbalX.com" + url + " for more info", "hyperlink.left", () => {
                         Application.OpenURL(KerbalXAPI.site_url_to(url));
                     });
                 });
             });
         }, "Upgrade Required");
         on_error();
     }
     else if (error_message != null)
     {
         List <string> messages = new List <string>();
         foreach (string s in error_message.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
         {
             messages.Add(s);
         }
         string title = messages[0];
         messages[0] = "";
         error_dialog(() => {
             label(title, "alert.h2");
             foreach (string message in messages)
             {
                 if (message != "")
                 {
                     label(message);
                 }
             }
         }, "KerbalX.com Error");
         on_error();
     }
     GameObject.Destroy(this);
 }
Exemplo n.º 2
0
 public string url_to(string path)
 {
     return(KerbalXAPI.site_url_to(path));
 }