Exemple #1
0
void PlayMovie(HWND hWnd){
	char szChoice[MAX_PATH]={0};

	OPENFILENAME ofn;

	soundDriver->pause();

	// browse button
	ZeroMemory(&ofn, sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.hwndOwner = hWnd;
	ofn.lpstrFilter = "Movie File (*.mc2, *.mcm)\0*.mc2;*.mcm\0All files(*.*)\0*.*\0\0";
	ofn.lpstrFile = (LPSTR)szChoice;
	ofn.lpstrTitle = "Play a movie";
	ofn.lpstrDefExt = "mc2";
	ofn.nMaxFile = MAX_PATH;
	ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
	if(GetOpenFileName(&ofn)) {

		if(toupper(strright(szChoice,4)) == ".MC2")
			LoadMovie(szChoice, 1, 0, 0);
		else if(toupper(strright(szChoice,4)) == ".MCM")
			LoadMCM(szChoice, true);
	}
	
	pcejin.tempUnPause();
}
Exemple #2
0
void HK_PrintScreen(int param, bool justPressed)
{
	if(!justPressed) return;
  if(!romloaded) return;

	bool unpause = NDS_Pause(false);

	char outFilename[MAX_PATH];
	
	OPENFILENAME ofn;
	ZeroMemory(&ofn,sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.hwndOwner = MainWindow->getHWnd();
	ofn.lpstrFilter = "png file (*.png)\0*.png\0Bmp file (*.bmp)\0*.bmp\0Any file (*.*)\0*.*\0\0";
	ofn.lpstrTitle = "Print Screen Save As";
	ofn.nMaxFile = MAX_PATH;
	ofn.lpstrFile = outFilename;
	ofn.lpstrDefExt = "png";
	ofn.Flags = OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST;

	std::string filename = path.getpath(path.SCREENSHOTS);

	char file[MAX_PATH];
	ZeroMemory(file, sizeof(file));
	path.formatname(file);
	filename += file;

	if(path.imageformat() == path.PNG)
	{
		filename += ".png";
		ofn.lpstrDefExt = "png";
		ofn.nFilterIndex = 1;
	}
	else if(path.imageformat() == path.BMP)
	{
		filename += ".bmp";
		ofn.lpstrDefExt = "bmp";
		ofn.nFilterIndex = 2;
	}

	strcpy(outFilename,filename.c_str());
	if(GetSaveFileName(&ofn))
	{
		filename = outFilename;

		if(toupper(strright(filename,4)) == ".PNG")
			NDS_WritePNG(filename.c_str(), GPU_screen);
		else if(toupper(strright(filename,4)) == ".BMP")
			NDS_WriteBMP(filename.c_str(), GPU_screen);
	}

	if(unpause) NDS_UnPause(false);
}
Exemple #3
0
char interpEditConfigMenu(const usint ch)
{
  struct rccoord coords;
  char tempStrn[256], strn[256];


 // toggle vnum checking

  if (ch == 'A')
  {
    setVarBoolVal(&varHead, VAR_VNUMCHECK_NAME, !getVnumCheckVal(), FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle zone flag checking

  if (ch == 'B')
  {
    setVarBoolVal(&varHead, VAR_CHECKZONEFLAGS_NAME, !getCheckZoneFlagsVal(),
                  FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle stopping at zone 'S' line setting

/*
  if (ch == 'C')
  {
    setVarBoolVal(&varHead, VAR_IGNOREZONES_NAME, !getIgnoreZoneSVal(),
                  FALSE);

    displayEditConfigMenu();
  }
  else
*/

 // toggle the showing of info on menus

  if (ch == 'C')
  {
    setVarBoolVal(&varHead, VAR_SHOWMENUINFO_NAME, !getShowMenuInfoVal(),
                  FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle walk creation mode

  if (ch == 'D')
  {
    setVarBoolVal(&varHead, VAR_WALKCREATE_NAME, !getWalkCreateVal(), FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle saving of currentRoom vnum

  if (ch == 'E')
  {
    setVarBoolVal(&varHead, VAR_SROOMACTIVE_NAME, !getStartRoomActiveVal(),
                  FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle object edesc thingy

/*
  if (ch == 'F')
  {
    setVarBoolVal(&varHead, VAR_FIRSTOBJEDESCKEY_NAME,
                  !getFirstObjEdescKeyVal(), FALSE);

    displayEditConfigMenu();
  }
  else
*/

 // toggle 'consider exit dest of -1 as out-of-zone' var

  if (ch == 'F')
  {
    setVarBoolVal(&varHead, VAR_NEGDESTOUTOFZONE_NAME,
                  !getNegDestOutofZoneVal(), FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle 'show shop prices adjusted' var

  if (ch == 'G')
  {
    setVarBoolVal(&varHead, VAR_SHOWPRICESADJUSTED_NAME,
                  !getShowPricesAdjustedVal(), FALSE);

    displayEditConfigMenu();
  }
  else

 // toggle 'autosave every X commands' var

  if (ch == 'H')
  {
    setVarBoolVal(&varHead, VAR_SAVEEVERYXCOMMANDS_NAME,
                  !getSaveEveryXCommandsVal(), FALSE);

    displayEditConfigMenu();
  }
  else

 // edit 'when to autosave' variable

  if (ch == 'I')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew number of commands between autosaving: &n");

    itoa(getSaveHowOftenVal(), strn, 10);

    getStrn(tempStrn, 4, 1, 7, '°', strn, FALSE, FALSE);

    if (strnumer(tempStrn))
    {
      addVar(&varHead, VAR_SAVEHOWOFTEN_NAME, tempStrn);
    }

    displayEditConfigMenu();
  }
  else

 // edit screen height

  if (ch == 'J')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew screen height: &n");

    itoa(getScreenHeight(), strn, 10);

    getStrn(tempStrn, 4, 1, 7, '°', strn, FALSE, FALSE);

   // allowing a height of 0 would be bad

    if (strnumer(tempStrn) && atoi(tempStrn))
    {
      addVar(&varHead, VAR_SCREENHEIGHT_NAME, tempStrn);
    }

    displayEditConfigMenu();
  }
  else

 // edit screen width

  if (ch == 'K')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew screen width: &n");

    itoa(getScreenWidth(), strn, 10);

    getStrn(tempStrn, 4, 1, 7, '°', strn, FALSE, FALSE);

   // allowing a width of 0 would be very bad

    if (strnumer(tempStrn) && atoi(tempStrn))
    {
      addVar(&varHead, VAR_SCREENWIDTH_NAME, tempStrn);
    }

    displayEditConfigMenu();
  }
  else

 // edit name of external editor

  if (ch == 'L')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew external editor (full path, if necessary): &n");

    getStrn(tempStrn, MAX_VARVAL_LEN - 1, 1, 7, '°',
            getEditorName(), FALSE, FALSE);

    addVar(&varHead, VAR_TEXTEDIT_NAME, tempStrn);

    displayEditConfigMenu();
  }
  else

 // edit name of menu edit prompt

  if (ch == 'M')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew prompt for menus: &n");

    getStrn(tempStrn, MAX_VARVAL_LEN - 1, 1, 7, '°',
            getMenuPromptName(), FALSE, FALSE);

    if ((strlen(tempStrn) < (MAX_VARVAL_LEN - 1 - 2)) &&
        !strright(tempStrn, "&n") &&
        !strright(tempStrn, "&N")) strcat(tempStrn, "&n");

    addVar(&varHead, VAR_MENUPROMPT_NAME, tempStrn);

    displayEditConfigMenu();
  }
  else

 // edit name of main prompt

  if (ch == 'N')
  {
    coords = _gettextposition();

    _settextposition(coords.row, 1);
    clrline(coords.row);

    displayColorString("&+CNew main prompt: &n");

    getStrn(tempStrn, MAX_VARVAL_LEN - 1, 1, 7, '°',
            getMainPromptStrn(), FALSE, FALSE);

    if ((strlen(tempStrn) < (MAX_VARVAL_LEN - 1 - 2)) &&
        !strright(tempStrn, "&n") &&
        !strright(tempStrn, "&N") &&
        strcmp(tempStrn, "default")) strcat(tempStrn, "&n");

    addVar(&varHead, VAR_MAINPROMPT_NAME, tempStrn);
    createPrompt();

    displayEditConfigMenu();
  }
  else

 // quit

  if (checkMenuKey(ch, FALSE) == MENUKEY_SAVE) return TRUE;

  return FALSE;
}