本文整理汇总了C++中ListIter::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ListIter::SetEnabled方法的具体用法?C++ ListIter::SetEnabled怎么用?C++ ListIter::SetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListIter
的用法示例。
在下文中一共展示了ListIter::SetEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menu_rect
void
RadioView::Refresh()
{
sim = Sim::GetSim();
if (!font)
return;
font->SetColor(txt_color);
font->SetAlpha(1);
if (sim && ship != sim->GetPlayerShip()) {
ship = sim->GetPlayerShip();
history.Clear();
if (ship) {
if (ship->Life() == 0 || ship->IsDying() || ship->IsDead()) {
ship = 0;
}
else {
Observe(ship);
}
}
}
QuantumView* qv = QuantumView::GetInstance();
if (!qv || !qv->IsMenuShown()) {
Menu* menu = history.GetCurrent();
if (menu) {
Rect menu_rect(width-115, 10, 115, 12);
font->DrawText(menu->GetTitle(), 0, menu_rect, DT_CENTER);
menu_rect.y += 15;
ListIter<MenuItem> item = menu->GetItems();
while (++item) {
if (ship->GetEMCON() < 2 ||
(TargetRequired(item.value()) && !ship->GetTarget()) ||
item->GetText().contains("KIA")) {
item->SetEnabled(false);
font->SetAlpha(0.35);
}
else {
item->SetEnabled(true);
font->SetAlpha(1);
}
font->DrawText(item->GetText(), 0, menu_rect, DT_LEFT);
menu_rect.y += 10;
}
}
}
int message_queue_empty = true;
// age messages:
for (int i = 0; i < MAX_MSG; i++) {
if (msg_time[i] > 0) {
msg_time[i] -= Game::GUITime();
if (msg_time[i] <= 0) {
msg_time[i] = 0;
msg_text[i] = "";
}
message_queue_empty = false;
}
}
if (!message_queue_empty) {
// advance message pipeline:
for (int i = 0; i < MAX_MSG; i++) {
if (msg_time[0] == 0) {
for (int j = 0; j < MAX_MSG-1; j++) {
msg_time[j] = msg_time[j+1];
msg_text[j] = msg_text[j+1];
}
msg_time[MAX_MSG-1] = 0;
msg_text[MAX_MSG-1] = "";
}
}
bool hud_off = false;
if (HUDView::GetInstance())
hud_off = (HUDView::GetInstance()->GetHUDMode() == HUDView::HUD_MODE_OFF);
// draw messages:
if (!hud_off) {
for (int i = 0; i < MAX_MSG; i++) {
if (msg_time[i] > 0) {
Rect msg_rect(0, 95 + i*10, width, 12);
if (msg_time[i] > 1)
font->SetAlpha(1);
else
font->SetAlpha(0.5 + 0.5*msg_time[i]);
//.........这里部分代码省略.........