Merge branch 'ryzom/ui/improvements' into yubo

fix_opengl_on_mac
Ulukyn 5 years ago
commit f053eaa157

@ -34,6 +34,7 @@
#include "interface_v3/inventory_manager.h" #include "interface_v3/inventory_manager.h"
#include "motion/user_controls.h" #include "motion/user_controls.h"
#include "sheet_manager.h" #include "sheet_manager.h"
#include "connection.h"
// GAME SHARE // GAME SHARE
#include "game_share/constants.h" #include "game_share/constants.h"
#include "game_share/properties.h" #include "game_share/properties.h"
@ -141,6 +142,9 @@ void CGameContextMenu::init(const std::string &srcMenuId)
_TextQuitTeam = "ui:interface:" + menuId + ":quit_team"; _TextQuitTeam = "ui:interface:" + menuId + ":quit_team";
_TextAddToFriendList = "ui:interface:" + menuId + ":add_to_friend_list"; _TextAddToFriendList = "ui:interface:" + menuId + ":add_to_friend_list";
_TextTalk = "ui:interface:" + menuId + ":talk"; _TextTalk = "ui:interface:" + menuId + ":talk";
_TextInvisible = "ui:interface:" + menuId + ":invisible";
_TextInvulnerable = "ui:interface:" + menuId + ":invulnerable";
_TextGod = "ui:interface:" + menuId + ":god";
// Mission DB and Text link // Mission DB and Text link
@ -257,6 +261,18 @@ void CGameContextMenu::update()
setupContextMenuCantTalk(); // can't talk by default setupContextMenuCantTalk(); // can't talk by default
bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER());
if (_TextInvisible)
_TextInvisible->setActive(showGMOptions);
if (_TextInvulnerable)
_TextInvulnerable->setActive(showGMOptions);
if (_TextGod)
_TextGod->setActive(showGMOptions);
// If mode Combat (no talk, no give, no mount, no extract_rm) // If mode Combat (no talk, no give, no mount, no extract_rm)
if(UserEntity->isFighting()) if(UserEntity->isFighting())
{ {
@ -391,7 +407,7 @@ void CGameContextMenu::update()
if(_TextExchange) if(_TextExchange)
{ {
// Action possible only if the client is not already busy and the selection is able to do this with you.. // Action possible only if the client is not already busy and the selection is able to do this with you..
if(selection && selection->properties().canExchangeItem()) if(selection && selection->isPlayer() && selection->properties().canExchangeItem())
_TextExchange->setActive(!UserEntity->isBusy()); _TextExchange->setActive(!UserEntity->isBusy());
else else
_TextExchange->setActive(false); _TextExchange->setActive(false);
@ -415,6 +431,9 @@ void CGameContextMenu::update()
if (_TextAttack) if (_TextAttack)
_TextAttack->setActive(canAttack()); _TextAttack->setActive(canAttack());
if (_TextNews)
_TextNews->setActive(!canAttack());
if (_TextDuel && _TextUnDuel) if (_TextDuel && _TextUnDuel)
{ {
if ((!UserEntity->isRiding()) && (_ServerInDuel->getValue8() != 0)) if ((!UserEntity->isRiding()) && (_ServerInDuel->getValue8() != 0))
@ -494,7 +513,7 @@ void CGameContextMenu::update()
{ {
bool invitable = false; bool invitable = false;
// User should not be flagged as invitable by himself, so no need to check that selection is not the user // User should not be flagged as invitable by himself, so no need to check that selection is not the user
if(selection && selection->properties().invitable() && propValidation.invitable() ) if(selection && selection->isPlayer() && selection->properties().invitable() && propValidation.invitable() )
{ {
invitable = true; invitable = true;
} }
@ -605,6 +624,7 @@ void CGameContextMenu::update()
// Apply real activation of Talk Texts. // Apply real activation of Talk Texts.
applyTextTalk(); applyTextTalk();
} }
// *************************************************************************** // ***************************************************************************
@ -715,9 +735,16 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
{ {
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
} }
if (result == ucstring("Qui etes-vous ?"))
{
pVTM->setActive(false);
}
else
{
pVTM->setText(result); pVTM->setText(result);
pVTM->setActive(true); pVTM->setActive(true);
} }
}
else else
{ {
pVTM->setText(ucstring("")); pVTM->setText(ucstring(""));
@ -856,7 +883,7 @@ void CGameContextMenu::updateContextMenuTalkEntries(uint options)
options = std::numeric_limits<uint>::max(); // in local mode, force all options to be shown (for debug) options = std::numeric_limits<uint>::max(); // in local mode, force all options to be shown (for debug)
} }
// news // news
_OkTextNews= ((options & (1 << BOTCHATTYPE::NewsFlag))); _OkTextNews= true; //((options & (1 << BOTCHATTYPE::NewsFlag)));
// trade // trade
_OkTextTradeItem= ((options & (1 << BOTCHATTYPE::TradeItemFlag)) != 0); _OkTextTradeItem= ((options & (1 << BOTCHATTYPE::TradeItemFlag)) != 0);
_OkTextTradeTeleport= ((options & (1 << BOTCHATTYPE::TradeTeleportFlag)) != 0); _OkTextTradeTeleport= ((options & (1 << BOTCHATTYPE::TradeTeleportFlag)) != 0);
@ -907,7 +934,6 @@ void CGameContextMenu::setupContextMenuTalkWithPlayer()
// *************************************************************************** // ***************************************************************************
void CGameContextMenu::applyTextTalk() void CGameContextMenu::applyTextTalk()
{ {
if (_TextNews) _TextNews->setActive(_OkTextNews);
if (_TextTradeItem) _TextTradeItem->setActive(_OkTextTradeItem); if (_TextTradeItem) _TextTradeItem->setActive(_OkTextTradeItem);
if (_TextTradeTeleport) _TextTradeTeleport->setActive(_OkTextTradeTeleport); if (_TextTradeTeleport) _TextTradeTeleport->setActive(_OkTextTradeTeleport);
if (_TextTradeFaction) _TextTradeFaction->setActive(_OkTextTradeFaction); if (_TextTradeFaction) _TextTradeFaction->setActive(_OkTextTradeFaction);

@ -155,6 +155,9 @@ private:
CViewTextMenuPtr _TextOutpostBanishPlayer; CViewTextMenuPtr _TextOutpostBanishPlayer;
CViewTextMenuPtr _TextOutpostBanishGuild; CViewTextMenuPtr _TextOutpostBanishGuild;
CViewTextMenuPtr _TextWebPage; CViewTextMenuPtr _TextWebPage;
CViewTextMenuPtr _TextInvisible;
CViewTextMenuPtr _TextInvulnerable;
CViewTextMenuPtr _TextGod;
CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase]; CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
// Forage source // Forage source

Loading…
Cancel
Save