void StageBuilder::addFrame(PlayerSet &players, ToonzScene *scene, TXsheet *xsh, int row, int level, bool includeUnvisible, bool checkPreviewVisibility) { int columnCount = xsh->getColumnCount(); unsigned int maskCount = m_masks.size(); std::vector<std::pair<double, int>> shuffle; for (int c = 0; c < columnCount; c++) { TXshColumnP column = xsh->getColumn(c); assert(column); TStageObject *pegbar = xsh->getStageObject(TStageObjectId::ColumnId(c)); double columnSO = pegbar->getSO(row); shuffle.push_back(std::make_pair(columnSO, c)); } std::stable_sort(shuffle.begin(), shuffle.end(), StackingOrder()); for (int i = 0; i < columnCount; i++) { int c = shuffle[i].second; if (CameraTestCheck::instance()->isEnabled() && c != m_currentColumnIndex) continue; if (level == 0) { // m_isCurrentColumn = (c == m_currentColumnIndex); m_ancestorColumnIndex = c; } TXshColumn *column = xsh->getColumn(c); bool isMask = false; if (column && !column->isEmpty()) { if (!column->isPreviewVisible() && checkPreviewVisibility) continue; if (column->isCamstandVisible() || includeUnvisible) // se l'"occhietto" non e' chiuso { if (column->isMask()) // se e' una maschera (usate solo in tab pro) { isMask = true; std::vector<int> saveMasks; saveMasks.swap(m_masks); int maskIndex = m_maskPool.size(); PlayerSet *mask = new PlayerSet(); m_maskPool.push_back(mask); addCellWithOnionSkin(*mask, scene, xsh, row, c, level); std::stable_sort(mask->begin(), mask->end(), PlayerLt()); saveMasks.swap(m_masks); m_masks.push_back(maskIndex); } else addCellWithOnionSkin(players, scene, xsh, row, c, level); } } if (!isMask) { while (m_masks.size() > maskCount) m_masks.pop_back(); } } if (level == 0) std::stable_sort(players.begin(), players.end(), PlayerLt()); }
void WorldPvPEP::HandleObjectiveComplete(PlayerSet m_sPlayersSet, uint32 uiEventId) { uint32 uiCredit = 0; switch(uiEventId) { case EVENT_CROWNGUARD_PROGRESS_ALLIANCE: case EVENT_CROWNGUARD_PROGRESS_HORDE: uiCredit = NPC_CROWNGUARD_TOWER_QUEST_DOODAD; break; case EVENT_EASTWALL_PROGRESS_ALLIANCE: case EVENT_EASTWALL_PROGRESS_HORDE: uiCredit = NPC_EASTWALL_TOWER_QUEST_DOODAD; break; case EVENT_NORTHPASS_PROGRESS_ALLIANCE: case EVENT_NORTHPASS_PROGRESS_HORDE: uiCredit = NPC_NORTHPASS_TOWER_QUEST_DOODAD; break; case EVENT_PLAGUEWOOD_PROGRESS_ALLIANCE: case EVENT_PLAGUEWOOD_PROGRESS_HORDE: uiCredit = NPC_PLAGUEWOOD_TOWER_QUEST_DOODAD; break; } if (!uiCredit) return; for(PlayerSet::iterator itr = m_sPlayersSet.begin(); itr != m_sPlayersSet.end(); ++itr) { if (!(*itr)) continue; (*itr)->KilledMonsterCredit(uiCredit); (*itr)->RewardHonor(NULL, 1, HONOR_REWARD_PLAGUELANDS); } }