Merge branch '36-add-ability-to-have-translated-titles-with-untraslated-fields' into main/yubo-dev

main/yubo-dev
Nuno 3 years ago
commit fc32731142

@ -408,6 +408,18 @@ NLMISC_COMMAND(afk, "Set the player as 'away from keyboard'","[<custom text>]")
return true;
}
NLMISC_COMMAND(selfkill, "Kill the player ","")
{
CBitMemStream out;
if(!GenericMsgHeaderMngr.pushNameToStream("COMMAND:SELFKILL", out))
{
nlwarning("Unknown message name COMMAND:SELFKILL");
return false;
}
NetMngr.push(out);
return true;
}
bool randomCheckCharset(std::string const& str)
{
std::string::const_iterator it, itEnd = str.end();

@ -1111,6 +1111,20 @@ public:
REGISTER_ACTION_HANDLER( CHandlerContextWebPage, "context_web_page");
// ***************************************************************************
class CHandlerFullMap : public IActionHandler
{
public:
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
CLuaManager::getInstance().executeLuaScript("game:openFullMap()", true);
}
};
REGISTER_ACTION_HANDLER( CHandlerFullMap, "fullmap");
// ***************************************************************************

@ -1973,16 +1973,15 @@ class CHandlerItemMenuCheck : public IActionHandler
for(i=0;i<MAX_INVENTORY_ANIMAL;i++)
{
if (pMoveToPa[i])
pMoveToPa[i]->setActive(invId!=INVENTORIES::guild &&
(uint)invId!=INVENTORIES::pet_animal+i &&
pMoveToPa[i]->setActive((uint)invId!=INVENTORIES::pet_animal+i &&
invMngr.isInventoryPresent((INVENTORIES::TInventory)(INVENTORIES::pet_animal+i)) );
}
if (pMoveToGuild)
pMoveToGuild->setActive(invId==INVENTORIES::bag && invMngr.isInventoryPresent(INVENTORIES::guild));
pMoveToGuild->setActive(invId!=INVENTORIES::guild && invMngr.isInventoryPresent(INVENTORIES::guild));
if (pMoveToRoom)
pMoveToRoom->setActive(invId==INVENTORIES::bag && invMngr.isInventoryPresent(INVENTORIES::player_room));
pMoveToRoom->setActive(invId!=INVENTORIES::player_room && invMngr.isInventoryPresent(INVENTORIES::player_room));
// std case: can drop / destroy
if(pDrop) pDrop->setActive(invId!=INVENTORIES::guild);
@ -2063,7 +2062,8 @@ class CHandlerItemMenuCheck : public IActionHandler
}
// Only show lock menu item if inventory contains the info
if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock());
if (invId!=INVENTORIES::guild)
if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock());
// **** Gray Entries

@ -50,6 +50,10 @@ using namespace NLMISC;
// ***************************************************************************
const std::string FaberPlanDB= "UI:PHRASE:FABER:FABER_PLAN:SHEET";
const std::string FaberPlanHpBuffDB= "UI:PHRASE:FABER:FABER_PLAN:HP_BUFF";
const std::string FaberPlanSapBuffDB= "UI:PHRASE:FABER:FABER_PLAN:SAP_BUFF";
const std::string FaberPlanStaBuffDB= "UI:PHRASE:FABER:FABER_PLAN:STA_BUFF";
const std::string FaberPlanFocusBuffDB= "UI:PHRASE:FABER:FABER_PLAN:FOCUS_BUFF";
const std::string MPFaberDB= "UI:PHRASE:FABER:MP_BUILD";
const std::string MPSelectionDB= "UI:PHRASE:FABER:MP_SELECT";
const std::string MPQuantityDb= "UI:PHRASE:FABER:MP_QUANTITY";
@ -170,6 +174,16 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn
if(node)
node->setValue32(0);
// Reset buff values
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanHpBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanSapBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanStaBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanFocusBuffDB, false);
if (node) node->setValue32(0);
// Reset the result item
node= NLGUI::CDBManager::getInstance()->getDbProp(ItemResultSheetDB, false);
if(node)
@ -1565,6 +1579,14 @@ void CActionPhraseFaber::updateItemResult()
uint phraseSlot= pPM->getMemorizedPhrase(_ExecuteFromMemoryLine, _ExecuteFromMemoryIndex);
const CSPhraseCom &phrase= pPM->getPhrase(phraseSlot);
uint32 recommendedPropId= pBM->getBrickPropId("cr_recommended");
uint32 crHp = pBM->getBrickPropId("cr_hp");
uint32 crSap = pBM->getBrickPropId("cr_sap");
uint32 crSta = pBM->getBrickPropId("cr_sta");
uint32 crFocus = pBM->getBrickPropId("cr_focus");
sint32 hpBuff = 0;
sint32 sapBuff = 0;
sint32 staBuff = 0;
sint32 focusBuff = 0;
for(i=0;i<phrase.Bricks.size();i++)
{
CSBrickSheet *brick= pBM->getBrick(phrase.Bricks[i]);
@ -1578,10 +1600,30 @@ void CActionPhraseFaber::updateItemResult()
// minimze the level
minLevel= min(minLevel, sint32(brick->Properties[j].Value));
}
if (brick->Properties[j].PropId == crHp)
hpBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crSap)
sapBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crSta)
staBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crFocus)
focusBuff = sint32(brick->Properties[j].Value);
}
}
}
{
NLGUI::CDBManager *cdb = NLGUI::CDBManager::getInstance();
NLMISC::CCDBNodeLeaf *node = cdb->getDbProp(FaberPlanHpBuffDB, false);
if (node) node->setValue32(hpBuff);
node = cdb->getDbProp(FaberPlanSapBuffDB, false);
if (node) node->setValue32(sapBuff);
node = cdb->getDbProp(FaberPlanStaBuffDB, false);
if (node) node->setValue32(staBuff);
node = cdb->getDbProp(FaberPlanFocusBuffDB, false);
if (node) node->setValue32(focusBuff);
}
// **** Parse all MPs setuped, to compute level and stats
uint totalItemPartMPReq= 0;

