예제 #1
0
// ----------------------------------------------------------------------------
// Name : CUICheckButton()
// Desc : Constructor
// ----------------------------------------------------------------------------
CUICheckButton::CUICheckButton()
{
	m_bChecked = FALSE;
	m_strText = CTString( "" );
	m_bValidText = FALSE;
	m_colText[0] = 0xAAAAAAFF;
	m_colText[1] = 0xF2F2F2FF;

	m_nTextSY = 0;
	m_nTextArea = 0;
	m_eAlignText_h	= eALIGN_H_LEFT;
	m_bTextEdge	= false;
	m_colHighlight = DEF_UI_COLOR_WHITE;
	m_bHighlightOn = false;
	m_ulOldTime = 0;
	m_fHighlightTime = 0;
#ifdef UI_TOOL
	m_bLeft			= TRUE;
	m_nCheckRegion	= 0;
	m_nTempTextSX	= 0;
	m_stringIndex	= -1;
#endif //UI_TOOL
	setType(eUI_CONTROL_CHECKBOX);
}
예제 #2
0
void CVirtualTreeCtrl::OnDropFiles(HDROP hDropInfo) 
{
	CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
  INDEX ctFiles = DragQueryFile( hDropInfo, 0xFFFFFFFF, NULL, 0);

  // get dropped coordinates
  CPoint point;
  DragQueryPoint( hDropInfo, &point);
  
  CVirtualTreeNode *pVTNDst = ItemForCoordinate(point);
  if( pVTNDst!=NULL)
  {
    for( INDEX i=0; i<ctFiles; i++)
    {
	    char chrFile[ 256];
      DragQueryFile( hDropInfo, i, chrFile, 256);
      CTString strAddr = CTString(chrFile);
      if( strAddr != "")
      {
        CVirtualTreeNode *pVTNSrc;
        strAddr.ScanF("VTN%d", &pVTNSrc);
        if(pVTNSrc==pVTNDst) return;
        pVTNSrc->MoveToDirectory( pVTNDst);
        // delete all items
        DeleteAllItems();
        m_pBrowser->AddDirectoryRecursiv( &m_pBrowser->m_VirtualTree, TVI_ROOT);   // Fill CTreeCtrl using recursion
        SortChildren( NULL);
        SelectItem( (HTREEITEM) pVTNSrc->vtn_Handle);
        m_pBrowser->m_bVirtualTreeChanged = TRUE;
        m_pBrowser->OpenSelectedDirectory();
      }
    }
  }

	CTreeCtrl::OnDropFiles(hDropInfo);
}
void CUIAuctionNew::initFavorite()
{
	m_pListFavorite = (CUIList*)findUI("list_favorite");
	{
		CmdSelectListFav* pCmd = new CmdSelectListFav;
		pCmd->setData(this);
		m_pListFavorite->SetCommand(pCmd);

		CmdDblClickList* pCmdDBL = new CmdDblClickList;
		pCmdDBL->setData(this);
		m_pListFavorite->SetCommandDBL(pCmdDBL);
	}

	m_pBtnFavCancel = (CUIButton*)findUI("btn_fav_reg_cancel");

	if (m_pBtnFavCancel != NULL)
	{
		CmdRegFavorite* pCmd = new CmdRegFavorite;
		pCmd->setData(this, false);
		m_pBtnFavCancel->SetCommandUp(pCmd);
	}

	m_pBtnFavBuy = (CUIButton*)findUI("btn_fav_buy");

	if (m_pBtnFavBuy != NULL)
	{
		CmdBuyItem* pCmd = new CmdBuyItem;
		pCmd->setData(this);
		m_pBtnFavBuy->SetCommandUp(pCmd);
	}

	m_pTxtFavNas = (CUIText*)findUI("str_favorite_nas");

	m_pTxtFavCount = (CUIText*)findUI("str_fav_count");
	m_pTxtFavCount->SetText( CTString(0, "0 / %d", MAX_LIKE_REG_COUNT) );
}
예제 #4
0
CLevelInfo::CLevelInfo(void)
{
  li_fnLevel = CTString("Levels\\Default.wld");
  li_strName = TRANS("<invalid level>");
  li_ulSpawnFlags = 0x0;
}
예제 #5
0
// ----------------------------------------------------------------------------
// Name : Create()
// Desc :
// ----------------------------------------------------------------------------
void CUIRemission::Create( CUIWindow *pParentWnd, int nX, int nY, int nWidth, int nHeight )
{
    CUIWindow::Create(pParentWnd, nX, nY, nWidth, nHeight);

    _iMaxMsgStringChar = REMISSION_DESC_CHAR_WIDTH / ( _pUIFontTexMgr->GetFontWidth() + _pUIFontTexMgr->GetFontSpacing() );

    // Region of each part
    m_rcTitle.SetRect( 0, 0, 216, 22 );
    m_rcIcons.SetRect( 17, 55, 51, 200 );

    // Create remission texture
    m_ptdBaseTexture = CreateTexture( CTString( "Data\\Interface\\SkillLearn.tex" ) );
    FLOAT	fTexWidth = m_ptdBaseTexture->GetPixWidth();
    FLOAT	fTexHeight = m_ptdBaseTexture->GetPixHeight();

    // UV Coordinate of each part
    m_rtBackground.SetUV( 0, 0, 216, 400, fTexWidth, fTexHeight );
    m_rtSelOutline.SetUV( 218, 80, 250, 112, fTexWidth, fTexHeight );
    m_rtTabLine.SetUV( 12, 31, 13, 50, fTexWidth, fTexHeight );

    // Close button
    m_btnClose.Create( this, CTString( "" ), 184, 4, 14, 14 );
    m_btnClose.SetUV( UBS_IDLE, 219, 0, 233, 14, fTexWidth, fTexHeight );
    m_btnClose.SetUV( UBS_CLICK, 219, 15, 233, 29, fTexWidth, fTexHeight );
    m_btnClose.CopyUV( UBS_IDLE, UBS_ON );
    m_btnClose.CopyUV( UBS_IDLE, UBS_DISABLE );

    // Buy button
    m_btnOK.Create( this, _S( 600, "구입" ), 70, 372, 63, 21 );
    m_btnOK.SetUV( UBS_IDLE, 0, 403, 63, 424, fTexWidth, fTexHeight );
    m_btnOK.SetUV( UBS_CLICK, 66, 403, 129, 424, fTexWidth, fTexHeight );
    m_btnOK.CopyUV( UBS_IDLE, UBS_ON );
    m_btnOK.CopyUV( UBS_IDLE, UBS_DISABLE );

    // Cancel button
    m_btnCancel.Create( this, _S( 139, "취소" ), 141, 372, 63, 21 );
    m_btnCancel.SetUV( UBS_IDLE, 0, 403, 63, 424, fTexWidth, fTexHeight );
    m_btnCancel.SetUV( UBS_CLICK, 66, 403, 129, 424, fTexWidth, fTexHeight );
    m_btnCancel.CopyUV( UBS_IDLE, UBS_ON );
    m_btnCancel.CopyUV( UBS_IDLE, UBS_DISABLE );

    // Scroll bar of special remission icons
    m_sbRemissionIcon.Create( this, 193, 51, 9, 153 );
    m_sbRemissionIcon.CreateButtons( TRUE, 9, 7, 0, 0, 10 );
    m_sbRemissionIcon.SetScrollPos( 0 );
    m_sbRemissionIcon.SetScrollRange( REMISSION_SLOT_ROW_TOTAL );
    m_sbRemissionIcon.SetCurItemCount( 0 );
    m_sbRemissionIcon.SetItemsPerPage( REMISSION_SLOT_ROW );
    // Up button
    m_sbRemissionIcon.SetUpUV( UBS_IDLE, 219, 62, 228, 69, fTexWidth, fTexHeight );
    m_sbRemissionIcon.SetUpUV( UBS_CLICK, 230, 62, 239, 69, fTexWidth, fTexHeight );
    m_sbRemissionIcon.CopyUpUV( UBS_IDLE, UBS_ON );
    m_sbRemissionIcon.CopyUpUV( UBS_IDLE, UBS_DISABLE );
    // Bar button
    m_sbRemissionIcon.SetBarTopUV( 219, 32, 228, 42, fTexWidth, fTexHeight );
    m_sbRemissionIcon.SetBarMiddleUV( 219, 43, 228, 45, fTexWidth, fTexHeight );
    m_sbRemissionIcon.SetBarBottomUV( 219, 46, 228, 56, fTexWidth, fTexHeight );
    // Down button
    m_sbRemissionIcon.SetDownUV( UBS_IDLE, 219, 71, 228, 78, fTexWidth, fTexHeight );
    m_sbRemissionIcon.SetDownUV( UBS_CLICK, 230, 71, 239, 78, fTexWidth, fTexHeight );
    m_sbRemissionIcon.CopyDownUV( UBS_IDLE, UBS_ON );
    m_sbRemissionIcon.CopyDownUV( UBS_IDLE, UBS_DISABLE );
    // Wheel region
    m_sbRemissionIcon.SetWheelRect( -181, -1, 180, 154 );

    // List box of remission description
    m_lbRemissionDesc.Create( this, 13, 207, 180, 124, _pUIFontTexMgr->GetLineHeight(), 7, 6, 1, FALSE );
    m_lbRemissionDesc.CreateScroll( TRUE, 0, 0, 9, 124, 9, 7, 0, 0, 10 );
    // Up button
    m_lbRemissionDesc.SetScrollUpUV( UBS_IDLE, 219, 62, 228, 69, fTexWidth, fTexHeight );
    m_lbRemissionDesc.SetScrollUpUV( UBS_CLICK, 230, 62, 239, 69, fTexWidth, fTexHeight );
    m_lbRemissionDesc.CopyScrollUpUV( UBS_IDLE, UBS_ON );
    m_lbRemissionDesc.CopyScrollUpUV( UBS_IDLE, UBS_DISABLE );
    // Bar button
    m_lbRemissionDesc.SetScrollBarTopUV( 219, 32, 228, 42, fTexWidth, fTexHeight );
    m_lbRemissionDesc.SetScrollBarMiddleUV( 219, 43, 228, 45, fTexWidth, fTexHeight );
    m_lbRemissionDesc.SetScrollBarBottomUV( 219, 46, 228, 56, fTexWidth, fTexHeight );
    // Down button
    m_lbRemissionDesc.SetScrollDownUV( UBS_IDLE, 219, 71, 228, 78, fTexWidth, fTexHeight );
    m_lbRemissionDesc.SetScrollDownUV( UBS_CLICK, 230, 71, 239, 78, fTexWidth, fTexHeight );
    m_lbRemissionDesc.CopyScrollDownUV( UBS_IDLE, UBS_ON );
    m_lbRemissionDesc.CopyScrollDownUV( UBS_IDLE, UBS_DISABLE );
}
예제 #6
0
void CUITrade::UpdateAmendItem( int nAmendIndex )
{
	if (m_pBaseAmendInfo == NULL)
		return;

	m_pBaseAmendInfo->Hide(TRUE);
	
	if (nAmendIndex < 0)
		return;

	stEventTrade* pTradeItem = CTradeItem::GetTradeItem(nAmendIndex);

	if (pTradeItem->result_itemIndex <= 0 || pTradeItem == NULL)
		return;
		
	m_pBaseAmendInfo->Hide(FALSE);
	
	CItemData* pItemData = _pNetwork->GetItemData(pTradeItem->result_itemIndex);

	if (pItemData == NULL)
		return;

	if (CUIIcon* pIcon = (CUIIcon*)m_pBaseAmendInfo->findUI("icon_amend_item"))
	{
		pIcon->setData(UBET_ITEM, pTradeItem->result_itemIndex);
	}

	if (CUITextBox* pTextBox = (CUITextBox*)m_pBaseAmendInfo->findUI("tb_amend_desc"))
	{
 		CTString strTmp = pItemData->GetDesc();
 
 		pTextBox->SetText(strTmp);
	}

	if (CUIText* pText = (CUIText*)m_pBaseAmendInfo->findUI("text_amend_name"))
	{
 		CTString strTmp = pItemData->GetName();
		
		strTmp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTmp, pText->GetWidth(), CTString("..."));

 		pText->SetText(strTmp);
	}

	UpdateAmendItemCount(nAmendIndex);
}
예제 #7
0
void InitStreams(void)
{
  // obtain information about system
// !!! FIXME: Move this into an abstraction of some sort...
#ifdef PLATFORM_WIN32
  SYSTEM_INFO siSystemInfo;
  GetSystemInfo( &siSystemInfo);
  // and remember page size
  _ulPageSize = siSystemInfo.dwPageSize*16;   // cca. 64kB on WinNT/Win95
#else
  _ulPageSize = PAGESIZE;
#endif

  // keep a copy of path for setting purposes
  _fnmApp = _fnmApplicationPath;

  // if no mod defined yet
  if (_fnmMod=="") {
    // check for 'default mod' file
    LoadStringVar(CTString("DefaultMod.txt"), _fnmMod);
  }

  CPrintF(TRANSV("Current mod: %s\n"),
            (_fnmMod=="") ? TRANS("<none>") :
                            (const char *) (CTString&)_fnmMod);
  // if there is a mod active
  if (_fnmMod!="") {
    // load mod's include/exclude lists
    CPrintF(TRANSV("Loading mod include/exclude lists...\n"));
    BOOL bOK = FALSE;
    bOK |= LoadFileList(_afnmBaseWriteInc , CTString("BaseWriteInclude.lst"));
    bOK |= LoadFileList(_afnmBaseWriteExc , CTString("BaseWriteExclude.lst"));
    bOK |= LoadFileList(_afnmBaseBrowseInc, CTString("BaseBrowseInclude.lst"));
    bOK |= LoadFileList(_afnmBaseBrowseExc, CTString("BaseBrowseExclude.lst"));

    // if none found
    if (!bOK) {
      // the mod is not valid
      _fnmMod = CTString("");
      CPrintF(TRANSV("Error: MOD not found!\n"));
    // if mod is ok
    } else {
      // remember mod name (the parameter that is passed on cmdline)
      _strModName = _fnmMod;
      _strModName.DeleteChar(_strModName.Length()-1);
      _strModName = CTFileName(_strModName).FileName();
    }
  }
  // find eventual extension for the mod's dlls
  _strModExt = "";
  LoadStringVar(CTString("ModExt.txt"), _strModExt);


  CPrintF(TRANSV("Loading group files...\n"));

  CDynamicArray<CTString> *files = NULL;

  // for each group file in base directory
  files = _pFileSystem->FindFiles(_fnmApplicationPath, "*.gro");
  int max = files->Count();
  int i;

  // for each .gro file in the directory
  for (i = 0; i < max; i++) {
    // add it to active set
    UNZIPAddArchive( _fnmApplicationPath+((*files)[i]) );
  }
  delete files;

  // if there is a mod active
  if (_fnmMod!="") {
    // for each group file in mod directory
     files = _pFileSystem->FindFiles(_fnmApplicationPath+_fnmMod, "*.gro");
     max = files->Count();
     for (i = 0; i < max; i++) {
       UNZIPAddArchive( _fnmApplicationPath + _fnmMod + ((*files)[i]) );
     }
     delete files;
  }

  // if there is a CD path
  if (_fnmCDPath!="") {
    // for each group file on the CD
    files = _pFileSystem->FindFiles(_fnmCDPath, "*.gro");
    max = files->Count();
    for (i = 0; i < max; i++) {
      UNZIPAddArchive( _fnmCDPath + ((*files)[i]) );
    }
    delete files;

    // if there is a mod active
    if (_fnmMod!="") {
      // for each group file in mod directory
      files = _pFileSystem->FindFiles(_fnmCDPath+_fnmMod, "*.gro");
      max = files->Count();
      for (i = 0; i < max; i++) {
        UNZIPAddArchive( _fnmCDPath + _fnmMod + ((*files)[i]) );
      }
      delete files;
    }
  }

  // try to
  try {
    // read the zip directories
    UNZIPReadDirectoriesReverse_t();
  // if failed
  } catch( char *strError) {
    // report warning
    CPrintF( TRANS("There were group file errors:\n%s"), strError);
  }
  CPrintF("\n");

  const char *dirsep = CFileSystem::GetDirSeparator();
  LoadFileList(_afnmNoCRC, CTFILENAME("Data") + CTString(dirsep) + CTString("NoCRC.lst"));

  _pShell->SetINDEX(CTString("sys")+"_iCPU"+"Misc", 1);
}
예제 #8
0
void CUITextBox::_ResetString()
{
	m_Str = CTString("");
	m_color = 0xFFFFFFFF;
	m_nBoxWidth = 0;
}
예제 #9
0
/*
 * String concatenation.
 */
