本文整理汇总了C++中Reference::addSuiBox方法的典型用法代码示例。如果您正苦于以下问题:C++ Reference::addSuiBox方法的具体用法?C++ Reference::addSuiBox怎么用?C++ Reference::addSuiBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference::addSuiBox方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendBanReason
void PlayerManagementSessionImplementation::sendBanReason(bool unban) {
ManagedReference<CreatureObject*> admin = this->admin.get();
if (admin == NULL || accountBox == NULL)
return;
Reference<PlayerObject*> ghost = admin->getPlayerObject();
if (ghost == NULL)
return;
if (!ghost->hasSuiBox(accountBox->getBoxID()))
sendAccountInfo();
if (reasonBox == NULL) {
reasonBox = new SuiInputBox(admin, SuiWindowType::ADMIN_BAN_REASON);
reasonBox->setUsingObject(admin);
reasonBox->setCallback(new PlayerManagementSessionSuiCallback(admin->getZoneServer()));
}
if (unban) {
reasonBox->setPromptTitle("ENTER UNBAN REASON");
reasonBox->setPromptText("Enter the reason for unbanning");
} else {
reasonBox->setPromptTitle("ENTER BAN REASON");
reasonBox->setPromptText("Enter the reason for the ban");
}
ghost->addSuiBox(reasonBox);
admin->sendMessage(reasonBox->generateMessage());
}
示例2: sendBanDuration
void PlayerManagementSessionImplementation::sendBanDuration() {
ManagedReference<CreatureObject*> admin = this->admin.get();
if (admin == NULL || accountBox == NULL)
return;
Reference<PlayerObject*> ghost = admin->getPlayerObject();
if (ghost == NULL)
return;
if (!ghost->hasSuiBox(accountBox->getBoxID()))
sendAccountInfo();
if (durationBox == NULL) {
durationBox = new SuiInputBox(admin, SuiWindowType::ADMIN_BAN_DURATION);
durationBox->setPromptTitle("ENTER BAN DURATION");
durationBox->setPromptText("Enter the duration of ban in years, months, days, hours, minutes\n\nEx: 1y 2m 3d 4h 5M");
durationBox->setUsingObject(admin);
durationBox->setCallback(new PlayerManagementSessionSuiCallback(admin->getZoneServer()));
}
ghost->addSuiBox(durationBox);
admin->sendMessage(durationBox->generateMessage());
}
示例3: showUnbanSummary
void PlayerManagementSessionImplementation::showUnbanSummary() {
ManagedReference<CreatureObject*> admin = this->admin.get();
if (admin == NULL)
return;
Reference<PlayerObject*> ghost = admin->getPlayerObject();
if (ghost == NULL)
return;
Locker alocker(targetAccount);
if (unbanSummaryBox == NULL) {
unbanSummaryBox = new SuiMessageBox(admin, SuiWindowType::ADMIN_UNBAN_SUMMARY);
unbanSummaryBox->setOkButton(true, "@ok");
unbanSummaryBox->setCancelButton(true, "@cancel");
unbanSummaryBox->setCallback(new PlayerManagementSessionSuiCallback(admin->getZoneServer()));
unbanSummaryBox->setUsingObject(admin);
unbanSummaryBox->setPromptTitle("Unban Summary");
}
StringBuffer summary;
summary << "Unbanning ";
if (banMode == ACCOUNT && targetAccount != NULL) {
summary << " Account: " << targetAccount->getUsername() << endl;
banExpiration = targetAccount->getBanExpires();
} else if (banMode == GALAXY && galaxyID != 0) {
GalaxyBanEntry* galaxyBan = targetAccount->getGalaxyBan(galaxyID);
if (galaxyBan != NULL) {
banExpiration = galaxyBan->getBanExpiration();
}
summary << " From " << galaxyName << " Galaxy" << endl;
} else if (banMode == CHARACTER && !targetName.isEmpty()) {
summary << " Character: " << targetName << endl;
CharacterListEntry* entry = targetAccount->getCharacterBan(galaxyID, targetName);
if (entry != NULL) {
banExpiration = entry->getBanExpiration();
}
}
summary << getBanDuration(banExpiration) << endl;
summary << "Unban Reason: "<< banReason << endl;
unbanSummaryBox->setPromptText(summary.toString());
ghost->addSuiBox(unbanSummaryBox);
admin->sendMessage(unbanSummaryBox->generateMessage());
}
示例4: sendAccountInfo
void PlayerManagementSessionImplementation::sendAccountInfo() {
ManagedReference<CreatureObject*> admin = this->admin.get();
if (admin == NULL || accountBox == NULL)
return;
Reference<PlayerObject*> ghost = admin->getPlayerObject();
if (ghost == NULL)
return;
admin->sendMessage(accountBox->generateCloseMessage());
ghost->addSuiBox(accountBox);
admin->sendMessage(accountBox->generateMessage());
}
示例5: showBanSummary
void PlayerManagementSessionImplementation::showBanSummary() {
ManagedReference<CreatureObject*> admin = this->admin.get();
if (admin == NULL)
return;
Reference<PlayerObject*> ghost = admin->getPlayerObject();
if (ghost == NULL)
return;
Locker alocker(targetAccount);
if (summaryBox == NULL) {
summaryBox = new SuiListBox(admin, SuiWindowType::ADMIN_BAN_SUMMARY);
summaryBox->setOkButton(true, "@ok");
summaryBox->setCancelButton(true, "@cancel");
summaryBox->setCallback(new PlayerManagementSessionSuiCallback(admin->getZoneServer()));
summaryBox->setUsingObject(admin);
summaryBox->setPromptTitle("Ban Summary");
summaryBox->addMenuItem("Change Duration", 0);
summaryBox->addMenuItem("Change Reason", 0);
summaryBox->addMenuItem("\\#FF0000Complete Ban", 0);
}
StringBuffer summary;
summary << "Banning ";
if (banMode == ACCOUNT && targetAccount != NULL)
summary << " Account: " << targetAccount->getUsername() << endl;
else if (banMode == GALAXY && galaxyID != 0)
summary << " From " << galaxyName << " Galaxy" << endl;
else if (banMode == CHARACTER && !targetName.isEmpty())
summary << " Character: " << targetName << endl;
summary << getBanDuration(banExpiration) << endl;
summary << "Ban Reason: "<< banReason << endl;
summaryBox->setPromptText(summary.toString());
ghost->addSuiBox(summaryBox);
admin->sendMessage(summaryBox->generateMessage());
}
示例6: showCampStatus
void CampTerminalMenuComponent::showCampStatus(SceneObject* sceneObject,
CreatureObject* player) const {
Terminal* terminal = cast<Terminal*>(sceneObject);
if(terminal == NULL) {
error("Terminal is null in CampTerminalMenuComponent::showCampStatus");
return;
}
if (!player->isInRange(terminal, 16)) {
return;
}
StructureObject* camp = cast<StructureObject*>(terminal->getControlledObject());
if(camp == NULL) {
error("Camp is null in CampTerminalMenuComponent::showCampStatus");
return;
}
// Get Camp Area
SortedVector<ManagedReference<ActiveArea* > >* areas = camp->getActiveAreas();
ManagedReference<ActiveArea*> area = NULL;
for(int i = 0; i < areas->size(); ++i) {
area = areas->get(i);
if(area->isCampArea()) {
break;
}
area = NULL;
}
if(area == NULL) {
Reference<StructureManager*> structureManager = StructureManager::instance();
if (structureManager == NULL) {
error("Unable to get StructureManager in CampTerminalMenuComponent::showCampStatus");
return;
}
structureManager->destroyStructure(camp);
player->sendSystemMessage("This camp is broken, removing from world. Thanks!");
error("CampSiteActiveArea is null in CampTerminalMenuComponent::showCampStatus");
return;
}
CampSiteActiveArea* campArea = cast<CampSiteActiveArea*>(area.get());
if(campArea == NULL) {
error("How the fuck did this happen");
return;
}
/// Get Ghost
Reference<PlayerObject*> ghost = player->getSlottedObject("ghost").castTo<PlayerObject*>();
if (ghost == NULL) {
error("PlayerCreature has no ghost in CampTerminalMenuComponent::showCampStatus: " + String::valueOf(player->getObjectID()));
return;
}
ManagedReference<SuiListBox*> suiBox = new SuiListBox(player, SuiWindowType::CAMP_STATUS);
suiBox->setPromptTitle("@camp:mnu_status");
suiBox->setUsingObject(terminal);
suiBox->setPromptText(terminal->getDisplayedName());
StringBuffer owner, time, visitors;
owner << "Owner: " << campArea->getOwner()->getFirstName() << " " <<
camp->getOwnerCreatureObject()->getLastName() << endl;
suiBox->addMenuItem(owner.toString());
time << "Time: " << (campArea->getUptime() / 60) << " minutes, "<< (campArea->getUptime() % 60) << "seconds";
suiBox->addMenuItem(time.toString());
visitors << "Visitors: " << campArea->getVisitorCount() << endl;
suiBox->addMenuItem(visitors.toString());
ghost->addSuiBox(suiBox);
player->sendMessage(suiBox->generateMessage());
}