@ -2534,7 +2534,8 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
// there is max 4 icons
sint32 hArea = (hSheet / 4);
sint32 xIcon = x;
sint32 yIcon = y;
// move buff icons up a row, quantity text is displayed on bottom-left corner
sint32 yIcon = y + hArea;
for (uint i = 0; i < _BuffIcons.size(); ++i)
{
sint32 wIcon = _BuffIcons[i].IconW;

@ -799,7 +799,11 @@ static DECLARE_INTERFACE_USER_FCT(getAnimalInventoryStateText)
// According to server status, change the inventory text
uint status= (uint)args[0].getInteger();
if(ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)status))
if(ANIMAL_STATUS::isInBag((ANIMAL_STATUS::EAnimalStatus)status))
{
result.setString("uiAnimalInBag");
}
else if(ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)status))
{
result.setString("uiAnimalInStable");
}

@ -2903,32 +2903,6 @@ class CHandlerInvCanDropTo : public IActionHandler
if ((pListDstText != NULL) || (pListDstIcon != NULL))
{
bool bCanDrop = true;
// WE CANT DND if we want to dnd from other bag than BAG to guild bag
if (pListDstIcon != NULL)
{
if (pListDstIcon->getInvType() == CInventoryManager::InvGuild)
if (strnicmp(pCSSrc->getSheet().c_str(),"LOCAL:INVENTORY:BAG", 19) != 0)
bCanDrop = false;
}
if (pListDstText != NULL)
{
if (pListDstText->getInvType() == CInventoryManager::InvGuild)
if (strnicmp(pCSSrc->getSheet().c_str(),"LOCAL:INVENTORY:BAG", 19) != 0)
bCanDrop = false;
}
// WE CANT DND if we want to dnd from guild bag to other bag than BAG
if (pListDstIcon != NULL)
{
if (pListDstIcon->getInvType() != CInventoryManager::InvBag)
if (strnicmp(pCSSrc->getSheet().c_str(),"SERVER:GUILD:INVENTORY", 19) == 0)
bCanDrop = false;
}
if (pListDstText != NULL)
{
if (pListDstText->getInvType() != CInventoryManager::InvBag)
if (strnicmp(pCSSrc->getSheet().c_str(),"SERVER:GUILD:INVENTORY", 19) == 0)
bCanDrop = false;
}
// WE CANT DND when packer/mount is too far
if (pListDstIcon != NULL)
@ -3100,7 +3074,6 @@ class CHandlerInvDropTo : public IActionHandler
else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvGuild)) ||
((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvGuild)))
{
if (strnicmp(pCSSrc->getSheet().c_str(), "LOCAL:INVENTORY:BAG", 19) == 0)
CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_guild");
}
else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvRoom)) ||

@ -1681,7 +1681,19 @@ vector<string> CStringManagerClient::getTitleInfos(const string &titleId, bool w
{
if (titleId[0] != '#')
{
listInfos[0] = getSpecialWord(listInfos[0], women);
// Check special case like SON_OF|jane|joe (with SON_OF = "Son of {1} and {2}")
vector<string> titleReps;
splitString(listInfos[0], string("|"), titleReps);
if (titleReps.size() > 1)
{
listInfos[0] = getSpecialWord(titleReps[0], women);
for(uint i=1; i < titleReps.size(); ++i )
{
while(strFindReplace(listInfos[0], toString("{%d}", i), titleReps[i]));
}
}
else
listInfos[0] = getSpecialWord(listInfos[0], women);
}
}

Loading…
Cancel
Save