Beispiel #1
0
void CWorld::loadCombo()
{
	CTString fnTemp; 
	CTString strFullPath = _fnmApplicationPath.FileDir();

	static BOOL bComboData = TRUE;

	if (m_bLoad == FALSE && !_bWorldEditorApp && bComboData)
	{
		CallProgressHook_t(0.0f);

		CTString tMissionCaseLoc;
		switch( g_iCountry )
		{
		case THAILAND:
			tMissionCaseLoc.PrintF("data\\combo_th.lod");
			break;
		default:
			tMissionCaseLoc.PrintF("data\\combo.lod");
			break;
		}
		fnTemp = strFullPath + tMissionCaseLoc;
		if(CMissionCase::loadEx(fnTemp) == false)
		{
			MessageBox(NULL, "combo file is not correct", "Error!", MB_OK);
			_pGameState->Running() = FALSE;
			_pGameState->QuitScreen() = FALSE;
		}
		CallProgressHook_t(1.0f);
		LoadStringCombo();

		bComboData = FALSE;
	}
}
Beispiel #2
0
void CWorld::loadSetItemData()
{
	CTString fnTemp; 
	CTString strFullPath = _fnmApplicationPath.FileDir();
	static BOOL bSetItemLoad = TRUE;

	//[ttos_2009_5_22]: 세트 아이템 적용
	if (m_bLoad == FALSE && !_bWorldEditorApp && bSetItemLoad)
	{
		CallProgressHook_t(0.0f);

		CTString tSetItemDataLoc;
		switch( g_iCountry )
		{
		case THAILAND:
			tSetItemDataLoc.PrintF("data\\setItemALL_th.lod");
			break;
		default:
			tSetItemDataLoc.PrintF("data\\setItemALL.lod");
			break;		
		}
		fnTemp = strFullPath + tSetItemDataLoc;
		if(CSetItemData::loadSetItemEx(fnTemp) == false)
		{
			MessageBox(NULL, "SetItem file is not correct", "Error!", MB_OK);
			_pGameState->Running() = FALSE;
			_pGameState->QuitScreen() = FALSE;
		}
		CallProgressHook_t(1.0f);
		LoadStringItemSet();
		bSetItemLoad = FALSE;
	}
}
Beispiel #3
0
void CWorld::loadBigpet()
{
	CTString fnTemp; 
	CTString strFullPath = _fnmApplicationPath.FileDir();

	static BOOL bAPetdata = TRUE;

	if (m_bLoad == FALSE && !_bWorldEditorApp && bAPetdata)
	{
		CallProgressHook_t(0.0f);

		CTString tWildPetDataLoc;
		switch( g_iCountry )
		{
		case THAILAND:
			tWildPetDataLoc.PrintF("data\\bigpet_th.lod");
			break;	
		default:
			tWildPetDataLoc.PrintF("data\\bigpet.lod");
			break;
		}
		fnTemp = strFullPath + tWildPetDataLoc;
		if(CWildPetData::loadEx(fnTemp) == false)
		{
			MessageBox(NULL, "Apet file is not correct", "Error!", MB_OK);
			_pGameState->Running() = FALSE;
			_pGameState->QuitScreen() = FALSE;
		}
		bAPetdata = FALSE;
		CallProgressHook_t(1.0f);
	}
}
void ExecScript(const CTString &str)
{
  CPrintF("Executing: '%s'\n", str);
  CTString strCmd;
  strCmd.PrintF("include \"%s\"", str);
  _pShell->Execute(strCmd);
}
void CUICharacterCreateNew::SetArrayList(CUIArray* pArray)
{
	CUIArrayItem* pArrayItem = NULL;

	if (pArray == NULL)
		return;

	int count = pArray->GetArrayChildCount();

	CUIText* pText;

	for (int i = 0; i < count; i++)
	{
		pArrayItem = pArray->GetArrayItem(i);

		if ( pArrayItem == NULL )
			continue;

		pText = (CUIText*)pArrayItem->findUI("str_number");

		if (pText != NULL)
		{
			CTString strNum = "";
			strNum.PrintF( "%d", i+1 );
			pText->SetText(strNum);
		}
	}
}
Beispiel #6
0
void CStageGamePlay::Run()
{
    CUIManager* pUIManager = CUIManager::getSingleton();

    if (_pGameState->IsRestartGame() && m_bSendRestart == false)
    {
        DWORD	tmpTime			= _pTimer->GetHighPrecisionTimer().GetMilliseconds();
        DWORD	IntervalTime	= 0;
        int		iShowTime		= 0;
        CTString strtime;

        IntervalTime = tmpTime - pUIManager->GetSystemMenu()->GetRestartTime();
        iShowTime = m_dwRemainTime - (IntervalTime / 1000);

        strtime.PrintF(_S(4201,"%d 초 후에 접속종료됩니다."), iShowTime);

        if (m_dwRemainTime > 0)
            _UIAutoHelp->SetGMNotice(strtime);

        if (IntervalTime >= (m_dwRemainTime * 1000)) // 15초  15000 -> 10초로 수정
        {   // 재시작
            _UIAutoHelp->ClearGMNNotice();
            pUIManager->GetSystemMenu()->ResetRestartTime();
            pUIManager->GetSystemMenu()->ReStartNow();
            m_bSendRestart = true;
        }
    }
}
Beispiel #7
0
void CInfo::AddString( const char* pszTxt, DWORD color, HNODE hFont, UINT uFormat )
{
	if( pszTxt == NULL )
	{
		Clear();		
		return;
	}

	SIZE sizeString = getFontTextExtent( hFont, pszTxt );

	m_iHeight += 18;//sizeString.cy + 5;

	if( m_iWidth < sizeString.cx + 5)
		m_iWidth = sizeString.cx + 5;

	if( strlen( pszTxt ) > m_uMaxSizeString )
		m_uMaxSizeString = strlen( pszTxt );


	CTString String;
	String.SetColor( color );
	String.SetString( pszTxt );
	String.SetFormat( uFormat );
	String.SetFont( hFont );
	m_listString.push_back( String );	
	AdjustPosition();
}
// ----------------------------------------------------------------------------
// Name : AddString()
// Desc : 
// ----------------------------------------------------------------------------
void CUIPetItemMix::AddString ( CTString& strText, COLOR colText )
{
	int nLength =  strText.Length();

	if( nLength >= _iMaxMsgStringChar )
	{
		nLength -= nLength - _iMaxMsgStringChar;
		
		do
		{
			if ( strText[nLength] == ' ' )
			{
				break;
			}

		} while ( nLength-- );

		CTString strTemp2, strTemp;

		strText.Split( nLength, strTemp2, strTemp );
		m_lbPreconditionDesc.AddString ( 0, strTemp2, colText );

		strTemp2.PrintF ( "%s", strTemp );
		
		m_lbPreconditionDesc.AddString ( 0, strTemp2, colText );

	}
	else 
	{
		m_lbPreconditionDesc.AddString ( 0, strText, colText );
	}

}
CTString CUIQuestBook::MakeTitleString(CTString strTitle, int iSplitPos)
{
	if( strTitle.Length() <= iSplitPos )
		return strTitle;

	BOOL b2ByteChar = FALSE;

	for( int iPos = 0; iPos < iSplitPos; ++iPos )
	{
		if( strTitle[iPos] & 0x80 )
			b2ByteChar = !b2ByteChar;
		else
			b2ByteChar = FALSE;
	}

	if( b2ByteChar )
		iSplitPos--;

	CTString	strTemp, strTemp2;
	strTitle.Split( iSplitPos, strTemp, strTemp2 );

	strTemp += _s("...");

	return strTemp;
}
Beispiel #10
0
void CUIPortal::Create_SiegeDungeon_HuntingCtr_MsgBox(int nCurFree)
{
	CUIManager* pUIManager = CUIManager::getSingleton();

	if( pUIManager->DoesMessageBoxExist(MSGCMD_SIEGE_DUNGEON_HUNTING_FEE_CONTROL) )
		pUIManager->CloseMessageBox(MSGCMD_SIEGE_DUNGEON_HUNTING_FEE_CONTROL);

	CTString strMessage;
	CUIMsgBox_Info	MsgBoxInfo;

	MsgBoxInfo.SetMsgBoxInfo( _S(3935, "던전 수렵세율 조정" ), UMBS_OKCANCEL | UMBS_SPINBUTTON , UI_PORTAL, MSGCMD_SIEGE_DUNGEON_HUNTING_FEE_CONTROL, 300 );
	
	MsgBoxInfo.AddString( _S(3936, "던전 내의 몬스터가 드롭하는 나스 중 수렵세율만큼의 나스가 성주길드의 세금으로 지급됩니다.") );
	MsgBoxInfo.AddString( _S(3937, "던전의 수렵세율을 설정해주세요.") );
	CTString strMsg;
	strMsg.PrintF(_S(3938, "현재 수렵세율은 %d%%입니다."), nCurFree);
	MsgBoxInfo.AddString(strMsg);
	++MsgBoxInfo.m_nMaxRow;

	MsgBoxInfo.SetSpinButton(MsgBoxInfo.m_nMaxRow, 1, -1, _S(3939, "수렵세율%") + _s("   "));

	pUIManager->CreateMessageBox( MsgBoxInfo );

	for(int i=0; i<5; ++i)
	{
		CTString strData;
		strData.PrintF("%d", i*5);
		pUIManager->GetMessageBox(MSGCMD_SIEGE_DUNGEON_HUNTING_FEE_CONTROL)->GetSpinButton().AddData(strData);
	}
}
WMSG_RESULT CUISpinControl::OnCharMessage( MSG* pMsg )
{
	extern UBYTE	_abKeysPressed[256];

	// If editbox is not focused
	if( !IsFocused() || m_InValidEditBox )
		return WMSG_FAIL;

	if(m_bOnlyInteger && (pMsg->wParam < 48 || pMsg->wParam > 57))
	{
		return WMSG_SUCCESS;
	}

	InsertChar(m_nCursorIndex, pMsg->wParam);

	if (_atoi64(GetString()) > m_llMax)
	{
		CTString strTmp;
		strTmp.PrintF("%I64d", m_llMax);

		SetString(strTmp.str_String);
	}

	return WMSG_SUCCESS;
}
void CUIQuestBook::OpenTutorialWindow()
{
	CUIManager* pUIManager = CUIManager::getSingleton();

	// If this is alreay exist.
	if( pUIManager->DoesMessageBoxLExist( MSGLCMD_QUEST_TUTORIAL_OPEN ) )
		return;

	pUIManager->CloseMessageBox(MSGCMD_QUEST_TUTORIAL_START);
	pUIManager->CloseMessageBox(MSGCMD_QUEST_TUTORIAL_CANCEL);

	// Create refine message box.
	pUIManager->CreateMessageBoxL( _S( 928,"튜토리얼" ), UI_QUESTBOOK_LIST, MSGLCMD_QUEST_TUTORIAL_OPEN );

	pUIManager->AddMessageBoxLString( MSGLCMD_QUEST_TUTORIAL_OPEN, TRUE, _S( 928, "튜토리얼" ), -1, 0xE18600FF );
	pUIManager->AddMessageBoxLString( MSGLCMD_QUEST_TUTORIAL_OPEN, TRUE, _S( 5039, "라스트카오스에 오신것을 환영합니다.\n이곳은 처음 접속하시는 유저분들을 위해\n기본 조작 방법을 안내하는 곳입니다.\n\n앞에 있는 문을 열고 통로를 따라가시면 각종\n몬스터가 등장하고, 통로 끝에 존재하는 몬스터를\n사냥하면 쥬노 란돌 마을로 이동하실 수 있습니다." ), -1, 0xA3A1A3FF );

	CTString strMessage;

	// accept
	strMessage.PrintF( _S( 5040, "확인 (튜토리얼을 진행합니다.)" ) );
	pUIManager->AddMessageBoxLString( MSGLCMD_QUEST_TUTORIAL_OPEN, FALSE, strMessage, RESPONSE_OK );

	// cancel.
	strMessage.PrintF( _S( 5041, "나가기 (튜토리얼을 진행하지 않습니다.)") );
	pUIManager->AddMessageBoxLString( MSGLCMD_QUEST_TUTORIAL_OPEN, FALSE, strMessage, RESPONSE_CALCEL );
}
Beispiel #13
0
void CUITrackPopup::DeleteMenuList( int nCol, int nIndex )
{
	CTString strMenu =GetString(nCol, nIndex);

	RemoveString(nIndex, nCol);	

	// 해당 라인의 command 삭제
	std::vector<int>::iterator iter = m_vecCommandList.begin();
	iter += nIndex;
	m_vecCommandList.erase(iter);

	int nMaxLengthIdx = 0;

	if( strMenu.Length() == m_nMaxCharCount )
	{
		m_nMaxCharCount =0;
		for(int i=0; i<m_vecString[nCol].vecString.size(); ++i)
		{
			if( m_vecString[nCol].vecString[i].Length() > m_nMaxCharCount )
			{
				m_nMaxCharCount =m_vecString[nCol].vecString[i].Length();
				nMaxLengthIdx = i;
			}
		}
	}

#if defined G_RUSSIA
	m_strLongestStringInMenu = m_vecString[nCol].vecString[nMaxLengthIdx];
#else
	Resize();
#endif
}
Beispiel #14
0
// ----------------------------------------------------------------------------
// Name : AddListSubjectString()
// Desc :
// ----------------------------------------------------------------------------
void CUIHelp::AddListSubjectString( CTString &strSubject )
{
	CTString	strTemp = strSubject;
	
	INDEX	nLength = strTemp.Length();
	if( nLength > HELP_LIST_SUBJECT_MAX_CHAR )
	{
		// Check splitting position for 2 byte characters
		int		nSplitPos = HELP_LIST_SUBJECT_MAX_CHAR - 4;
		BOOL	b2ByteChar = FALSE;
		for( int iPos = 0; iPos < nSplitPos; iPos++ )
		{
			if( strTemp[iPos] & 0x80 )
				b2ByteChar = !b2ByteChar;
			else
				b2ByteChar = FALSE;
		}

		if( b2ByteChar )
			nSplitPos--;

		// Trim right
		strTemp.TrimRight( nSplitPos );
		strTemp += CTString( "..." );
	}

	m_lbListContent.AddString( 0, strTemp, 0xFFAD60FF );
}
//------------------------------------------------------------------------------
// CUISiegeWarfareDoc::SetTimeRep
// Explain:  
// Date : 2005-07-07,Author: Lee Ki-hwan
//------------------------------------------------------------------------------
void CUISiegeWarfareDoc::SetTimeRep( int nMonth, int nDay, int nHour, int nMin )
{
	CTString strMessage;
	strMessage.PrintF(_S(2147 ,  "공성 시간이 %d월 %d일 %d시로 설정되었습니다." ), nMonth, nDay, nHour );  
	CUIManager::getSingleton()->GetSiegeWarfare()->Message( MSGCMD_SIEGE_WARFARE_INFO, strMessage, UMBS_OK  );
	
}
Beispiel #16
0
void CUIPortal::Create_SiegeDungeon_AdmissionCtr_MsgBox(int nCurFree)
{
	CUIManager* pUIManager = CUIManager::getSingleton();

	if( pUIManager->DoesMessageBoxExist(MSGCMD_SIEGE_DUNGEON_ADMISSION_FEE_CONTROL) )
		pUIManager->CloseMessageBox(MSGCMD_SIEGE_DUNGEON_ADMISSION_FEE_CONTROL);

	CTString strMessage;
	CUIMsgBox_Info	MsgBoxInfo;

	MsgBoxInfo.SetMsgBoxInfo( _S(3931, "던전 입장료 조정" ), UMBS_OKCANCEL | UMBS_SPINBUTTON , UI_PORTAL, MSGCMD_SIEGE_DUNGEON_ADMISSION_FEE_CONTROL, 300 );
	
	MsgBoxInfo.AddString( _S(3932, "던전의 입장료 세율을 설정해주세요.") );

	CTString strMsg;
	strMsg.PrintF(_S(3933, "현재 입장료 세율은 %d%%입니다."), nCurFree);
	MsgBoxInfo.AddString(strMsg);
	++MsgBoxInfo.m_nMaxRow;

	MsgBoxInfo.SetSpinButton(MsgBoxInfo.m_nMaxRow, 1, -1, _S(3934, "입장료 세율%") + _s("   "));

	pUIManager->CreateMessageBox( MsgBoxInfo );

	for(int i=0; i<17; ++i)
	{
		CTString strData;
		strData.PrintF("%d", 70+i*5);
		pUIManager->GetMessageBox(MSGCMD_SIEGE_DUNGEON_ADMISSION_FEE_CONTROL)->GetSpinButton().AddData(strData);
	}

}
Beispiel #17
0
//缺失值填充
bool TCManager::FillMissing(TCPacket &inP, AnaWord &aw, string szVO, TCPacket &outP)
{
	int nUserID = GetUserID(inP);
	if (nUserID==0)
		return SetResultState(false,outP,GetLanguage(UserIDIsNotFound));

	string szTableName = "";
	int nCount = aw.GetWordCount();
	for (int i=0;i<nCount;i++)
	{
		if (aw.GetAt(i) == "/DATA" &&  i< nCount-2 )
		{
			szTableName = aw.GetAt(i+2);
			break;
		}
	}
	if (szTableName.size()==0)
		return SetResultState(false,outP,GetLanguage(FormatIsError));
	//接口指针
	CDataInterface *pDI = g_system.GetCurData(nUserID,szTableName);
	if (pDI ==NULL)
	{
		if (g_system.OpenTable(nUserID,szTableName,szTableName)==false)
			return SetResultState(false,outP,GetLanguage(OperationFail)); 
		
		pDI = g_system.GetCurData(nUserID,szTableName);
		if (pDI ==NULL)
			return SetResultState(false,outP,GetLanguage(UserTableIsNotFound));
	}
#ifdef WINPLAT
	CTString szPath = "tlBase.dll";
	TCSystem::GetModulePath(szPath);
	szPath += "/DataDeal.dll";	
	HINSTANCE hmod = LoadLibrary(szPath.GetData());
	if (hmod==NULL)
	{//没有找到对应的DLL
		SetResultState(false,outP,GetLanguage(DLLFileNotFind));//"没有找到对应的DLL"
		return false;
	}
	
	typedef int (*pFillMissing)(CDataInterface *pData, LPCTSTR lpszVO);
	pFillMissing proc;
	proc = (pFillMissing)GetProcAddress(hmod,"FillMissing");
	if (proc==NULL)
	{//"没有找到对应的过程名"
		SetResultState(false,outP,GetLanguage(ProcNameNotFind));
		return false;
	}
	
	int rst = (*proc)(pDI,szVO.c_str());
	if (rst == 0)
		return SetResultState(false,outP,"");
	else
		return SetResultState(true,outP);
	
#else
	
#endif
	return SetResultState(true,outP);
}
// get generic socket error info string about last error
CTString CCommunicationInterface::GetSocketError(INDEX iError)
{
  CTString strError;
  strError.PrintF(TRANSV("Socket %d, Error %d (%s)"),
    cci_hSocket, iError, ErrorDescription(&SocketErrors, iError));
  return strError;
};
Beispiel #19
0
/*
数据过滤
Filter /DATA =表名 /EXPR \"条件表达式\"
 */
