예제 #1
0
  /*
   * ============== SCR_CenterPrint
   *
   * Called for important messages that should stay in the center of the
   * screen for a few moments ==============
   */
  static void CenterPrint(String str) {
    // char *s;
    int s;
    StringBuffer line = new StringBuffer(64);
    int i, j, l;

    // strncpy (scr_centerstring, str, sizeof(scr_centerstring)-1);
    scr_centerstring = str;
    scr_centertime_off = scr_centertime.value;
    scr_centertime_start = cl.time;

    // count the number of lines for centering
    scr_center_lines = 1;
    s = 0;
    while (s < str.length()) {
      if (str.charAt(s) == '\n') scr_center_lines++;
      s++;
    }

    // echo it to the console
    Com.Printf(
        "\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");

    s = 0;

    if (str.length() != 0) {
      do {
        // scan the width of the line

        for (l = 0; l < 40 && (l + s) < str.length(); l++)
          if (str.charAt(s + l) == '\n' || str.charAt(s + l) == 0) break;
        for (i = 0; i < (40 - l) / 2; i++) line.append(' ');

        for (j = 0; j < l; j++) {
          line.append(str.charAt(s + j));
        }

        line.append('\n');

        Com.Printf(line.toString());

        while (s < str.length() && str.charAt(s) != '\n') s++;

        if (s == str.length()) break;
        s++; // skip the \n
      } while (true);
    }
    Com.Printf(
        "\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");
    Console.ClearNotify();
  }
예제 #2
0
 /*
  * ================ SCR_EndLoadingPlaque ================
  */
 public static void EndLoadingPlaque() {
   cls.disable_screen = 0;
   Console.ClearNotify();
 }