Exemplo n.º 1
0
// WO : ウィンドウオープン Nonaka.K, T.Yui							DRS cmd:28
int isfcmd_29(SCR_OPE *op) {

	BYTE	num;

	if (scr_getbyte(op, &num) != SUCCESS) {
		return(GAMEEV_WRONGLENG);
	}
	TRACEOUT(("cmd 29"));
	textwin_open(num);
	return(GAMEEV_SUCCESS);
}
Exemplo n.º 2
0
int ui_message_window_open(message_window_e mwin, const char *title, const char *message, int cols, int rows)
{
  text_window_t *tw;
  message_window_t *mw;

  switch (mwin)
  {
    case msg_win_monitor:
      Wimp_GetCaretPosition(&LastCaret);
      tw = MsgWinDescs;
      mw = MsgWindows;
      if (mw->win == NULL)
      {
        mw->win = wimp_window_clone(MessageWindow);
        wimp_window_create((int*)(mw->win), title);
      }
      if (mw->tw == NULL)
      {
        mw->tw = tw;
        ui_msgwin_set_dimensions(mw, cols, rows);
        textwin_init(tw, mw->win, message, NULL);
        (tw->Events)[WimpEvt_CloseWin] = MsgCloseEvents[msg_win_monitor];
      }
      textwin_open_centered(tw, tw->MaxWidth, 1024, ScreenMode.resx, ScreenMode.resy);
      textwin_set_caret(tw, 0, 0);
      MsgWindows[mwin].Flags |= MSGWIN_FLAG_OPEN;
      break;
    case msg_win_license:
    case msg_win_warranty:
    case msg_win_contrib:
    case msg_win_log:
      tw = MsgWinDescs + mwin;
      mw = MsgWindows + mwin;
      if (mw->win == NULL)
      {
        mw->win = wimp_window_clone(MessageWindow);
        wimp_window_create((int*)(mw->win), title);
      }
      if (mw->tw == NULL)
      {
        mw->tw = tw;
        ui_msgwin_set_dimensions(mw, cols, rows);
        textwin_init(tw, mw->win, message, NULL);
        (tw->Events)[WimpEvt_CloseWin] = MsgCloseEvents[mwin];
      }

      if (mwin == msg_win_log)
      {
        int block[WindowB_WFlags+1];

        /* if already opened then raise, otherwise open in bottom left corner */
        block[WindowB_Handle] = mw->win->Handle;
        Wimp_GetWindowState(block);
        block[WindowB_Stackpos] = -1;
        if ((block[WindowB_WFlags] & (1<<16)) == 0)
        {
          /* open in the bottom left corner, but leave room below for the icon bar */
          textwin_open(tw, tw->MaxWidth, tw->MinHeight, 0, 160 + tw->MinHeight);
        }
        else
        {
          /* just raise */
          Wimp_OpenWindow(block);
        }
        /* always set caret at end */
        textwin_caret_to_end(tw);
      }
      else
      {
        textwin_open_centered(tw, tw->MaxWidth, 1024, ScreenMode.resx, ScreenMode.resy);
      }

      MsgWindows[mwin].Flags |= MSGWIN_FLAG_OPEN;
      break;
    default:
      return -1;
  }
  return 0;
}