本文整理汇总了C++中Mission::getMaxEnhanceLvl方法的典型用法代码示例。如果您正苦于以下问题:C++ Mission::getMaxEnhanceLvl方法的具体用法?C++ Mission::getMaxEnhanceLvl怎么用?C++ Mission::getMaxEnhanceLvl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mission
的用法示例。
在下文中一共展示了Mission::getMaxEnhanceLvl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleAction
void BriefMenu::handleAction(const int actionId, void *ctx, const int modKeys) {
Mission *pMission = g_Session.getMission();
if (actionId == infosButId_) {
// Buy some informations
if (g_Session.getSelectedBlock().infoLevel < pMission->getMaxInfoLvl()) {
g_Session.setMoney(g_Session.getMoney() - pMission->infoCost(g_Session.getSelectedBlock().infoLevel));
g_Session.getSelectedBlock().infoLevel += 1;
getStatic(txtMoneyId_)->setTextFormated("%d", g_Session.getMoney());
if (g_Session.getSelectedBlock().infoLevel < pMission->getMaxInfoLvl()) {
getStatic(txtInfoId_)->setTextFormated("%d",
pMission->infoCost(g_Session.getSelectedBlock().infoLevel));
} else
getStatic(txtInfoId_)->setText("");
}
getOption(nextButId_)->setVisible(true);
}
if (actionId == enhButId_) {
// Buy some map enhancement
if (g_Session.getSelectedBlock().enhanceLevel < pMission->getMaxEnhanceLvl()) {
g_Session.setMoney(g_Session.getMoney() -
pMission->enhanceCost(g_Session.getSelectedBlock().enhanceLevel));
g_Session.getSelectedBlock().enhanceLevel += 1;
getStatic(txtMoneyId_)->setTextFormated("%d", g_Session.getMoney());
if (g_Session.getSelectedBlock().enhanceLevel < pMission->getMaxEnhanceLvl()) {
getStatic(txtEnhId_)->setTextFormated("%d",
pMission->enhanceCost(g_Session.getSelectedBlock().enhanceLevel));
} else
getStatic(txtEnhId_)->setText("");
}
}
if (actionId == nextButId_) {
// Next page
start_line_ += 14;
getOption(prevButId_)->setVisible(true);
needRendering();
}
if (actionId == prevButId_) {
// Previous page
start_line_ -= 14;
if (start_line_ <= 0) {
start_line_ = 0;
getOption(prevButId_)->setVisible(false);
}
getOption(nextButId_)->setVisible(true);
needRendering();
}
}
示例2: handleShow
void BriefMenu::handleShow() {
menu_manager_->saveBackground();
// grab mission info
int cur_miss = g_Session.getSelectedBlock().mis_id;
Mission *pMission = g_App.missions().loadMission(cur_miss);
assert(pMission != NULL);
g_Session.setMission(pMission);
// NOTE: map is required to be loaded here, because minimap is z=0
pMission->loadMap();
pMission->createMinimap();
bool found = false;
int maxx = pMission->mmax_x_;
int maxy = pMission->mmax_y_;
for (int x = 0; x < maxx && (!found); x++) {
for (int y = 0; y < maxy && (!found); y++) {
if (pMission->getMinimapOverlay(x, y) == 1) {
minimap_scroll_x_ = x;
minimap_scroll_y_ = y;
found = true;
}
}
}
minimap_blink_ticks_ = 0;
minimap_blink_ = 0;
start_line_ = 0;
updateClock();
if (g_Session.getSelectedBlock().infoLevel < pMission->getMaxInfoLvl()) {
getStatic(txtInfoId_)->setTextFormated("%d",
pMission->infoCost(g_Session.getSelectedBlock().infoLevel));
} else
getStatic(txtInfoId_)->setText("");
if (g_Session.getSelectedBlock().enhanceLevel < pMission->getMaxEnhanceLvl()) {
getStatic(txtEnhId_)->setTextFormated("%d",
pMission->enhanceCost(g_Session.getSelectedBlock().enhanceLevel));
} else
getStatic(txtEnhId_)->setText("");
g_System.showCursor();
}