45 #include "gui/viewport.h" 76 #endif // TMWA_SUPPORT 88 #include "resources/map/map.h" 105 Popup(
"PopupMenu",
"popupmenu.xml"),
107 "popupbrowserbox.xml")),
130 mAllowCleanMenu(true)
204 if (being ==
nullptr ||
221 const std::string &name =
mName;
253 #endif // TMWA_SUPPORT 263 if (guild2 !=
nullptr)
265 if (guild1 !=
nullptr)
267 if (guild1->getId() == guild2->
getId())
272 _(
"Kick from guild"));
276 "@@guild-pos|%s >@@",
279 _(
"Change pos in guild")),
289 _(
"Kick from guild"));
293 "@@guild-pos|%s >@@",
296 _(
"Change pos in guild")),
305 #endif // TMWA_SUPPORT 310 _(
"Invite to guild"));
381 _(
"Remove from attack list"));
388 _(
"Add to priority attack list"));
392 _(
"Add to attack list"));
396 _(
"Add to ignore list"));
422 _(
"Move to master"));
482 std::string creatorName;
484 if (creator !=
nullptr)
485 creatorName = creator->
getName();
489 if (creatorName.empty())
495 creatorName.c_str()),
522 if (being ==
nullptr)
530 const STD_VECTOR<BeingMenuItem> &
menu = info->
getMenu();
531 FOR_EACH (STD_VECTOR<BeingMenuItem>::const_iterator, it, menu)
554 if (
mX == 0 &&
mY == 0)
569 const STD_VECTOR<ActorSprite*> &beings)
577 FOR_EACH (STD_VECTOR<ActorSprite*>::const_iterator, it, beings)
579 const Being *
const being =
dynamic_cast<const Being*
>(*it);
581 if ((being !=
nullptr) && !being->
getName().empty())
619 const std::string &name =
mName;
641 if (party !=
nullptr)
644 if (member !=
nullptr)
664 if (guild2 !=
nullptr)
671 #endif // TMWA_SUPPORT 676 _(
"Kick from guild"));
683 "@@guild-pos|%s >@@",
_(
"Change pos in guild")),
692 #endif // TMWA_SUPPORT 716 if (floorItem ==
nullptr)
729 const std::string name = floorItem->
getName();
770 if (mapItem ==
nullptr)
805 const int x2,
const int y2,
806 const bool isMinimap)
914 if (tab ==
nullptr ||
994 const std::string &name = wTab->
getNick();
1000 if (being !=
nullptr)
1032 if (guild2 !=
nullptr)
1034 if (guild1 !=
nullptr)
1036 if (guild1->getId() == guild2->
getId())
1042 #endif // TMWA_SUPPORT 1047 _(
"Kick from guild"));
1054 _(
"Change pos in guild")),
1064 #endif // TMWA_SUPPORT 1069 _(
"Invite to guild"));
1089 if (party !=
nullptr)
1129 if (guild !=
nullptr)
1132 FOR_EACH (PositionsMap::const_iterator, itr, map)
1135 itr->first, itr->second.c_str()),
1150 for (
int f = 0; f <
maxCards; f ++)
1165 if (window ==
nullptr)
1186 if (window ==
nullptr)
1253 Being *being =
nullptr;
1259 if (link ==
"remove map" && (
mMapItem !=
nullptr))
1267 if (specialLayer !=
nullptr)
1287 else if (link ==
"rename map" && (
mMapItem !=
nullptr))
1293 _(
"Rename map sign "),
1304 else if (link ==
"edit spell" && (
mSpell !=
nullptr))
1308 else if (link ==
"addcomment" && !
mName.empty())
1313 _(
"Player comment "),
1323 if (being !=
nullptr)
1331 static_cast<ActorTypeT>(
mType)));
1336 else if (link ==
"guild-pos" && !
mName.empty())
1341 else if (link ==
"clipboard copy")
1346 else if (link ==
"clipboard paste")
1351 else if (link ==
"gm" && !
mName.empty())
1356 else if (link ==
"mute" && !
mName.empty())
1361 else if (link ==
"show" && !
mName.empty())
1366 else if (link ==
"window close" && (
mCallerWindow !=
nullptr))
1371 else if (link ==
"window unlock" && (
mCallerWindow !=
nullptr))
1376 else if (link ==
"window lock" && (
mCallerWindow !=
nullptr))
1381 else if (link ==
"join chat" && (being !=
nullptr))
1384 if (chat !=
nullptr)
1387 else if (link ==
"craftmenu")
1392 else if (link.compare(0, 10,
"guild-pos-") == 0)
1396 const int num = atoi(link.substr(10).c_str());
1398 if (guild !=
nullptr)
1401 guild->getMember(
mName), num);
1405 else if (link.compare(0, 7,
"player_") == 0)
1411 if (being !=
nullptr)
1418 else if (link.compare(0, 10,
"flooritem_") == 0)
1423 link.substr(10).c_str()),
BeingId);
1427 if (item !=
nullptr)
1431 for (
int f = 0; f <
maxCards; f ++)
1439 else if (link.compare(0, 12,
"hide button_") == 0)
1444 else if (link.compare(0, 12,
"show button_") == 0)
1449 else if (link.compare(0, 9,
"hide bar_") == 0)
1454 else if (link.compare(0, 9,
"show bar_") == 0)
1459 else if (link.compare(0, 12,
"show window_") == 0)
1461 const int id = atoi(link.substr(12).c_str());
1465 else if (link.compare(0, 6,
"mute_+") == 0)
1467 if (being !=
nullptr)
1469 const int time = atoi(link.substr(6).c_str());
1473 else if (link.compare(0, 6,
"mute_-") == 0)
1475 if (being !=
nullptr)
1477 const int time = atoi(link.substr(6).c_str());
1481 else if (!link.empty() && link[0] ==
'/')
1483 std::string cmd = link.substr(1);
1516 for (
int f = 0; f <
maxCards; f ++)
1529 if (being ==
nullptr)
1535 if (being !=
nullptr)
1540 const size_t pos = cmd.find(
' ');
1541 const std::string type(cmd, 0, pos);
1542 std::string args(cmd, pos == std::string::npos ? cmd.size() : pos + 1);
1547 else if (link !=
"cancel")
1549 reportAlways(
"PopupMenu: Warning, unknown action '%s'", link.c_str())
1561 for (
int f = 0; f <
maxCards; f ++)
1580 const int x,
const int y,
1584 if (item ==
nullptr)
1590 for (
int f = 0; f <
maxCards; f ++)
1620 _(
"Add to trade 10"));
1625 _(
"Add to trade half"));
1629 _(
"Add to trade all-1"));
1633 _(
"Add to trade all"));
1669 if ((dialog !=
nullptr) &&
1675 _(
"Move to craft..."));
1698 _(
"Retrieve half"));
1702 _(
"Retrieve all-1"));
1756 if (item !=
nullptr)
1766 for (
int f = 0; f <
maxCards; f ++)
1795 if (item !=
nullptr)
1800 for (
int f = 0; f <
maxCards; f ++)
1808 for (
int f = 0; f <
maxCards; f ++)
1815 if (item !=
nullptr)
1859 if (item !=
nullptr)
1864 for (
int f = 0; f <
maxCards; f ++)
1901 if ((button ==
nullptr) || (
windowMenu ==
nullptr))
1911 for (STD_VECTOR<Button *>::const_iterator it = names.begin(),
1912 it_end = names.end(); it != it_end; ++ it)
1914 const Button *
const btn = *it;
1960 for (STD_VECTOR <ProgressBar*>::const_iterator it = bars.begin(),
1961 it_end = bars.end(); it != it_end; ++it)
1976 for (STD_VECTOR <ProgressBar*>::const_iterator it = bars.begin(),
1977 it_end = bars.end(); it != it_end; ++it)
1980 if ((bar ==
nullptr) || bar == onlyBar)
1988 bar->
getId().c_str()),
1996 bar->
getId().c_str()),
2018 const std::string &name,
2066 getPriorityAttackMobIndex(name);
2102 const std::string &name)
2139 const Being *
const being,
2142 if ((being ==
nullptr) || (item ==
nullptr))
2150 for (
int f = 0; f <
maxCards; f ++)
2226 FOR_EACH (STD_VECTOR<ButtonText*>::const_iterator, it, names)
2245 const int x,
const int y)
2265 if (info ==
nullptr)
2282 _(
"Add skill shortcut"));
2287 _(
"Skill level..."));
2291 _(
"Skill cast type..."));
2295 _(
"Skill offset by x..."));
2299 _(
"Skill offset by y..."));
2308 const bool isOffsetX)
2310 if (info ==
nullptr)
2335 for (
int f = -9; f <= 9; f ++)
2338 "/setskilloffset%c 'ITEMID' %d", letter, f);
2358 if (info ==
nullptr)
2369 for (
int f = 0; f <
maxCards; f ++)
2396 if (info ==
nullptr)
2407 for (
int f = 0; f <
maxCards; f ++)
2425 _(
"Mouse position"));
2598 const bool haveVending =
2606 else if (!haveVending)
2618 else if (!haveVending)
2670 if (party !=
nullptr)
2692 if (being ==
nullptr)
2695 if (chat !=
nullptr)
2725 _(
"Remove from pickup list"));
2732 _(
"Add to pickup list"));
2736 _(
"Add to ignore list"));
2743 if (model ==
nullptr)
2767 for (
int f = 0; f <
maxCards; f ++)
2821 const STD_VECTOR<ItemMenuItem> *
menu =
nullptr;
2847 FOR_EACHP (STD_VECTOR<ItemMenuItem>::const_iterator, it, menu)
2850 const std::string &name = firstMode ?
2852 const std::string &command = firstMode ?
2854 if (command.empty() ||
2865 const bool isProtected)
3023 if (party !=
nullptr &&
3030 _(
"Give party leader"));
3143 _(
"Spawn slave clone"));
3150 _(
"Spawn evil clone"));
3330 _(
"Search spawns"));
3464 for (
int f = 0; f < 9; f ++)
3466 const std::string cmd =
strprintf(
"/craft %d", f);
3470 strprintf(
_(
"Move to craft %d"), f + 1).c_str());
3514 if (party !=
nullptr)
3530 if (guild !=
nullptr)
#define FOR_EACH(type, iter, array)
static bool isStorageActive()
const std::string & getPartyName() const
#define FOR_EACHP(type, iter, array)
virtual void changeMemberPostion(const GuildMember *const member, const int level) const =0
const std::string & getExtName() const
int getPriorityAttackMobsSize() const
BeingInfo * get(const BeingTypeId id)
TradeWindow * tradeWindow
FloorItem * findItem(const BeingId id) const
OutfitWindow * outfitWindow
RelationT getRelation(const std::string &name) const
NpcInputStateT getInputState()
#define fromInt(val, name)
InventoryType ::T InventoryTypeT
const std::string & getComment() const
bool isBuyShopEnabled() const
Item * findItem(const int itemId, const ItemColor color) const
Equipped isEquipped() const
const Guild * getGuild(const std::string &guildName) const
Inventory * getInventory()
void setNick(const std::string &name)
int getCard(const int index) const
const BeingTypeId BeingTypeId_zero
virtual void joinChat(const ChatObject *const chat, const std::string &password) const =0
std::string & replaceAll(std::string &context, const std::string &from, const std::string &to)
bool isInAttackList(const std::string &name) const
bool getServerGuild() const
std::string getString(const int idx) const
bool msg(InputEvent &event)
virtual int getNumberOfElements()=0
const ItemColor ItemColor_one
const std::string & getName() const
int getAttackMobsSize() const
Net::GuildHandler * guildHandler
BeingId getCreatorId() const
const GroupInfo * getGroup(const int id)
void setTile(const int x, const int y, MapItem *const item)
bool isSellShopEnabled() const
static const unsigned int TRADE
bool isMember(const PartyMember *const member) const
ServerCommandType ::T ServerCommandTypeT
Enable mPermissions[static_cast< size_t >(ServerPermissionType::Max)]
void setDialog(TextDialog *dialog)
GuildMember * getMember(const BeingId id) const
const std::string getComment() const
const std::string & getUseButton() const
std::string getName() const
void addSeparator(const std::string &row)
virtual NpcDialog * getCurrentNpcDialog() const =0
void setLinkHandler(LinkHandler *linkHandler)
MiniStatusWindow * miniStatusWindow
bool getBoolValue(const std::string &key) const
const std::string & getUseButton2() const
std::string strprintf(const char *const format,...)
void setSticky(const bool sticky)
const PositionsMap & getPositions() const
const std::string & getNick() const
bool info(InputEvent &event)
const std::vector< BeingMenuItem > & getMenu() const A_CONST
LocalPlayer * localPlayer
SpecialLayer * getSpecialLayer() const
GuildManager * guildManager
virtual void add(Widget *const widget)
std::string trim(std::string const &str)
ItemColor getColor() const
std::string getSeenPlayerById(const BeingId id) const
Being * findBeing(const BeingId id) const
PartyMember * getMember(const BeingId id) const
bool isWindowVisible() const
ChatTabTypeT getType() const
ActorTypeT getType() const
bool getRemoveNames() const
const ItemInfo & getInfo() const
bool isInIgnorePickupList(const std::string &name) const
void setText(const std::string &text)
bool isInPickupList(const std::string &name) const
static uint8_t getMouseState(int &x, int &y)
void showBar(const std::string &name, const Visible visible)
SocialWindow * socialWindow
virtual std::string getElementAt(int i)=0
void setMapItem(const MapItem *const mapItem)
const std::string & getName() const
ServerCommandEnable::Type mCommands[static_cast< size_t >(ServerCommandType::Max)]
Net::AdminHandler * adminHandler
void setOpaque(Opaque opaque)
void setType(const ActorTypeT type)
virtual void mute(const Being *const being, const int type, const int limit) const =0
ChatTabType ::T ChatTabTypeT
std::string getName() const
void setDialog(TextDialog *const dialog)
ServerTypeT getNetworkType()
bool isItemProtected(const int id)
std::string toString(T const &value)
converts any type to a string
const std::vector< ItemMenuItem > & getInventoryMenuConst() const A_CONST
const std::vector< ItemMenuItem > & getStorageMenuConst() const A_CONST
const BeingInfo * getInfo() const
Net::ChatHandler * chatHandler
bool isStickyButtonLock() const
bool isInIgnoreAttackList(const std::string &name) const
HomunculusInfo * getHomunculus()
bool getAllowHighlight() const
Equipm isEquipment() const
int getAttackMobIndex(const std::string &name) const
const std::string & text() const
bool getAlowClose() const
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
Net::NpcHandler * npcHandler
std::string escapeString(std::string str)
const BeingId BeingId_zero
const std::vector< ItemMenuItem > & getCartMenuConst() const A_CONST
static std::string loadComment(const std::string &name, const ActorTypeT &type)
std::vector< ProgressBar * > & getBars()
std::map< unsigned, std::string > PositionsMap
std::string getMap() const
bool isInPriorityAttackList(const std::string &name) const
std::string getGenderSignWithSpace() const
unsigned int getDefault() const
PlayerRelationsManager playerRelations
#define reportAlways(...)
BeingTypeId getSubType() const
ChatObject * getChat() const
ActorManager * actorManager
void removePortal(const int x, const int y)
void addRow(const std::string &row, const bool atTop)
int getCard(const int index) const
virtual ActorTypeT getType() const
const std::string & getGuildName() const