MCPcopy Create free account
hub / github.com/TurningWheel/Barony / setCalloutText

Method setCalloutText

src/interface/interface.cpp:27745–28894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27743}
27744
27745std::string CalloutRadialMenu::setCalloutText(Field* field, const char* iconName, Uint32 color,
27746 CalloutRadialMenu::CalloutCommand cmd, SetCalloutTextTypes setType, const int targetPlayer)
27747{
27748 if ( !field && setType == SET_CALLOUT_BANNER_TEXT ) { return ""; }
27749 auto findIcon = CalloutRadialMenu::iconEntries.find(iconName);
27750 if ( findIcon == CalloutRadialMenu::iconEntries.end() )
27751 {
27752 return "";
27753 }
27754 std::string key = "default";
27755 Entity* entity = uidToEntity(lockOnEntityUid);
27756 const int player = getPlayer();
27757
27758 Entity* playerEntity = Player::getPlayerInteractEntity(player);
27759
27760 if ( players[player]->isLocalPlayer() )
27761 {
27762 if ( lockOnEntityUid == 0 )
27763 {
27764 if ( cmd == CALLOUT_CMD_AFFIRMATIVE
27765 || cmd == CALLOUT_CMD_NEGATIVE )
27766 {
27767 entity = playerEntity;
27768 }
27769 else if ( cmd == CALLOUT_CMD_HELP )
27770 {
27771 entity = playerEntity;
27772 }
27773 }
27774
27775 if ( cmd == CALLOUT_CMD_SOUTH
27776 || cmd == CALLOUT_CMD_SOUTHWEST
27777 || cmd == CALLOUT_CMD_SOUTHEAST )
27778 {
27779 int toPlayer = getPlayerForDirectPlayerCmd(getPlayer(), cmd);
27780 Entity* toPlayerEntity = Player::getPlayerInteractEntity(toPlayer);
27781 if ( toPlayer >= 0 && toPlayer < MAXPLAYERS
27782 && toPlayerEntity && !client_disconnected[toPlayer] )
27783 {
27784 entity = toPlayerEntity;
27785 }
27786 }
27787 }
27788
27789 if ( cmd == CALLOUT_CMD_MOVE )
27790 {
27791 if ( setType == SET_CALLOUT_BANNER_TEXT )
27792 {
27793 setCalloutBannerTextUnformatted(player, field, iconName, "default", color);
27794 }
27795 else if ( setType == SET_CALLOUT_ICON_KEY )
27796 {
27797 return "default";
27798 }
27799 else
27800 {
27801 return getCalloutMessage(findIcon->second.text_map["default"], nullptr, targetPlayer);
27802 }

Callers

nothing calls this directly

Calls 15

stringCopyFunction · 0.85
getEntityHungerIntervalFunction · 0.85
getMonsterLocalizedNameFunction · 0.85
monsterNameIsGenericFunction · 0.85
isLocalPlayerMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected