本文整理汇总了C++中UserInterface::GetActiveElement方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInterface::GetActiveElement方法的具体用法?C++ UserInterface::GetActiveElement怎么用?C++ UserInterface::GetActiveElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInterface
的用法示例。
在下文中一共展示了UserInterface::GetActiveElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMessage
void MessageManager::ProcessMessage(Message * message)
{
// Check for UI-messages first.
String msg = message->msg;
// UserInterface * globalUI = GlobalUI();
// Do note that not all messages uses the string-argument...
// if (!msg.Length())
// return;
if (message->recipientEntity)
{
message->recipientEntity->ProcessMessage(message);
}
// Let active lighting process messages if wanted.
Lighting * activeLighting = Graphics.ActiveLighting();
if (activeLighting)
{
if (activeLighting->ProcessMessage(message))
return;
}
WindowMan.ProcessMessage(message);
UI::ProcessMessage(message);
switch(message->type)
{
case MessageType::BOOL_MESSAGE:
{
BoolMessage * bm = (BoolMessage*) message;
if (msg == "BGMEnabled")
{
QueueAudio(new AMSetb(AT_BGM_ENABLED, bm->value));
}
break;
}
case MessageType::INTEGER_MESSAGE:
{
IntegerMessage * im = (IntegerMessage*) message;
if (msg == "SetMasterVolume")
{
QueueAudio(new AMSet(AT_MASTER_VOLUME, im->value * 0.01f));
}
else if (msg == "SetBGMVolume")
{
QueueAudio(new AMSet(AT_BGM_VOLUME, im->value * 0.01f));
}
else if (msg == "SetSFXVolume")
{
QueueAudio(new AMSet(AT_SFX_VOLUME, im->value * 0.01f));
}
break;
}
case MessageType::COLLISSION_CALLBACK:
{
CollisionCallback * cc = (CollisionCallback*) message;
/// o.o
Entity * one = cc->one;
Entity * two = cc->two;
one->ProcessMessage(cc);
two->ProcessMessage(cc);
break;
}
case MessageType::RAYCAST:
{
Raycast * raycast = (Raycast*) message;
if (raycast->relevantEntity)
{
raycast->relevantEntity->ProcessMessage(message);
}
break;
}
case MessageType::DRAG_AND_DROP:
{
DragAndDropMessage * dadm = (DragAndDropMessage*) message;
// Hover to where the drop is to take place.
InputMan.MouseMove(HoverWindow(), dadm->position);
/// Check cursor location, can we drop stuff?
UIElement * e = InputMan.HoverElement();
if (e)
e->ProcessMessage(message);
break;
}
case MessageType::PASTE:
{
if (msg.Contains("Paste:"))
{
// Check for active ui element.
UserInterface * ui = ActiveUI();
if (ui){
UIElement * element = ui->GetActiveElement();
if (element)
{
element->ProcessMessage(message);
}
}
}
}
case MessageType::STRING:
{
//.........这里部分代码省略.........