CTString CTString::operator+(const CTString &strSecond) const
{
  ASSERT(IsValid() && strSecond.IsValid());

  return(CTString(*this)+=strSecond);
}
예제 #10
0
// ----------------------------------------------------------------------------
// Name : Create()
// Desc :
// ----------------------------------------------------------------------------
void CUICreateChar::Create( CUIWindow *pParentWnd, int nX, int nY, int nWidth, int nHeight )
{
	CUIWindow::Create(pParentWnd, nX, nY, nWidth, nHeight);

	_iMaxCharInfoChar = MAX_CHARINFO_CHAR_WIDTH / ( _pUIFontTexMgr->GetFontWidth() + _pUIFontTexMgr->GetFontSpacing() );

	// Create creating character texture
	m_ptdBaseTexture = CreateTexture( CTString( "Data\\Interface\\CreateCharacter.tex" ) );
	FLOAT	fTexWidth	= m_ptdBaseTexture->GetPixWidth();
	FLOAT	fTexHeight	= m_ptdBaseTexture->GetPixHeight();

	// UV Coordinate of each part
	m_rtCharInfoTop.SetUV( 0, 0, 255, 386, fTexWidth, fTexHeight );
	m_rtCharInfoBottom.SetUV( 0, 390, 255, 393, fTexWidth, fTexHeight );

	// OK Button(Create character)
	m_btnOK.Create( this, _S( 138, "결정" ), 0, 0, 63, 21 );
	m_btnOK.SetUV( UBS_IDLE, 0, 397, 63, 418, fTexWidth, fTexHeight );
	m_btnOK.SetUV( UBS_CLICK, 66, 397, 129, 418, fTexWidth, fTexHeight );
	m_btnOK.CopyUV( UBS_IDLE, UBS_ON ); 
	m_btnOK.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Back Button
	m_btnCancel.Create( this, _S( 139, "취소" ), 0, 0, 63, 21 );
	m_btnCancel.SetUV( UBS_IDLE, 0, 397, 63, 418, fTexWidth, fTexHeight );
	m_btnCancel.SetUV( UBS_CLICK, 66, 397, 129, 418, fTexWidth, fTexHeight );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_ON );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_DISABLE );

	// ZoomIn Button
	m_btnZoomIn.Create( this, CTString( "" ), 0, 0, 38, 37 );
	m_btnZoomIn.SetUV( UBS_IDLE, 151, 418, 189, 455, fTexWidth, fTexHeight );
	m_btnZoomIn.SetUV( UBS_CLICK, 151, 418, 189, 455, fTexWidth, fTexHeight );
	m_btnZoomIn.CopyUV( UBS_IDLE, UBS_ON );
	m_btnZoomIn.CopyUV( UBS_IDLE, UBS_DISABLE );

	// ZoomOut Button
	m_btnZoomOut.Create( this, CTString( "" ), 0, 0, 38, 37 );
	m_btnZoomOut.SetUV( UBS_IDLE, 151, 464, 189, 501, fTexWidth, fTexHeight );
	m_btnZoomOut.SetUV( UBS_CLICK, 151, 464, 189, 501, fTexWidth, fTexHeight );
	m_btnZoomOut.CopyUV( UBS_IDLE, UBS_ON );
	m_btnZoomOut.CopyUV( UBS_IDLE, UBS_DISABLE );

	// RotateToLeft Character Button
	m_btnRotateToLeft.Create( this, CTString( "" ), 0, 0, 38, 37 );
	m_btnRotateToLeft.SetUV( UBS_IDLE, 209, 441, 247, 478, fTexWidth, fTexHeight );
	m_btnRotateToLeft.SetUV( UBS_CLICK, 209, 441, 247, 478, fTexWidth, fTexHeight );
	m_btnRotateToLeft.CopyUV( UBS_IDLE, UBS_ON );
	m_btnRotateToLeft.CopyUV( UBS_IDLE, UBS_DISABLE );

	// RotateToRight Button
	m_btnRotateToRight.Create( this, CTString( "" ), 0, 0, 38, 37 );
	m_btnRotateToRight.SetUV( UBS_IDLE, 94, 441, 132, 478, fTexWidth, fTexHeight );
	m_btnRotateToRight.SetUV( UBS_CLICK, 94, 441, 132, 478, fTexWidth, fTexHeight );
	m_btnRotateToRight.CopyUV( UBS_IDLE, UBS_ON );
	m_btnRotateToRight.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Prev Job
	m_btnJobPrev.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnJobPrev.SetUV( UBS_IDLE, 0, 421, 13, 434, fTexWidth, fTexHeight );
	m_btnJobPrev.SetUV( UBS_CLICK, 0, 436, 13, 449, fTexWidth, fTexHeight );
	m_btnJobPrev.CopyUV( UBS_IDLE, UBS_ON );
	m_btnJobPrev.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Next Job
	m_btnJobNext.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnJobNext.SetUV( UBS_IDLE, 16, 421, 29, 434, fTexWidth, fTexHeight );
	m_btnJobNext.SetUV( UBS_CLICK, 16, 436, 29, 449, fTexWidth, fTexHeight );
	m_btnJobNext.CopyUV( UBS_IDLE, UBS_ON );
	m_btnJobNext.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Prev Head
	m_btnFacePrev.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnFacePrev.SetUV( UBS_IDLE, 0, 421, 13, 434, fTexWidth, fTexHeight );
	m_btnFacePrev.SetUV( UBS_CLICK, 0, 436, 13, 449, fTexWidth, fTexHeight );
	m_btnFacePrev.CopyUV( UBS_IDLE, UBS_ON );
	m_btnFacePrev.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Next Head
	m_btnFaceNext.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnFaceNext.SetUV( UBS_IDLE, 16, 421, 29, 434, fTexWidth, fTexHeight );
	m_btnFaceNext.SetUV( UBS_CLICK, 16, 436, 29, 449, fTexWidth, fTexHeight );
	m_btnFaceNext.CopyUV( UBS_IDLE, UBS_ON );
	m_btnFaceNext.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Prev Hair
	m_btnHairPrev.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnHairPrev.SetUV( UBS_IDLE, 0, 421, 13, 434, fTexWidth, fTexHeight );
	m_btnHairPrev.SetUV( UBS_CLICK, 0, 436, 13, 449, fTexWidth, fTexHeight );
	m_btnHairPrev.CopyUV( UBS_IDLE, UBS_ON );
	m_btnHairPrev.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Next Hair
	m_btnHairNext.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnHairNext.SetUV( UBS_IDLE, 16, 421, 29, 434, fTexWidth, fTexHeight );
	m_btnHairNext.SetUV( UBS_CLICK, 16, 436, 29, 449, fTexWidth, fTexHeight );
	m_btnHairNext.CopyUV( UBS_IDLE, UBS_ON );
	m_btnHairNext.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Prev Face
	m_btnHeadPrev.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnHeadPrev.SetUV( UBS_IDLE, 0, 421, 13, 434, fTexWidth, fTexHeight );
	m_btnHeadPrev.SetUV( UBS_CLICK, 0, 436, 13, 449, fTexWidth, fTexHeight );
	m_btnHeadPrev.CopyUV( UBS_IDLE, UBS_ON );
	m_btnHeadPrev.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Next Face
	m_btnHeadNext.Create( this, CTString( "" ), 0, 0, 13, 13 );
	m_btnHeadNext.SetUV( UBS_IDLE, 16, 421, 29, 434, fTexWidth, fTexHeight );
	m_btnHeadNext.SetUV( UBS_CLICK, 16, 436, 29, 449, fTexWidth, fTexHeight );
	m_btnHeadNext.CopyUV( UBS_IDLE, UBS_ON );
	m_btnHeadNext.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Character name edit box
	m_ebCharName.Create( this, 0, 0, 88, 13, MAX_NAME_LEN );
	m_ebCharName.SetReadingWindowUV( 34, 423, 51, 439, fTexWidth, fTexHeight );
	m_ebCharName.SetCandidateUV( 34, 423, 51, 439, fTexWidth, fTexHeight );
	m_ebCharName.SetFocus( TRUE );
	// [2011/11/02 : Sora] 커서 이동 불가플래그
	m_ebCharName.SetCursorMove( FALSE );

	// Description of character
	m_astrDescription[0] = _S( 129, " 겉보기에는 다소 덩치 큰 사람처럼 보일 수 있으나, 겉모습으로는 상상할 수 없을 정도의 엄청난 괴력, 체력과 함께 전투 상황에 대한 기민한 판단력까지 지니고 있는 타고난 전사." );
	m_astrDescription[1] = _S( 130, "자신의 힘을 기르고 육체를 단련하는 것을 삶의 목표로 여기고 있으며 목숨이 왔다갔다 거리는 전장을 최고의 단련장소라 여기고 끊임없는 전투를 즐기며 살아가는 삶을 보낸다." );
	m_astrDescription[2] = _S( 131, " 빛의 신을 모시는 성스러운 기사로 단순히 무엇보다 악으로 물들어가는 혼돈의 시대를 살아가기 위해서만이 아닌 자신의 명예와 소중히 여기는 것을 지키기 위해 계속 단련하는 존재." );
	m_astrDescription[3] = _S( 132, "자신을 포함한 주변의 동료들의 상황을 언제나 보호하면서 싸우는 전법을 사용하기에 공격 기술 이상가는 다양한 방어기술을 지니고 있으며 이를 활용하여 전투를 항상 승리로 이끈다." );
	m_astrDescription[4] = _S( 133, " 정령의 힘을 이용하여 다양한 회복, 치유에 관련된 온화한 마법을 사용하는 것이 특기인 하이엘프 힐러는 전투 중 상처를 입은 동료와 자연을 치유하는 나날을 보내고 있다." );
	m_astrDescription[5] = _S( 134, "접근전을 좋아하지 않는 그들은 주로 활을 사용하여 원거리로부터 전투를 지원하는데 바람의 정령에게 도움을 받기 때문인지 여느 숙련된 궁수에 못지 않는 강력함을 지닌다." );
	m_astrDescription[6] = _S( 449, "정령의 가호를 받고 있는 엘프들과 달리 자신 스스로의 노력에 의해 습득한 지식에 의해 마나의 흐름을 통제하고 이를 응용하여 자유롭게 사용하는 자들이 이들 메이지이다. " );
	m_astrDescription[7] = _S( 450, "폭발적인 위력을 자랑하는 공격 마법과 상대를 혼란시키는 저주 마법을 주 특기로 사용하는 메이지는 그에게 적대하는 상대를 전멸, 제거하는데 그 힘을 아끼지 않고 사용한다. " );
	m_astrDescription[8] = _S( 1025, "무엇에도 얽매이지 않고 바람보다도 자유롭게 살아가는 존재. 정령 실프의 축복을 받아 태어난 이들은 매우 빠른 몸놀림과 뛰어난 시야를 지니며 그와 함께 자유분방한 사고방식과 여행을 좋아하는 성격을 타고났다고 전해진다." );		
	m_astrDescription[9] = _S( 1026, "빠른 몸놀림과 시야를 활용할 수 있는 단검과 석궁을 주로 사용하는 로그는 낮은 체력을 커버하기 위해 공격 하나하나를 적의 약점을 노려 치명상을 입히거나 원거리에서 적에 대해 아군을 서포트하는 것에 주력한다." );	
	m_astrDescription[10] = _S( 1027, "치유를 담당하는 하이엘프 힐러와 달리 하이엘프 소서러는 자연을 상처 입히거나 그들의 계율을 어기는 자에 대해 강력한 마법으로 제재를 가하는 역할을 맡고 있다." );	
	m_astrDescription[11] = _S( 1028, "자연 상의 마나를 에너지의 형태로 변환시켜 사용하는 메이지와 달리 소서러는 4대 정령의 힘을 빌은 강력한 4대 속성의 마법을 사용한다." );
	m_astrDescription[12] = _S( 4698, "적에게 강력한 암흑 공격마법으로 직접 피해를 입혀 제압하는 전투형 마법사이다. 기존 마법사 계열보다 빠른 연사력을 지니고 있으며, 공격 마법과 함께 적에게 저주를 같이 걸어버리기도 한다.");
	m_astrDescription[13] = _S( 4699, "무엇보다 나이트쉐도우는 적의 영혼을 흡수하고 흡수한 영혼을 이용해 강력한 연계 마법을 사용한다. 라스트카오스의 첫번째 영웅 클래스로 90레벨 이상 캐릭터를 소유한 계정에 한해서 생성이 가능하다.");
#ifdef CHAR_EX_ROGUE
	m_astrDescription[14] = _S( 1025, "무엇에도 얽매이지 않고 바람보다도 자유롭게 살아가는 존재. 정령 실프의 축복을 받아 태어난 이들은 매우 빠른 몸놀림과 뛰어난 시야를 지니며 그와 함께 자유분방한 사고방식과 여행을 좋아하는 성격을 타고났다고 전해진다." );		// [2012/08/27 : Sora] EX로그 추가
	m_astrDescription[15] = _S( 5733, "로그 중에서 어둠의 기운을 얻게된 특수한 로그들은 사악한 힘을 이용하여 적에게 피해를 입히거나 아군을 보호할 수 있으며, 다양한 함정을 설치하여 적을 교란시키는 등의 전투를 펼친다." );	// [2012/08/27 : Sora] EX로그 추가