bool TCManager::Filter(TCPacket &inP,AnaWord &aw, TCPacket &outP)
{
	int nUserID = GetUserID(inP);
	if (nUserID==0)
		return SetResultState(false,outP,GetLanguage(UserIDIsNotFound));

	int nTableIndex = -1;
	int nConditionIndex = -1;
	for (int i=2;i<aw.GetWordCount();i++)
	{
		if (aw.GetAt(i-2)=="/DATA" && aw.GetAt(i-1)=="=")
		{
			nTableIndex = i;
		}
		if (aw.GetAt(i-1)=="/EXPR")
		{
			nConditionIndex = i;
		}
	}

	if (nTableIndex == -1 || nConditionIndex == -1)
		return SetResultState(false,outP,GetLanguage(FormatIsError)); 
	
	CDataInterface *pDI = g_system.GetCurData(nUserID,aw.GetAt(nTableIndex));
	if (pDI ==NULL)
		return SetResultState(false,outP,GetLanguage(UserTableIsNotFound));
	

	string sCondition = aw.GetAt(nConditionIndex);

#ifdef WINPLAT
	CTString szPath = "tlBase.dll";
	TCSystem::GetModulePath(szPath);
	szPath += "/DataDeal.dll";	
	HINSTANCE hmod = LoadLibrary(szPath.GetData());
	if (hmod==NULL)
	{//没有找到对应的DLL
		return SetResultState(false,outP,GetLanguage(DLLFileNotFind));//"没有找到对应的DLL"
	}
	
	typedef int (*pFilter)(CDataInterface *pData, LPCSTR  sCondition);
	pFilter proc;
	proc = (pFilter)GetProcAddress(hmod,"Filter");
	if (proc==NULL)
	{//"没有找到对应的过程名"
		return SetResultState(false,outP,GetLanguage(ProcNameNotFind));
	}

	int rst = (*proc)(pDI,sCondition.c_str());
	if (rst == 0)
		return SetResultState(false,outP,"");
	else
		return SetResultState(true,outP);
			
#else

#endif

	return SetResultState(true,outP);
}
// save anim set file
BOOL CSeriousSkaStudioApp::SaveAnimSetFile(CAnimSet &as, BOOL bConvert)
{
  DisableRendering();
  CTFileName fnAnimSet = as.GetName();
  fnAnimSet = fnAnimSet.NoExt() + ".aal";
  try {
    fnAnimSet.RemoveApplicationPath_t();
  } catch(char *){}

  // back up current skeleton list file
  CTString strBackUp;
  try {
    strBackUp.Load_t(fnAnimSet); 
  } catch(char*){}

  CTFileStream ostrFile;
  try {
    ostrFile.Create_t(fnAnimSet,CTStream::CM_TEXT);
    SaveAnimSet_t(as,ostrFile);
    ostrFile.Close();
  } catch(char *strError) {
    ErrorMessage(strError);
    EnableRendering();
    return FALSE;
  }

  if(bConvert) {
    ConvertAnimSet(fnAnimSet);
  }

  EnableRendering();
  return TRUE;
}
CDlgSelectMode::CDlgSelectMode( CDisplayMode &dm, enum GfxAPIType &gfxAPI, 
                                CWnd* pParent /*=NULL*/) : CDialog( CDlgSelectMode::IDD, pParent)
{
  // obtain all available modes
  m_pdmAvailableModes = _pGfx->EnumDisplayModes(m_ctAvailableDisplayModes);

  // remember initial mode reference
  m_pdm = &dm;
  m_pGfxAPI = &gfxAPI;

  //{{AFX_DATA_INIT(CDlgSelectMode)
	m_strCurrentMode = _T("");
	m_strCurrentDriver = _T("");
	m_iColor = -1;
	//}}AFX_DATA_INIT

  // set current mode and driver strings
  CTString str;
  str.PrintF( "%d x %d x %s", dm.dm_pixSizeI, dm.dm_pixSizeJ, dm.DepthString());
  m_strCurrentMode = str;

  switch(gfxAPI) {
  case GAT_OGL:
    m_strCurrentDriver = "OpenGL";
    break;
#ifdef SE1_D3D
  case GAT_D3D:
    m_strCurrentDriver = "Direct3D";
    break;
#endif // SE1_D3D
  default:
    m_strCurrentDriver = "none";
    break;
  }
}
Beispiel #22
0
int CColoredButton::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const
{
  UBYTE ubR, ubG, ubB;
  UBYTE ubH, ubS, ubV, ubA;
  ubH = m_ubComponents[0][0];
  ubS = m_ubComponents[0][1];
  ubV = m_ubComponents[0][2];
  ubA = m_ubComponents[0][3];
  ubR = m_ubComponents[1][0];
  ubG = m_ubComponents[1][1];
  ubB = m_ubComponents[1][2];
  
  CTString strColor;
  if( m_bMixedColor)
  {
    strColor.PrintF( "Mixed color");
  }
  else
  {
    strColor.PrintF( "HSV=(%d,%d,%d),   RGB=(%d,%d,%d),    Alpha=%d", ubH, ubS, ubV, ubR, ubG, ubB, ubA);
  }
  pTI->lpszText = (char *)malloc( strlen(strColor)+1);
  strcpy( pTI->lpszText, strColor);
  RECT rectToolTip;
  rectToolTip.left = 50;
  rectToolTip.right = 60;
  rectToolTip.top = 50;
  rectToolTip.bottom = 60;
  pTI->hwnd = GetParent()->m_hWnd;
  pTI->uId = (UINT) m_hWnd;
  pTI->rect = rectToolTip;
  pTI->uFlags = TTF_IDISHWND;
  return 1;
}
Beispiel #23
0
//------------------------------------------------------------------------------
// UITrackPopup::AddMenuList
// Explain:  메류 항목 추가 
//			새로운 항목이 추가 될 때만 ListBox의 크기가 조절된다.
// Date : 2005-05-17,Author: Lee Ki-hwan
//------------------------------------------------------------------------------
void CUITrackPopup::AddMenuList( CTString strText, COLOR colText, int nCommandNum)
{
	AddString( 0, strText, colText );

	m_vecCommandList.push_back(nCommandNum); // [sora] command값 저장

	if (CUIListBox::GetScrollBar() == FALSE)
		CUIListBox::ChangeLineCount(m_vecString[0].vecString.size());
		
	if( m_nMaxCharCount < strText.Length() ) // 최대 글자수를 저장해 놓는다~
	{
		m_nMaxCharCount = strText.Length();
	}
	
#if defined G_RUSSIA
	if( strText.Length() > m_strLongestStringInMenu.Length() )	
	{
		m_strLongestStringInMenu = strText;
	}
#else
		Resize();
#endif

	// 일단은 숨겨 놓구 
	Hide();
}
BOOL CDlgAutTexturize::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_ctrPretenderTextureSize.ResetContent();
  // add all available frictions
  for(INDEX iW=0; iW<10; iW++)
  {
    CTString strSize;
    strSize.PrintF("%dx%d pixels", 1<<iW, 1<<iW);
    m_ctrPretenderTextureSize.AddString( CString(strSize));
  }
  INDEX iSelected=6;
  iSelected=AfxGetApp()->GetProfileInt( L"World editor", L"Pretender resolution", iSelected);
  m_ctrPretenderTextureSize.SetCurSel(iSelected);

	m_ctrlPretenderTextureStyle.ResetContent();
  m_ctrlPretenderTextureStyle.AddString( L"Front view only");
  m_ctrlPretenderTextureStyle.AddString( L"Cylindrical view (FRBL)");
  m_ctrlPretenderTextureStyle.AddString( L"Boxed view (FRBLUD)");
  iSelected=1;
  iSelected=AfxGetApp()->GetProfileInt( L"World editor", L"Pretender style", iSelected);
  m_ctrlPretenderTextureStyle.SetCurSel(iSelected);
	return TRUE;
}
void CDlgCreateSpecularTexture::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);

  if( !pDX->m_bSaveAndValidate)
  {
    INDEX iExponent = DEFAULT_EXPONENT_POS;
    if( IsWindow( m_sliderSpecularExponent.m_hWnd))
    {
      iExponent = m_sliderSpecularExponent.GetPos();
    }
    CTString strNumericalExponent;
    strNumericalExponent.PrintF( "Value: %.1f", GetFactorForPercentage(iExponent));
    m_strNumericalExponent = strNumericalExponent;
  }
	
  //{{AFX_DATA_MAP(CDlgCreateSpecularTexture)
	DDX_Control(pDX, IDC_SPECULAR_EXPONENT, m_sliderSpecularExponent);
	DDX_Control(pDX, IDC_SPECULAR_COLOR, m_colorSpecular);
	DDX_Control(pDX, IDC_SIZE_IN_PIXELS, m_comboSizeInPixels);
	DDX_Control(pDX, IDC_LIGHT_COLOR, m_colorLight);
	DDX_Control(pDX, IDC_AMBIENT_COLOR, m_colorAmbient);
	DDX_Text(pDX, IDC_NUMERIC_EXPONENT_T, m_strNumericalExponent);
	DDX_Check(pDX, IDC_AUTO_ROTATE, m_bAutoRotate);
	//}}AFX_DATA_MAP
  
  if( (pDX->m_bSaveAndValidate) && IsWindow( m_sliderSpecularExponent.m_hWnd) )
  {                    
    INDEX iSlider = m_sliderSpecularExponent.GetPos();
    CreateTexture( CTString("temp\\SpecularTemp.tex"), GetFactorForPercentage( iSlider));
    CTextureData *pTD = (CTextureData *) m_moModel.mo_toSpecular.GetData();
    if( pTD != NULL) pTD->Reload();
    Invalidate( FALSE);
  }
}
Beispiel #26
0
// print title
void PrintTitle(CDrawPort *pdp)
{
  SetFont2(pdp);
  CTString strTitle;
  strTitle.PrintF(TRANS("NETRICSA v2.01 - personal version for: %s"), 
    _ppenPlayer->GetPlayerName());
  pdp->PutText( strTitle, _pixMarginI*3, _pixMarginJ-2*_fScaling2+1, _colMedium);
}
Beispiel #27
0
COLOR GetColorFromProfile( CTString strVarName, COLOR colDefault)
{
  CTString strDefault;
  strDefault.PrintF("0x%08x", colDefault);
  CTString strTemp = theApp.GetProfileString( "Modeler prefs", strVarName, strDefault);
  COLOR colValue;
  sscanf( strTemp, "0x%08x", &colValue);
  return colValue;
};
Beispiel #28
0
INDEX GetIndexFromProfile( CTString strVarName, INDEX iDefault)
{
  CTString strDefault;
  strDefault.PrintF("%d", iDefault);
  CTString strTemp = theApp.GetProfileString( "Modeler prefs", strVarName, strDefault);
  INDEX iValue;
  sscanf( strTemp, "%d", &iValue);
  return iValue;
};
Beispiel #29
0
CTString FillRateString(void)
{
  CTString str;
  str.PrintF( "%s, %s, %s ", 
    _bTexture ? (_bMultiTexture ? "multitexture" : "texture") : "no texture", 
    _bBlend ? "blending"  : "no blending", 
    _bDepth ? "z-buffer:" : "no z-buffer:");
  return str;
}
Beispiel #30
0
static void GenerateFont(void)
{
  if(!_bInitialized) return;
  try {
    _iiFont.Clear();
    _iiGrid.Clear();

    _iiFont.ii_Width = GetIntFromControl(ICB_TEX_WIDTH);
    _iiFont.ii_Height = GetIntFromControl(ICB_TEX_HEIGHT);
    _iiFont.ii_BitsPerPixel = 32;

    _iiGrid.ii_Width = _iiFont.ii_Width;
    _iiGrid.ii_Height = _iiFont.ii_Height;
    _iiGrid.ii_BitsPerPixel = _iiFont.ii_BitsPerPixel;

    SLONG slSize = _iiFont.ii_Width*_iiFont.ii_Height * _iiFont.ii_BitsPerPixel/8;
    _iiFont.ii_Picture = (UBYTE*)AllocMemory(slSize);
    _iiGrid.ii_Picture = (UBYTE*)AllocMemory(slSize);

    memset(_iiFont.ii_Picture,0,slSize);
    memset(_iiGrid.ii_Picture,0,slSize);

    CTString strFontName = GetFontName();
    if(strFontName.Length() == 0) {
      throw("No font selected");
    }


    ULONG ulFlags = GetFontFlags();
    INDEX iFontSize = GetIntFromControl(IEC_FONT_SIZE);
    INDEX iFirstChar = GetIntFromControl(IEC_FIRST_CHAR);
    INDEX iLastChar = GetIntFromControl(IEC_LAST_CHAR);
    INDEX iAlignH  = GetComboIndex(IDC_ALIGN_H);
    INDEX iAlignV  = GetComboIndex(IDC_ALIGN_V);
    INDEX iPaddingX = GetIntFromControl(IEC_PADDINGX);
    INDEX iPaddingY = GetIntFromControl(IEC_PADDINGY);
    INDEX iWidthAdd = GetIntFromControl(IEC_WIDTH_ADD);
    INDEX iHeightAdd = GetIntFromControl(IEC_HEIGHT_ADD);
    INDEX ctShadows = GetIntFromControl(IEC_SHADOW_PASSES);
    
    if(ulFlags&FNT_HAS_SHADOW) {
      iPaddingX+=ctShadows;
      iPaddingY+=ctShadows;
      iWidthAdd+=ctShadows;
      iHeightAdd+=ctShadows;
    }

    _pfdCurrentFont = NULL;
    GenerateFont_t(_fdFont,_iiFont,_iiGrid,strFontName,iFontSize,iLastChar,iFirstChar,iAlignH,iAlignV,iPaddingX,iPaddingY,iWidthAdd,iHeightAdd,ulFlags,ctShadows);
    _pfdCurrentFont = &_fdFont;

    RefreshCanvas();
  } catch (char *strErr) {
    MessageBox(_hWnd,strErr,0,0);
  }
}