本文整理汇总了C++中CInterfaceManager类的典型用法代码示例。如果您正苦于以下问题:C++ CInterfaceManager类的具体用法?C++ CInterfaceManager怎么用?C++ CInterfaceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CInterfaceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId(Params));
if (pGC != NULL)
{
pGC->setUseGlobalAlpha(false);
pGC->setContainerAlpha((uint8) 0);
pGC->setContentAlpha((uint8) 255);
pGC->setRolloverAlphaContainer((uint8) 255);
pGC->setRolloverAlphaContent((uint8) 0);
}
}
示例2: execute
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
string sVDesk = getParam(Params,"vdesk");
if (sVDesk.empty()) return;
sint32 nVDesk;
fromString(sVDesk, nVDesk);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->resetMode((uint8)nVDesk);
PeopleInterraction.refreshActiveUserChats();
}
示例3: addCtrl
// ***************************************************************************
void CGroupTab::addTab(CCtrlTabButton * tabB)
{
addCtrl(tabB);
_Setuped = false;
updateCoords();
selectFromCtrl(tabB);
if(_HideOutTabs && !_AHOnChange.empty())
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange);
}
}
示例4: execute
void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
{
// Param
uint mode;
fromString(getParam (sParams, "mode"), mode);
ucstring text;
text.fromUtf8 (getParam (sParams, "text"));
// text = getParam (sParams, "text");
// Parse any tokens in the text
if ( ! CInterfaceManager::parseTokens(text))
{
return;
}
// Find the base group
if ((mode<CChatGroup::nbChatMode) && !text.empty())
{
if(text[0] == '/')
{
string str = text.toUtf8();
string cmdWithArgs = str.substr(1);
// Get the command name from the string, can contain spaces
string cmd = cmdWithArgs.substr(0, cmdWithArgs.find(' '));
if (cmdWithArgs.find('"') == 0)
{
string::size_type pos = cmdWithArgs.find('"', 1);
if (string::npos != pos)
{
cmd = cmdWithArgs.substr(1, pos - 1);
}
}
if ( NLMISC::ICommand::exists( cmd ) )
{
NLMISC::ICommand::execute( cmdWithArgs, g_log );
}
else
{
CInterfaceManager *im = CInterfaceManager::getInstance();
im->displaySystemInfo (ucstring(cmd+": ")+CI18N::get ("uiCommandNotExists"));
}
}
else
{
ChatMngr.setChatMode((CChatGroup::TGroupType)mode);
ChatMngr.chat(text, mode == CChatGroup::team);
}
}
}
示例5: execute
virtual void execute(CCtrlBase *pCaller, const std::string &/* sParams */)
{
CInterfaceManager *im = CInterfaceManager::getInstance();
CCtrlBaseButton *but = dynamic_cast<CCtrlBaseButton *>(pCaller);
if (but)
{
im->getDbProp("UI:TEMP:R2_DRAW_ARRAY")->setValueBool(but->getPushed());
CToolCreateEntity *tce = dynamic_cast<CToolCreateEntity *>(getEditor().getCurrentTool());
if (tce)
{
im->runActionHandler("r2ed_create_entity", NULL, "PaletteId=" + tce->getPaletteId());
}
}
}
示例6: prompt
//=============================================================================================================
void CChatTargetFilter::setTargetGroup(CChatGroup::TGroupType groupType, uint32 dynamicChannelDbIndex, bool allowUniverseWarning)
{
_TargetPlayer.resize(0);
if (_TargetPartyChat)
{
_TargetPartyChat->removeObserver(this);
_TargetPartyChat = NULL;
}
_TargetGroup = groupType;
_TargetDynamicChannelDbIndex = dynamicChannelDbIndex;
if (_Chat)
{
// set the prompt
const ucstring prompt("");
_Chat->setPrompt(prompt + (ucchar) '>');
// set the color
string entry="UI:SAVE:CHAT:COLORS:";
CInterfaceManager *pIM = CInterfaceManager::getInstance();
const bool teamActive = pIM->getDbProp("SERVER:GROUP:0:NAME")->getValueBool();
const bool guildActive = pIM->getDbProp("SERVER:GUILD:NAME")->getValueBool();
switch(groupType)
{
case CChatGroup::dyn_chat: entry+="DYN:" + NLMISC::toString(dynamicChannelDbIndex); break;
case CChatGroup::say: entry+="SAY"; break;
case CChatGroup::shout: entry+="SHOUT"; break;
case CChatGroup::team: if(!teamActive) return; entry+="GROUP"; break;
case CChatGroup::guild: entry+="CLADE"; break;
case CChatGroup::civilization: entry+="CIVILIZATION"; break;
case CChatGroup::territory: entry+="TERRITORY"; break;
case CChatGroup::universe:
{
entry+="UNIVERSE_NEW";
if(allowUniverseWarning)
pIM->getDbProp("UI:VARIABLES:UNIVERSE_CHANEL_WARNING_WANTED")->setValue64(1);
}
break;
case CChatGroup::region: entry+="REGION"; break;
case CChatGroup::tell: entry+="TELL"; break;
case CChatGroup::system: return; // return with no warning
default: nlwarning("unknown CChatGroup type"); return;
}
// read DB
CInterfaceProperty prop;
prop.readRGBA(entry.c_str()," ");
_Chat->setPromptColor(prop.getRGBA());
}
}
示例7: execute
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface", Params));
if (pGC == NULL)
{
nlwarning("%s is not a container", Params.c_str());
return;
}
if (!isContainerAuthorized(pGC)) return;
pGC->setActive(true);
pIM->setTopWindow(pGC);
}
示例8: splitString
// --------------------------------------------------------------------------------------------------------------------
bool CViewPointer::drawCustom(CCtrlBase* pCB)
{
string texName;
uint8 rot;
NLMISC::CRGBA col;
if (pCB->getMouseOverShape(texName, rot, col))
{
if (texName[0] == '@')
{
const string &tooltipInfos = texName.substr(1);
string tooltip;
vector<string> tooltipInfosList;
splitString(tooltipInfos, "@", tooltipInfosList);
texName = tooltipInfosList[0];
tooltip = tooltipInfosList[1];
nlinfo(tooltip.c_str());
setString(ucstring(tooltip));
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 texId = rVR.getTextureIdFromName (texName);
CInterfaceGroup *stringCursor = IsMouseCursorHardware() ? _StringCursorHardware : _StringCursor;
if (stringCursor)
{
stringCursor->setX(_PointerX);
stringCursor->setY(_PointerY);
stringCursor->updateCoords();
stringCursor->draw();
// if in hardware mode, force to draw the default cursor no matter what..
if (IsMouseCursorHardware())
drawCursor(texId, col, 0);
}
else
{
drawCursor(texId, col, 0);
}
return true;
}
else
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 texId = rVR.getTextureIdFromName (texName);
drawCursor(texId, col, 0);
return true;
}
}
return false;
}
示例9: parse
// ----------------------------------------------------------------------------
bool COptionsContainerInsertion::parse(xmlNodePtr cur)
{
if (!CInterfaceOptions::parse (cur))
return false;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
TxId_T_Arrow = rVR.getTextureIdFromName (getValStr("arrow_top"));
TxId_B_Arrow = rVR.getTextureIdFromName (getValStr("arrow_down"));
TxId_L_Arrow = rVR.getTextureIdFromName (getValStr("arrow_left"));
TxId_R_Arrow = rVR.getTextureIdFromName (getValStr("arrow_right"));
TxId_InsertionBar = rVR.getTextureIdFromName (getValStr("insertion_bar"));
return true;
}
示例10:
//**********************************************************************************
void CDBGroupListSheetMission::CSheetChildMission::init(CDBGroupListSheetText *pFather, uint index)
{
// init my parent
CSheetChild::init(pFather, index);
// init the link to the database requesites
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CCDBNodeLeaf *pNL;
string sTmp = Ctrl->getSheet()+":PREREQ_STATE";
sTmp = "LOCAL:" + sTmp.substr(6,sTmp.size());
pNL = pIM->getDbProp(sTmp, false);
nlassert(pNL != NULL);
CurrentPreReqState.link ( sTmp.c_str() );
}
示例11: nldebug
// ****************************************************************************
void CSessionBrowserImpl::on_joinSessionResult(NLNET::TSockId /* from */, uint32 /* userId */, TSessionId sessionId, uint32 result, const std::string &shardAddr, const RSMGR::TSessionPartStatus &participantStatus)
{
nldebug("SB: on_joinSessionResult : result = %u; msg = '%s'", result, shardAddr.c_str());
_LastJoinSessionResult = result;
_LastJoinSessionId = sessionId;
_LastJoinSessionShardAddr = shardAddr;
_LastJoinSessionPartStatus = participantStatus;
// trigger the far tp action
if (result == 0)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->runActionHandler("on_connect_to_shard", NULL, string("cookie=")+NetMngr.getLoginCookie().toString()+"|fsAddr="+shardAddr);
}
}
示例12: setLook
// *********************************************************
void CPrimRender::setLook(const CPrimLook &look)
{
//H_AUTO(R2_CPrimRender_setLook)
if (look == _Look) return;
_Look = look;
if (!look.EdgeLook.WorldMapTexture.empty())
{
CInterfaceManager *im = CInterfaceManager::getInstance();
CViewRenderer &vr = im->getViewRenderer();
sint32 width, height;
sint32 id = vr.getTextureIdFromName(look.EdgeLook.WorldMapTexture);
vr.getTextureSizeFromId(id, width, height);
_InvWorldTextureWidth = width > 0 ? 1.f / width : 0.f;
}
update();
}
示例13: drawCursor
// --------------------------------------------------------------------------------------------------------------------
void CViewPointer::drawCursor(sint32 texId, NLMISC::CRGBA col, uint8 rot)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 xPos = _XReal + _OffsetX;
sint32 yPos = _YReal + _OffsetY;
if (!IsMouseCursorHardware())
{
rVR.draw11RotFlipBitmap (_RenderLayer, xPos, yPos, rot, false, texId, col);
}
else
{
// set new cursor for the hardware mouse
std::string name = rVR.getTextureNameFromId(texId);
Driver->setCursor(name, col, rot, (uint32) std::max(getX() - xPos, (sint32) 0), (uint32) std::max(getY() - yPos, (sint32) 0));
}
}
示例14: begin
// *************************************************************************************************
void CBotChatPageDynamicMission::begin()
{
CBotChatPage::begin();
// clear db entries for dynamic missions
CInterfaceManager *im = CInterfaceManager::getInstance();
invalidateMission();
// clear all choices options
for(uint k = 0; k < DYNAMIC_MISSION_NUM_CHOICES; ++k)
{
im->getDbProp(toString(DM_CHOICE "%d:TITLE", (int) k))->setValue32(0);
for(uint l = 0; l < DYNAMIC_MISSION_MAX_NUM_OPTIONS; ++l)
{
im->getDbProp(toString(DM_CHOICE "%d:%d:TEXT", (int) k, (int) l))->setValue32(0);
}
}
activateWindow(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION, true);
CInterfaceGroup *ig = dynamic_cast<CInterfaceGroup *>(im->getElementFromId(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION));
if (!ig)
{
std::fill(_ChoiceCB, _ChoiceCB + DYNAMIC_MISSION_NUM_CHOICES, (CDBGroupComboBox *) NULL);
}
else
{
for(uint k = 0; k < DYNAMIC_MISSION_NUM_CHOICES; ++k)
{
// get pointers on combo boxs
_ChoiceCB[k] = dynamic_cast<CDBGroupComboBox *>(ig->getGroup(toString("choice%d", (int) k)));
// empty the choice list (no datas received yet)
if (_ChoiceCB[k])
{
_ChoiceCB[k]->setActive(false);
_ChoiceCB[k]->resetTexts();
}
for(uint l = 0; l < DYNAMIC_MISSION_MAX_NUM_OPTIONS; ++l)
{
_TextReceived[k][l] = false;
}
}
}
std::fill(_Choice, _Choice + DYNAMIC_MISSION_NUM_CHOICES, -1);
for(uint k = 0; k < DYNAMIC_MISSION_NUM_CHOICES; ++k)
{
im->getDbProp(toString("UI:TEMP:DYNAMIC_MISSION:CHOICE%d", (int) k))->setValue32(-1);
}
}
示例15: init
// Init the action manager
void init ()
{
// Get the current edit box
_GroupEdit = NULL;
_LooseSelection = false;
// Get the interface manager
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (pIM)
{
CCtrlBase *basectrl = pIM->getCaptureKeyboard();
if (basectrl)
_GroupEdit = dynamic_cast<CGroupEditBox*>(basectrl);
}
if (_GroupEdit)
_GroupEdit->stopParentBlink();
}