Add infos into target window
[ryzomcore.git] / ryzom / client / src / game_context_menu.h
blob499bd519781fae6f2a14361406067ef440097b62
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010-2020 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef NL_GAME_CONTEXT_MENU_H
23 #define NL_GAME_CONTEXT_MENU_H
25 #include "nel/misc/types_nl.h"
26 #include "main_loop.h"
27 #include "nel/gui/ctrl_text_button.h"
28 #include "nel/gui/interface_group.h"
29 #include "interface_v3/interface_pointer.h"
30 #include "game_share/bot_chat_types.h"
33 // ***************************************************************************
34 namespace NLGUI
36 class CGroupMenu;
37 class CViewTextMenu;
40 namespace NLMISC{
41 class CCDBNodeLeaf;
44 // ***************************************************************************
45 /**
46 * Update Context menu
47 * \author Lionel Berenguier
48 * \author Nevrax France
49 * \date 2003
51 class CGameContextMenu
53 public:
55 /// Constructor
56 CGameContextMenu();
58 // init with IM and DB
59 void init(const std::string &menuId);
61 // update the context menu
62 void update();
64 bool isBuilding() const { return _OkTextTradeOutpostBuilding; }
66 private:
68 // Conditions
69 bool canAttack();
70 bool canDuel();
71 bool canPvpChallenge();
72 bool canDisengage();
73 bool canTeamKick();
75 void updateContextMenuMissionsOptions( bool forceHide );
76 void updateContextMenuWebPage(uint options);
77 void updateContextMenuOutpostState(uint options);
78 void updateContextMenuOutpostBanish();
79 void updateContextMenuMissionRing();
81 // talk.
82 void updateContextMenuTalkEntries(uint options);
83 void setupContextMenuCantTalk();
84 void setupContextMenuTalkWithPlayer();
85 void applyTextTalk();
87 // MilkoPad
88 CInterfaceGroupPtr _GroupMilkoPad;
89 NLMISC::CCDBNodeLeaf *_MilkoAttackDisengage;
90 CCtrlTextButtonPtr _MilkoAttDisBut1;
91 CCtrlTextButtonPtr _MilkoAttDisBut2;
93 CGroupMenu *_GroupMenu;
94 NLMISC::CCDBNodeLeaf *_ContextVal;
95 NLMISC::CCDBNodeLeaf *_AvailablePrograms;
96 NLMISC::CCDBNodeLeaf *_ServerTeamPresent;
97 NLMISC::CCDBNodeLeaf *_MissionOption[NUM_MISSION_OPTIONS];
98 NLMISC::CCDBNodeLeaf *_ServerInDuel;
99 NLMISC::CCDBNodeLeaf *_ServerInPvpChallenge;
100 NLMISC::CCDBNodeLeaf *_WebPageTitle;
101 NLMISC::CCDBNodeLeaf *_OutpostSheet;
102 NLMISC::CCDBNodeLeaf *_OutpostRightToBannish;
103 NLMISC::CCDBNodeLeaf *_MissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
106 CViewTextMenuPtr _TextLootAction;
107 CViewTextMenuPtr _TextQuartering;
108 CViewTextMenuPtr _TextAttack;
109 CViewTextMenuPtr _TextDuel;
110 CViewTextMenuPtr _TextUnDuel;
111 CViewTextMenuPtr _TextPvpChallenge;
112 CViewTextMenuPtr _TextUnPvpChallenge;
113 CViewTextMenuPtr _TextExchange;
114 CViewTextMenuPtr _TextMount;
115 CViewTextMenuPtr _TextFreeLook;
116 CViewTextMenuPtr _TextMove;
117 CViewTextMenuPtr _TextStop;
118 CViewTextMenuPtr _TextDisengage;
119 CViewTextMenuPtr _TextUnseat;
120 CViewTextMenuPtr _TextInfo;
121 CViewTextMenuPtr _TextFollow;
122 CViewTextMenuPtr _TextAssist;
123 CViewTextMenuPtr _TextInvit;
124 CViewTextMenuPtr _TextGuildInvit;
125 CViewTextMenuPtr _TextQuitTeam;
126 CViewTextMenuPtr _TextAddToFriendList;
127 CViewTextMenuPtr _TextMission[NUM_MISSION_OPTIONS];
129 // Pack Animal
130 CViewTextMenuPtr _TextPAFollow;
131 CViewTextMenuPtr _TextPAStop;
132 CViewTextMenuPtr _TextPAFree;
133 CViewTextMenuPtr _TextPAEnterStable;
134 CViewTextMenuPtr _TextPAEnterBag;
136 // BotChat and player talk
137 CViewTextMenuPtr _TextNews;
138 CViewTextMenuPtr _TextNewsAgressive;
139 CViewTextMenuPtr _TextTradeItem;
140 CViewTextMenuPtr _TextTradeTeleport;
141 CViewTextMenuPtr _TextTradeFaction;
142 CViewTextMenuPtr _TextTradeCosmetic;
143 CViewTextMenuPtr _TextTradeGuildOptions;
144 CViewTextMenuPtr _TextTradeOutpostBuilding;
145 CViewTextMenuPtr _TextTradeGuildRoleMaster;
146 CViewTextMenuPtr _TextTradePact;
147 CViewTextMenuPtr _TextTradePhrase;
148 CViewTextMenuPtr _TextChooseMission;
149 CViewTextMenuPtr _TextCreateGuild;
150 CViewTextMenuPtr _TextDynamicMission;
151 CViewTextMenuPtr _TextTalk;
152 CViewTextMenuPtr _TextChooseZCCharge;
153 CViewTextMenuPtr _TextChooseBuilding;
154 CViewTextMenuPtr _TextBuyRM;
155 CViewTextMenuPtr _TextUpgradeRM;
156 CViewTextMenuPtr _TextCancelZCCharge;
157 CViewTextMenuPtr _TextDestroyBuilding;
158 CViewTextMenuPtr _TextOutpostState;
159 CViewTextMenuPtr _TextOutpostBanishPlayer;
160 CViewTextMenuPtr _TextOutpostBanishGuild;
161 CViewTextMenuPtr _TextWebPage;
162 CViewTextMenuPtr _TextInvisible;
163 CViewTextMenuPtr _TextInvulnerable;
164 CViewTextMenuPtr _TextGod;
165 CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
167 // Forage source
168 CViewTextMenuPtr _TextExtractRM;
170 // Build Spire
171 CViewTextMenuPtr _TextBuildTotem;
173 // Use intermediate OK value. not good thing to do "text->setActive(false); text->setActive(true)" each frame for nothing.
174 bool _OkTextNews;
175 bool _OkTextTradeItem;
176 bool _OkTextTradeTeleport;
177 bool _OkTextTradeFaction;
178 bool _OkTextTradeCosmetic;
179 bool _OkTextTradeGuildOptions;
180 bool _OkTextTradeOutpostBuilding;
181 bool _OkTextTradeGuildRoleMaster;
182 bool _OkTextTradePact;
183 bool _OkTextTradePhrase;
184 bool _OkTextChooseMission;
185 bool _OkTextCreateGuild;
186 bool _OkTextDynamicMission;
187 bool _OkTextTalk;
188 bool _OkTextChooseZCCharge;
189 bool _OkTextChooseBuilding;
190 bool _OkTextBuyRM;
191 bool _OkTextUpgradeRM;
192 bool _OkTextCancelZCCharge;
193 bool _OkTextDestroyBuilding;
194 bool _OkTextOutpostState;
195 bool _OkTextWebPage;
199 class CEntityCL;
202 * Enable/disable various menu items for animals.
203 * selectedAnimalInVision can be NULL (out of vision)
204 * index can be -1 (no owned animal)
205 * Any CViewTextMenu* can be NULL
207 bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index, bool clearAll,
208 CViewTextMenu *pFollow, CViewTextMenu *pStop, CViewTextMenu *pFree,
209 CViewTextMenu *pEnterStable, CViewTextMenu *pLeaveStable,
210 CViewTextMenu *pMount, CViewTextMenu *pUnmount,
211 CViewTextMenu *pEnterBag, CViewTextMenu *pLeaveBag );
214 #endif // NL_GAME_CONTEXT_MENU_H
216 /* End of game_context_menu.h */