本文整理汇总了C++中Sector::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ Sector::setVisible方法的具体用法?C++ Sector::setVisible怎么用?C++ Sector::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector::setVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: L1_MakeSectorActive
void L1_MakeSectorActive() {
lua_Object sectorObj = lua_getparam(1);
if (!lua_isnumber(sectorObj) && !lua_isstring(sectorObj))
return;
// FIXME: This happens on initial load. Are we initting something in the wrong order?
if (!g_grim->getCurrScene()) {
warning("!!!! Trying to call MakeSectorActive without a scene");
return;
}
bool visible = !lua_isnil(lua_getparam(2));
int numSectors = g_grim->getCurrScene()->getSectorCount();
if (lua_isstring(sectorObj)) {
const char *name = lua_getstring(sectorObj);
for (int i = 0; i < numSectors; i++) {
Sector *sector = g_grim->getCurrScene()->getSectorBase(i);
if (strmatch(sector->getName(), name)) {
sector->setVisible(visible);
return;
}
}
} else if (lua_isnumber(sectorObj)) {
int id = (int)lua_getnumber(sectorObj);
for (int i = 0; i < numSectors; i++) {
Sector *sector = g_grim->getCurrScene()->getSectorBase(i);
if (sector->getSectorId() == id) {
sector->setVisible(visible);
return;
}
}
}
}