Merge branch 'yubo' into SIELA1915/friend_list_groups_and_notes

merge-requests/7/merge
Ulukyn 4 years ago
commit 3d6869fbae

@ -444,9 +444,13 @@ namespace NLGUI
SGlobalTexture ()
{
FromGlobaleTexture = true;
Scale = 1.f;
}
uint32 Width, Height;
uint32 DefaultWidth, DefaultHeight;
// used by texture atlas to unscale individual texture
// getTextureSizeFromId() calls to return 1x size for GUI.
float Scale;
NL3D::UTexture *Texture;
std::string Name;
bool FromGlobaleTexture;

@ -621,9 +621,7 @@ namespace NLGUI
return;
sint32 txw, txh;
SImage &rImage = *getSImage(nTxId);
txw = (sint32)((rImage.UVMax.U - rImage.UVMin.U)*rImage.GlobalTexturePtr->Width+0.5f);
txh = (sint32)((rImage.UVMax.V - rImage.UVMin.V)*rImage.GlobalTexturePtr->Height+0.5f);
getTextureSizeFromId(nTxId, txw, txh);
drawRotFlipBitmap (layerId, x, y, txw, txh, rot, flipv, nTxId, col);
}
@ -859,6 +857,14 @@ namespace NLGUI
CIFile ifTmp;
if (ifTmp.open(filename))
CBitmap::loadSize (ifTmp, gt.Width, gt.Height);
// extract textures scale from filename
// texture_interface_v3_2x.tga / texture_interface_v3_4x.tga
if (textureFileName.find("_2x.") != std::string::npos)
gt.Scale = 2.f;
else if (textureFileName.find("_4x.") != std::string::npos)
gt.Scale = 4.f;
gt.Texture = driver->createTextureFile (filename);
// Force to generate the texture now. This way we can extract the mouse bitmaps from it now without having to load it again.
// Its why we don't release it at the end, because it is likely to be uploaded soon)
@ -932,6 +938,10 @@ namespace NLGUI
CBitmap curs;
curs.resize(x1 - x0, y1 - y0);
curs.blit(*texDatas, x0, y0, (x1 - x0), (y1 - y0), 0, 0);
// TODO: scaled cursors not supported
if (gt.Scale > 1.f) {
curs.resample((sint)(curs.getWidth() / gt.Scale), (sint)(curs.getHeight() / gt.Scale));
}
driver->addCursor(image.Name, curs);
}
}
@ -1357,8 +1367,8 @@ namespace NLGUI
else
{
SImage &rImage = *getSImage(id);
width = (sint32)((rImage.UVMax.U - rImage.UVMin.U)*rImage.GlobalTexturePtr->Width+0.5f);
height = (sint32)((rImage.UVMax.V - rImage.UVMin.V)*rImage.GlobalTexturePtr->Height+0.5f);
width = (sint32)(((rImage.UVMax.U - rImage.UVMin.U)*rImage.GlobalTexturePtr->Width / rImage.GlobalTexturePtr->Scale)+0.5f);
height = (sint32)(((rImage.UVMax.V - rImage.UVMin.V)*rImage.GlobalTexturePtr->Height / rImage.GlobalTexturePtr->Scale)+0.5f);
}
}
/*
@ -1373,9 +1383,11 @@ namespace NLGUI
SImage &rImage = *getSImage(id);
SGlobalTexture &rGT = *rImage.GlobalTexturePtr;
// get (possibly) scaled width/height
sint32 width, height;
width = (sint32)((rImage.UVMax.U - rImage.UVMin.U)*rGT.Width+0.5f);
height = (sint32)((rImage.UVMax.V - rImage.UVMin.V)*rGT.Height+0.5f);
getTextureSizeFromId(id, width, height);
if (width == 0 || height == 0)
return CRGBA(255,255,255);
float xRatio = ((float)x) / ((float)(width));
float yRatio = ((float)y) / ((float)(height));
UTexture *pTF = rGT.Texture;

@ -136,7 +136,7 @@ public:
if (pCSDst->isShortCut())
pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB();
else
pPM->CompositionPhraseMemoryLineDest= 0;
pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryAltLineDB();
pPM->CompositionPhraseMemorySlotDest= pCSDst->getIndexInDB();
}
@ -536,7 +536,7 @@ public:
CInterfaceManager *pIM= CInterfaceManager::getInstance();
// Launch the modal to select the faber plan
extern void fillFaberPlanSelection(const std::string &brickDB, uint maxSelection, TOOL_TYPE::TCraftingToolType toolType);
extern void fillFaberPlanSelection(const std::string &brickDB, uint maxSelection, TOOL_TYPE::TCraftingToolType toolType);
// from sphrase_manager.cpp
extern TOOL_TYPE::TCraftingToolType getRightHandCraftToolType();
fillFaberPlanSelection(CDBGroupBuildPhrase::BrickSelectionDB, CDBGroupBuildPhrase::MaxSelection, getRightHandCraftToolType());
@ -750,8 +750,8 @@ class CHandlerMemorizePhraseOrMacro : public IActionHandler
{
public:
virtual void execute (CCtrlBase *pCaller, const string &Params);
void memorizePhraseOrMacro(uint dstMemoryIndex, bool isMacro, sint32 phraseId, sint32 macroId);
void memorizePhraseSheet(uint dstMemoryIndex, uint32 sheetId);
void memorizePhraseOrMacro(sint32 memoryLine, uint dstMemoryIndex, bool isMacro, sint32 phraseId, sint32 macroId);
void memorizePhraseSheet(sint32 memoryLine, uint dstMemoryIndex, uint32 sheetId);
};
REGISTER_ACTION_HANDLER( CHandlerMemorizePhraseOrMacro, "memorize_phrase_or_macro");
@ -771,7 +771,11 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
// The dest must be a memory or a macro memory
if (!pCSDst->isSPhraseIdMemory() && !pCSDst->isMacroMemory()) return;
// get the memory line and memory index
sint32 dstMemoryLine= pPM->getSelectedMemoryLineDB();
sint32 dstMemoryLine;
if (pCSDst->isShortCut())
dstMemoryLine = pPM->getSelectedMemoryLineDB();
else
dstMemoryLine = pPM->getSelectedMemoryAltLineDB();
uint dstMemoryIndex= pCSDst->getIndexInDB();
bool srcIsMacro;
@ -806,7 +810,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
pPM->sendLearnToServer(newPhraseId);
// memorize the new phrase
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, newPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, newPhraseId, srcMacroId);
}
}
else
@ -833,7 +837,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
if(pCSSrc->isSPhrase())
{
// learn and memorize this phrase
memorizePhraseSheet(dstMemoryIndex, pCSSrc->getSheetId());
memorizePhraseSheet(dstMemoryLine, dstMemoryIndex, pCSSrc->getSheetId());
}
else
{
@ -842,7 +846,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
pPM->fullDeletePhraseIfLast(dstMemoryLine, dstMemoryIndex);
// memorize the phrase or macro
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
}
}
// Else the src is a memory too
@ -868,7 +872,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
pPM->sendLearnToServer(newPhraseId);
// memorize the new phrase
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, newPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, newPhraseId, srcMacroId);
}
else
{
@ -876,7 +880,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
pPM->fullDeletePhraseIfLast(dstMemoryLine, dstMemoryIndex);
// memorize the macro (still a reference)
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
}
}
// else this is a swap!
@ -887,17 +891,23 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
{
// get the memory index for src
uint srcMemoryIndex= pCSSrc->getIndexInDB();
// get the memory line for src
sint32 srcMemoryLine;
if (pCSSrc->isShortCut())
srcMemoryLine = pPM->getSelectedMemoryLineDB();
else
srcMemoryLine = pPM->getSelectedMemoryAltLineDB();
// memorize dst into src
memorizePhraseOrMacro(srcMemoryIndex, dstIsMacro, dstPhraseId, dstMacroId);
memorizePhraseOrMacro(srcMemoryLine, srcMemoryIndex, dstIsMacro, dstPhraseId, dstMacroId);
// memorize src into dst
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
}
// else, it's a move
else
{
// copy
memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
memorizePhraseOrMacro(dstMemoryLine, dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId);
// forget src (after shorctut change!)
CAHManager::getInstance()->runActionHandler("forget_phrase_or_macro", pCSSrc);
@ -909,13 +919,12 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P
// memorize a spell
void CHandlerMemorizePhraseOrMacro::memorizePhraseOrMacro(uint memoryIndex, bool isMacro, sint32 phraseId, sint32 macroId)
void CHandlerMemorizePhraseOrMacro::memorizePhraseOrMacro(sint32 memoryLine, uint memoryIndex, bool isMacro, sint32 phraseId, sint32 macroId)
{
CSPhraseManager *pPM= CSPhraseManager::getInstance();
sint32 memoryLine= pPM->getSelectedMemoryLineDB();
if(memoryLine<0)
return;
if (memoryLine<0)
return;
if(isMacro)
{
@ -931,11 +940,10 @@ void CHandlerMemorizePhraseOrMacro::memorizePhraseOrMacro(uint memoryIndex, bool
}
// memorize a default spell
void CHandlerMemorizePhraseOrMacro::memorizePhraseSheet(uint memoryIndex, uint32 sheetId)
void CHandlerMemorizePhraseOrMacro::memorizePhraseSheet(sint32 memoryLine, uint memoryIndex, uint32 sheetId)
{
CSPhraseManager *pPM= CSPhraseManager::getInstance();
sint32 memoryLine= pPM->getSelectedMemoryLineDB();
if(memoryLine<0)
return;
@ -989,7 +997,11 @@ public:
return;
// Ok, the user try to forget a phrase slot.
sint32 memoryLine= pPM->getSelectedMemoryLineDB();
sint32 memoryLine;
if (pCSDst->isShortCut())
memoryLine = pPM->getSelectedMemoryLineDB();
else
memoryLine = pPM->getSelectedMemoryAltLineDB();
if(memoryLine<0)
return;
@ -1026,6 +1038,9 @@ public:
if (!pCSDst->isSPhraseIdMemory() && !pCSDst->isMacroMemory())
return;
// is alternative action bar
bool isMain = pCSDst->isShortCut();
// get the memory index
uint memoryIndex = pCSDst->getIndexInDB();
@ -1034,7 +1049,9 @@ public:
// build params string
string sParams;
sParams.append("memoryIndex=");
sParams.append("isMain=");
sParams.append(toString(isMain));
sParams.append("|memoryIndex=");
sParams.append(toString(memoryIndex));
sParams.append("|isMacro=");
sParams.append(toString(isMacro));
@ -1066,11 +1083,10 @@ public:
// Ok, the user try to forget a phrase slot
CSPhraseManager *pPM = CSPhraseManager::getInstance();
sint32 memoryLine = pPM->getSelectedMemoryLineDB();
if (memoryLine<0)
return;
// get params
bool isMain;
fromString(getParam(Params, "isMain"), isMain);
uint memoryIndex;
fromString(getParam(Params, "memoryIndex"), memoryIndex);
bool isMacro;
@ -1078,6 +1094,14 @@ public:
sint32 phraseId;
fromString(getParam(Params, "phraseId"),phraseId);
sint32 memoryLine;
if (isMain)
memoryLine = pPM->getSelectedMemoryLineDB();
else
memoryLine = pPM->getSelectedMemoryAltLineDB();
if (memoryLine<0)
return;
if (isMacro)
{
pPM->forgetMacro(memoryLine, memoryIndex);
@ -1513,7 +1537,7 @@ public:
if (pCSDst->isShortCut())
memoryLine = pPM->getSelectedMemoryLineDB();
else
memoryLine = 0;
memoryLine = pPM->getSelectedMemoryAltLineDB();
if(memoryLine<0)
return;

@ -588,7 +588,8 @@ void CBotChatPageTrade::updateTradeModal()
if ((_BuyMean == MoneyGuildXP) || (_BuyMean == GuildMoney) || (_BuyMean == GuildMoneyGuildXP))
{
uint64 totalPrice = (uint64) priceWithoutFame * (uint64) quantity;
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:PRICE")->setValue64(totalPrice);
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:UNIT_PRICE")->setValue64(totalPrice);
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:UNIT_PRICE_WITH_FAME")->setValue64(totalPrice);
uint64 totalXP = (uint64) getCurrItemXP() * (uint64) quantity;
CGuildManager *pGM = CGuildManager::getInstance();

@ -425,6 +425,9 @@ CViewBase *CChatTextManager::createMsgTextComplex(const ucstring &msg, NLMISC::C
ucstring::size_type pos = 0;
// Manage Translations
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
bool originalFirst = node->getValueBool();
string::size_type startTr = msg.find(ucstring("{:"));
string::size_type endOfOriginal = msg.find(ucstring("}@{"));
@ -436,12 +439,22 @@ CViewBase *CChatTextManager::createMsgTextComplex(const ucstring &msg, NLMISC::C
string texture = "flag-"+toLower(msg.substr(startTr+2, 2)).toString()+".tga";
ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5);
pos = endOfOriginal+3;
ucstring translation = msg.substr(endOfOriginal+3);
CCtrlButton *ctrlButton = new CCtrlButton(CViewBase::TCtorParam());
ctrlButton->setTexture(texture);
ctrlButton->setTextureOver(texture);
ctrlButton->setTexturePushed(texture);
ctrlButton->setDefaultContextHelp(original);
if (!originalFirst)
{
ctrlButton->setDefaultContextHelp(original);
pos = endOfOriginal+3;
}
else
{
ctrlButton->setDefaultContextHelp(translation);
pos = startTr+5;
textSize = endOfOriginal;
}
ctrlButton->setId("tr");
para->addChild(ctrlButton);
}

@ -846,10 +846,25 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
// Clean bubble from translation system
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
bool originalFirst = node->getValueBool();
ucstring::size_type pos = 0;
ucstring::size_type textSize = ucsText.size();
string::size_type startTr = ucsText.find(ucstring("{:"));
string::size_type endOfOriginal = ucsText.find(ucstring("}@{"));
if (endOfOriginal != string::npos)
pos = endOfOriginal+4;
{
if (!originalFirst)
{
pos = endOfOriginal+4;
}
else
{
pos = startTr+5;
textSize = endOfOriginal;
}
}
// Output the message in a bubble
@ -870,7 +885,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
return;
// Get a bubble
CGroupInSceneBubble *bubble = newBubble (ucsText.substr(pos));
CGroupInSceneBubble *bubble = newBubble (ucsText.substr(pos, textSize-pos));
if (bubble)
{
// Link the bubble

@ -67,6 +67,7 @@ NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupListAscensor, std::string, "list_sheet
#define VIEW_TEXT_GUILD_QUIT "ui:interface:guild:content:tab_guild_info:quit_guild"
#define CTRL_SHEET_GUILD_BLASON "ui:interface:guild:content:tab_guild_info:blason"
#define VIEW_TEXT_GUILD_MEMBER_COUNT "ui:interface:guild:content:tab_guild_info:member_count"
#define VIEW_TEXT_GUILD_MEMBER_COUNT_ONLINE "ui:interface:guild:content:tab_guild_info:member_count_online"
#define LIST_GUILD_MEMBERS "ui:interface:guild:content:tab_guild:list_member:guild_members"
@ -817,6 +818,7 @@ class CAHGuildSheetOpen : public IActionHandler
if (pParent == NULL) return;
pParent->clearGroups();
pParent->setDynamicDisplaySize(false);
uint member_online = 0;
for (uint i = 0; i < rGuildMembers.size(); i++)
{
// create the member line
@ -855,11 +857,13 @@ class CAHGuildSheetOpen : public IActionHandler
switch(rGuildMembers[i].Online)
{
case ccs_online:
member_online++;
onlineView->setTexture("w_online.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline"));
break;
case ccs_online_abroad:
member_online++;
onlineView->setTexture("w_online_abroad.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad"));
@ -895,6 +899,12 @@ class CAHGuildSheetOpen : public IActionHandler
pLine->setParent (pParent);
pParent->addChild (pLine);
}
// update member online count view
CViewText *pOnlineMember = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(VIEW_TEXT_GUILD_MEMBER_COUNT_ONLINE));
if (pOnlineMember)
pOnlineMember->setText(toString(member_online));
}
}
};

@ -3769,6 +3769,21 @@ void CInventoryManager::sortBag()
if (pIconList != NULL) pIconList->needToSort();
pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA3_TEXT));
if (pList != NULL) pList->needToSort();
pIconList = dynamic_cast<CDBGroupIconListBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA4_ICONS));
if (pIconList != NULL) pIconList->needToSort();
pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA4_TEXT));
if (pList != NULL) pList->needToSort();
pIconList = dynamic_cast<CDBGroupIconListBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA5_ICONS));
if (pIconList != NULL) pIconList->needToSort();
pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA5_TEXT));
if (pList != NULL) pList->needToSort();
pIconList = dynamic_cast<CDBGroupIconListBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA6_ICONS));
if (pIconList != NULL) pIconList->needToSort();
pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA6_TEXT));
if (pList != NULL) pList->needToSort();
}
// ***************************************************************************

@ -822,6 +822,15 @@ private:
#define LIST_PA3_TEXT "ui:interface:inv_pa3:content:iil:bag_list"
#define LIST_PA3_ICONS "ui:interface:inv_pa3:content:iil:bag_icons"
#define LIST_PA4_TEXT "ui:interface:inv_pa4:content:iil:bag_list"
#define LIST_PA4_ICONS "ui:interface:inv_pa4:content:iil:bag_icons"
#define LIST_PA5_TEXT "ui:interface:inv_pa5:content:iil:bag_list"
#define LIST_PA5_ICONS "ui:interface:inv_pa5:content:iil:bag_icons"
#define LIST_PA6_TEXT "ui:interface:inv_pa6:content:iil:bag_list"
#define LIST_PA6_ICONS "ui:interface:inv_pa6:content:iil:bag_icons"
// Theorically never used
#define LIST_BAG2_TEXT "ui:interface:inv_bag:content:iil:bag_list"
#define LIST_BAG2_ICONS "ui:interface:inv_bag:content:iil:bag_icons"

@ -565,6 +565,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isDynStringAvailable),
LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetShape),
LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex),
@ -3469,6 +3470,30 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet)
return CEntitySheet::typeToString(sheetPtr->Type);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet)
{
//H_AUTO(Lua_CLuaIHM_getSheetType)
const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet));
if (!sheetPtr)
return "";
if (sheetPtr->type() == CEntitySheet::ITEM)
{
CItemSheet *sheet = (CItemSheet*)sheetPtr;
return sheet->getShape();
}
else if (sheetPtr->type() == CEntitySheet::FAUNA)
{
CCharacterSheet *sheet = (CCharacterSheet*)(sheetPtr);
return sheet->Body.getItem();
}
return "";
}
// ***************************************************************************
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)

@ -204,6 +204,7 @@ private:
static bool isDynStringAvailable(sint32 dynStringId);
static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet);
static std::string getSheetShape(const std::string &sheet);
static std::string getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName);

@ -411,7 +411,7 @@ void CSPhraseManager::forgetPhrase(uint32 memoryLine, uint32 memorySlot)
_Memories[memoryLine].Slot[memorySlot].Id= 0;
// must update DB?
if((sint32)memoryLine==_SelectedMemoryDB)
if((sint32)memoryLine==_SelectedMemoryDB || (sint32)memoryLine==_SelectedMemoryDBalt)
{
// update the db
updateMemoryDBSlot(memorySlot);
@ -465,7 +465,7 @@ void CSPhraseManager::memorizePhrase(uint32 memoryLine, uint32 memorySlot, ui
_Memories[memoryLine].Slot[memorySlot].Id= slot;
// must update DB?
if((sint32)memoryLine==_SelectedMemoryDB)
if((sint32)memoryLine==_SelectedMemoryDB || (sint32)memoryLine==_SelectedMemoryDBalt)
{
// update the DB
updateMemoryDBSlot(memorySlot);
@ -3276,7 +3276,7 @@ void CSPhraseManager::memorizeMacro(uint32 memoryLine, uint32 memorySlot, uint32
_Memories[memoryLine].Slot[memorySlot].Id= macroId;
// must update DB?
if((sint32)memoryLine==_SelectedMemoryDB)
if((sint32)memoryLine==_SelectedMemoryDB || (sint32)memoryLine==_SelectedMemoryDBalt)
{
// update the DB
updateMemoryDBSlot(memorySlot);
@ -3302,7 +3302,7 @@ void CSPhraseManager::forgetMacro(uint32 memoryLine, uint32 memorySlot)
_Memories[memoryLine].Slot[memorySlot].Id= 0;
// must update DB?
if((sint32)memoryLine==_SelectedMemoryDB)
if((sint32)memoryLine==_SelectedMemoryDB || (sint32)memoryLine==_SelectedMemoryDBalt)
{
// update the db
updateMemoryDBSlot(memorySlot);

@ -733,6 +733,12 @@ std::string CItemGroupManager::toDbPath(INVENTORIES::TInventory inventory)
return LIST_PA2_TEXT; break;
case INVENTORIES::pet_animal4:
return LIST_PA3_TEXT; break;
case INVENTORIES::pet_animal5:
return LIST_PA4_TEXT; break;
case INVENTORIES::pet_animal6:
return LIST_PA5_TEXT; break;
case INVENTORIES::pet_animal7:
return LIST_PA6_TEXT; break;
case INVENTORIES::player_room:
return LIST_ROOM_TEXT;break;
case INVENTORIES::guild:

@ -269,6 +269,7 @@ public:
void setStartRyzomAtEnd(bool startAtEnd){ _StartRyzomAtEnd = startAtEnd; }
// Forward message to installation software if needed
void fatalError(const std::string& errorId, const std::string& param1, const std::string& param2);
bool bnpUnpack(const std::string &srcBigfile, const std::string &dstPath, std::vector<std::string> &vFilenames);
const std::string & getServerVersion () { return ServerVersion; }
private:
@ -320,8 +321,6 @@ private:
void getPatchFromDesc(SFileToPatch &ftpOut, const CBNPFile &fIn, bool forceCheckSumTest);
bool bnpUnpack(const std::string &srcBigfile, const std::string &dstPath, std::vector<std::string> &vFilenames);
// stop the threads (called when knowing the thread ended)
void stopCheckThread();
void stopPatchThread();

@ -200,9 +200,38 @@ int main(int argc, char *argv[])
Args.setVersion(getDisplayVersion());
Args.setDescription("Ryzom client");
Args.addArg("p", "patch", "patch", "Name of the file to use tp xdelta the source file");
Args.addArg("s", "source", "source", "Name of source file to xdelta with patch file");
Args.addArg("d", "destination", "destination", "Name of destination operation (patch or unpack)");
Args.addArg("u", "unpack", "unpack", "Name of bnp file to unpack");
if (!Args.parse(argc, argv)) return 1;
if (Args.haveArg("p") && Args.haveArg("p") && Args.haveArg("p"))
{
string patchName = Args.getArg("p").front();
string sourceName = Args.getArg("s").front();
string destinationName = Args.getArg("d").front();
std::string errorMsg;
CXDeltaPatch::TApplyResult ar = CXDeltaPatch::apply(patchName, sourceName, destinationName, errorMsg);
nlinfo("%s", errorMsg.c_str());
return ar;
}
// initialize patch manager and set the ryzom full path, before it's used
CPatchManager *pPM = CPatchManager::getInstance();
if (Args.haveArg("u") && Args.haveArg("d"))
{
string bnpName = Args.getArg("u").front();
string destinationName = Args.getArg("d").front();
vector<string> vFilenames;
if (pPM->bnpUnpack(bnpName, destinationName, vFilenames))
return 0;
return 1;
}
// create logs in temporary directory
createDebug(CPath::getTemporaryDirectory().c_str(), true, true);
@ -244,8 +273,6 @@ int main(int argc, char *argv[])
printf("\n");
printf("Checking %s files to patch...\n", convert(CI18N::get("TheSagaOfRyzom")).c_str());
// initialize patch manager and set the ryzom full path, before it's used
CPatchManager *pPM = CPatchManager::getInstance();
// use PatchUrl
vector<string> patchURLs;

Loading…
Cancel
Save