本文整理汇总了C++中ManagedReference::generateMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ ManagedReference::generateMessage方法的具体用法?C++ ManagedReference::generateMessage怎么用?C++ ManagedReference::generateMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManagedReference
的用法示例。
在下文中一共展示了ManagedReference::generateMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleObjectMenuSelect
int LightsaberCrystalComponentImplementation::handleObjectMenuSelect(CreatureObject* player, byte selectedID) {
if (selectedID == 128 && player->hasSkill("force_title_jedi_rank_01") && hasPlayerAsParent(player) && ownerID == 0) {
ManagedReference<SuiMessageBox*> suiMessageBox = new SuiMessageBox(player, SuiWindowType::TUNE_CRYSTAL);
suiMessageBox->setPromptTitle("@jedi_spam:confirm_tune_title");
suiMessageBox->setPromptText("@jedi_spam:confirm_tune_prompt");
suiMessageBox->setCancelButton(true, "Cancel");
suiMessageBox->setUsingObject(_this.getReferenceUnsafeStaticCast());
suiMessageBox->setCallback(new LightsaberCrystalTuneSuiCallback(player->getZoneServer()));
player->getPlayerObject()->addSuiBox(suiMessageBox);
player->sendMessage(suiMessageBox->generateMessage());
}
PlayerObject* ghost = player->getPlayerObject();
if (ghost != NULL && ghost->isPrivileged()){
if (selectedID == 130 && getColor() == 31) {
generateCrystalStats();
} else if (selectedID == 131 && ownerID != 0) {
ownerID = 0;
String tuneName = StringIdManager::instance()->getStringId(objectName.getFullPath().hashCode()).toString();
if (getCustomObjectName().toString().contains("(Exceptional)"))
tuneName = tuneName + " (Exceptional)\\#.";
else if (getCustomObjectName().toString().contains("(Legendary)"))
tuneName = tuneName + " (Legendary)\\#.";
else
tuneName = tuneName + "\\#.";
}
}
return 0;
}
示例2: sendInputBox
void SuiManager::sendInputBox(SceneObject* terminal, SceneObject* player, const String& play, const String& callback, const String& prompt, const String& button) {
if (terminal == NULL)
return;
if (player == NULL || !player->isCreatureObject())
return;
CreatureObject* creature = cast<CreatureObject*>(player);
PlayerObject* playerObject = creature->getPlayerObject();
if (playerObject != NULL) {
ManagedReference<SuiInputBox*> confirmSui = new SuiInputBox(creature, 0x00);
confirmSui->setCallback(new LuaSuiCallback(creature->getZoneServer(), play, callback));
confirmSui->setUsingObject(terminal);
confirmSui->setPromptText(prompt);
confirmSui->setOkButton(true, button);
confirmSui->setOtherButton(false, "");
confirmSui->setCancelButton(false, "");
confirmSui->setForceCloseDistance(32);
creature->sendMessage(confirmSui->generateMessage());
playerObject->addSuiBox(confirmSui);
}
}
示例3: doMusicSelection
void JukeboxImplementation::doMusicSelection(CreatureObject* player) {
PlayerObject* ghost = player->getPlayerObject();
if (ghost == NULL)
return;
PlayerManager* playerManager = player->getZoneServer()->getPlayerManager();
if (playerManager == NULL)
return;
ManagedReference<SuiListBox*> listbox = new SuiListBox(player, SuiWindowType::JUKEBOX_SELECTION);
listbox->setCallback(new JukeboxSelectionSuiCallback(server->getZoneServer()));
listbox->setPromptTitle("@event_perk_jukebox_songs:songs_t"); // Music Select
listbox->setPromptText("@event_perk_jukebox_songs:songs_d"); // Select a song to play from the list below.
listbox->setUsingObject(_this.getReferenceUnsafeStaticCast());
listbox->setForceCloseDistance(32.f);
listbox->setCancelButton(true, "@cancel");
int songListSize = playerManager->getNumJukeboxSongs();
JukeboxSong* song = NULL;
for (int i = 0; i < songListSize; i++) {
song = playerManager->getJukeboxSong(i);
if (song != NULL) {
listbox->addMenuItem(song->getStringId());
}
}
ghost->addSuiBox(listbox);
player->sendMessage(listbox->generateMessage());
}
示例4: showData
void FireworkShowMenuComponent::showData(CreatureObject* player, FireworkObject* fireworkShow) const {
ManagedReference<PlayerObject*> ghost = player->getPlayerObject();
if (ghost == NULL || ghost->hasSuiBoxWindowType(SuiWindowType::FIREWORK_SHOW_ADDEVENT) || ghost->hasSuiBoxWindowType(SuiWindowType::FIREWORK_SHOW_REMOVEEVENT)
|| ghost->hasSuiBoxWindowType(SuiWindowType::FIREWORK_SHOW_REORDERSHOW) || ghost->hasSuiBoxWindowType(SuiWindowType::FIREWORK_SHOW_MODIFYEVENT)
|| ghost->hasSuiBoxWindowType(SuiWindowType::FIREWORK_SHOW_DELAYSELECTION)) {
return;
}
DataObjectComponent* data = fireworkShow->getDataObjectComponent()->get();
if (data == NULL || !data->isFireworkShowData())
return;
FireworkShowDataComponent* fireworkShowData = cast<FireworkShowDataComponent*>(data);
Locker plocker(player);
ManagedReference<SuiListBox*> suiBox = new SuiListBox(player, SuiWindowType::FIREWORK_SHOW_ADDEVENT, SuiListBox::HANDLESINGLEBUTTON);
suiBox->setPromptTitle("@firework:data_title");
suiBox->setPromptText("@firework:data_prompt");
suiBox->setOkButton(true, "@ok");
suiBox->setUsingObject(fireworkShow);
int totalFireworks = fireworkShowData->getTotalFireworkCount();
for (int i = 0; i < totalFireworks; i++) {
ManagedReference<FireworkObject*> firework = fireworkShowData->getFirework(i);
String fireworkDelay = String::valueOf(float(fireworkShowData->getFireworkDelay(i)) / 1000.f);
String menuItem = "(" + String::valueOf(i) + ":" + fireworkDelay + "s) " + firework->getDisplayedName();
suiBox->addMenuItem(menuItem);
}
ghost->addSuiBox(suiBox);
player->sendMessage(suiBox->generateMessage());
}
示例5: sendMaintenanceTransferBox
void DroidMaintenanceSessionImplementation::sendMaintenanceTransferBox(){
// add result
if (selectedStructure == NULL) {
cancelSession();
return;
}
ManagedReference<CreatureObject*> creature = this->player.get();
ManagedReference<DroidMaintenanceModuleDataComponent*> module = this->maintModule.get();
// create transfer box
ManagedReference<SuiTransferBox*> sui = new SuiTransferBox(creature,SuiWindowType::DROID_ADD_STRUCTURE_AMOUNT);
sui->setCallback(new DroidMaintenanceSessionAddCreditsSuiCallback(creature->getZoneServer()));
sui->setPromptTitle("@pet/droid_modules:droid_maint_amount_title"); //Select Amount
bool offplanet = false;
if (selectedStructure->getZone()->getZoneName() != creature->getZone()->getZoneName())
offplanet = true;
StringBuffer promptText = "@pet/droid_modules:droid_maint_amount_prompt \[email protected]_structure:current_maint_pool "+ String::valueOf(selectedStructure->getSurplusMaintenance())+"cr";
selectedFees = 0;
if (offplanet) {
PlanetManager* planetManager = creature->getZone()->getPlanetManager();
if (planetManager == NULL) {
return;
}
int fee = planetManager->getTravelFare(selectedStructure->getZone()->getZoneName(),creature->getZone()->getZoneName());
selectedFees = fee;
promptText << "\[email protected]/droid_modules:droid_maint_diff_planet_prefix " << fee << " @pet/droid_modules:droid_maint_diff_planet_suffix \n";
}
sui->setPromptText(promptText.toString());
// check for off planet, it has a fee
sui->addFrom("@player_structure:total_funds",String::valueOf(availableCredits),String::valueOf(availableCredits), "1");
sui->addTo("@player_structure:to_pay", "0", "0", "1");
creature->getPlayerObject()->addSuiBox(sui);
creature->sendMessage(sui->generateMessage());
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:33,代码来源:DroidMaintenanceSessionImplementation.cpp
示例6: handleStructureAddEnergy
void InstallationObjectImplementation::handleStructureAddEnergy(CreatureObject* player) {
try {
StringBuffer sstext, ssTotalEnergy;
ManagedReference<SuiTransferBox*> energyBox = new SuiTransferBox(player, SuiWindowType::STRUCTURE_ADD_ENERGY);
energyBox->setUsingObject(_this.get());
energyBox->setPromptTitle("@player_structure:add_power");
sstext << "@player_structure:select_power_amount"
<<"\n\[email protected]_structure:current_power_value " << (int) surplusPower;
energyBox->setPromptText(sstext.toString());
ResourceManager* resourceManager = getZoneServer()->getResourceManager();
ssTotalEnergy << resourceManager->getAvailablePowerFromPlayer(player);
energyBox->addFrom("@player_structure:total_energy", ssTotalEnergy.toString(), ssTotalEnergy.toString(), "1");
energyBox->addTo("@player_structure:to_deposit", "0", "0", "1");
energyBox->setCallback(new InsertPowerSuiCallback(server->getZoneServer()));
player->getPlayerObject()->addSuiBox(energyBox);
player->sendMessage(energyBox->generateMessage());
} catch (Exception& e) {
e.printStackTrace();
error("unreported exception in InstallationObjectImplementation::handleStructureAddEnergy");
}
}
示例7: sendMasterLooterList
void GroupManager::sendMasterLooterList(GroupObject* group, CreatureObject* leader) {
//Pre: Leader and group are locked
//Post: Leader and group are locked
if (group == NULL || leader == NULL)
return;
ManagedReference<PlayerObject*> ghost = leader->getPlayerObject();
if (ghost == NULL)
return;
//Close SUI box if already open.
ghost->closeSuiWindowType(SuiWindowType::GROUP_LOOT_PICK_LOOTER);
//Create Master Looter selection list box.
ManagedReference<SuiListBox*> sui = new SuiListBox(leader, SuiWindowType::GROUP_LOOT_PICK_LOOTER);
sui->setPromptTitle("@group:master_looter_sui_title"); //"Select Master Looter"
sui->setPromptText("@group:choose_master_looter"); //"Choose a Master Looter from the list of available players:"
sui->setCancelButton(true, "@ui:cancel");
sui->setOkButton(true, "@ui:ok");
sui->setCallback(new GroupLootPickLooterSuiCallback(leader->getZoneServer()));
for (int i = 0; i < group->getGroupSize(); ++i) {
ManagedReference<CreatureObject*> member = (group->getGroupMember(i)).castTo<CreatureObject*>();
if (member == NULL || !member->isPlayerCreature())
continue;
sui->addMenuItem(member->getFirstName(), member->getObjectID());
}
//Send list box to the group leader.
ghost->addSuiBox(sui);
leader->sendMessage(sui->generateMessage());
}
示例8: sendItemListSUI
void ScavengerDroidImplementation::sendItemListSUI(CreatureObject* player) {
PlayerObject* ghost = player->getPlayerObject();
if (ghost == NULL)
return;
if (itemList.size() == 0) {
player->sendSystemMessage("@event_perk:scavenger_no_items");
return;
}
ManagedReference<SuiListBox*> listbox = new SuiListBox(player, SuiWindowType::SCAVENGER_ITEM_LIST);
listbox->setPromptTitle("@event_perk:scavenger_list_t"); // Scavenger Hunt List
listbox->setPromptText("@event_perk:scavenger_list_d"); // Below you will find the list of items you need to find for the scavenger hunt. Good luck!
listbox->setUsingObject(_this.getReferenceUnsafeStaticCast());
listbox->setForceCloseDistance(32.f);
listbox->setCancelButton(true, "@cancel");
for (int i = 0; i < itemList.size(); i++) {
String itemTemplate = itemList.get(i);
listbox->addMenuItem(TemplateManager::instance()->getTemplate(itemTemplate.hashCode())->getObjectName());
}
ghost->addSuiBox(listbox);
player->sendMessage(listbox->generateMessage());
}
示例9: useObject
int ResourceDeedImplementation::useObject(CreatureObject* creature) {
if (creature == NULL)
return 0;
if (!isASubChildOf(creature))
return 0;
ManagedReference<PlayerObject*> ghost = creature->getPlayerObject();
if (ghost == NULL || ghost->hasSuiBoxWindowType(SuiWindowType::FREE_RESOURCE)) {
//ghost->closeSuiWindowType(SuiWindowType::FREE_RESOURCE);
ghost->removeSuiBoxType(SuiWindowType::FREE_RESOURCE);
return 0;
}
ManagedReference<ResourceManager*> resourceManager = server->getZoneServer()->getResourceManager();
ManagedReference<SuiListBox*> sui = new SuiListBox(creature, SuiWindowType::FREE_RESOURCE);
sui->setUsingObject(_this.getReferenceUnsafeStaticCast());
sui->setCallback(new ResourceDeedSuiCallback(server->getZoneServer(), "Resource"));
sui->setPromptTitle("@veteran:resource_title"); //Resources
sui->setPromptText("@veteran:choose_class"); //Choose resource class
sui->setOtherButton(true, "@back");
sui->setCancelButton(true, "@cancel");
sui->setOkButton(true, "@ok");
resourceManager->addNodeToListBox(sui, "resource");
ghost->addSuiBox(sui);
creature->sendMessage(sui->generateMessage());
return 1;
}
示例10: promptWithdrawMaintenance
void StructureManager::promptWithdrawMaintenance(StructureObject* structure, CreatureObject* creature) {
if (!structure->isGuildHall()) {
return;
}
if (!structure->isOnAdminList(creature)) {
creature->sendSystemMessage("@player_structure:withdraw_admin_only"); // You must be an administrator to remove credits from the treasury.
return;
}
//Get the most up to date maintenance count.
structure->updateStructureStatus();
int surplusMaintenance = structure->getSurplusMaintenance();
if (surplusMaintenance <= 0) {
creature->sendSystemMessage("@player_structure:insufficient_funds_withdrawal"); // Insufficent funds for withdrawal.
return;
}
ManagedReference<PlayerObject*> ghost = creature->getPlayerObject();
if (ghost == NULL)
return;
ManagedReference<SuiInputBox*> sui = new SuiInputBox(creature, SuiWindowType::STRUCTURE_MANAGE_MAINTENANCE);
sui->setCallback(new StructureWithdrawMaintenanceSuiCallback(server));
sui->setPromptTitle("@player_structure:withdraw_maintenance"); // Withdraw From Treasury
sui->setUsingObject(structure);
sui->setPromptText("@player_structure:treasury_prompt " + String::valueOf(surplusMaintenance)); // Treasury:
ghost->addSuiBox(sui);
creature->sendMessage(sui->generateMessage());
}
示例11: sendMessageBox
void SuiManager::sendMessageBox(SceneObject* usingObject, SceneObject* player, const String& title, const String& text, const String& okButton, const String& screenplay, const String& callback) {
if (usingObject == NULL)
return;
if (player == NULL || !player->isCreatureObject())
return;
CreatureObject* creature = cast<CreatureObject*>(player);
PlayerObject* playerObject = creature->getPlayerObject();
if (playerObject != NULL) {
ManagedReference<SuiMessageBox*> messageBox = new SuiMessageBox(creature, 0x00);
messageBox->setCallback(new LuaSuiCallback(creature->getZoneServer(), screenplay, callback));
messageBox->setPromptTitle(title);
messageBox->setPromptText(text);
messageBox->setUsingObject(usingObject);
messageBox->setOkButton(true, okButton);
messageBox->setCancelButton(true, "@cancel");
messageBox->setForceCloseDistance(32.f);
creature->sendMessage(messageBox->generateMessage());
playerObject->addSuiBox(messageBox);
}
}
示例12: sendSignNameTo
void SignObjectImplementation::sendSignNameTo(CreatureObject* player) {
ManagedReference<SuiMessageBox*> suiBox = new SuiMessageBox(player, SuiWindowType::NONE);
suiBox->setPromptTitle("@sui:swg"); //Star Wars Galaxies
suiBox->setPromptText(getDisplayedName());
player->sendMessage(suiBox->generateMessage());
}
示例13: sendListBox
void SuiManager::sendListBox(SceneObject* usingObject, SceneObject* player, const String& title, const String& text, const uint8& numOfButtons, const String& cancelButton, const String& otherButton, const String& okButton, LuaObject& options, const String& screenplay, const String& callback) {
if (usingObject == NULL)
return;
if (player == NULL || !player->isCreatureObject())
return;
CreatureObject* creature = cast<CreatureObject*>(player);
PlayerObject* playerObject = creature->getPlayerObject();
if (playerObject != NULL) {
ManagedReference<SuiListBox*> box = NULL;
switch (numOfButtons) {
case 1:
box = new SuiListBox(creature, 0x00, SuiListBox::HANDLESINGLEBUTTON);
box->setCancelButton(false, "");
box->setOtherButton(false, "");
box->setOkButton(true, okButton);
break;
case 2:
box = new SuiListBox(creature, 0x00, SuiListBox::HANDLETWOBUTTON);
box->setCancelButton(true, cancelButton);
box->setOtherButton(false, "");
box->setOkButton(true, okButton);
break;
case 3:
box = new SuiListBox(creature, 0x00, SuiListBox::HANDLETHREEBUTTON);
box->setCancelButton(true, cancelButton);
box->setOtherButton(true, otherButton);
box->setOkButton(true, okButton);
break;
default:
return;
break;
}
if(options.isValidTable()){
for(int i = 1; i <= options.getTableSize(); ++i){
String optionString = options.getStringAt(i);
box->addMenuItem(optionString);
}
options.pop();
}
box->setCallback(new LuaSuiCallback(creature->getZoneServer(), screenplay, callback));
box->setPromptTitle(title);
box->setPromptText(text);
box->setUsingObject(usingObject);
box->setForceCloseDistance(32.f);
creature->sendMessage(box->generateMessage());
playerObject->addSuiBox(box);
}
}
示例14: sendResourceSUI
void PlantObjectImplementation::sendResourceSUI(CreatureObject* player, int type) {
ManagedReference<PlayerObject*> ghost = player->getPlayerObject();
if (ghost == NULL)
return;
ManagedReference<SuiListBox*> suiBox = new SuiListBox(player, SuiWindowType::GROWABLE_PLANT, SuiListBox::HANDLETWOBUTTON);
suiBox->setCallback(new GrowablePlantSuiCallback(player->getZoneServer()));
suiBox->setPromptTitle("@plant_grow:select_resource_sub");
suiBox->setPromptText("@plant_grow:select_resource_body");
suiBox->setOkButton(true, "@ok");
suiBox->setCancelButton(true, "@cancel");
suiBox->setUsingObject(_this.getReferenceUnsafeStaticCast());
suiBox->setForceCloseDistance(32.f);
ManagedReference<SceneObject*> inventory = player->getSlottedObject("inventory");
ManagedReference<SceneObject*> sceneObject = NULL;
for (int i=0; i< inventory->getContainerObjectsSize(); i++) {
sceneObject = inventory->getContainerObject(i);
if (sceneObject == NULL)
continue;
if (sceneObject->isResourceContainer()) {
ManagedReference<ResourceContainer*> rcno = cast<ResourceContainer*>( sceneObject.get());
if (rcno == NULL)
continue;
ManagedReference<ResourceSpawn*> spawn = rcno->getSpawnObject();
if (spawn == NULL)
continue;
if ((type == 1 && spawn->isType("organic")) || (type == 2 && spawn->isType("water"))) {
suiBox->addMenuItem(spawn->getName(), sceneObject->getObjectID());
}
}
}
if (suiBox->getMenuSize() > 0) {
ghost->closeSuiWindowType(SuiWindowType::GROWABLE_PLANT);
ghost->addSuiBox(suiBox);
player->sendMessage(suiBox->generateMessage());
} else {
if (type == 1)
player->sendSystemMessage("@plant_grow:no_nutrients"); // You don't have any nutrients.
else
player->sendSystemMessage("@plant_grow:no_water"); // You don't have any water.
}
}
示例15: handleObjectMenuSelect
int CoaMessageMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* player, byte selectedID) {
if (!player->isPlayerCreature()) {
return 0;
}
if (!sceneObject->isASubChildOf(player)) {
player->sendSystemMessage("@encoded_disk/message_fragment:sys_not_in_inv"); // The disk can't be used unless it is in your inventory!
return 0;
}
TangibleObject* disk = cast<TangibleObject*>(sceneObject);
if (disk == NULL) {
return 0;
}
PlayerObject* ghost = player->getPlayerObject();
if (ghost == NULL) {
return 0;
}
if (selectedID == 20) {
CoaMessageDataComponent* data = cast<CoaMessageDataComponent*>(disk->getDataObjectComponent()->get());
if (data == NULL) {
return 0;
}
String title = disk->getObjectName()->getFullPath();
StringBuffer body;
body << "@encoded_disk/message_fragment:complete_event";
if (data->getFaction().toLowerCase() == "imperial") {
body << "imp1\n\n" << "@encoded_disk/message_fragment:frag_eventimp1_" << String::valueOf(data->getNumber());
} else if (data->getFaction().toLowerCase() == "rebel") {
body << "reb1\n\n" << "@encoded_disk/message_fragment:frag_eventreb1_" << String::valueOf(data->getNumber());
} else {
return 0;
}
ManagedReference<SuiMessageBox*> box = new SuiMessageBox(player, SuiWindowType::COA_MESSAGE);
box->setPromptTitle(title);
box->setPromptText(body.toString());
box->setUsingObject(disk);
box->setOkButton(true, "@close");
ghost->addSuiBox(box);
player->sendMessage(box->generateMessage());
return 0;
}
return TangibleObjectMenuComponent::handleObjectMenuSelect(sceneObject, player, selectedID);
}