Merge branch '30-changes-for-silan-refactoring' into main/yubo-dev

main/yubo-dev
Nuno 3 years ago
commit 1898b0db6d

@ -460,11 +460,14 @@ void CGameContextMenu::update()
fameValue = pLeafFame->getValue8(); fameValue = pLeafFame->getValue8();
} }
bool enable_rumors = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:ENABLE_RUMORS")->getValueBool();
if (_TextNews) if (_TextNews)
_TextNews->setActive(!UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue >= -30); _TextNews->setActive(enable_rumors && !UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue >= -30);
if (_TextNewsAgressive) if (_TextNewsAgressive)
_TextNewsAgressive->setActive(!UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue < -30); _TextNewsAgressive->setActive(enable_rumors && !UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue < -30);
if (_TextDuel && _TextUnDuel) if (_TextDuel && _TextUnDuel)

@ -497,7 +497,7 @@ REGISTER_ACTION_HANDLER(CHandlerContextCreateGuild, "context_create_guild");
// *************************************************************************** // ***************************************************************************
// GCM Mission option // GCM Mission option
// *************************************************************************** // ***************************************************************************
class CHandlerContextMissionOption : public IActionHandler class CHandlerContextOpenMissionOption : public IActionHandler
{ {
public: public:
void execute (CCtrlBase * /* pCaller */, const std::string &sParams) void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
@ -524,9 +524,25 @@ public:
} }
} }
}; };
REGISTER_ACTION_HANDLER(CHandlerContextOpenMissionOption, "open_mission_option");
class CHandlerContextMissionOption : public IActionHandler
{
public:
void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
{
std::string id = getParam(sParams, "id");
sint intId;
if (!fromString(id, intId)) return;
UserEntity->moveToMission(UserEntity->targetSlot(), 3.0, intId);
}
};
REGISTER_ACTION_HANDLER(CHandlerContextMissionOption, "mission_option"); REGISTER_ACTION_HANDLER(CHandlerContextMissionOption, "mission_option");
// *************************************************************************** // ***************************************************************************
// GCM Missions // GCM Missions
// *************************************************************************** // ***************************************************************************

@ -1611,7 +1611,7 @@ void CUserEntity::moveToAction(CEntityCL *ent)
case CUserEntity::Mission: case CUserEntity::Mission:
{ {
string param = toString("id=%d", _MoveToMissionId); string param = toString("id=%d", _MoveToMissionId);
CAHManager::getInstance()->runActionHandler("mission_option", 0, param); CAHManager::getInstance()->runActionHandler("open_mission_option", 0, param);
} }
break; break;
// Dynamic Mission // Dynamic Mission

Loading…
Cancel
Save