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 () SGlobalTexture ()
{ {
FromGlobaleTexture = true; FromGlobaleTexture = true;
Scale = 1.f;
} }
uint32 Width, Height; uint32 Width, Height;
uint32 DefaultWidth, DefaultHeight; uint32 DefaultWidth, DefaultHeight;
// used by texture atlas to unscale individual texture
// getTextureSizeFromId() calls to return 1x size for GUI.
float Scale;
NL3D::UTexture *Texture; NL3D::UTexture *Texture;
std::string Name; std::string Name;
bool FromGlobaleTexture; bool FromGlobaleTexture;

@ -621,9 +621,7 @@ namespace NLGUI
return; return;
sint32 txw, txh; sint32 txw, txh;
SImage &rImage = *getSImage(nTxId); getTextureSizeFromId(nTxId, txw, txh);
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);
drawRotFlipBitmap (layerId, x, y, txw, txh, rot, flipv, nTxId, col); drawRotFlipBitmap (layerId, x, y, txw, txh, rot, flipv, nTxId, col);
} }
@ -859,6 +857,14 @@ namespace NLGUI
CIFile ifTmp; CIFile ifTmp;
if (ifTmp.open(filename)) if (ifTmp.open(filename))
CBitmap::loadSize (ifTmp, gt.Width, gt.Height); 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); 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. // 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) // 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; CBitmap curs;
curs.resize(x1 - x0, y1 - y0); curs.resize(x1 - x0, y1 - y0);
curs.blit(*texDatas, x0, y0, (x1 - x0), (y1 - y0), 0, 0); 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); driver->addCursor(image.Name, curs);
} }
} }
@ -1357,8 +1367,8 @@ namespace NLGUI
else else
{ {
SImage &rImage = *getSImage(id); SImage &rImage = *getSImage(id);
width = (sint32)((rImage.UVMax.U - rImage.UVMin.U)*rImage.GlobalTexturePtr->Width+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+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); SImage &rImage = *getSImage(id);
SGlobalTexture &rGT = *rImage.GlobalTexturePtr; SGlobalTexture &rGT = *rImage.GlobalTexturePtr;
// get (possibly) scaled width/height
sint32 width, height; sint32 width, height;
width = (sint32)((rImage.UVMax.U - rImage.UVMin.U)*rGT.Width+0.5f); getTextureSizeFromId(id, width, height);
height = (sint32)((rImage.UVMax.V - rImage.UVMin.V)*rGT.Height+0.5f); if (width == 0 || height == 0)
return CRGBA(255,255,255);
float xRatio = ((float)x) / ((float)(width)); float xRatio = ((float)x) / ((float)(width));
float yRatio = ((float)y) / ((float)(height)); float yRatio = ((float)y) / ((float)(height));
UTexture *pTF = rGT.Texture; UTexture *pTF = rGT.Texture;

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

@ -588,7 +588,8 @@ void CBotChatPageTrade::updateTradeModal()
if ((_BuyMean == MoneyGuildXP) || (_BuyMean == GuildMoney) || (_BuyMean == GuildMoneyGuildXP)) if ((_BuyMean == MoneyGuildXP) || (_BuyMean == GuildMoney) || (_BuyMean == GuildMoneyGuildXP))
{ {
uint64 totalPrice = (uint64) priceWithoutFame * (uint64) quantity; 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; uint64 totalXP = (uint64) getCurrItemXP() * (uint64) quantity;
CGuildManager *pGM = CGuildManager::getInstance(); CGuildManager *pGM = CGuildManager::getInstance();

@ -425,6 +425,9 @@ CViewBase *CChatTextManager::createMsgTextComplex(const ucstring &msg, NLMISC::C
ucstring::size_type pos = 0; ucstring::size_type pos = 0;
// Manage Translations // 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 startTr = msg.find(ucstring("{:"));
string::size_type endOfOriginal = 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"; string texture = "flag-"+toLower(msg.substr(startTr+2, 2)).toString()+".tga";
ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5); ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5);
pos = endOfOriginal+3; ucstring translation = msg.substr(endOfOriginal+3);
CCtrlButton *ctrlButton = new CCtrlButton(CViewBase::TCtorParam()); CCtrlButton *ctrlButton = new CCtrlButton(CViewBase::TCtorParam());
ctrlButton->setTexture(texture); ctrlButton->setTexture(texture);
ctrlButton->setTextureOver(texture); ctrlButton->setTextureOver(texture);
ctrlButton->setTexturePushed(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"); ctrlButton->setId("tr");
para->addChild(ctrlButton); para->addChild(ctrlButton);
} }

@ -846,11 +846,26 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
// Clean bubble from translation system // 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 pos = 0;
ucstring::size_type textSize = ucsText.size();
string::size_type startTr = ucsText.find(ucstring("{:"));
string::size_type endOfOriginal = ucsText.find(ucstring("}@{")); string::size_type endOfOriginal = ucsText.find(ucstring("}@{"));
if (endOfOriginal != string::npos) if (endOfOriginal != string::npos)
pos = endOfOriginal+4; {
if (!originalFirst)
{
pos = endOfOriginal+4;
}
else
{
pos = startTr+5;
textSize = endOfOriginal;
}
}
// Output the message in a bubble // Output the message in a bubble
bool show = false; bool show = false;
@ -870,7 +885,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
return; return;
// Get a bubble // Get a bubble
CGroupInSceneBubble *bubble = newBubble (ucsText.substr(pos)); CGroupInSceneBubble *bubble = newBubble (ucsText.substr(pos, textSize-pos));
if (bubble) if (bubble)
{ {
// Link the 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 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 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 "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" #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; if (pParent == NULL) return;
pParent->clearGroups(); pParent->clearGroups();
pParent->setDynamicDisplaySize(false); pParent->setDynamicDisplaySize(false);
uint member_online = 0;
for (uint i = 0; i < rGuildMembers.size(); i++) for (uint i = 0; i < rGuildMembers.size(); i++)
{ {
// create the member line // create the member line
@ -855,11 +857,13 @@ class CAHGuildSheetOpen : public IActionHandler
switch(rGuildMembers[i].Online) switch(rGuildMembers[i].Online)
{ {
case ccs_online: case ccs_online:
member_online++;
onlineView->setTexture("w_online.tga"); onlineView->setTexture("w_online.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline")); toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline"));
break; break;
case ccs_online_abroad: case ccs_online_abroad:
member_online++;
onlineView->setTexture("w_online_abroad.tga"); onlineView->setTexture("w_online_abroad.tga");
if (toolTip) if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad")); toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad"));
@ -895,6 +899,12 @@ class CAHGuildSheetOpen : public IActionHandler
pLine->setParent (pParent); pLine->setParent (pParent);
pParent->addChild (pLine); 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(); if (pIconList != NULL) pIconList->needToSort();
pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA3_TEXT)); pList = dynamic_cast<CDBGroupListSheetBag*>(CWidgetManager::getInstance()->getElementFromId(LIST_PA3_TEXT));
if (pList != NULL) pList->needToSort(); 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_TEXT "ui:interface:inv_pa3:content:iil:bag_list"
#define LIST_PA3_ICONS "ui:interface:inv_pa3:content:iil:bag_icons" #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 // Theorically never used
#define LIST_BAG2_TEXT "ui:interface:inv_bag:content:iil:bag_list" #define LIST_BAG2_TEXT "ui:interface:inv_bag:content:iil:bag_list"
#define LIST_BAG2_ICONS "ui:interface:inv_bag:content:iil:bag_icons" #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(isDynStringAvailable),
LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType), LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetShape),
LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName), LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex), LUABIND_FUNC(getFameIndex),
@ -1245,7 +1246,7 @@ int CLuaIHMRyzom::getMousePos(CLuaState &ls)
CTool::getMousePos(x, y); CTool::getMousePos(x, y);
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
return 2; return 2;
} }
@ -1257,7 +1258,7 @@ int CLuaIHMRyzom::getMouseDown(CLuaState &ls)
ls.push(down); ls.push(down);
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
return 3; return 3;
} }
@ -1266,11 +1267,11 @@ int CLuaIHMRyzom::getMouseMiddleDown(CLuaState &ls)
sint32 x, y; sint32 x, y;
bool down; bool down;
CTool::getMouseMiddleDown(down, x, y); CTool::getMouseMiddleDown(down, x, y);
ls.push(down); ls.push(down);
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
return 3; return 3;
} }
@ -1279,11 +1280,11 @@ int CLuaIHMRyzom::getMouseRightDown(CLuaState &ls)
sint32 x, y; sint32 x, y;
bool down; bool down;
CTool::getMouseRightDown(down, x, y); CTool::getMouseRightDown(down, x, y);
ls.push(down); ls.push(down);
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
return 3; return 3;
} }
@ -1294,10 +1295,10 @@ int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgCount(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER);
uint32 x = (uint32)ls.toInteger(1); uint32 x = (uint32)ls.toInteger(1);
uint32 y = (uint32)ls.toInteger(2); uint32 y = (uint32)ls.toInteger(2);
uint32 w, h; uint32 w, h;
CViewRenderer &viewRender = *CViewRenderer::getInstance(); CViewRenderer &viewRender = *CViewRenderer::getInstance();
viewRender.getScreenSize(w, h); viewRender.getScreenSize(w, h);
@ -1308,11 +1309,11 @@ int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
float cursX = (float)x/(float)w; float cursX = (float)x/(float)w;
float cursY = (float)y/(float)h; float cursY = (float)y/(float)h;
sint32 instance_idx; sint32 instance_idx;
EntitiesMngr.getShapeInstanceUnderPos(cursX, cursY, instance_idx); EntitiesMngr.getShapeInstanceUnderPos(cursX, cursY, instance_idx);
ls.push(instance_idx); ls.push(instance_idx);
return 1; return 1;
} }
@ -1339,7 +1340,7 @@ int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls)
worldViewRay.Up = camMatrix.getK().normed(); worldViewRay.Up = camMatrix.getK().normed();
CVector sceneInter; CVector sceneInter;
CTool::TRayIntersectionType rayInterType = CTool::computeLandscapeRayIntersection(worldViewRay, sceneInter); CTool::TRayIntersectionType rayInterType = CTool::computeLandscapeRayIntersection(worldViewRay, sceneInter);
ls.push(sceneInter.x); ls.push(sceneInter.x);
ls.push(sceneInter.y); ls.push(sceneInter.y);
ls.push(sceneInter.z); ls.push(sceneInter.z);
@ -1367,7 +1368,7 @@ int CLuaIHMRyzom::moveCam(CLuaState &ls)
float z = (float)ls.toNumber(3); float z = (float)ls.toNumber(3);
CVector moves(x, y, z); CVector moves(x, y, z);
UserEntity->setCameraMoves(moves); UserEntity->setCameraMoves(moves);
return 0; return 0;
} }
@ -1541,7 +1542,7 @@ int CLuaIHMRyzom::moveToTarget(CLuaState &ls)
const std::string &url = ls.toString(1); const std::string &url = ls.toString(1);
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
CLuaManager::getInstance().executeLuaScript("ArkTargetUrl = [["+url+"]]", 0); CLuaManager::getInstance().executeLuaScript("ArkTargetUrl = [["+url+"]]", 0);
UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl); UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl);
return 0; return 0;
@ -2180,7 +2181,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
sint32 idx = -1; sint32 idx = -1;
if (!Scene) if (!Scene)
{ {
nlwarning("No scene available"); nlwarning("No scene available");
@ -2189,7 +2190,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
} }
string shape = ls.toString(1); string shape = ls.toString(1);
float x = 0.0f, y = 0.0f, z = 0.0f; float x = 0.0f, y = 0.0f, z = 0.0f;
float scale = 1.0f; float scale = 1.0f;
string context, url, skeleton, texture; string context, url, skeleton, texture;
@ -2197,7 +2198,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
bool transparency = false; bool transparency = false;
bool collision = true; bool collision = true;
bool inIgZone = false; bool inIgZone = false;
if (ls.getTop() >= 2) if (ls.getTop() >= 2)
{ {
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER);
@ -2223,14 +2224,14 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
y = UserEntity->pos().y; y = UserEntity->pos().y;
z = UserEntity->pos().z; z = UserEntity->pos().z;
} }
CVector userDir = UserEntity->dir(); CVector userDir = UserEntity->dir();
if (ls.getTop() >= 5) if (ls.getTop() >= 5)
{ {
CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING);
string angle = ls.toString(5); string angle = ls.toString(5);
if (angle != "user") if (angle != "user")
{ {
float a; float a;
@ -2238,7 +2239,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
userDir = CVector(sin(a), cos(a), 0.f); userDir = CVector(sin(a), cos(a), 0.f);
} }
} }
if (ls.getTop() >= 6) if (ls.getTop() >= 6)
{ {
CLuaIHM::checkArgType(ls, funcName, 6, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 6, LUA_TNUMBER);
@ -2250,19 +2251,19 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
CLuaIHM::checkArgType(ls, funcName, 7, LUA_TBOOLEAN); CLuaIHM::checkArgType(ls, funcName, 7, LUA_TBOOLEAN);
collision = ls.toBoolean(7); collision = ls.toBoolean(7);
} }
if (ls.getTop() >= 8) if (ls.getTop() >= 8)
{ {
CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING);
context = ls.toString(8); context = ls.toString(8);
} }
if (ls.getTop() >= 9) if (ls.getTop() >= 9)
{ {
CLuaIHM::checkArgType(ls, funcName, 9, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 9, LUA_TSTRING);
url = ls.toString(9); url = ls.toString(9);
} }
if (ls.getTop() >= 10) if (ls.getTop() >= 10)
{ {
CLuaIHM::checkArgType(ls, funcName, 10, LUA_TBOOLEAN); CLuaIHM::checkArgType(ls, funcName, 10, LUA_TBOOLEAN);
@ -2274,25 +2275,25 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
CLuaIHM::checkArgType(ls, funcName, 11, LUA_TBOOLEAN); CLuaIHM::checkArgType(ls, funcName, 11, LUA_TBOOLEAN);
transparency = ls.toBoolean(11); transparency = ls.toBoolean(11);
} }
if (ls.getTop() >= 12) if (ls.getTop() >= 12)
{ {
CLuaIHM::checkArgType(ls, funcName, 12, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 12, LUA_TSTRING);
texture = ls.toString(12); texture = ls.toString(12);
} }
if (ls.getTop() >= 13) if (ls.getTop() >= 13)
{ {
CLuaIHM::checkArgType(ls, funcName, 13, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 13, LUA_TSTRING);
skeleton = ls.toString(13); skeleton = ls.toString(13);
} }
if (ls.getTop() >= 14) if (ls.getTop() >= 14)
{ {
CLuaIHM::checkArgType(ls, funcName, 14, LUA_TBOOLEAN); CLuaIHM::checkArgType(ls, funcName, 14, LUA_TBOOLEAN);
inIgZone = ls.toBoolean(14); inIgZone = ls.toBoolean(14);
} }
CShapeInstanceReference instref = EntitiesMngr.createInstance(shape, CVector(x, y, z), context, url, collision, inIgZone, idx); CShapeInstanceReference instref = EntitiesMngr.createInstance(shape, CVector(x, y, z), context, url, collision, inIgZone, idx);
UInstance instance = instref.Instance; UInstance instance = instref.Instance;
@ -2373,9 +2374,9 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
instance.setPos(CVector(x, y, z)); instance.setPos(CVector(x, y, z));
instance.setRotQuat(dir.getRot()); instance.setRotQuat(dir.getRot());
} }
instance.setTransformMode(UTransformable::RotEuler); instance.setTransformMode(UTransformable::RotEuler);
// if the shape is a particle system, additionnal parameters are user params // if the shape is a particle system, additionnal parameters are user params
UParticleSystemInstance psi; UParticleSystemInstance psi;
psi.cast (instance); psi.cast (instance);
@ -2398,7 +2399,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
} }
} }
}*/ }*/
UMovePrimitive *primitive = instref.Primitive; UMovePrimitive *primitive = instref.Primitive;
if (primitive) if (primitive)
{ {
@ -2408,7 +2409,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
primitive->setReactionType(UMovePrimitive::Slide); primitive->setReactionType(UMovePrimitive::Slide);
primitive->setTriggerType(UMovePrimitive::NotATrigger); primitive->setTriggerType(UMovePrimitive::NotATrigger);
primitive->setAbsorbtion(0); primitive->setAbsorbtion(0);
primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox); primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox);
primitive->setSize((bbox.getMax().x - bbox.getMin().x)*scale, (bbox.getMax().y - bbox.getMin().y)*scale); primitive->setSize((bbox.getMax().x - bbox.getMin().x)*scale, (bbox.getMax().y - bbox.getMin().y)*scale);
primitive->setHeight((bbox.getMax().z - bbox.getMin().z)*scale); primitive->setHeight((bbox.getMax().z - bbox.getMin().z)*scale);
@ -2416,10 +2417,10 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
primitive->setCollisionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setCollisionMask(MaskColPlayer | MaskColNpc | MaskColDoor);
primitive->setOcclusionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setOcclusionMask(MaskColPlayer | MaskColNpc | MaskColDoor);
primitive->setObstacle(true); primitive->setObstacle(true);
primitive->setGlobalPosition(instance.getPos(), dynamicWI); primitive->setGlobalPosition(instance.getPos(), dynamicWI);
primitive->insertInWorldImage(dynamicWI); primitive->insertInWorldImage(dynamicWI);
} }
} }
@ -2434,9 +2435,9 @@ int CLuaIHMRyzom::setupShape(CLuaState &ls)
CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgCount(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
std::vector<string> keys; std::vector<string> keys;
std::vector<string> values; std::vector<string> values;
CLuaObject params; CLuaObject params;
@ -2459,12 +2460,12 @@ int CLuaIHMRyzom::setupShape(CLuaState &ls)
values.push_back(it.nextValue().toString()); values.push_back(it.nextValue().toString());
keys.push_back(it.nextKey().toString()); keys.push_back(it.nextKey().toString());
} }
if (EntitiesMngr.setupInstance(idx, keys, values)) if (EntitiesMngr.setupInstance(idx, keys, values))
ls.push(1); ls.push(1);
else else
ls.pushNil(); ls.pushNil();
return 1; return 1;
} }
@ -2476,15 +2477,15 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls)
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector pos = EntitiesMngr.getInstancePos(idx); CVector pos = EntitiesMngr.getInstancePos(idx);
string x = ls.toString(2); string x = ls.toString(2);
string y = ls.toString(3); string y = ls.toString(3);
string z = ls.toString(4); string z = ls.toString(4);
float move_x = 0; float move_x = 0;
float move_y = 0; float move_y = 0;
float move_z = 0; float move_z = 0;
@ -2502,7 +2503,7 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls)
pos.x = move_x; pos.x = move_x;
} }
} }
if (!y.empty()) if (!y.empty())
{ {
if (y[0] == '+') if (y[0] == '+')
@ -2516,7 +2517,7 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls)
pos.y = move_y; pos.y = move_y;
} }
} }
if (!z.empty()) if (!z.empty())
{ {
if (z[0] == '+') if (z[0] == '+')
@ -2530,12 +2531,12 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls)
pos.z = move_z; pos.z = move_z;
} }
} }
if (EntitiesMngr.setInstancePos(idx, pos)) if (EntitiesMngr.setInstancePos(idx, pos))
ls.push(1); ls.push(1);
else else
ls.pushNil(); ls.pushNil();
return 1; return 1;
} }
@ -2547,9 +2548,9 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls)
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector rot = EntitiesMngr.getInstanceRot(idx); CVector rot = EntitiesMngr.getInstanceRot(idx);
string x = ls.toString(2); string x = ls.toString(2);
@ -2573,7 +2574,7 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls)
rot.x = rot_x; rot.x = rot_x;
} }
} }
if (!y.empty()) if (!y.empty())
{ {
if (y[0] == '+') if (y[0] == '+')
@ -2587,7 +2588,7 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls)
rot.y = rot_y; rot.y = rot_y;
} }
} }
if (!z.empty()) if (!z.empty())
{ {
if (z[0] == '+') if (z[0] == '+')
@ -2601,12 +2602,12 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls)
rot.z = rot_z; rot.z = rot_z;
} }
} }
if (EntitiesMngr.setInstanceRot(idx, rot)) if (EntitiesMngr.setInstanceRot(idx, rot))
ls.push(1); ls.push(1);
else else
ls.pushNil(); ls.pushNil();
return 1; return 1;
} }
@ -2615,7 +2616,7 @@ int CLuaIHMRyzom::deleteShape(CLuaState &ls)
const char* funcName = "deleteShape"; const char* funcName = "deleteShape";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
if (EntitiesMngr.deleteInstance((uint32)ls.toInteger(1))) if (EntitiesMngr.deleteInstance((uint32)ls.toInteger(1)))
ls.push(1); ls.push(1);
else else
@ -2629,9 +2630,9 @@ int CLuaIHMRyzom::getShapePos(CLuaState &ls)
const char* funcName = "getShapePos"; const char* funcName = "getShapePos";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector pos = EntitiesMngr.getInstancePos(idx); CVector pos = EntitiesMngr.getInstancePos(idx);
ls.push(pos.x); ls.push(pos.x);
@ -2645,9 +2646,9 @@ int CLuaIHMRyzom::getShapeRot(CLuaState &ls)
const char* funcName = "getShapeRot"; const char* funcName = "getShapeRot";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector rot = EntitiesMngr.getInstanceRot(idx); CVector rot = EntitiesMngr.getInstanceRot(idx);
ls.push(rot.x); ls.push(rot.x);
@ -2661,11 +2662,11 @@ int CLuaIHMRyzom::getShapeScale(CLuaState &ls)
const char* funcName = "getShapeScale"; const char* funcName = "getShapeScale";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector scale = EntitiesMngr.getInstanceScale(idx); CVector scale = EntitiesMngr.getInstanceScale(idx);
ls.push(scale.x); ls.push(scale.x);
ls.push(scale.y); ls.push(scale.y);
ls.push(scale.z); ls.push(scale.z);
@ -2677,11 +2678,11 @@ int CLuaIHMRyzom::getShapeColPos(CLuaState &ls)
const char* funcName = "getShapeColPos"; const char* funcName = "getShapeColPos";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector pos = EntitiesMngr.getInstanceColPos(idx); CVector pos = EntitiesMngr.getInstanceColPos(idx);
ls.push(pos.x); ls.push(pos.x);
ls.push(pos.y); ls.push(pos.y);
ls.push(pos.z); ls.push(pos.z);
@ -2693,11 +2694,11 @@ int CLuaIHMRyzom::getShapeColScale(CLuaState &ls)
const char* funcName = "getShapeColScale"; const char* funcName = "getShapeColScale";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
CVector scale = EntitiesMngr.getInstanceColScale(idx); CVector scale = EntitiesMngr.getInstanceColScale(idx);
ls.push(scale.x); ls.push(scale.x);
ls.push(scale.y); ls.push(scale.y);
ls.push(scale.z); ls.push(scale.z);
@ -2709,11 +2710,11 @@ int CLuaIHMRyzom::getShapeColOrient(CLuaState &ls)
const char* funcName = "getShapeColOrient"; const char* funcName = "getShapeColOrient";
CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint32 idx = (uint32)ls.toInteger(1); uint32 idx = (uint32)ls.toInteger(1);
double orient = EntitiesMngr.getInstanceColOrient(idx); double orient = EntitiesMngr.getInstanceColOrient(idx);
ls.push(orient); ls.push(orient);
return 1; return 1;
} }
@ -3469,6 +3470,30 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet)
return CEntitySheet::typeToString(sheetPtr->Type); 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) std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
@ -3481,7 +3506,7 @@ std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
if (pIS) if (pIS)
return ITEMFAMILY::toString(pIS->Family); return ITEMFAMILY::toString(pIS->Family);
} }
return ""; return "";
} }
@ -3712,7 +3737,7 @@ float CLuaIHMRyzom::setChar3dDBfromVPX(const std::string &branch, const std::str
cs.People = EGSPD::CPeople::fromString(people); cs.People = EGSPD::CPeople::fromString(people);
SCharacter3DSetup::setupDBFromCharacterSummary(branch, cs); SCharacter3DSetup::setupDBFromCharacterSummary(branch, cs);
return cs.VisualPropC.PropertySubData.CharacterHeight; return cs.VisualPropC.PropertySubData.CharacterHeight;
} }
@ -4172,12 +4197,12 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls)
point.LeftClickParam = ls.toString(6); point.LeftClickParam = ls.toString(6);
point.RightClickAction = ls.toString(7); point.RightClickAction = ls.toString(7);
point.RightClickParam = ls.toString(8); point.RightClickParam = ls.toString(8);
point.Color = CRGBA(255,255,255,255); point.Color = CRGBA(255,255,255,255);
if (ls.getTop() >= 9) if (ls.getTop() >= 9)
CLuaIHM::pop(ls, point.Color); CLuaIHM::pop(ls, point.Color);
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL) if (pMap != NULL)
pMap->addArkPoint(point); pMap->addArkPoint(point);