#endif
#ifdef CHAR_EX_MAGE
		//2013/01/08 jeil EX메이지 추가 스트링 나오면 추가 수정 필요 
	m_astrDescription[16] = _S( 449, "정령의 가호를 받고 있는 엘프들과 달리 자신 스스로의 노력에 의해 습득한 지식에 의해 마나의 흐름을 통제하고 이를 응용하여 자유롭게 사용하는 자들이 이들 메이지이다. " );
	m_astrDescription[17] = _S( 5821, "아크메이지는 메이지와 다르게 순수한 마법을 사용하는 백마법사로, 학문적인 관점에서의 마법을 연구한다. 가장 기본적이면서도 공격적인 속성 마법을 자유롭게 다룰 수 있으며 적대하는 상대를 전멸, 제거하는데는 결코 주저함이 없다." );

#endif

	m_ptdMsgTexture = CreateTexture( CTString( "Data\\Interface\\TopUI.tex" ) );
	m_rcMessageInfo.SetRect( 20, 40, 215, 102 );
	m_bxNoticeMsg.SetBoxUV(m_ptdMsgTexture,7,WRect(239,253,335,269));

	m_msgNCText.SetRenderRect( 20, 45, 187, 62 );
	m_msgNCText.AddString( _S(4794, "나이트쉐도우 캐릭터를 생성할 수 있는 조건을 만족하였습니다. 나이트쉐도우 캐릭터를 생성하여 육성하십시오." ) );
}
예제 #11
0
void CUIMySyndicateInfo::UpdateMyInfo()
{
	BOOL bKay = FALSE;

	int nSyndiType = _pNetwork->MyCharacterInfo.iSyndicateType;
	
	if (nSyndiType == CSyndicate::eTYPE_KAILUX)
		bKay = FALSE;
	else if (nSyndiType == CSyndicate::eTYPE_DEALERMOON)
		bKay = TRUE;		
	else
		return;

	if (m_pimgSyndicate[eSYNDICATE_TYPE_KAY] != NULL)
		m_pimgSyndicate[eSYNDICATE_TYPE_KAY]->Hide(bKay);

	if (m_pimgSyndicate[eSYNDICATE_TYPE_DEAL] != NULL)
		m_pimgSyndicate[eSYNDICATE_TYPE_DEAL]->Hide(!bKay);

	GameDataManager* pGameDataManager = GameDataManager::getSingleton();
	CSyndicate* pSyndiInfo = pGameDataManager->GetSyndicate();

	if (pSyndiInfo == NULL)
		return;

	UpdateClient::RVRSyndicateInfoOfServer* pData = pSyndiInfo->GetSyndicateInfo();

	if (pData == NULL)
		return;

	CTString strString = pData->kingName;

	if (m_ptxtKingName != NULL)
		m_ptxtKingName->SetText(strString);
	
	strString = CTString("");
	CTString strTemp1 = CTString("");
	CTString strTemp2 = CTString("");

	int nGrade = _pNetwork->MyCharacterInfo.iSyndicateGrade;

	strTemp1.PrintF(_S(6165, "나의 직위:"));
	strTemp2 = pSyndiInfo->GetGradeName(nSyndiType, nGrade);
	strString = strTemp1 + " " + strTemp2;

	if (m_ptxtMyPos != NULL)
		m_ptxtMyPos->SetText(strString);

	int		nLevel = pData->skillLevel;
	int		nSkillIdx = pData->skillIndex;
	
	CSkill	&rSkill = _pNetwork->GetSkillData( nSkillIdx );

	strTemp1.PrintF( _S(6166,"직위 해택:"));

	if (nSkillIdx <= 0 || nSkillIdx >= _pNetwork->wo_iNumOfSkill)
		strTemp2.PrintF( _S(3865,"없음"));
	else
		strTemp2.PrintF( _S(6258,"%s %d 레벨"), rSkill.GetName(), nLevel );
	
	strString = strTemp1 + " " + strTemp2;

	if (m_ptxtMyBuff != NULL)
		m_ptxtMyBuff->SetText(strString);
}
예제 #12
0
void CChildFrame::TestGame( BOOL bFullScreen) 
{
  // turn off info window
  CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
  pMainFrame->HideInfoWindow();

  CWorldEditorView *pPerspectiveView = GetPerspectiveView();
  ASSERT( pPerspectiveView != NULL);
  SetActiveView( pPerspectiveView, FALSE);
	CWorldEditorDoc* pDoc = pPerspectiveView->GetDocument();

  CTFileName fnmWorldToPlay;
  CTFileName fnmTempWorld = CTString("Temp\\TestGame.wld");

  // if the world was never saved or if it is modified
  if( (!pDoc->m_bWasEverSaved && wed_bSaveTestGameFirstTime) || pDoc->IsModified())
  { // save world under temporary name
    ASSERT_VALID(pDoc);
    try {  
      pDoc->m_woWorld.Save_t(fnmTempWorld);
      fnmWorldToPlay = fnmTempWorld;
    } catch( char *strError) {
      AfxMessageBox( CString(strError));
      pPerspectiveView->EnableToolTips(TRUE);
      return;
    }
  // if the world is not modified (it is saved on disk)
  } else
  { // use the saved world
    fnmWorldToPlay = CTString(CStringA(pDoc->GetPathName()));
    try {
      fnmWorldToPlay.RemoveApplicationPath_t();
    } catch( char *strError) {
      AfxMessageBox( CString(strError));
      pPerspectiveView->EnableToolTips(TRUE);
      return;
    }
  }

  // set rendering preferences
  _wrpWorldRenderPrefs = pPerspectiveView->m_vpViewPrefs.m_wrpWorldRenderPrefs;
  _mrpModelRenderPrefs = pPerspectiveView->m_vpViewPrefs.m_mrpModelRenderPrefs;
  _wrpWorldRenderPrefs.SetShadowsType( pPerspectiveView->GetChildFrame()->m_stShadowType);
  _wrpWorldRenderPrefs.SetSelectedEntityModel( theApp.m_pEntityMarkerModelObject);
  _wrpWorldRenderPrefs.SetSelectedPortalModel( theApp.m_pPortalMarkerModelObject);
  _wrpWorldRenderPrefs.SetEmptyBrushModel( theApp.m_pEmptyBrushModelObject);
  _wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture1, 0);
  _wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture2, 1);
  _wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture3, 2);
  _wrpWorldRenderPrefs.DisableVisTweaks(FALSE);

  _wrpWorldRenderPrefs.SetSelectedEntityModel( theApp.m_pEntityMarkerModelObject);
  _wrpWorldRenderPrefs.SetSelectedPortalModel( theApp.m_pPortalMarkerModelObject);
  _wrpWorldRenderPrefs.SetEmptyBrushModel( theApp.m_pEmptyBrushModelObject);

  // prepare test game view/draw ports
  CViewPort *pvp = pPerspectiveView->m_pvpViewPort;
  CDrawPort *pdp = pPerspectiveView->m_pdpDrawPort;
  pdp->SetOverlappedRendering(FALSE); // we are not rendering scene over already rendered scene (used for CSG layer)

  // if full screen mode is required
  HWND hWndFullScreen=NULL;
  HINSTANCE hInstanceFullScreen;
  WNDCLASSEX wcFullScreen;
  char achWindowTitle[256]; // current window title
  if( bFullScreen) 
  {
    // get full screen display mode info
    const PIX pixSizeI = theApp.m_dmFullScreen.dm_pixSizeI;
    const PIX pixSizeJ = theApp.m_dmFullScreen.dm_pixSizeJ;
    const DisplayDepth dd = theApp.m_dmFullScreen.dm_ddDepth;
    const GfxAPIType gat  = theApp.m_gatFullScreen;
    // set OpenGL fullscreen (before window)
    if( gat==GAT_OGL) {
      const BOOL bRes = _pGfx->SetDisplayMode( gat, 0, pixSizeI, pixSizeJ, dd);
      if( !bRes) {
        WarningMessage( "Unable to setup full screen display.");
        return;
      }
    } // register the window class
    hInstanceFullScreen = AfxGetInstanceHandle();
    ASSERT( hInstanceFullScreen!=NULL);
    wcFullScreen.cbSize = sizeof(wcFullScreen);
    wcFullScreen.style = CS_HREDRAW | CS_VREDRAW;
    wcFullScreen.lpfnWndProc = ::DefWindowProc;
    wcFullScreen.cbClsExtra = 0;
    wcFullScreen.cbWndExtra = 0;
    wcFullScreen.hInstance = hInstanceFullScreen;
    wcFullScreen.hIcon = LoadIcon( hInstanceFullScreen, (LPCTSTR)IDR_MAINFRAME );
    wcFullScreen.hCursor = NULL;
    wcFullScreen.hbrBackground = NULL;
    wcFullScreen.lpszMenuName  = CString(APPLICATION_NAME);
    wcFullScreen.lpszClassName = CString(APPLICATION_NAME);
    wcFullScreen.hIconSm = NULL;
    RegisterClassEx(&wcFullScreen);

    // create a window, invisible initially
    hWndFullScreen = CreateWindowExA(
      WS_EX_TOPMOST,
      APPLICATION_NAME,
      "Serious Editor - Full Screen Test Game",   // title
      WS_POPUP,
      0,0,
      pixSizeI, pixSizeJ,  // window size
      NULL,
      NULL,
      hInstanceFullScreen,
      NULL);
    // didn't make it?
    ASSERT( hWndFullScreen!=NULL);
    if( hWndFullScreen==NULL) {
      if( gat==GAT_OGL) _pGfx->ResetDisplayMode( (enum GfxAPIType)theApp.m_iApi);
      WarningMessage( "Unable to setup window for full screen display.");
      return;
    }
    // set windows for engine
    CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
    SE_UpdateWindowHandle( hWndFullScreen);

    // set window title and show it
    sprintf( achWindowTitle, "Serious Editor - Test Game (FullScreen %dx%d)", pixSizeI, pixSizeJ);
    ::SetWindowTextA( hWndFullScreen, achWindowTitle);
    ::ShowWindow(    hWndFullScreen, SW_SHOWNORMAL);

    // set Direct3D full screen (after window)
#ifdef SE1_D3D
    if( gat==GAT_D3D) {
      const BOOL bRes = _pGfx->SetDisplayMode( gat, 0, pixSizeI, pixSizeJ, dd);
      if( !bRes) {
        WarningMessage( "Unable to setup full screen display.");
        ::DestroyWindow( hWndFullScreen);
        SE_UpdateWindowHandle( pMainFrame->m_hWnd);
        return;
      }
    }
#endif // SE1_D3D
    // create canvas
    _pGfx->CreateWindowCanvas( hWndFullScreen, &pvp, &pdp);
    // initial screen fill and swap, just to get context running
    BOOL bSuccess = FALSE;
    if( pdp!=NULL && pdp->Lock()) {
      pdp->Fill(C_dGREEN|CT_OPAQUE);
      pdp->Unlock();
      pvp->SwapBuffers();
      bSuccess = TRUE;
    }
    // must succeed!
    ASSERT( bSuccess);
    if( !bSuccess) {
      _pGfx->ResetDisplayMode( (enum GfxAPIType)theApp.m_iApi);
      WarningMessage( "Unable to setup canvas for full screen display.");
      return;
    }
  }

  // enable sound
  snd_iFormat = Clamp( snd_iFormat, (INDEX)CSoundLibrary::SF_NONE, (INDEX)CSoundLibrary::SF_44100_16);
  _pSound->SetFormat( (enum CSoundLibrary::SoundFormat)snd_iFormat, TRUE);

  // run quick test game
  extern BOOL _bInOnDraw; 
  _bInOnDraw = TRUE;
  _pGameGUI->QuickTest( fnmWorldToPlay, pdp, pvp);
  _bInOnDraw = FALSE;

  // disable sound
  _pSound->SetFormat( CSoundLibrary::SF_NONE);

  // restore default display mode and close test full screen window
  if( hWndFullScreen!=NULL) {
    _pGfx->ResetDisplayMode( (enum GfxAPIType)theApp.m_iApi);
    ::DestroyWindow( hWndFullScreen);
    SE_UpdateWindowHandle( pMainFrame->m_hWnd);
  }
  // redraw all views
  pDoc->UpdateAllViews( NULL);
  pPerspectiveView->EnableToolTips( TRUE);
}
예제 #13
0
/////////////////////////////////////////////////////////////////////////////
// value changed in some text box
void CTextBox::ValueChanged() 
{
  CSeriousSkaStudioDoc *pDoc = theApp.GetDocument();

  wchar_t wstrText[32];
  // get value from text box
  GetWindowText(wstrText,31);
  CTString strText = CStringA(wstrText);
  CModelTreeCtrl &m_TreeCtrl = theApp.m_dlgBarTreeView.m_TreeCtrl;
  // get selected item in tree view
  HTREEITEM hSelected = m_TreeCtrl.GetSelectedItem();
  if(hSelected == NULL) return;
  if(pmiSelected == NULL) return;

  INDEX iSelected = m_TreeCtrl.GetItemData(hSelected);
  INDEX iParent;
  // get parent of selected item in tree view
  HTREEITEM hParent = m_TreeCtrl.GetParentItem(hSelected);
  // if no parent set iParent to = 1 
  if(hParent == NULL) iParent = -1;
  else iParent = m_TreeCtrl.GetItemData(hParent);

  NodeInfo &niSelected = theApp.aNodeInfo[iSelected];

  FLOATmatrix3D mat;
  FLOAT3D &vPos = pmiSelected->mi_qvOffset.vPos;
  ANGLE3D aRot;
  pmiSelected->mi_qvOffset.qRot.ToMatrix(mat);
  DecomposeRotationMatrix(aRot,mat);
  // colison
  ColisionBox *pcb = NULL;
  if(pmiSelected->mi_iCurentBBox >= 0 && pmiSelected->mi_iCurentBBox < pmiSelected->mi_cbAABox.Count()) {
    pcb = &pmiSelected->mi_cbAABox[pmiSelected->mi_iCurentBBox];
  }
  if(niSelected.ni_iType == NT_ALLFRAMESBBOX) {
    pcb = &pmiSelected->mi_cbAllFramesBBox;
  }


  FLOAT fOffset[6] = {vPos(1),vPos(2),vPos(3),aRot(1),aRot(2),aRot(3)};

  INDEX ictrlID = GetDlgCtrlID();
  switch(ictrlID)
  {
    case IDC_TB_OFFSET_POSX:
      fOffset[0] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
    break;
    case IDC_TB_OFFSET_POSY:
      fOffset[1] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
    break;
    case IDC_TB_OFFSET_POSZ:
      fOffset[2] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
    break;
    case IDC_TB_OFFSET_ROTH:
      fOffset[3] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
      // refresh all text boxes for colision 
      theApp.m_dlgBarTreeView.SelItemChanged(hSelected);
    break;
    case IDC_TB_OFFSET_ROTP:
      fOffset[4] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
      // refresh all text boxes for colision 
      theApp.m_dlgBarTreeView.SelItemChanged(hSelected);
    break;
    case IDC_TB_OFFSET_ROTB:
      fOffset[5] = atof(strText);
      // set offset of selected object
      pmiSelected->SetOffset(fOffset);
      // refresh all text boxes for colision 
      theApp.m_dlgBarTreeView.SelItemChanged(hSelected);
    break;
    case IDC_EB_DISTANCE:
    {
      // set lod distance
      if(niSelected.ni_iType == NT_SKELETONLOD)
      {
        // if no parent return
        if(iParent < 0) return;
        NodeInfo &niParent   = theApp.aNodeInfo[iParent];
        // get references to objects
        CSkeleton *psk = (CSkeleton*)niParent.ni_pPtr;
        SkeletonLOD *slod = (SkeletonLOD*)niSelected.ni_pPtr;
        // change slods max distance
        slod->slod_fMaxDistance = atof(strText);
        theApp.UpdateRootModelInstance();
      }
      else if(niSelected.ni_iType == NT_MESHLOD)
      {
        // if no parent return
        if(iParent < 0) return;
        NodeInfo &niParent = theApp.aNodeInfo[iParent];
        // get references to objects
        MeshInstance *pmshi = (MeshInstance*)niParent.ni_pPtr;
        MeshLOD *pmlod = (MeshLOD*)niSelected.ni_pPtr;
        CMesh *pmesh = pmshi->mi_pMesh;
        // change mlods max distance
        pmlod->mlod_fMaxDistance = atof(strText);
        theApp.UpdateRootModelInstance();
      }
    }
    break;
    case IDC_EB_TRESHOLD:
    {
      if(niSelected.ni_iType == NT_ANIMATION)
      {
        // if no parent return
        if(iParent < 0) return;
        NodeInfo &niParent = theApp.aNodeInfo[iParent];
        // get references to objects
        CAnimSet *pas = (CAnimSet*)niParent.ni_pPtr;
        Animation *pan = (Animation*)niSelected.ni_pPtr;
        // remember old treshold
        FLOAT fOldTreshold = pan->an_fTreshold;
        pan->an_fTreshold = atof(strText);
        // convert only one animation in animset
        if(!theApp.ConvertAnimationInAnimSet(pas,pan)) {
          pan->an_fTreshold = fOldTreshold;
        }
        // update model instance
        theApp.UpdateRootModelInstance();
      }
    }
    break;
    case IDC_TB_COLWIDTH:
    {
      // change width of colision box
      if(pcb!=NULL)
      {
        FLOAT fWidth = atof(strText);
        FLOAT fPosX = (pcb->Max()(1)+pcb->Min()(1)) / 2;
        pcb->Min()(1) = -(fWidth/2) + fPosX;
        pcb->Max()(1) = (fWidth/2) + fPosX;
      }
    }
    break;
    case IDC_TB_COLHEIGHT:
    {
      // change height of colision box
      if(pcb!=NULL)
      {
        FLOAT fHeight = atof(strText);
        FLOAT fPosY = pcb->Min()(2);
        pcb->Min()(2) = fPosY;
        pcb->Max()(2) = fHeight + fPosY;
      }
    }
    break;
    case IDC_TB_COLLENGTH:
    {                  
      // change length of colision box
      if(pcb!=NULL)
      {
        FLOAT fLength = atof(strText);
        FLOAT fPosZ = (pcb->Max()(3)+pcb->Min()(3)) / 2;
        pcb->Min()(3) = -(fLength/2) + fPosZ;
        pcb->Max()(3) = (fLength/2) + fPosZ;
      }
    }
    break;
    case IDC_TB_COLPOSX:
    {
      // change pos x of colision box
      if(pcb!=NULL)
      {
        FLOAT fPosX = atof(strText);
        FLOAT fWidth = (pcb->Max()(1)-pcb->Min()(1));
        pcb->Min()(1) = -(fWidth/2) + fPosX;
        pcb->Max()(1) = (fWidth/2) + fPosX;
      }
    }
    break;
    case IDC_TB_COLPOSY:
    {
      // change pos y of colision box
      if(pcb!=NULL)
      {
        FLOAT fPosY = atof(strText);
        FLOAT fHeight = (pcb->Max()(2)-pcb->Min()(2));
        fPosY += fHeight/2;
        pcb->Min()(2) = -(fHeight/2) + fPosY;
        pcb->Max()(2) = (fHeight/2) + fPosY;
      }
    }
    break;
    case IDC_TB_COLPOSZ:
    {
      // change pos z of colision box
      if(pcb!=NULL)
      {
        FLOAT fPosZ = atof(strText);
        FLOAT fLength = (pcb->Max()(3)-pcb->Min()(3));
        pcb->Min()(3) = -(fLength/2) + fPosZ;
        pcb->Max()(3) = (fLength/2) + fPosZ;
      }
    }
    break;
    case IDC_TB_COLNAME:
    {
      // change name of colision box
      if(pcb!=NULL) {
        pcb->SetName(strText);
        m_TreeCtrl.SetItemText(hSelected, CString(strText));
      }
    }
    break;
    // change animation speed
    case IDC_EB_SECPERFRAME:
    {
      // if no parent return
      if(iParent < 0) return;
      NodeInfo &niParent = theApp.aNodeInfo[iParent];
      Animation *pan = (Animation*)niSelected.ni_pPtr;
      CAnimSet *pas = (CAnimSet*)niParent.ni_pPtr;
      pan->an_fSecPerFrame = atof(strText);
      if(pan->an_fSecPerFrame == 0) pan->an_fSecPerFrame = 0.00001f;
      // update model instance
      theApp.UpdateRootModelInstance();
    }
    break;
    // change animation walk speed 
    case IDC_TB_WALKSPEED:
    {
      pDoc->m_fSpeedZ = atof(strText);
      return; // do not mark doc as channged
    }
    break;
    // change animation walk loop
    case IDC_TB_WALKLOOP:
    {
      pDoc->m_fLoopSecends = atof(strText);
      return; // do not mark doc as channged
    }
    break;
    case IDC_EB_TEXTURENAME:
    {
      TextureInstance *pti = (TextureInstance*)niSelected.ni_pPtr;
      pti->SetName(CTString(strText));
      // update model instance
      theApp.UpdateRootModelInstance();
    }
    break;
    case IDC_TB_MI_NAME:
    {
      NodeInfo &ni = theApp.m_dlgBarTreeView.GetSelectedNodeInfo();
      CModelInstance &mi = *(CModelInstance*)ni.ni_pPtr;
      mi.SetName(strText);
      // update model instance
      theApp.UpdateRootModelInstance();
    }
    break;
    default:
    {
      // check if this text box is in shader dialog
      if((ictrlID>FIRSTSHADEID) && (ictrlID<LASTSHADEID))
      {
        // control is in shader dialog
        theApp.m_dlgBarTreeView.ChangeFloatOnSelectedSurfaces(m_strID,atof(strText));
      }
    }
    break;
  }
  pDoc->MarkAsChanged();
}
예제 #14
0
void CTextBox::SetDataPtr(FLOAT *pFloat)
{
  CTString strText = CTString(0,"%g",*pFloat);
  SetWindowText(CString(strText));
}
예제 #15
0
파일: CmdLine.cpp 프로젝트: rdrago/LCSource
// parse command line parameters and set results to static variables
void ParseCommandLine(CTString strCmd)
{
    cmd_strOutput = "";
    cmd_strOutput+=CTString(0, TRANS("Command line: '%s'\n"), strCmd);
    // if no command line
    if (strlen(strCmd) == 0) {
        // do nothing
        return;
    }
    _strCmd = strCmd;

    FOREVER {
        CTString strWord = GetNextParam();
        if (strWord=="") {
            cmd_strOutput+="\n";
            return;
        } else if (strWord=="+level") {
            cmd_strWorld = GetNextParam();
        } else if (strWord=="+server") {
            cmd_bServer = TRUE;
        } else if (strWord=="+player") {
            cmd_strPlayer = GetNextParam();
        } else if (strWord=="+quickjoin") {
            cmd_bQuickJoin = TRUE;
        } else if (strWord=="+game") {
            CTString strMod = GetNextParam();
#if _SE_DEMO
            if (strMod!="SeriousSam" && strMod!="Warped") {
                FatalError(TRANS("This MOD is not allowed in demo version!"));
                return;
            }
#endif
            if (strMod!="SeriousSam") { // (we ignore default mod - always use base dir in that case)
                _fnmMod = "Mods\\"+strMod+"\\";
            }
        } else if (strWord=="+cdpath") {
            _fnmCDPath = GetNextParam();
        } else if (strWord=="+password") {
            cmd_strPassword = GetNextParam();
        } else if (strWord=="+connect") {
            cmd_strServer = GetNextParam();
            const char *pcColon = strchr(cmd_strServer, ':');
            if (pcColon!=NULL) {
                CTString strServer;
                CTString strPort;
                cmd_strServer.Split(pcColon-cmd_strServer, strServer, strPort);
                cmd_strServer = strServer;
                strPort.ScanF(":%d", &cmd_iPort);
            }
        } else if (strWord=="+windowpos") {
            CTString strWinPos = GetNextParam();
            const char *pcColon = strchr(strWinPos, ':');
            if (pcColon!=NULL) {
                CTString strLeft;
                CTString strTop;
                strWinPos.Split(pcColon-strWinPos, strLeft, strTop);
                strLeft.ScanF("%d", &cmd_iWindowLeft);
                strTop.ScanF(":%d", &cmd_iWindowTop);
            }
        } else if (strWord=="+script") {
            cmd_strScript = GetNextParam();
        } else if (strWord=="+goto") {
            GetNextParam().ScanF("%d", &cmd_iGoToMarker);
        } else if (strWord=="+logfile") {
            _strLogFile = GetNextParam();
        } else {
            cmd_strOutput+=CTString(0, TRANS("  Unknown option: '%s'\n"), strWord);
        }
    }
}
예제 #16
0
void CDlgPgCollision::DoDataExchange(CDataExchange* pDX)
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if(pModelerView == NULL) return;
  CModelerDoc* pDoc = pModelerView->GetDocument();  

  // if transfering data from document to dialog
  if( !pDX->m_bSaveAndValidate)
  {
    // get collision min vector
    FLOAT3D vMinCollisionBox = pDoc->m_emEditModel.GetCollisionBoxMin();
    // get collision max vector
    FLOAT3D vMaxCollisionBox = pDoc->m_emEditModel.GetCollisionBoxMax();

    FLOATaabbox3D bboxCollision = FLOATaabbox3D( vMinCollisionBox, vMaxCollisionBox);

    m_fWidth   = bboxCollision.Size()(1);
    m_fHeight  = bboxCollision.Size()(2);
    m_fLenght  = bboxCollision.Size()(3);
    m_fXCenter = bboxCollision.Center()(1);
    m_fYDown   = vMinCollisionBox(2);
    m_fZCenter = bboxCollision.Center()(3);
    
    // set equality radio initial value
    INDEX iEqualityType = pDoc->m_emEditModel.GetCollisionBoxDimensionEquality();

    // get index of curently selected collision box
    char achrString[ 256];
    sprintf( achrString, "%d.", pDoc->m_emEditModel.GetActiveCollisionBoxIndex());
    m_strCollisionBoxIndex = achrString;
    // get name of curently selected collision box
    sprintf( achrString, "%s", pDoc->m_emEditModel.GetCollisionBoxName());
    m_strCollisionBoxName = achrString;

    // enable all controls
    GetDlgItem( IDC_STATIC_WIDTH)->EnableWindow( TRUE);
    GetDlgItem( IDC_EDIT_WIDTH)->EnableWindow( TRUE);
    GetDlgItem( IDC_STATIC_HEIGHT)->EnableWindow( TRUE);
    GetDlgItem( IDC_EDIT_HEIGHT)->EnableWindow( TRUE);
    GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( TRUE);
    GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( TRUE);

    m_bCollideAsBox = pDoc->m_emEditModel.edm_md.md_bCollideAsCube;
    // if we are colliding using sphere approximation
    switch( iEqualityType)
    {
      case HEIGHT_EQ_WIDTH:
      {
        m_EqualityRadio = 0;
        if( !m_bCollideAsBox)
        {
          GetDlgItem( IDC_STATIC_HEIGHT)->EnableWindow( FALSE);
          GetDlgItem( IDC_EDIT_HEIGHT)->EnableWindow( FALSE);
          m_fHeight = m_fWidth;
        }
        break;
      }
      case LENGTH_EQ_WIDTH:
      {
        m_EqualityRadio = 1;
        if( !m_bCollideAsBox)
        {
          GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( FALSE);
          GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( FALSE);
          m_fLenght = m_fWidth;
        }
        break;
      }
      case LENGTH_EQ_HEIGHT:
      {
        m_EqualityRadio = 2;
        if( !m_bCollideAsBox)
        {
          GetDlgItem( IDC_STATIC_LENGHT)->EnableWindow( FALSE);
          GetDlgItem( IDC_EDIT_LENGHT)->EnableWindow( FALSE);
          m_fLenght = m_fHeight;
        }
        break;
      }
      default:
      {
        ASSERTALWAYS( "None of collision dimensions are the same and that can't be.");
      }
    }
    // mark that the values have been updated to reflect the state of the view
    m_udAllValues.MarkUpdated();
  }
    
  CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgPgCollision)
	DDX_SkyFloat(pDX, IDC_EDIT_WIDTH, m_fWidth);
	DDX_SkyFloat(pDX, IDC_EDIT_HEIGHT, m_fHeight);
	DDX_SkyFloat(pDX, IDC_EDIT_LENGHT, m_fLenght);
	DDX_SkyFloat(pDX, IDC_EDIT_XCENTER, m_fXCenter);
	DDX_SkyFloat(pDX, IDC_EDIT_YDOWN, m_fYDown);
	DDX_SkyFloat(pDX, IDC_EDIT_ZCENTER, m_fZCenter);
	DDX_Radio(pDX, IDC_H_EQ_W, m_EqualityRadio);
	DDX_Text(pDX, IDC_COLLISION_BOX_NAME, m_strCollisionBoxName);
	DDX_Text(pDX, IDC_COLLISION_BOX_INDEX, m_strCollisionBoxIndex);
	DDX_Check(pDX, IDC_COLLIDE_AS_BOX, m_bCollideAsBox);
	//}}AFX_DATA_MAP

  // if transfering data from dialog to document
  if( pDX->m_bSaveAndValidate)
  {
    // if we are colliding using sphere approximation
    if( !pDoc->m_emEditModel.edm_md.md_bCollideAsCube)
    {
      INDEX iEqualityType;
      switch( m_EqualityRadio)
      {
        case 0:
        {
          iEqualityType = HEIGHT_EQ_WIDTH;
          CString strWidth;
          GetDlgItem( IDC_EDIT_WIDTH)->GetWindowText(strWidth);
          GetDlgItem( IDC_EDIT_HEIGHT)->SetWindowText(strWidth);
          break;
        }
        case 1:
        {
          iEqualityType = LENGTH_EQ_WIDTH;
          CString strWidth;
          GetDlgItem( IDC_EDIT_WIDTH)->GetWindowText(strWidth);
          GetDlgItem( IDC_EDIT_LENGHT)->SetWindowText( strWidth );
          break;
        }
        case 2:
        {
          iEqualityType = LENGTH_EQ_HEIGHT;
          CString strHeight;
          GetDlgItem( IDC_EDIT_HEIGHT)->GetWindowText(strHeight);
          GetDlgItem( IDC_EDIT_LENGHT)->SetWindowText( strHeight);
          break;
        }
        default:
        {
          ASSERTALWAYS( "Illegal value found in collision dimensions equality radio.");
        }
      }
      // set collision equality value
      if( pDoc->m_emEditModel.GetCollisionBoxDimensionEquality() != iEqualityType)
      {
        pDoc->m_emEditModel.SetCollisionBoxDimensionEquality( iEqualityType);
      }
    }

    // set name of curently selected collision box
    pDoc->m_emEditModel.SetCollisionBoxName( CTString( m_strCollisionBoxName) );
    
    // get collision min and max vectors
    FLOAT3D vMinCollisionBox;
    FLOAT3D vMaxCollisionBox;
    // get sizing values
    vMinCollisionBox(1) = m_fXCenter-m_fWidth/2.0f;
    vMinCollisionBox(2) = m_fYDown;
    vMinCollisionBox(3) = m_fZCenter-m_fLenght/2.0f;
    // get origin coordinates
    vMaxCollisionBox(1) = m_fXCenter+m_fWidth/2.0f; 
    vMaxCollisionBox(2) = m_fYDown+m_fHeight;
    vMaxCollisionBox(3) = m_fZCenter+m_fLenght/2.0f;
    
    // transfer data from dialog to document
    pDoc->m_emEditModel.SetCollisionBox( vMinCollisionBox, vMaxCollisionBox);

    pDoc->SetModifiedFlag();
    // update all views
    pDoc->UpdateAllViews( NULL);
  }
}
예제 #17
0
void IgnoreApplicationPath(void)
{
  _fnmApplicationPath = CTString("");
}
예제 #18
0
void CUIChildQuickSlot::Create( CUIWindow *pParentWnd, int nX, int nY, int nWidth, int nHeight )
{
	CUIWindow::Create(pParentWnd, nX, nY, nWidth, nHeight);
	//============== RECT ==============
	m_rcDragArea.SetRect( 0, 0, 15, 37 );
	
	///< create UIQuickslot Texture
	m_ptdBaseTexture = CreateTexture(CTString("Data\\Interface\\TopUI.tex"));
	
	///< Texture size
	FLOAT	fTexWidth = m_ptdBaseTexture->GetPixWidth();
	FLOAT	fTexHeight = m_ptdBaseTexture->GetPixHeight();
	
	//============== U . V ==============
	m_rtHorzBackground.SetUV(QSLOT_VER_BASE_TEXTURE_STARTX, QSLOT_VER_BASE_TEXTURE_STARTY, QSLOT_VER_BASE_TEXTURE_ENDX+1, QSLOT_VER_BASE_TEXTURE_ENDY+1, fTexWidth, fTexHeight);
	m_rtVerBackground.SetUV(QSLOT_HORZ_BASE_TEXTURE_STARTX, QSLOT_HORZ_BASE_TEXTURE_STARTY, QSLOT_HORZ_BASE_TEXTURE_ENDX+1, QSLOT_HORZ_BASE_TEXTURE_ENDY+1, fTexWidth, fTexHeight);
	
	
	switch(m_nID)
	{
	case UI_QUICKSLOT2:
		{
			m_rtHorzSlotNumber.SetUV(120, 574, 518, 581, fTexWidth, fTexHeight);
			m_rtVerSlotNumber.SetUV(80, 533, 93, 925, fTexWidth, fTexHeight);
		}
		break;
		
	case UI_QUICKSLOT3:
		{
			m_rtHorzSlotNumber.SetUV(120, 557, 526, 564, fTexWidth, fTexHeight);
			m_rtVerSlotNumber.SetUV(55, 533, 76, 925, fTexWidth, fTexHeight);
		}
		break;
	}
	
	// UV of rotation
	m_rtHorzOver.SetUV(680, 549, 697, 566, fTexWidth, fTexHeight);
	m_rtHorzClick.SetUV(698, 549, 715, 566, fTexWidth, fTexHeight);
	m_rtVerOver.SetUV(680, 567, 697, 584, fTexWidth, fTexHeight);
	m_rtVerClick.SetUV(698, 567, 715, 584, fTexWidth, fTexHeight);
	
	// rotation
	m_btnHorizontal.Create( this, CTString( "" ), CHILD_QUICKSLOT_WIDTH - QSLOT_OUTSIDE_BTN_SIZE - 1, 1, QSLOT_OUTSIDE_BTN_SIZE, QSLOT_OUTSIDE_BTN_SIZE );
	m_btnHorizontal.CopyUV( UBS_ON, m_rtHorzOver );
	m_btnHorizontal.CopyUV( UBS_CLICK, m_rtHorzClick );
	m_btnHorizontal.CopyUV( UBS_IDLE, UBS_DISABLE );
	
	m_btnVertical.Create( this, CTString( "" ), QSLOT_OUTSIDE_BTN_SIZE + 2, CHILD_QUICKSLOT_WIDTH - QSLOT_OUTSIDE_BTN_SIZE - 1, QSLOT_OUTSIDE_BTN_SIZE, QSLOT_OUTSIDE_BTN_SIZE );
	m_btnVertical.CopyUV( UBS_ON, m_rtVerOver );
	m_btnVertical.CopyUV( UBS_CLICK, m_rtVerClick );
	m_btnVertical.CopyUV( UBS_IDLE, UBS_DISABLE );
	
	// UV of lock
	m_rtLockIdle.SetUV(662, 513, 662+17, 513+17, fTexWidth, fTexHeight);
	m_rtLockOver.SetUV(680, 513, 680+17, 513+17, fTexWidth, fTexHeight);
	m_rtLockClick.SetUV(698, 513, 698+17, 513+17, fTexWidth, fTexHeight);
	
	m_rtUnLockIdle.SetUV(662, 531, 662+17, 531+17, fTexWidth, fTexHeight);
	m_rtUnLockOver.SetUV(680, 531, 680+17, 531+17, fTexWidth, fTexHeight);
	m_rtUnLockClick.SetUV(698, 531, 698+17, 531+17, fTexWidth, fTexHeight);
	
	// lock
	m_btnLock.Create( this, CTString( "" ), CHILD_QUICKSLOT_WIDTH - QSLOT_OUTSIDE_BTN_SIZE - 1, 19, QSLOT_OUTSIDE_BTN_SIZE, QSLOT_OUTSIDE_BTN_SIZE );
	m_btnLock.CopyUV( UBS_ON, m_rtLockOver );
	m_btnLock.CopyUV( UBS_CLICK, m_rtLockClick );
	m_btnLock.CopyUV( UBS_IDLE, m_rtLockIdle );
	
	m_btnUnLock.Create( this, CTString( "" ), CHILD_QUICKSLOT_WIDTH - QSLOT_OUTSIDE_BTN_SIZE - 1, 19, QSLOT_OUTSIDE_BTN_SIZE, QSLOT_OUTSIDE_BTN_SIZE );
	m_btnUnLock.CopyUV( UBS_ON, m_rtUnLockOver );
	m_btnUnLock.CopyUV( UBS_CLICK, m_rtUnLockClick );
	m_btnUnLock.CopyUV( UBS_IDLE, m_rtUnLockIdle );
	//============== BUTTON ==============
	
	if( *(m_bRotation[m_nCurSlot]) == 1 ) // 1 가로 0 세로 [12/21/2012 Ranma]
	{	
		SetSize( CHILD_QUICKSLOT_WIDTH, CHILD_QUICKSLOT_HEIGHT );
		m_rcDragArea.SetRect( 0, 0, 15, 37 );
		m_rcSlot.SetRect(15, 0, CHILD_QUICKSLOT_RCSLOT_AREA , CHILD_QUICKSLOT_HEIGHT);
	}
	else if ( *(m_bRotation[m_nCurSlot]) == 0 )
	{
		SetSize( CHILD_QUICKSLOT_HEIGHT, CHILD_QUICKSLOT_WIDTH );
		m_rcDragArea.SetRect( 0, 0, 37, 15 );
		m_rcSlot.SetRect(0, 15, CHILD_QUICKSLOT_HEIGHT, CHILD_QUICKSLOT_RCSLOT_AREA);
	}
}
void CDlgCreateSpecularTexture::DrawPreview( CDrawPort *pdp, FLOAT fExp)
{
  BOOL bErrorOcured = FALSE;
  
  if( (m_moModel.GetData() == NULL) || (m_moModel.mo_toTexture.GetData() == NULL) ||
      (m_moModel.mo_toSpecular.GetData() == NULL) )
  // obtain components for rendering
  try
  {
    DECLARE_CTFILENAME( fnBCGTexture, "Models\\Editor\\SpecularPreviewBCG.tex");
    m_toBackground.SetData_t( fnBCGTexture);

    DECLARE_CTFILENAME( fnTeapotModel, "Models\\Editor\\Teapot.mdl");
    DECLARE_CTFILENAME( fnTeapotTexture, "Models\\Editor\\Teapot.tex");
    m_moModel.SetData_t( fnTeapotModel);
    m_moModel.mo_toTexture.SetData_t( fnTeapotTexture);
    m_moModel.mo_toSpecular.SetData_t( CTString("temp\\SpecularTemp.tex"));
  }
  catch( char *strError)
  {
    (void) strError;
    bErrorOcured = TRUE;
  }

  if( !bErrorOcured)
  {

    ((CModelData*)m_moModel.GetData())->md_colSpecular = m_colorSpecular.GetColor();
    PIXaabbox2D screenBox = PIXaabbox2D( PIX2D(0,0), PIX2D(pdp->GetWidth(), pdp->GetHeight()) );
    //pdp->PutTexture( &m_moModel.mo_toSpecular, screenBox);
    //return;
    pdp->PutTexture( &m_toBackground, screenBox);
    pdp->FillZBuffer( ZBUF_BACK);

    CRenderModel rmRenderModel;
    CPerspectiveProjection3D prPerspectiveProjection;

    a3dObjectAngles += a3dObjectRotation;
    a3dLightAngles += a3dLightRotation;

    m_plPlacement.pl_OrientationAngle = a3dObjectAngles;
    AnglesToDirectionVector( a3dLightAngles, rmRenderModel.rm_vLightDirection);

    prPerspectiveProjection.FOVL() = AngleDeg(50.0f);
    prPerspectiveProjection.ScreenBBoxL() = FLOATaabbox2D( 
      FLOAT2D(0.0f,0.0f),FLOAT2D((float)pdp->GetWidth(), (float)pdp->GetHeight()));
    prPerspectiveProjection.AspectRatioL() = 1.0f;
    prPerspectiveProjection.FrontClipDistanceL() = 0.05f;

    prPerspectiveProjection.ViewerPlacementL().pl_PositionVector = FLOAT3D(0.0f,0.0f,0.0f);
    prPerspectiveProjection.ViewerPlacementL().pl_OrientationAngle = ANGLE3D( 0, -20, 0);
    prPerspectiveProjection.Prepare();
    CAnyProjection3D apr;
    apr = prPerspectiveProjection;
    BeginModelRenderingView(apr, pdp);

    _mrpModelRenderPrefs.SetRenderType( RT_TEXTURE|RT_SHADING_PHONG);
    m_plPlacement.pl_PositionVector = FLOAT3D( 0.0f, -0.19f, -0.35f);
    rmRenderModel.SetObjectPlacement(m_plPlacement);
    rmRenderModel.rm_colLight = m_colorLight.GetColor();
    rmRenderModel.rm_colAmbient = m_colorAmbient.GetColor();
    m_moModel.SetupModelRendering(rmRenderModel);
    m_moModel.RenderModel(rmRenderModel);
    EndModelRenderingView();
  }


  /*
  pdp->Fill(C_GREEN|CT_OPAQUE);
  PIX pixSizeI = pdp->GetWidth();
  PIX pixSizeJ = pdp->GetHeight();
  for (PIX pixI=0; pixI<pixSizeI; pixI++) {
    for (PIX pixJ=0; pixJ<pixSizeJ; pixJ++) {
      FLOAT fX = pixI*2.0f/pixSizeI-1;
      FLOAT fY = pixJ*2.0f/pixSizeJ-1;
      FLOAT fZ;
      FLOAT fZ2 = 1-fX*fX-fY*fY;
      if (fZ2<0) {
        fZ = 0;
      } else {
        fZ = Sqrt(fZ2);
      }
      FLOAT fZN = FLOAT(pow(fZ, fExp));
      ASSERT(fZN>=0 && fZN<=1);
      UBYTE ub = UBYTE(fZN*255);
      pdp->Fill(pixI, pixJ, 1,1, RGBToColor(ub,ub,ub)|CT_OPAQUE);
    }
  }
  */
}
예제 #20
0
// ----------------------------------------------------------------------------
// Name : CreateSelectList()
// Desc : 
// ----------------------------------------------------------------------------
void CUISelectList::CreateSelectList(int nStyle ,int nLine,CTString strTitle)
{
	m_dwStyle = nStyle;
	m_nMaxLine = nLine;
	
	m_nTextRegionHeight = (nLine+2)*TEXT_GAP - 7;	
	m_nHeight = m_nTextRegionHeight + TEXT_GAP*3 + 7;
	SetSize(m_nWidth,m_nHeight);
	int	tv_Height = m_nHeight - SL_BTN_OFFSETY;
	int	tv_Width  = m_nWidth/2  - SL_BTN_OFFSETX - BTN_GAP;

	if(strTitle != "") SetTitle(strTitle);

	m_rcList.SetRect( 8, 25, m_nWidth-8, nLine*TEXT_GAP +25);
	// 버튼 위치 조정 
	if( m_dwStyle & SLS_REGIST )
	{
		m_btnRegist.SetEnable( TRUE );
		m_btnRegist.SetText( _S( 2484, "친구등록" ) );
		m_btnRegist.SetPos( tv_Width, tv_Height );
		
		if( m_dwStyle & SLS_CANCEL )
		{
			tv_Width = m_nWidth/2  + BTN_GAP;
			m_btnCancel.SetEnable( TRUE );
			m_btnCancel.SetText( _S( 139, "취소" ) );
			m_btnCancel.SetPos( tv_Width  , tv_Height );
		
		} else {
			tv_Width += SL_BTN_OFFSETX/2;
			m_btnRegist.SetPos( tv_Width, tv_Height );
		}

	} else if( m_dwStyle & SLS_REWARD){
		m_btnReward.SetEnable( TRUE );
		m_btnReward.SetText( _S( 2494, "보상지급") );
		m_btnReward.SetPos( tv_Width, tv_Height );
		if( m_dwStyle & SLS_CANCEL )
		{
			tv_Width = m_nWidth/2  + BTN_GAP;
			m_btnCancel.SetEnable( TRUE );
			m_btnCancel.SetText( _S( 139, "취소" ) );
			m_btnCancel.SetPos( tv_Width  , tv_Height );
		
		} else {
			tv_Width += SL_BTN_OFFSETX/2;
			m_btnReward.SetPos( tv_Width, tv_Height );
		}
	} else if( m_dwStyle & SLS_CANCEL )	{
			tv_Width += SL_BTN_OFFSETX/2;
			m_btnCancel.SetEnable( TRUE );
			m_btnCancel.SetText( _S( 139, "취소" ) );
			m_btnCancel.SetPos( tv_Width  , tv_Height );
		
	}

	tv_Height = m_nHeight - SL_BTN_OFFSETY*2;
		
	if(m_dwStyle & SLS_PREV){
		tv_Width  = BTN_GAP;
		m_btnPrev.SetEnable( TRUE );
		m_btnPrev.SetText( CTString( " << " ) );
		m_btnPrev.SetPos( tv_Width  , tv_Height );
		m_btnPrev.SetWidth(m_nWidth/2-BTN_GAP);

	}	
	if( m_dwStyle & SLS_NEXT){
		tv_Width  = m_nWidth/2;
		m_btnNext.SetEnable( TRUE );
		m_btnNext.SetText( CTString( " >> " ) );
		m_btnNext.SetPos( tv_Width  , tv_Height );
		m_btnNext.SetWidth(m_nWidth/2-BTN_GAP);
		
	}
	/*
	// TEST 
	for(int i=0; i<24 ; i++)
	{
		SEL_LIST tv_sel;
		tv_sel.m_nIndex = i;
		tv_sel.m_nState = 0;
		tv_sel.m_sName	= "NAME";
		m_vSelList.push_back(tv_sel);
	}
	*/
	int tv_size = m_vSelList.size()/m_nMaxLine;
	int tv_left = m_vSelList.size()%m_nMaxLine;
	m_nPageAll = tv_left > 0 ? tv_size+1 : tv_size;

	CUIManager::getSingleton()->RearrangeOrder( UI_SELECTLIST, TRUE );
}
예제 #21
0
BOOL CModelerApp::SubInitInstance()
{
  char strIni[ 128];
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

  // settings will be saved into registry instead of ini file
  SetRegistryKey( "LastChaos");

	LoadStdProfileSettings(8);  // Load standard INI file options (including MRU)

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CMultiDocTemplate* pDocTemplate;
	m_pdtModelDocTemplate = pDocTemplate = new CMultiDocTemplate(
		IDR_MDLDOCTYPE,
		RUNTIME_CLASS(CModelerDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CModelerView));
	AddDocTemplate(pDocTemplate);
  
  m_pdtScriptTemplate = pDocTemplate = new CMultiDocTemplate(
		IDR_SCRIPTDOCTYPE,
		RUNTIME_CLASS(CScriptDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CScriptView));
	AddDocTemplate(pDocTemplate);

  // initialize engine, without network
  SE_InitEngine("");  // DO NOT SPECIFY NAME HERE!
  SE_LoadDefaultFonts();

	// create main MDI Frame window
	CMainFrame* pMainFrame = new CMainFrame;
	if( !pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE;
  m_pMainWnd = pMainFrame;
  
  // set main window for engine
  SE_UpdateWindowHandle( m_pMainWnd->m_hWnd);

	// Enable drag/drop open
	m_pMainWnd->DragAcceptFiles();

	// Enable DDE Execute open
	EnableShellOpen();
	RegisterShellFileTypes(TRUE);

  // load startup script
  _pShell->Execute( "include \"Scripts\\Modeler_startup.ini\"");
  
//안태훈 수정 시작	//(Modify Default API to D3D)(0.1)
  m_iApi=GAT_D3D;
  m_iApi=GetProfileInt("Display modes", "SED Gfx API", GAT_D3D);
//안태훈 수정 끝	//(Modify Default API to D3D)(0.1)
  // (re)set default display mode
  _pGfx->ResetDisplayMode((enum GfxAPIType) m_iApi);

  m_Preferences.ReadFromIniFile();

  // load background textures
  INDEX iWorkingTexturesCt = theApp.GetProfileInt( "Modeler prefs", 
                                                   "Modeler working textures count", -1);
  if( iWorkingTexturesCt != -1) {
    char strWTName[ 128];
    for( INDEX i=0; i<iWorkingTexturesCt; i++) {
      sprintf( strWTName, "Working texture %02d", i);
      INI_READ( strWTName, "Error in INI .file!");
      AddModelerWorkingTexture( CTString(strIni));
    }
  }
  // load working patches
  INDEX iWorkingPatchesCt = theApp.GetProfileInt( "Modeler prefs", 
                                                 "Modeler working patches count", -1);
  char strWPName[ 128];
  for( INDEX i=0; i<iWorkingPatchesCt; i++) {
    sprintf( strWPName, "Working patch %02d", i);
    INI_READ( strWPName, "Error in INI .file!");
    AddModelerWorkingPatch( CTString(strIni));
  }
  pMainFrame->m_StainsComboBox.Refresh();

  // create temporary directory to contain copy/paste mapping all
  CreateDirectory( _fnmApplicationPath + "Temp\\", NULL);
  
  // try to
  try
  { // load lamp model
    DECLARE_CTFILENAME( fnLampName, "Data\\Models\\Editor\\Lamp.mdl");
    m_pLampModelData = _pModelStock->Obtain_t( fnLampName);
    m_LampModelObject = new CModelObject;
    m_LampModelObject->SetData(m_pLampModelData);
    m_LampModelObject->SetAnim( 0);
    // load lamp's texture
    DECLARE_CTFILENAME( fnLampTex, "Data\\Models\\Editor\\SpotLight.tex");
    m_ptdLamp = _pTextureStock->Obtain_t( fnLampTex);
    m_LampModelObject->mo_toTexture.SetData( m_ptdLamp); 

    // load collision box model
    DECLARE_CTFILENAME( fnCollisionBox, "Data\\Models\\Editor\\CollisionBox.mdl");
    m_pCollisionBoxModelData = _pModelStock->Obtain_t( fnCollisionBox);
    m_pCollisionBoxModelObject = new CModelObject;
    m_pCollisionBoxModelObject->SetData(m_pCollisionBoxModelData);
    m_pCollisionBoxModelObject->SetAnim( 0);
    // load collision box's texture
    DECLARE_CTFILENAME( fnCollisionBoxTex, "Data\\Models\\Editor\\CollisionBox.tex");
    m_ptdCollisionBoxTexture = _pTextureStock->Obtain_t( fnCollisionBoxTex);
    m_pCollisionBoxModelObject->mo_toTexture.SetData( m_ptdCollisionBoxTexture); 

    // load floor model
    DECLARE_CTFILENAME( fnFloor, "Data\\Models\\Editor\\Floor.mdl");
    m_pFloorModelData = _pModelStock->Obtain_t( fnFloor);
    m_pFloorModelObject = new CModelObject;
    m_pFloorModelObject->SetData(m_pFloorModelData);
    m_pFloorModelObject->SetAnim( 0);
    // load collision box's texture
    DECLARE_CTFILENAME( fnFloorTex, "Data\\Models\\Editor\\Floor.tex");
    m_ptdFloorTexture = _pTextureStock->Obtain_t( fnFloorTex);
    m_pFloorModelObject->mo_toTexture.SetData( m_ptdFloorTexture); 

    DECLARE_CTFILENAME( fnShadowTex, "Data\\Textures\\Effects\\Shadow\\SimpleModelShadow.tex");
    // setup simple model shadow texture
    _toSimpleModelShadow.SetData_t( fnShadowTex);
  }
  catch( char *err_str)
  { // report error and continue without models
    AfxMessageBox( err_str);

    // if we allocated model object for collision box
    if( m_pCollisionBoxModelObject != NULL) {
      // delete it
      delete m_pCollisionBoxModelObject;
      m_pCollisionBoxModelObject = NULL;
    }
    // if we loaded collision box's texture
    if( m_ptdCollisionBoxTexture != NULL) {
      // release it and
      _pTextureStock->Release( m_ptdCollisionBoxTexture);
      m_ptdCollisionBoxTexture = NULL;
    }

    // if we loaded lamp's texture
    if( m_ptdLamp != NULL) {
      // release it and
      _pTextureStock->Release( m_ptdLamp);
      m_ptdLamp = NULL;
    }

    // if we allocated model object for floor
    if( m_pFloorModelObject != NULL) {
      // delete it
      delete m_pFloorModelObject;
      m_pFloorModelObject = NULL;
    }
    // if we loaded floor's texture
    if( m_ptdFloorTexture != NULL) {
      // release it and
      _pTextureStock->Release( m_ptdFloorTexture);
      m_ptdFloorTexture = NULL;
    }
  }

  // assign system font
  m_pfntFont = _pfdDisplayFont;

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

  if(CTString("")==CTString(cmdInfo.m_strFileName))
  {
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
  }
  else
  {
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileOpen;
  }
  // Dispatch commands specified on the command line
	if( !ProcessShellCommand(cmdInfo)) return FALSE;

	// The main window has been initialized, so show and update it.
  m_nCmdShow = SW_SHOWMAXIMIZED; // maximize main frame !!!
	pMainFrame->ShowWindow(m_nCmdShow);
	pMainFrame->UpdateWindow();

  // if stating modeler for the first time
  if( m_bFirstTimeStarted) {
    // call preferences
    OnFilePreferences();
  }
  
  return TRUE;
}
예제 #22
0
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUISelectList::Render()
{
	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

	// Set texture
	pDrawPort->InitTextureData( m_ptdBaseTexture );

	// Add render regions
	int	nX, nY;
	// Background
	// Top
	nX = m_nPosX + m_nWidth;
	nY = m_nPosY + 26;
	
	pDrawPort->AddTexture( m_nPosX, m_nPosY, nX, nY,
										m_rtBackTop.U0, m_rtBackTop.V0,
										m_rtBackTop.U1, m_rtBackTop.V1,
										0xFFFFFFFF );

	// Middle 1
	pDrawPort->AddTexture( m_nPosX, nY, nX, nY + m_nTextRegionHeight,
										m_rtBackMiddle1.U0, m_rtBackMiddle1.V0,
										m_rtBackMiddle1.U1, m_rtBackMiddle1.V1,
										0xFFFFFFFF );

	// Middle 2
	nY += m_nTextRegionHeight;
	pDrawPort->AddTexture( m_nPosX, nY, nX, m_nPosY + m_nHeight - 7,
										m_rtBackMiddle2.U0, m_rtBackMiddle2.V0,
										m_rtBackMiddle2.U1, m_rtBackMiddle2.V1,
										0xFFFFFFFF );

	// Bottom
	nY = m_nPosY + m_nHeight - 7;
	pDrawPort->AddTexture( m_nPosX, nY, nX, m_nPosY + m_nHeight,
										m_rtBackBottom.U0, m_rtBackBottom.V0,
										m_rtBackBottom.U1, m_rtBackBottom.V1,
										0xFFFFFFFF );

	
	
	// Registration
	if( m_dwStyle & SLS_REGIST )
		m_btnRegist.Render();

	// Reward
	if( m_dwStyle & SLS_REWARD )
		m_btnReward.Render();

	// Cancel button
	if( m_dwStyle & SLS_CANCEL )
		m_btnCancel.Render();

	// Prev button
	if( m_dwStyle & SLS_PREV )
		m_btnPrev.Render();

	// Next button
	if( m_dwStyle & SLS_NEXT )		
		m_btnNext.Render();



	// Render all elements
	pDrawPort->FlushRenderingQueue();

	// Title
	pDrawPort->PutTextEx( m_strTitle, m_nPosX + SELECTLIST_TITLE_TEXT_OFFSETX,
										m_nPosY + SELECTLIST_TITLE_TEXT_OFFSETY, 0xFFFFFFFF );

	// List strings
	int nLineCount;
	int tv_size = m_vSelList.size();
	int tv_page = m_nMaxLine*m_nPageCur;
	nLineCount = tv_size>(tv_page+m_nMaxLine) ? (tv_page+m_nMaxLine):tv_size ;
	CTString	tIdx,sName;
	nX = m_nPosX ;
	nY = m_nPosY + 30 ;

	for( int i = tv_page; i < nLineCount; i++ )
	{
		tIdx.PrintF("%d.",i+1);
		sName  = m_vSelList[i].m_sName;
	
		if( m_nSelLine == i ) m_selColor = 0x49A1FFFF;
		else m_selColor = 0xF2F2F2FF;
		pDrawPort->PutTextEx( tIdx, nX +15,	nY ,m_selColor);
		if(m_vSelList[i].m_nIndex == _pNetwork->MyCharacterInfo.index)  sName+=CTString("(Me)");
		pDrawPort->PutTextEx( sName, nX + 35,  nY ,m_selColor);
		pDrawPort->PutTextEx( m_pstrState[m_vSelList[i].m_nState], nX + 160, nY,m_selColor);
		nY += TEXT_GAP;

	}

	// Flush all render text queue
	pDrawPort->EndTextEx();

}
예제 #23
0
CTString operator+(const char *strFirst, const CTString &strSecond)
{
  ASSERT(strFirst!=NULL && strSecond.IsValid());

  return(CTString(strFirst)+=strSecond);
}
예제 #24
0
void CUIQuestBook::AddQuestListToMessageBoxL(const int& iMessageBoxType)
{
	CUIManager* pUIManager = CUIManager::getSingleton();
	Quest* pQuest = GAMEDATAMGR()->GetQuest();

	if (pQuest == NULL)
		return;

	int iQuestIndex = -1;
	CTString strQuestTitle;
	int count;

	count = pQuest->GetCompleteQuestCount();

	for( int iComplete = 0; iComplete < count; ++iComplete )
	{
		iQuestIndex = pQuest->GetCompleteQuestIndex(iComplete);

		CQuestDynamicData qdd(CQuestSystem::Instance().GetStaticData(iQuestIndex));				
		strQuestTitle = qdd.GetName();

		if( 0 == strQuestTitle.Length() )
		{
			if (_pNetwork->m_ubGMLevel > 1)
				strQuestTitle.PrintF("Index : %d", iQuestIndex);
			else
				continue;
		}

		pUIManager->AddMessageBoxLString( iMessageBoxType, FALSE, strQuestTitle, ciQuestClassifier + iQuestIndex, 0xF2F200FF, CTString("A") );
	}

	count = pQuest->GetProceedQuestCount();

	for( int iNew = 0; iNew < count; ++iNew )
	{
		iQuestIndex = pQuest->GetProceedQuestIndex(iNew);

		CQuestDynamicData qdd(CQuestSystem::Instance().GetStaticData(iQuestIndex));				
		strQuestTitle = qdd.GetName();

		if( 0 == strQuestTitle.Length() )
		{
			if (_pNetwork->m_ubGMLevel > 1)
				strQuestTitle.PrintF("Index : %d", iQuestIndex);
			else
				continue;
		}

		pUIManager->AddMessageBoxLString( iMessageBoxType, FALSE, strQuestTitle, ciQuestClassifier + iQuestIndex, 0xF2F200FF, CTString("Q") );
	}
}
예제 #25
0
void CUIPortal::updateUI()
{
	if (m_pList == NULL)
		return;

	m_pList->DeleteAllListItem();

	int nMax = m_vectorListInfo.size();

	if (nMax <= 0)
		return;

	CUIListItem* pTemp = m_pList->GetListItemTemplate();

	if (pTemp == NULL)
		return;

	CUIListItem* pItem = NULL;
	CUIText*	 pText = NULL;
	CTString	 strTemp;
	CDrawPort*  pDrawPort = CUIManager::getSingleton()->GetDrawPort();
		
	for( int i = 0; i < nMax; i++ )
	{
		m_pList->AddListItem(pTemp->Clone());

		pItem = (CUIListItem*)m_pList->GetListItem(i);

		if (pItem == NULL)
			return;

		{
			CmdPortalMouseEvent* pCmd = new CmdPortalMouseEvent;
			pCmd->setData(this, pItem, 0xF8E1B5FF);
			pItem->SetCommandEnter(pCmd);
		}

		{
			CmdPortalMouseEvent* pCmd = new CmdPortalMouseEvent;
			pCmd->setData(this, pItem, 0xC0C0C0FF);
			pItem->SetCommandLeave(pCmd);
		}

		pText = (CUIText*)pItem->findUI("txt_zone");

		if (pText != NULL)
		{
			strTemp.PrintF("%s", CZoneInfo::getSingleton()->GetZoneName( m_vectorListInfo[i].zone ) );

			ULONG nStringWidth = pDrawPort->GetTextWidth2(strTemp);
			if (nStringWidth > pText->GetWidth())
			{
				pText->setTooltip(strTemp);
				strTemp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTemp, pText->GetWidth(), CTString("..."));
			}			
			pText->SetText(strTemp);
		}

		pText = (CUIText*)pItem->findUI("txt_pos");

		if (pText != NULL)
		{
			strTemp.PrintF("%s", CZoneInfo::getSingleton()->GetExtraName( m_vectorListInfo[i].zone, m_vectorListInfo[i].extra ) );

			ULONG nStringWidth = pDrawPort->GetTextWidth2(strTemp);
			if (nStringWidth > pText->GetWidth())
			{
				pText->setTooltip(strTemp);
				strTemp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTemp, pText->GetWidth(), CTString("..."));
			}			
			pText->SetText(strTemp);
		}
	}

	m_pList->UpdateList();
}
예제 #26
0
void CUITrade::UpdateAmendConditionCount( int nAmendIndex )
{
	if (m_pList[eLIST_AMEND_CONDITION] == NULL)
		return;

	if (nAmendIndex < 0 && m_pList[eLIST_AMEND_ITEM] != NULL)
		nAmendIndex = m_pList[eLIST_AMEND_ITEM]->getCurSel();

	if (m_pBtnOk != NULL)
		m_pBtnOk->SetEnable(IsAmend(nAmendIndex) ? TRUE : FALSE);

	if (nAmendIndex < 0)
		return;

	stEventTrade* pTradeItem = CTradeItem::GetTradeItem(nAmendIndex);

	if (pTradeItem == NULL)
		return;

	CUIListItem* pItemTmp = NULL;

	int i;
	int nListCnt = m_pList[eLIST_AMEND_CONDITION]->getListItemCount();

	CUIText* pText = NULL;

	for (i = 0; i < DEF_CONDITION_ITEM_MAX; ++i)
	{
		if (pTradeItem->st_source_item[i].src_item_idx <= 0 || i > nListCnt)
			continue;

		pItemTmp = (CUIListItem*)m_pList[eLIST_AMEND_CONDITION]->GetListItem(i);

		if (pItemTmp == NULL)
			continue;

		COLOR	 strCol = 0x00FF21FF;

		int nMyItemCount = UIMGR()->GetInventory()->GetItemCount(pTradeItem->st_source_item[i].src_item_idx);

		if (CheckItem(nAmendIndex, i) == false)
			strCol = DEF_UI_COLOR_RED;

		if (pText = (CUIText*)pItemTmp->findUI("text_item_cnt"))
		{
			CTString strTmp;

			strTmp.PrintF("%d/%d", nMyItemCount, pTradeItem->st_source_item[i].src_item_cnt);
			pText->SetText(strTmp);
			pText->setFontColor(strCol);
		}

		if (pText = (CUIText*)pItemTmp->findUI("text_name"))
		{
			CTString strTmp = _pNetwork->GetItemName(pTradeItem->st_source_item[i].src_item_idx);

			strTmp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTmp, pText->GetWidth(), CTString("..."));

			pText->SetText(strTmp);
			pText->setFontColor(strCol);
		}
	}
}
예제 #27
0
void CUIQuestBook::UpdateQuestContent( int nQuestIdx )
{
	CUITooltipMgr::getSingleton()->setData(NULL);

	m_nSelectQuestIdx = nQuestIdx;

	std::map<int, CUIImage*>::iterator iter = m_mapQuestSelect.begin();
	std::map<int, CUIImage*>::iterator iter_end = m_mapQuestSelect.end();

	for (; iter != iter_end; ++iter)
	{
		(*iter).second->Hide(TRUE);
	}

	if (m_nSelectQuestIdx <= 0)
	{
		initContent();
		return;
	}

	std::map<int, CUIImage*>::iterator it = m_mapQuestSelect.find(m_nSelectQuestIdx);

	if (it != iter_end)
	{
		(*it).second->Hide(FALSE);
	}

	CQuestDynamicData* pQuestDD = CQuestSystem::Instance().GetDynamicDataByQuestIndex( m_nSelectQuestIdx );
	CQuestDynamicData qdd(CQuestSystem::Instance().GetStaticData(m_nSelectQuestIdx));

	if (GAMEDATAMGR()->GetQuest()->isRaidMessage(m_nSelectQuestIdx) == true)
	{		
		pQuestDD = &qdd;
	}

	// 타입 아이콘
	int nType[eICON_MAX];
	int nToolTipIdx[eICON_MAX];
	nType[eQUEST_TYPE1] = pQuestDD->GetQuestType1();
	nType[eQUEST_TYPE2] = pQuestDD->GetQuestType2();
	nType[eQUEST_SCALE] = pQuestDD->GetQuestPartyScale();

	nToolTipIdx[eQUEST_TYPE1] = nType1StringIdx[nType[eQUEST_TYPE1]];
	nToolTipIdx[eQUEST_TYPE2] = nType2StringIdx[nType[eQUEST_TYPE2]];
	nToolTipIdx[eQUEST_SCALE] = nScaleStringIdx[nType[eQUEST_SCALE]];

	CTString strTooltip;
	COLOR	tempColor;
	int		i;

	for (i = 0; i < eICON_MAX; i++)
	{		
		if(m_pImageArr[i] != NULL)
		{
			m_pImageArr[i]->SetRenderIdx(nType[i]);
			strTooltip.PrintF(_S(nToolTipIdx[i], "타입 툴팁"));
			m_pImageArr[i]->setTooltip(strTooltip.str_String);
			m_pImageArr[i]->Hide(FALSE);
		}
	}	

	// 퀘스트 이름
	if (m_ptbName != NULL)
	{
		tempColor = m_ptbName->GetTextColor();
		m_ptbName->SetAlignTextV(eALIGN_V_CENTER);
		m_ptbName->SetText( CTString(pQuestDD->GetName()), tempColor );
		m_ptbName->StringEllipsis(2);

		if (m_ptbName->IsEllipsis() == true)
		{
			m_ptbName->setTooltip(CTString(pQuestDD->GetName()));
		}
		else
		{
			m_ptbName->setTooltip(CTString(""));
		}
		m_ptbName->Hide(FALSE);
	}

	// List 내용
	if (m_plistContent == NULL)
		return;

	m_plistContent->Hide(FALSE);
	m_plistContent->DeleteAllListItem();
	m_vecOptionPrize.clear();

	if (m_plistScroll)
		m_plistScroll->SetScrollPos(0);

	CUITextBox* pTextBox = NULL;
	CUITextBox* pTempTb = NULL;
	CUIText* pText = NULL;
	CUIImage* pImg = NULL;
	CUIIcon* pIcon = NULL;
	CUIListItem* plistItem = NULL;
	CTString strTemp;

	// 1. Summury
	pTextBox = (CUITextBox*)m_pDesign->CloneSummury();

	if (pTextBox != NULL)
	{		
		pTextBox->SetText(CTString(pQuestDD->GetDesc3()));
		int nCnt = pTextBox->GetLineCount();

		for (i = 0; i < nCnt; ++i)
		{			
			pText = (CUIText*)m_pDesign->CloneSummuryText();

			if(pText != NULL)
			{
				strTemp = pTextBox->GetLineString(i);
				pText->SetText(strTemp);
				m_plistContent->AddListItem(pText);
			}
		}

		SAFE_DELETE(pTextBox);
		pText = (CUIText*)m_pDesign->CloneSpace();
		if (pText != NULL)
		{
			m_plistContent->AddListItem(pText);
		}
	}

	// 2. 진행 상황
	plistItem = (CUIListItem*)m_pDesign->CloneTitle();

	if (plistItem != NULL)
	{
		strTemp.PrintF(_S(1703, "진행상황"));
		pText = (CUIText*)plistItem->findUI("str_copytitle");

		if (pText != NULL)
			pText->SetText(strTemp);

		m_plistContent->AddListItem(plistItem);
	}

	// 진행 상황 내용
	int count = pQuestDD->GetCountStatusDesc();

	for (int index = 0; index < count; index++)
	{
		pTextBox = (CUITextBox*)m_pDesign->CloneDesc();

		if (pTextBox != NULL)
		{
			if (index != 0 && index % 2 == 1)
				tempColor = 0xFF0000FF;
			else
				tempColor = pTextBox->GetTextColor();

			pTextBox->SetText(CTString(pQuestDD->GetStatusDesc(index)), tempColor, TRUE);
			int nCnt = pTextBox->GetLineCount();

			for (i = 0; i < nCnt; ++i)
			{			
				pTempTb = (CUITextBox*)m_pDesign->CloneDesc();
				if(pTempTb != NULL)
				{
					strTemp = pTextBox->GetLineString(i);
					pTempTb->SetText(strTemp, tempColor, TRUE);
					m_plistContent->AddListItem(pTempTb);
				}
			}
			SAFE_DELETE(pTextBox);
		}
	}

	pText = (CUIText*)m_pDesign->CloneSpace();
	if (pText != NULL)
	{
		m_plistContent->AddListItem(pText);
	}

	// 3. Npc
	plistItem = (CUIListItem*)m_pDesign->CloneTitle();

	if (plistItem != NULL)
	{
		int NpcIdx = pQuestDD->GetPrizeNPCIndex();
		// Name
		if (NpcIdx > 0)
		{
			CMobData* pNpc = CMobData::getData(NpcIdx);
			strTemp.PrintF("%s", pNpc->GetName());
		}
		else
		{
			strTemp.PrintF(_S(457, "시스템"));
		}		
			
		pText = (CUIText*)plistItem->findUI("str_copytitle");

		if (pText != NULL)
			pText->SetText(strTemp);

		m_plistContent->AddListItem(plistItem);
	}

	// 4. StartDesc
	pTextBox = (CUITextBox*)m_pDesign->CloneDesc();

	if (pTextBox != NULL)
	{
		pTextBox->SetText(CTString(pQuestDD->GetDesc()));

		int nCnt = pTextBox->GetLineCount();

		for (i = 0; i < nCnt; ++i)
		{			
			pText = (CUIText*)m_pDesign->CloneDescText();

			if(pText != NULL)
			{
				strTemp = pTextBox->GetLineString(i);
				pText->SetText(strTemp);
				m_plistContent->AddListItem(pText);
			}
		}
		
		SAFE_DELETE(pTextBox);
		pText = (CUIText*)m_pDesign->CloneSpace();
		if (pText != NULL)
		{
			m_plistContent->AddListItem(pText);
		}
	}

	// 5. 수행가능 레벨
	plistItem = (CUIListItem*)m_pDesign->CloneTitle();

	if (plistItem != NULL)
	{
		strTemp.PrintF(_S( 1704, "수행가능 레벨" ));

		pText = (CUIText*)plistItem->findUI("str_copytitle");

		if (pText != NULL)
			pText->SetText(strTemp);

		m_plistContent->AddListItem(plistItem);
	}

	// 6. 레벨 값	
	pTextBox = (CUITextBox*)m_pDesign->CloneDesc();

	if (pTextBox != NULL)
	{
		if(pQuestDD->GetNeedMinLevel() == pQuestDD->GetNeedMaxLevel())
		{
			strTemp.PrintF(_S( 1705, "레벨 %d" ), pQuestDD->GetNeedMinLevel());
		}
		else if(pQuestDD->GetNeedMaxLevel()==999)
		{
			strTemp.PrintF(_S( 5667, "레벨 : %d ~ MAX" ), pQuestDD->GetNeedMinLevel());
		}
		else
		{
			strTemp.PrintF(_S( 1706, "레벨 %d ~ 레벨 %d" ), pQuestDD->GetNeedMinLevel(), pQuestDD->GetNeedMaxLevel());
		}

		pTextBox->SetText(strTemp);
		int nCnt = pTextBox->GetLineCount();

		for (i = 0; i < nCnt; ++i)
		{			
			pText = (CUIText*)m_pDesign->CloneDescText();
			if(pText != NULL)
			{
				strTemp = pTextBox->GetLineString(i);
				pText->SetText(strTemp);
				m_plistContent->AddListItem(pText);
			}
		}
		SAFE_DELETE(pTextBox);
		pText = (CUIText*)m_pDesign->CloneSpace();
		if (pText != NULL)
		{
			m_plistContent->AddListItem(pText);
		}
	}

	// 7. 퀘스트 보상	
	// 고정보상
	if(pQuestDD->IsPrizeExist())
	{
		// 보상 타이틀
		plistItem = (CUIListItem*)m_pDesign->CloneTitle();

		if (plistItem != NULL)
		{
			pText = (CUIText*)plistItem->findUI("str_copytitle");

			if (pText != NULL)
				pText->SetText(pQuestDD->GetPrizeDesc( 0 ));

			m_plistContent->AddListItem(plistItem);
		}

		// 보상 아이템		
		CUIImageBox* pImgBox = new CUIImageBox;
		int Count = pQuestDD->GetCountPrizeDesc();

		for( INDEX i = 1; i < Count; ++i )
		{
			plistItem = (CUIListItem*)m_pDesign->CloneListItem();

			if (plistItem == NULL)
				continue;

			// 아이템 설명
			CTString strPrize = pQuestDD->GetPrizeDesc( i );
			bool bIcon = true;
			UIBtnExType eBtnType = UBET_ITEM;

			pTextBox = (CUITextBox*)plistItem->findUI("tb_copyComplete");

			if (pTextBox != NULL)
			{
				tempColor = pTextBox->GetTextColor();
				pTextBox->SetText(strPrize, tempColor, TRUE);
			}

			// 아이콘인지, 이미지 인지 결정
			switch (pQuestDD->GetPrizeType(i-1) )
			{
			case QPRIZE_ITEM:
				eBtnType = UBET_ITEM;
				break;
			case QPRIZE_SKILL:
			case QPRIZE_SSKILL:
				eBtnType = UBET_SKILL;
				break;
			default:
				bIcon = false;
				break;
			}

			pIcon = (CUIIcon*)plistItem->findUI("icon_copyItem");
			pImg = (CUIImage*)plistItem->findUI("img_copyitem");

			// 아이템
			if (bIcon == true)
			{			
				if (pIcon != NULL)
				{
					pIcon->setData(eBtnType, pQuestDD->GetPrizeIndex(i-1));
					pIcon->Hide(FALSE);
				}
			}
			else
			{
				if (pImg != NULL)
				{					
					pImgBox->SetImageByType(CUIImageBox::eImageType(pQuestDD->GetPrizeType(i-1)), pQuestDD->GetPrizeIndex(i-1), pQuestDD->GetSyndicateType());
					UIRectUV pUv = pImgBox->GetUV();
					pImg->setTexData( _pUIBtnTexMgr->GetTex( UIBtnExType(pImgBox->GetBtnType()), pImgBox->GetTextureID() ));					
					pImg->SetUV(pUv.U0, pUv.V0, pUv.U1, pUv.V1);
					pImg->Hide(FALSE);
				}
			}

			m_plistContent->AddListItem(plistItem);
		}

		if (pImgBox)
		{
			delete pImgBox;
			pImgBox = NULL;
		}
	}

	//선택 보상
	if(pQuestDD->IsOptionPrizeExist())
	{
		// 보상 타이틀
		plistItem = (CUIListItem*)m_pDesign->CloneTitle();

		if (plistItem != NULL)
		{
			pText = (CUIText*)plistItem->findUI("str_copytitle");

			if (pText != NULL)
				pText->SetText(pQuestDD->GetOptionPrizeDesc(0));

			m_plistContent->AddListItem(plistItem);
		}

		// 보상 아이템		
		CUIImageBox* pImgBox = new CUIImageBox;
		int Count = pQuestDD->GetCountOptionPrizeDesc();

		for( INDEX i = 1; i < Count; ++i )
		{
			plistItem = (CUIListItem*)m_pDesign->CloneListItem();

			if (plistItem == NULL)
				continue;

			// 아이템 설명
			CTString strPrize = pQuestDD->GetOptionPrizeDesc( i );
			bool bIcon = true;
			UIBtnExType eBtnType = UBET_ITEM;

			pTextBox = (CUITextBox*)plistItem->findUI("tb_copyComplete");

			if (pTextBox != NULL)
			{
				tempColor = pTextBox->GetTextColor();
				pTextBox->SetText(strPrize, tempColor, TRUE);
			}

			// 아이콘인지, 이미지 인지 결정
			switch (pQuestDD->GetOptionPrizeType(i-1) )
			{
			case QPRIZE_ITEM:
				eBtnType = UBET_ITEM;
				break;
			case QPRIZE_SKILL:
			case QPRIZE_SSKILL:
				eBtnType = UBET_SKILL;
				break;
			default:
				bIcon = false;
				break;
			}

			pIcon = (CUIIcon*)plistItem->findUI("icon_copyItem");
			pImg = (CUIImage*)plistItem->findUI("img_copyitem");

			// 아이템
			if (bIcon == true)
			{			
				if (pIcon != NULL)
				{
					pIcon->setData(eBtnType, pQuestDD->GetOptionPrizeIndex(i-1));
					pIcon->Hide(FALSE);
				}
			}
			else
			{
				if (pImg != NULL)
				{					
					pImgBox->SetImageByType(CUIImageBox::eImageType(pQuestDD->GetOptionPrizeType(i-1)), pQuestDD->GetOptionPrizeIndex(i-1), pQuestDD->GetSyndicateType());
					UIRectUV pUv = pImgBox->GetUV();
					pImg->setTexData( _pUIBtnTexMgr->GetTex( UIBtnExType(pImgBox->GetBtnType()), pImgBox->GetTextureID() ));					
					pImg->SetUV(pUv.U0, pUv.V0, pUv.U1, pUv.V1);
					pImg->Hide(FALSE);
				}
			}

			pImg = (CUIImage*)plistItem->findUI("img_selectItem");

			if (pImg != NULL)
				m_vecOptionPrize.push_back(pImg);

			CmdQuestBookPrizeItemSet* pCmd = new CmdQuestBookPrizeItemSet;
			pCmd->setData(this, i - 1);
			plistItem->SetCommandUp(pCmd);

			m_plistContent->AddListItem(plistItem);
		}

		if (pImgBox)
		{
			delete pImgBox;
			pImgBox = NULL;
		}
	}

	int nMaxItem = m_plistContent->getListItemCount();
	m_plistContent->UpdateScroll(nMaxItem);
	m_plistContent->UpdateList();

	int nShowCnt = m_plistContent->GetItemShowNum();

	if (m_plistScroll != NULL)
		m_plistScroll->SetItemsPerPage(nShowCnt);

	if (m_pbtnGiveUp != NULL)
		m_pbtnGiveUp->SetEnable(TRUE);

	if (pQuestDD->GetPrizeNPCIndex() == 0 && GAMEDATAMGR()->GetQuest()->IsCompleteQuest(pQuestDD->GetQuestIndex()))
	{
		if (m_pbtnOk != NULL)
			m_pbtnOk->SetEnable(TRUE);
	}
}
예제 #28
0
BOOL CModelerDoc::OnSaveDocument(LPCTSTR lpszPathName) 
{
  CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
	//return CDocument::OnSaveDocument(lpszPathName);
  CTFileName fnModelFile = CTString(lpszPathName);
  try
  {
    fnModelFile.RemoveApplicationPath_t();
  }
  catch( char *err_str)
  {
    AfxMessageBox( err_str);
    return FALSE;
  }

#if BUILD_PUBLISHER
  WarningMessage(
    "Saving is disabled in this version!");
  return FALSE;
#else
  try
  {
  	m_emEditModel.Save_t( fnModelFile);
    m_emEditModel.SaveMapping_t( fnModelFile.NoExt()+".map", 0);
  }
  catch( char *err_str)
  {
    MessageBoxA(pMainFrame->m_hWnd, err_str, "Warning! Model Save failed.", MB_OK|MB_ICONHAND|MB_SYSTEMMODAL);
    return FALSE;
  }
  SetModifiedFlag( FALSE);

  CModelerView *pModelerView = CModelerView::GetActiveView();
  if( pModelerView != NULL)
  {
    pModelerView->SaveThumbnail();
  }

  // reload attachments of all loaded models 
  POSITION pos = theApp.m_pdtModelDocTemplate->GetFirstDocPosition();
  while (pos!=NULL)
  {
    CModelerDoc *pmdCurrent = (CModelerDoc *)theApp.m_pdtModelDocTemplate->GetNextDoc(pos);
    if( pmdCurrent != this)
    {
      BOOL bUpdateAttachments = TRUE;
      
      // if document is modified
      if( pmdCurrent->IsModified())
      {
        CTString strMessage;
        CTFileName fnDoc = CTString(pmdCurrent->GetPathName());
        strMessage.PrintF("Do you want to save model \"%s\" before reloading its attachments?", fnDoc.FileName() );
        if( ::MessageBox( pMainFrame->m_hWnd, strMessage,
                        "Warning !", MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON1 | 
                        MB_TASKMODAL | MB_TOPMOST) != IDYES)
        {
          bUpdateAttachments = FALSE;
        }
        // save document
        else
        {
          pmdCurrent->OnSaveDocument(pmdCurrent->GetPathName());
        }
      }

      if( bUpdateAttachments)
      {
        POSITION pos = pmdCurrent->GetFirstViewPosition();
        while (pos != NULL)
        {
          CView* pView = GetNextView(pos);
          ((CModelerView *)pView)->m_ModelObject.AutoSetAttachments();
          
          //CModelData *pmd = (CModelData *) ((CModelerView *)pView)->m_ModelObject.GetData();
          //pmd->Reload();
        }
      }
    }
  }


  return TRUE;
#endif
}
예제 #29
0
// ----------------------------------------------------------------------------
// Name : Create()
// Desc :
// ----------------------------------------------------------------------------
void CUICompound::Create( CUIWindow *pParentWnd, int nX, int nY, int nWidth, int nHeight )
{
	CUIWindow::Create(pParentWnd, nX, nY, nWidth, nHeight);

	_iMaxMsgStringChar = 187 / ( _pUIFontTexMgr->GetFontWidth() + _pUIFontTexMgr->GetFontSpacing() );

	// Region of each part
	m_rcTitle.SetRect( 0, 0, 216, 22 );
	
	m_rcItemSlot[0].SetRect( 66, 0, 66 + COMPOUND_ITEM_SLOT_SIZE, 0 );
	m_rcItemSlot[1].SetRect( 116, 0, 116 + COMPOUND_ITEM_SLOT_SIZE, 0 );
	m_rcItemSlot[2].SetRect( 91, 0, 91 + COMPOUND_ITEM_SLOT_SIZE, 0 );

	m_rcInsertItem.SetRect( 3, 0, 213, 0 );

	// Create Compound texture
	m_ptdBaseTexture = CreateTexture( CTString( "Data\\Interface\\MessageBox.tex" ) );
	FLOAT	fTexWidth	= m_ptdBaseTexture->GetPixWidth();
	FLOAT	fTexHeight	= m_ptdBaseTexture->GetPixHeight();

	// UV Coordinate of each part
	// Background
	m_rtTop.SetUV( 0, 0, 216, 26, fTexWidth, fTexHeight );
	m_rtMiddle1.SetUV( 0, 31, 216, 33, fTexWidth, fTexHeight );
	m_rtMiddle2.SetUV( 0, 35, 216, 37, fTexWidth, fTexHeight );
	m_rtBottom.SetUV( 0, 38, 216, 45, fTexWidth, fTexHeight );
	m_rtItemSlot.SetUV( 0, 68, 34, 102, fTexWidth, fTexHeight );

	// Close button
	m_btnClose.Create( this, CTString( "" ), 184, 4, 14, 14 );
	m_btnClose.SetUV( UBS_IDLE, 219, 0, 233, 14, fTexWidth, fTexHeight );
	m_btnClose.SetUV( UBS_CLICK, 234, 0, 248, 14, fTexWidth, fTexHeight );
	m_btnClose.CopyUV( UBS_IDLE, UBS_ON );
	m_btnClose.CopyUV( UBS_IDLE, UBS_DISABLE );

	// OK button
	m_btnOK.Create( this, _S( 191, "확인" ), 36, 154, 63, 21 );					
	m_btnOK.SetUV( UBS_IDLE, 0, 46, 63, 67, fTexWidth, fTexHeight );
	m_btnOK.SetUV( UBS_CLICK, 66, 46, 129, 67, fTexWidth, fTexHeight );
	m_btnOK.CopyUV( UBS_IDLE, UBS_ON );
	m_btnOK.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Cancel button
	m_btnCancel.Create( this, _S( 139, "취소" ), 117, 154, 63, 21 );
	m_btnCancel.SetUV( UBS_IDLE, 0, 46, 63, 67, fTexWidth, fTexHeight );
	m_btnCancel.SetUV( UBS_CLICK, 66, 46, 129, 67, fTexWidth, fTexHeight );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_ON );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Add string
	AddString( _S( 724, "합성할 일반제련석, 악세사리, 마법가루를 인벤토리에서 선택하여 넣어주십시오." ) );

	// Set region of slot item & money...
	int	nNewHeight = COMPOUND_DESC_TEXT_SY + ( m_nStringCount + 1 ) * _pUIFontTexMgr->GetLineHeight();
		
	m_rcItemSlot[0].Top = nNewHeight;
	m_rcItemSlot[0].Bottom = m_rcItemSlot[0].Top + COMPOUND_ITEM_SLOT_SIZE;

	m_rcItemSlot[1].Top = nNewHeight;
	m_rcItemSlot[1].Bottom = m_rcItemSlot[1].Top + COMPOUND_ITEM_SLOT_SIZE;

	nNewHeight += 12 + COMPOUND_ITEM_SLOT_SIZE;

	m_rcItemSlot[2].Top = nNewHeight;
	m_rcItemSlot[2].Bottom = m_rcItemSlot[2].Top + COMPOUND_ITEM_SLOT_SIZE;

	nNewHeight += COMPOUND_ITEM_SLOT_SIZE + _pUIFontTexMgr->GetLineHeight();
	m_nTextRegionHeight = nNewHeight - COMPOUND_DESC_TEXT_SY + 8;

	m_rcInsertItem.Top = COMPOUND_DESC_TEXT_SY;
	m_rcInsertItem.Bottom = nNewHeight;

	nNewHeight += 6;
	m_btnOK.SetPosY( nNewHeight );
	m_btnCancel.SetPosY( nNewHeight );

	nNewHeight += m_btnOK.GetHeight() + 7;
	SetHeight( nNewHeight );

	// Slot item button
	for (int i  = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++)
	{
		//m_pIconSlot[i].Create( this, m_rcItemSlot[i].Left + 1, m_rcItemSlot[i].Top + 1, BTN_SIZE, BTN_SIZE, UI_COMPOUND, UBET_ITEM );
		m_pIconSlot[i] = new CUIIcon();
		m_pIconSlot[i]->Create(this, m_rcItemSlot[i].Left + 1, m_rcItemSlot[i].Top + 1, BTN_SIZE, BTN_SIZE, UI_COMPOUND, UBET_ITEM);
	}
}
예제 #30
0
void CUITrade::UpdateItemList()
{
	if (m_pList[eLIST_AMEND_ITEM] == NULL)
		return;

	m_pList[eLIST_AMEND_ITEM]->DeleteAllListItem();

	int i = 0, max = CTradeItem::GetItemCount();

	if (max < 0)
		return;

	int nItemCnt = m_pList[eLIST_AMEND_ITEM]->getListItemCount();

	CUIListItem* pItem = m_pList[eLIST_AMEND_ITEM]->GetListItemTemplate();
	CUIListItem* pItemTmp = NULL;

	CUIIcon* pIcon = NULL;
	CUIText* pText = NULL;
	stEventTrade* pTradeItem = NULL;

	for (i = 0; i < max; ++i)
	{
		pTradeItem = CTradeItem::GetTradeItem(i);

		if (pTradeItem == NULL || pTradeItem->result_itemIndex <= 0)
			continue;

		if (nItemCnt <= i)
			m_pList[eLIST_AMEND_ITEM]->AddListItem(pItem->Clone());

		pItemTmp = (CUIListItem*)m_pList[eLIST_AMEND_ITEM]->GetListItem(i);

		if (pItemTmp == NULL)
			continue;

		CmdSelectItem* pCmd = new CmdSelectItem;
		pCmd->setData(this, i);
		pItemTmp->SetCommand(pCmd);

		if (pIcon = (CUIIcon*)pItemTmp->findUI("icon_item"))
		{
			pIcon->setData(UBET_ITEM, pTradeItem->result_itemIndex);
		}

		if (pText = (CUIText*)pItemTmp->findUI("text_name"))
		{
			CTString strTmp = _pNetwork->GetItemName(pTradeItem->result_itemIndex);

			strTmp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTmp, pText->GetWidth(), CTString("..."));

			pText->SetText(strTmp);
		}
	}

	m_pList[eLIST_AMEND_ITEM]->setCurSel(-1);
	m_pList[eLIST_AMEND_ITEM]->UpdateList();

	UpdateAmendItem(-1);
	UpdateAmendCondition(-1);
}