Example #1
0
 public static void List(string question, Dictionary <object, string> options, Action okay, bool allowEscape = false, bool doNotPush = false, string title = "", string icon = "")
 {
     fromWalkaround = NoxicoGame.Subscreen == null || Subscreens.PreviousScreen.Count == 0;
     if (!doNotPush)
     {
         Subscreens.PreviousScreen.Push(NoxicoGame.Subscreen);
     }
     NoxicoGame.Subscreen = MessageBox.Handler;
     type             = BoxType.List;
     MessageBox.title = title;
     width            = 46;
     foreach (var o in options.Values)
     {
         if (o.Length() + 2 > width)
         {
             width = o.Length() + 2;
         }
     }
     text                   = Toolkit.Wordwrap(question.Trim(), width); //.Split('\n');
     option                 = 0;
     onYes                  = okay;
     MessageBox.options     = options;
     MessageBox.allowEscape = allowEscape;
     MessageBox.icon        = icon.IsBlank() ? null : new UIPNG(Mix.GetBitmap(icon));
     NoxicoGame.Mode        = UserMode.Subscreen;
     Subscreens.FirstDraw   = true;
 }
Example #2
0
 public static void Notice(string message, bool doNotPush = false, string title = "", string icon = "")
 {
     fromWalkaround = NoxicoGame.Subscreen == null || Subscreens.PreviousScreen.Count == 0;
     if (!doNotPush)
     {
         Subscreens.PreviousScreen.Push(NoxicoGame.Subscreen);
     }
     NoxicoGame.Subscreen = MessageBox.Handler;
     MessageBox.title     = title;
     type                 = BoxType.Notice;
     width                = 46;
     text                 = Toolkit.Wordwrap(message.Trim(), width); //.Split('\n');
     MessageBox.icon      = icon.IsBlank() ? null : new UIPNG(Mix.GetBitmap(icon));
     NoxicoGame.Mode      = UserMode.Subscreen;
     Subscreens.FirstDraw = true;
 }