本文整理汇总了C++中GetInst函数的典型用法代码示例。如果您正苦于以下问题:C++ GetInst函数的具体用法?C++ GetInst怎么用?C++ GetInst使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetInst函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetInst
bool CREvent::OnCreateRoleBtn(const CEGUI::EventArgs &e)
{
if (GetInst(SelectRolePage).GetPlayerCount() >= 1)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Base_34")); //目前不能创建更多的角色了!
return false;
}
CEGUI::Window *pPageWin = GetInst(CreateRolePage).GetPageWindow();
CEGUI::Editbox* pNameEdit = static_cast<CEGUI::Editbox*>(pPageWin->getChild("EditName"));
const char * strName = CEGUIStringToAnsiChar(pNameEdit->getText());
if (strcmp(strName,"") == 0)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Player_72")); //"名字不能为空"
return false;
}
if (!CheckName(strName))
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Player_73")); //"名字中不能有空格"
return false;
}
int iSex = random(2);
//RandomChoseDetails();
//RandomChoseCountry();
BYTE lConstellation = random(12) + 1;
//const char *strName,char nOccupation, char nSex, BYTE lHead, BYTE lFace, BYTE lCountry,BYTE lConstellation,BYTE bRandCountry
GetGame()->C2L_AddRole_Send(strName, 0, (char)GetSelectSex(), GetHair(), GetFace(), GetSelectCountry(), lConstellation, 0 );
return true;
}
示例2: GetInst
bool CQuestionManager::Startup()
{
if( !GetInst( CConfiger ).IsEnable() )
{
return false;
}
// create events
m_Events[ET_QUIT] = ::CreateEvent( NULL, FALSE, FALSE, NULL );
m_Events[ET_GEN] = ::CreateEvent( NULL, FALSE, FALSE, NULL );
// create the mutex
::InitializeCriticalSection( &m_QuesMutex );
// startup update questions timer
int updateInterval = 1000 * GetInst( CConfiger ).GetSystem().UpdateQuestionInterval;
m_UpdateTimer = m_Timer.Schedule( this, NULL, timeGetTime() + updateInterval, updateInterval );
// generate questions at startup in the main thread.
m_pQuestions = GenQuestions();
// create the thread
m_Thread = (HANDLE)::_beginthreadex( NULL, 0, threadFunc, this, 0, NULL );
return true;
}
示例3: OpenSaleUI
bool OpenSaleUI()
{
CEGUI::WindowManager& wndmgr = GetWndMgr();
//获取出售订单ID
CEGUI::MultiColumnList* mcl = WMCL(wndmgr.getWindow("Auction/Tab/BuySale/BuyMCL"));
if(!mcl)
return false;
CEGUI::ListboxItem* lbi = mcl->getFirstSelectedItem();
if(!lbi)
{
//MessageBox(g_hWnd,AppFrame::GetText("AU_100"),"ERROR",MB_OK);
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_100"),NULL,NULL,true);
return false;
}
CEGUI::Window* wnd = wndmgr.getWindow("Auction/SaleWnd");
wnd->setVisible(true);
wnd->setAlwaysOnTop(true);
CEGUI::Editbox* editbox = WEditBox(wnd->getChildRecursive("Auction/SaleWnd/saleNum"));//出售界面编辑框激活
editbox->activate();
AHdata& ah = GetInst(AHdata);
uint ID = lbi->getID();
ah.SetCanSaleID(ID);
return true;
}
示例4: GetInst
//添加任务奖励
void CEncouragement::OnBnClickedButton1()
{
POSITION pos = m_EncouragementList.GetFirstSelectedItemPosition();
int ItemNum = m_EncouragementList.GetNextSelectedItem(pos);
if (ItemNum<0)
{
ItemNum = 0;
}
CXmlEdit::MapTextFileTable::iterator MapIter = GetInst(CXmlEdit).m_AllQuestTextFile.find( m_Textfile);
if ( MapIter != GetInst(CXmlEdit).m_AllQuestTextFile.end() )
{
MapIter->second[ "Q" ] = ":";
}
else
{
return ;
}
m_TextIndex.SetWindowText("Q");
m_TextContext.SetWindowText("");
ReadRoleEncouragement( &m_Textfile );
m_EncouragementList.EnsureVisible( 0 , FALSE );
m_EncouragementList.SetItemState( 0 , LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
m_EncouragementList.SetFocus();
m_EncouragementList.SetSelectedColumn(0);
}
示例5: OnReturnCharSel
bool OnReturnCharSel(const CEGUI::EventArgs &args)
{
// 玩家有队伍发送离开队伍消息
TeamMsgMgr& mgr = GetInst(TeamMsgMgr);
mgr.SendSelfLeaveTeam();
CMessage msg(MSG_C2S_OTHER_QUITTOSELECT);
msg.Send();
GetInst(UIManager).CloseAllPage();
return true;
}
示例6: timeGetTime
void SkillTracer::Init(long id, long lvl, const CGUID &target, ulong traceTime)
{
m_SkillID = id;
m_SkillLvl = lvl;
m_TargetID = target;
m_EndTime = timeGetTime() + traceTime;
m_SkillMaxDis = (float)GetInst(SkillAttribute).GetStrCondif(m_SkillID,lvl, "MaxAtkDistance");
m_SkillMinDis = (float)GetInst(SkillAttribute).GetStrCondif(m_SkillID,lvl, "MinAtkDistance");
}
示例7: GetInst
DWORD IBuff::GetRemain()
{
if( GetInst() == 0 )
return 0;
DWORD dwElapsedTime = ::timeGetTime() - GetInst();
if( dwElapsedTime > GetTotal() ) // 남은 시간은 총 버프 시간보다 클 수 없다.
return 0; // 실제로 버프 제거는 시간 만료 후 다음 프로세스에서 하기 때문에 발생 가능하다.
return GetTotal() - dwElapsedTime;
}
示例8: wsprintf
void FactionOper::RecvSetChairmanNotifyMsg(CMessage* pMsg)
{
TCHAR szPrompt[ 256 ];
// 老族长 名字
TCHAR nameOldMaster[ MAX_MEMBER_NAME_SIZE ];
pMsg->GetStr( nameOldMaster, MAX_MEMBER_NAME_SIZE );
// 新族长 名字
TCHAR nameNewMaster[ MAX_MEMBER_NAME_SIZE ];
pMsg->GetStr( nameNewMaster, MAX_MEMBER_NAME_SIZE );
// 如果我是老族长
if( ! lstrcmp( GetGame()->GetMainPlayer()->GetName(), nameOldMaster ) )
{
// "您已经将族长职位转让给 %s!"
wsprintf( szPrompt, AppFrame::GetText("FA_104") , nameNewMaster );
GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt);
// 修改官阶
m_pFactionManager->SetMyJob( 0 );
}
// 如果我是新族长
else if( ! lstrcmp( GetGame()->GetMainPlayer()->GetName(), nameNewMaster ) )
{
// "%s 任命您为 %s 的新族长!"
wsprintf( szPrompt, AppFrame::GetText("FA_302") , nameOldMaster, m_pFactionManager->GetMyFaction()->GetName() );
GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt);
// 设置作为族长的相关数据
m_pFactionManager->SetMyJob( Exceptive_JobLvl );
}
// 如果是我的会友
else if( m_pFactionManager->GetMyFaction() )
{
// "%s 任命 %s 为 %s 的新族长!"
wsprintf( szPrompt, AppFrame::GetText("FA_303") , nameOldMaster, m_pFactionManager->GetMyFaction()->GetName() );
GetInst(ChatListPage).AddChatWords(szPrompt,0xffffffff,0,0xff000000,"",CHAT_SYSTEM);
}
// 更新 Member 数据
if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( nameOldMaster ) )
{
pMember->SetJob( 0 );
}
if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( nameNewMaster ) )
{
pMember->SetJob( Exceptive_JobLvl );
}
// 刷新界面
FireUIEvent("FactionPage","UpdateMem");
}
示例9: ShellInitDialog
void CPlayListDlg::OnInitDialog(HWND hwndDlg)
{
m_hWnd = hwndDlg;
ShellInitDialog(m_hWnd);
// ツールバーの準備
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = m_hWnd;
mbi.nToolBarId = IDR_DUMMY;
mbi.hInstRes = GetInst();
SHCreateMenuBar(&mbi);
m_hwndMB = mbi.hwndMB;
SendMessage(m_hwndMB, TB_DELETEBUTTON, 0, 0);
SendMessage(m_hwndMB, TB_ADDSTRING, (WPARAM)GetInst(), IDC_UP);
SendMessage(m_hwndMB, TB_ADDSTRING, (WPARAM)GetInst(), IDC_DOWN);
CommandBar_AddBitmap(m_hwndMB, GetInst(), IDR_PLAYLIST, 6, 16, 16);
TBBUTTON tbbMain[] = {
{0, IDC_ADD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, -1},
{1, IDC_UP, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, 0, 0, 0},
{2, IDC_DOWN, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, 0, 0, 1},
{3, IDC_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, -1},
{4, IDC_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, -1},
{5, IDC_CTRLKEY, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, 0, 0, -1}
};
for (int i = 0; i < sizeof(tbbMain) / sizeof(TBBUTTON); i++) {
CommandBar_InsertButton(m_hwndMB, i, &tbbMain[i]);
}
// リストの準備
HWND hwndLV = GetDlgItem(m_hWnd, IDC_PLAY_LIST);
ListView_SetExtendedListViewStyle(hwndLV,
ListView_GetExtendedListViewStyle(hwndLV) | LVS_EX_FULLROWSELECT);
// カラムの挿入
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = 0;
lvc.pszText = _T("Name");
lvc.iSubItem = 0;
ListView_InsertColumn(hwndLV, 0, &lvc);
// イメージリストを設定
ListView_SetImageList(hwndLV, m_hImageList, LVSIL_SMALL);
// リストを更新
UpdatePlayList();
}
示例10: ImageList_Create
CPlayListDlg::CPlayListDlg()
{
m_fListDrag = FALSE;
m_nDragItem = -1;
m_hWnd = NULL;
m_hImageList = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 2, 2);
HICON hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_FILE_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_PLAY_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
}
示例11: GetInst
void FightStateScript::OnUseSkillEnd(long ret)
{
Script *script = GetInst(ScriptSys).GetScript(m_skillScriptID);
if(script != NULL)
{
script->PushRetValue(ret);
GetInst(ScriptSys).ResumeScript(script, 1);
}
else
{
LogError(AI_MODULE, "Get ScriptSys instance error.");
}
m_State = NORMAL;
}
示例12: ImageList_Create
CPlayListDlg::CPlayListDlg()
{
m_hWnd = NULL;
m_hwndMB = NULL;
m_fCtrlKey = FALSE;
m_hImageList = ImageList_Create(SCALEX(16), SCALEY(16), ILC_COLOR | ILC_MASK, 2, 2);
HICON hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_FILE_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
hIcon = (HICON)LoadImage(GetInst(), (LPCTSTR)IDI_PLAY_S, IMAGE_ICON, SCALEX(16), SCALEY(16), 0);
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
}
示例13: strTitle
void CEffectDlg::ShowEffectDlg(HWND hwndParent, HANDLE hMap)
{
m_hMap = hMap;
CTempStr strTitle(IDS_TITLE_EFFECT);
PROPSHEETPAGE psp[4];
memset(psp, 0, sizeof(psp));
psp[0].dwSize = sizeof(PROPSHEETPAGE);
psp[0].dwFlags = PSP_DEFAULT;
psp[0].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_EQUALIZER);
psp[0].pfnDlgProc = (DLGPROC)EqualizerProc;
psp[0].hInstance = GetInst();
psp[0].pszIcon = NULL;
psp[0].lParam = (LPARAM)this;
psp[1].dwSize = sizeof(PROPSHEETPAGE);
psp[1].dwFlags = PSP_DEFAULT;
psp[1].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_EFFECT);
psp[1].pfnDlgProc = (DLGPROC)EffectProc;
psp[1].hInstance = GetInst();
psp[1].pszIcon = NULL;
psp[1].lParam = (LPARAM)this;
psp[2].dwSize = sizeof(PROPSHEETPAGE);
psp[2].dwFlags = PSP_DEFAULT;
psp[2].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_REVERB);
psp[2].pfnDlgProc = (DLGPROC)ReverbProc;
psp[2].hInstance = GetInst();
psp[2].pszIcon = NULL;
psp[2].lParam = (LPARAM)this;
psp[3].dwSize = sizeof(PROPSHEETPAGE);
psp[3].dwFlags = PSP_DEFAULT;
psp[3].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_EFFECT_SAVE);
psp[3].pfnDlgProc = (DLGPROC)PresetProc;
psp[3].hInstance = GetInst();
psp[3].pszIcon = NULL;
psp[3].lParam = (LPARAM)this;
PROPSHEETHEADER psh;
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_USECALLBACK;
psh.pfnCallback = PropSheetCallback;
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.nStartPage = 0;
psh.pszIcon = NULL;
psh.pszCaption = strTitle;
psh.hwndParent = hwndParent;
psh.hInstance = GetInst();
psh.ppsp = psp;
PropertySheet(&psh);
}
示例14: OnSaleSubmit
//提交出售请求
bool OnSaleSubmit(const CEGUI::EventArgs& e)
{
CEGUI::WindowManager& wndmgr = GetWndMgr();
CEGUI::Editbox* edb = WEditBox(wndmgr.getWindow("Auction/SaleWnd/saleNum"));
AHdata& ah = GetInst(AHdata);
//获取出售数量
uint saleNum = CEGUI::PropertyHelper::stringToInt(edb->getText());
uint cansaleNum = ah.GetCountByCanSaleID(ah.GetCanSaleID());
if(saleNum == 0 || saleNum > cansaleNum )
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_101"),NULL,NULL,true);
return false;
}
ah.Send_AH_SEL(cansaleNum);//发送出售请求前要设置出售的订单ID
return true;
}
示例15: OnBuySubmit
////提交购买请求
bool OnBuySubmit(const CEGUI::EventArgs& e)
{
CEGUI::WindowManager& wndmgr = GetWndMgr();
CEGUI::Editbox* edb = WEditBox(wndmgr.getWindow("Auction/Buy/buyNum"));
AHdata& ah = GetInst(AHdata);
//获取购买数量
uint buyNum = CEGUI::PropertyHelper::stringToInt(edb->getText());
uint canbuyNum = ah.GetCountByCanBuyID(ah.GetCanBuyID());
if(buyNum== 0 || buyNum > canbuyNum)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_103"),NULL,NULL,true);
return false;
}
ah.Send_AH_BUY(buyNum);//发送购买请求前要设置购买的订单ID
return true;
}