@ -15,7 +15,7 @@ private:
static int luaClientCfgIndex(CLuaState &ls); static int luaClientCfgIndex(CLuaState &ls);
static int luaClientCfgNewIndex(CLuaState &ls); static int luaClientCfgNewIndex(CLuaState &ls);
// CInterfaceElement management on stack, stored by a CRefPtr. // CInterfaceElement management on stack, stored by a CRefPtr.
public: public:
@ -204,6 +204,7 @@ private:
static bool isDynStringAvailable(sint32 dynStringId); static bool isDynStringAvailable(sint32 dynStringId);
static bool isFullyPatched(); static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet); 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 getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId); static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName); static sint32 getFameIndex(const std::string &factionName);
@ -251,7 +252,7 @@ private:
static int addRespawnPoint(CLuaState &ls); static int addRespawnPoint(CLuaState &ls);
static int delArkPoints(CLuaState &ls); static int delArkPoints(CLuaState &ls);
static int setArkPowoOptions(CLuaState &ls); static int setArkPowoOptions(CLuaState &ls);
// open the window to do a tell to 'player', if 'msg' is not empty, then the message will be sent immediatly // open the window to do a tell to 'player', if 'msg' is not empty, then the message will be sent immediatly
// else, current command of the chat window will be replaced with tell 'player' // else, current command of the chat window will be replaced with tell 'player'
@ -260,7 +261,7 @@ private:
static void updateTooltipCoords(); static void updateTooltipCoords();
// test if the ctrl key is down (NB nico : I didn't add other key, // test if the ctrl key is down (NB nico : I didn't add other key,
// because it would be too easy to write a key recorder ...) // because it would be too easy to write a key recorder ...)
static bool isCtrlKeyDown(); static bool isCtrlKeyDown();
static std::string encodeURLUnicodeParam(const ucstring &text); static std::string encodeURLUnicodeParam(const ucstring &text);
static std::string encodeURLParam(const std::string &text); static std::string encodeURLParam(const std::string &text);

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

@ -733,6 +733,12 @@ std::string CItemGroupManager::toDbPath(INVENTORIES::TInventory inventory)
return LIST_PA2_TEXT; break; return LIST_PA2_TEXT; break;
case INVENTORIES::pet_animal4: case INVENTORIES::pet_animal4:
return LIST_PA3_TEXT; break; 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: case INVENTORIES::player_room:
return LIST_ROOM_TEXT;break; return LIST_ROOM_TEXT;break;
case INVENTORIES::guild: case INVENTORIES::guild:

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

@ -200,9 +200,38 @@ int main(int argc, char *argv[])
Args.setVersion(getDisplayVersion()); Args.setVersion(getDisplayVersion());
Args.setDescription("Ryzom client"); 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.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 // create logs in temporary directory
createDebug(CPath::getTemporaryDirectory().c_str(), true, true); createDebug(CPath::getTemporaryDirectory().c_str(), true, true);
@ -244,8 +273,6 @@ int main(int argc, char *argv[])
printf("\n"); printf("\n");
printf("Checking %s files to patch...\n", convert(CI18N::get("TheSagaOfRyzom")).c_str()); 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 // use PatchUrl
vector<string> patchURLs; vector<string> patchURLs;

Loading…
Cancel
Save