46 #include "gui/viewport.h"
89 #include "resources/map/map.h"
106 Popup(
"PopupMenu",
"popupmenu.xml"),
108 "popupbrowserbox.xml")),
131 mAllowCleanMenu(true)
205 if (being ==
nullptr ||
222 const std::string &name =
mName;
264 if (guild2 !=
nullptr)
266 if (guild1 !=
nullptr)
273 _(
"Kick from guild"));
277 "@@guild-pos|%s >@@",
280 _(
"Change pos in guild")),
290 _(
"Kick from guild"));
294 "@@guild-pos|%s >@@",
297 _(
"Change pos in guild")),
311 _(
"Invite to guild"));
382 _(
"Remove from attack list"));
389 _(
"Add to priority attack list"));
393 _(
"Add to attack list"));
397 _(
"Add to ignore list"));
423 _(
"Move to master"));
483 std::string creatorName;
485 if (creator !=
nullptr)
486 creatorName = creator->
getName();
490 if (creatorName.empty())
496 creatorName.c_str()),
523 if (being ==
nullptr)
531 const STD_VECTOR<BeingMenuItem> &
menu =
info->getMenu();
532 FOR_EACH (STD_VECTOR<BeingMenuItem>::const_iterator, it,
menu)
555 if (
mX == 0 &&
mY == 0)
570 const STD_VECTOR<ActorSprite*> &beings)
578 FOR_EACH (STD_VECTOR<ActorSprite*>::const_iterator, it, beings)
580 const Being *
const being =
dynamic_cast<const Being*
>(*it);
582 if ((being !=
nullptr) && !being->
getName().empty())
620 const std::string &name =
mName;
642 if (
party !=
nullptr)
645 if (member !=
nullptr)
665 if (guild2 !=
nullptr)
677 _(
"Kick from guild"));
684 "@@guild-pos|%s >@@",
_(
"Change pos in guild")),
717 if (floorItem ==
nullptr)
730 const std::string name = floorItem->
getName();
771 if (mapItem ==
nullptr)
806 const int x2,
const int y2,
807 const bool isMinimap)
915 if (tab ==
nullptr ||
995 const std::string &name = wTab->
getNick();
1001 if (being !=
nullptr)
1033 if (guild2 !=
nullptr)
1035 if (guild1 !=
nullptr)
1048 _(
"Kick from guild"));
1055 _(
"Change pos in guild")),
1070 _(
"Invite to guild"));
1090 if (
party !=
nullptr)
1130 if (
guild !=
nullptr)
1133 FOR_EACH (PositionsMap::const_iterator, itr, map)
1136 itr->first, itr->second.c_str()),
1151 for (
int f = 0; f <
maxCards; f ++)
1166 if (window ==
nullptr)
1187 if (window ==
nullptr)
1254 Being *being =
nullptr;
1260 if (link ==
"remove map" && (
mMapItem !=
nullptr))
1268 if (specialLayer !=
nullptr)
1288 else if (link ==
"rename map" && (
mMapItem !=
nullptr))
1294 _(
"Rename map sign "),
1305 else if (link ==
"edit spell" && (
mSpell !=
nullptr))
1309 else if (link ==
"addcomment" && !
mName.empty())
1314 _(
"Player comment "),
1324 if (being !=
nullptr)
1337 else if (link ==
"guild-pos" && !
mName.empty())
1342 else if (link ==
"clipboard copy")
1347 else if (link ==
"clipboard paste")
1352 else if (link ==
"gm" && !
mName.empty())
1357 else if (link ==
"mute" && !
mName.empty())
1362 else if (link ==
"show" && !
mName.empty())
1367 else if (link ==
"window close" && (
mCallerWindow !=
nullptr))
1372 else if (link ==
"window unlock" && (
mCallerWindow !=
nullptr))
1377 else if (link ==
"window lock" && (
mCallerWindow !=
nullptr))
1382 else if (link ==
"join chat" && (being !=
nullptr))
1385 if (chat !=
nullptr)
1388 else if (link ==
"craftmenu")
1393 else if (link.compare(0, 10,
"guild-pos-") == 0)
1398 if (
guild !=
nullptr)
1400 const int num = atoi(link.substr(10).c_str());
1406 else if (link.compare(0, 7,
"player_") == 0)
1412 if (being !=
nullptr)
1419 else if (link.compare(0, 10,
"flooritem_") == 0)
1424 link.substr(10).c_str()),
BeingId);
1428 if (item !=
nullptr)
1432 for (
int f = 0; f <
maxCards; f ++)
1440 else if (link.compare(0, 12,
"hide button_") == 0)
1445 else if (link.compare(0, 12,
"show button_") == 0)
1450 else if (link.compare(0, 9,
"hide bar_") == 0)
1455 else if (link.compare(0, 9,
"show bar_") == 0)
1460 else if (link.compare(0, 12,
"show window_") == 0)
1462 const int id = atoi(link.substr(12).c_str());
1466 else if (link.compare(0, 6,
"mute_+") == 0)
1468 if (being !=
nullptr)
1470 const int time = atoi(link.substr(6).c_str());
1474 else if (link.compare(0, 6,
"mute_-") == 0)
1476 if (being !=
nullptr)
1478 const int time = atoi(link.substr(6).c_str());
1482 else if (!link.empty() && link[0] ==
'/')
1484 std::string cmd = link.substr(1);
1517 for (
int f = 0; f <
maxCards; f ++)
1530 if (being ==
nullptr)
1536 if (being !=
nullptr)
1541 const size_t pos = cmd.find(
' ');
1542 const std::string type(cmd, 0, pos);
1543 std::string args(cmd, pos == std::string::npos ? cmd.size() : pos + 1);
1548 else if (link !=
"cancel")
1550 reportAlways(
"PopupMenu: Warning, unknown action '%s'", link.c_str())
1562 for (
int f = 0; f <
maxCards; f ++)
1581 const int x,
const int y,
1582 const Item *
const item,
1585 if (item ==
nullptr)
1591 for (
int f = 0; f <
maxCards; f ++)
1621 _(
"Add to trade 10"));
1626 _(
"Add to trade half"));
1630 _(
"Add to trade all-1"));
1634 _(
"Add to trade all"));
1670 if ((dialog !=
nullptr) &&
1676 _(
"Move to craft..."));
1699 _(
"Retrieve half"));
1703 _(
"Retrieve all-1"));
1757 if (item !=
nullptr)
1767 for (
int f = 0; f <
maxCards; f ++)
1791 const Item *
const item)
1796 if (item !=
nullptr)
1801 for (
int f = 0; f <
maxCards; f ++)
1809 for (
int f = 0; f <
maxCards; f ++)
1816 if (item !=
nullptr)
1851 const Item *
const item)
1860 if (item !=
nullptr)
1865 for (
int f = 0; f <
maxCards; f ++)
1902 if ((button ==
nullptr) || (
windowMenu ==
nullptr))
1912 for (STD_VECTOR<Button *>::const_iterator it = names.begin(),
1913 it_end = names.end(); it != it_end; ++ it)
1915 const Button *
const btn = *it;
1961 for (STD_VECTOR <ProgressBar*>::const_iterator it = bars.begin(),
1962 it_end = bars.end(); it != it_end; ++it)
1977 for (STD_VECTOR <ProgressBar*>::const_iterator it = bars.begin(),
1978 it_end = bars.end(); it != it_end; ++it)
1981 if ((bar ==
nullptr) || bar == onlyBar)
1989 bar->
getId().c_str()),
1997 bar->
getId().c_str()),
2019 const std::string &name,
2067 getPriorityAttackMobIndex(name);
2102 const std::string &name)
2139 const Being *
const being,
2140 const Item *
const item)
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)
2672 if (!
party->isMember(nick))
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 ++)
2803 ?
info.getUseButton2() :
info.getUseButton();
2821 const STD_VECTOR<ItemMenuItem> *
menu =
nullptr;
2825 menu = &
info.getInventoryMenuConst();
2828 menu = &
info.getStorageMenuConst();
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 &&
3024 party->isMember(name) &&
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)
ActorManager * actorManager
Net::AdminHandler * adminHandler
const BeingId BeingId_zero
const BeingTypeId BeingTypeId_zero
Net::ChatHandler * chatHandler
ChatTabType ::T ChatTabTypeT
#define reportAlways(...)
bool isInAttackList(const std::string &name) const
bool isInIgnoreAttackList(const std::string &name) const
Being * findBeing(const BeingId id) const
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
bool isInPriorityAttackList(const std::string &name) const
std::string getSeenPlayerById(const BeingId id) const
int getPriorityAttackMobsSize() const
bool isInPickupList(const std::string &name) const
int getAttackMobsSize() const
FloorItem * findItem(const BeingId id) const
bool isInIgnorePickupList(const std::string &name) const
int getAttackMobIndex(const std::string &name) const
virtual ActorTypeT getType() const
std::string getMap() const
virtual void add(Widget *const widget)
const Guild * getGuild(const std::string &guildName) const
const std::string getComment() const
BeingTypeId getSubType() const
const std::string & getPartyName() const
std::string getGenderSignWithSpace() const
ChatObject * getChat() const
const std::string & getName() const
BeingId getCreatorId() const
bool isBuyShopEnabled() const
const std::string & getGuildName() const
static std::string loadComment(const std::string &name, const ActorTypeT &type)
const std::string & getExtName() const
bool isSellShopEnabled() const
ActorTypeT getType() const
const BeingInfo * getInfo() const
bool getRemoveNames() const
ChatTabTypeT getType() const
bool getAllowHighlight() const
bool getBoolValue(const std::string &key) const
std::string getName() const
int getCard(const int index) const
static uint8_t getMouseState(int &x, int &y)
bool getServerGuild() const
GuildMember * getMember(const BeingId id) const
static bool isStorageActive()
Item * findItem(const int itemId, const ItemColor color) const
Equipm isEquipment() const
int getCard(const int index) const
Equipped isEquipped() const
std::string getName() const
ItemColor getColor() const
const ItemInfo & getInfo() const
virtual std::string getElementAt(int i)=0
virtual int getNumberOfElements()=0
const std::string & getComment() const
SpecialLayer * getSpecialLayer() const
std::vector< ProgressBar * > & getBars()
void showBar(const std::string &name, const Visible visible)
virtual void mute(const Being *const being, const int type, const int limit) const =0
virtual void joinChat(const ChatObject *const chat, const std::string &password) const =0
virtual void changeMemberPostion(const GuildMember *const member, const int level) const =0
virtual NpcDialog * getCurrentNpcDialog() const =0
NpcInputStateT getInputState()
const std::string & getName() const
void setNick(const std::string &name)
void setDialog(TextDialog *const dialog)
void setType(const ActorTypeT type)
unsigned int getDefault() const
RelationT getRelation(const std::string &name) const
const std::string & text() const
void setDialog(TextDialog *dialog)
void setMapItem(const MapItem *const mapItem)
void removePortal(const int x, const int y)
void setTile(const int x, const int y, MapItem *const item)
void addRow(const std::string &row, const bool atTop)
void setOpaque(Opaque opaque)
void addSeparator(const std::string &row)
void setLinkHandler(LinkHandler *linkHandler)
void setText(const std::string &text)
const std::string & getNick() const
bool isWindowVisible() const
bool getAlowClose() const
void setSticky(const bool sticky)
bool isStickyButtonLock() const
#define FOR_EACHP(type, iter, array)
#define FOR_EACH(type, iter, array)
std::map< unsigned, std::string > PositionsMap
Net::GuildHandler * guildHandler
GuildManager * guildManager
#define fromInt(val, name)
InventoryType ::T InventoryTypeT
const ItemColor ItemColor_one
LocalPlayer * localPlayer
MiniStatusWindow * miniStatusWindow
bool kick(InputEvent &event)
bool where(InputEvent &event)
bool heal(InputEvent &event)
bool msg(InputEvent &event)
bool slide(InputEvent &event)
bool info(InputEvent &event)
std::string trim(std::string const &str)
std::string toString(T const &value)
converts any type to a string
const GroupInfo * getGroup(const int id)
BeingInfo * get(const BeingTypeId id)
ServerTypeT getNetworkType()
Inventory * getInventory()
bool isItemProtected(const int id)
HomunculusInfo * getHomunculus()
Net::NpcHandler * npcHandler
OutfitWindow * outfitWindow
PlayerRelationsManager playerRelations
ServerCommandType ::T ServerCommandTypeT
SocialWindow * socialWindow
std::string & replaceAll(std::string &context, const std::string &from, const std::string &to)
std::string strprintf(const char *const format,...)
std::string escapeString(std::string str)
Enable mPermissions[static_cast< size_t >(ServerPermissionType::Max)]
ServerCommandEnable::Type mCommands[static_cast< size_t >(ServerCommandType::Max)]
static const unsigned int TRADE
TradeWindow * tradeWindow