Changed: Merge changes from next patch

This commit is contained in:
kervala 2011-05-26 14:33:04 +02:00
parent e59f5dbf31
commit 9093af7439
34 changed files with 730 additions and 71 deletions

View file

@ -71,6 +71,8 @@ public:
const NLMISC::CMatrix *StaticMatrix; // Useful if stick mode is "StaticMatrix"
uint MaxNumAnimCount; // Number of frame on which the fx can overlap when it is being shutdown
float TimeOut;
double StartTime;
float DelayBeforeStart;
public:
CBuildInfo()
{
@ -80,6 +82,8 @@ public:
StaticMatrix = NULL;
MaxNumAnimCount = 0;
TimeOut = FX_MANAGER_DEFAULT_TIMEOUT;
StartTime = 0.0;
DelayBeforeStart = 0.f;
}
};
CAttachedFX();

View file

@ -5874,6 +5874,27 @@ void CCharacterCL::updateAttachedFX()
CMatrix alignMatrix;
buildAlignMatrix(alignMatrix);
std::list<CAttachedFX::CBuildInfo>::iterator itAttachedFxToStart = _AttachedFXListToStart.begin();
while(itAttachedFxToStart != _AttachedFXListToStart.end())
{
if ((*itAttachedFxToStart).DelayBeforeStart < (float)(TimeInSec - (*itAttachedFxToStart).StartTime))
{
uint index = (*itAttachedFxToStart).MaxNumAnimCount;
(*itAttachedFxToStart).MaxNumAnimCount = 0;
CAttachedFX::TSmartPtr fx = new CAttachedFX;
fx->create(*this, (*itAttachedFxToStart), CAttachedFX::CTargeterInfo());
if (!fx->FX.empty())
{
_AuraFX[index] = fx;
}
itAttachedFxToStart = _AttachedFXListToStart.erase(itAttachedFxToStart);
}
else
{
++itAttachedFxToStart;
}
}
// update tracks & pos for anim attachedfxs
std::list<CAttachedFX::TSmartPtr>::iterator itAttachedFx = _AttachedFXListForCurrentAnim.begin();
while(itAttachedFx != _AttachedFXListForCurrentAnim.end())
@ -8993,12 +9014,35 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet)
}
else
{
std::list<CAttachedFX::CBuildInfo>::iterator itAttachedFxToStart = _AttachedFXListToStart.begin();
while(itAttachedFxToStart != _AttachedFXListToStart.end())
{
if ((*itAttachedFxToStart).MaxNumAnimCount == index)
return;
}
// remove previous aura
_AuraFX[index] = NULL;
CAttachedFX::TSmartPtr fx = new CAttachedFX;
CAttachedFX::CBuildInfo bi;
bi.Sheet = sheet;
bi.TimeOut = 0.f;
if (sheet->Sheet->PSName == "misc_caravan_teleportout.ps")
{
bi.MaxNumAnimCount = index;
bi.StartTime = TimeInSec;
bi.DelayBeforeStart = 12.5f;
_AttachedFXListToStart.push_front(bi);
}
else if (sheet->Sheet->PSName == "misc_kami_teleportout.ps")
{
bi.MaxNumAnimCount = index;
bi.StartTime = TimeInSec;
bi.DelayBeforeStart = 11.5f;
_AttachedFXListToStart.push_front(bi);
}
else
{
CAttachedFX::TSmartPtr fx = new CAttachedFX;
fx->create(*this, bi, CAttachedFX::CTargeterInfo());
if (!fx->FX.empty())
{
@ -9006,6 +9050,7 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet)
}
}
}
}
// ***********************************************************************************************************************
void CCharacterCL::setLinkFX(const CAnimationFX *fx, const CAnimationFX *dispell)

View file

@ -675,6 +675,7 @@ protected:
/// List of attached to remove as soon as possible (when there are no particles left)
std::list<CAttachedFX::TSmartPtr> _AttachedFXListToRemove;
std::list<CAttachedFX::CBuildInfo> _AttachedFXListToStart;
CAttachedFX::TSmartPtr _AuraFX[MaxNumAura]; // special case for aura
CAttachedFX::TSmartPtr _LinkFX; // special case for link

View file

@ -1199,6 +1199,11 @@ class CHandlerTell : public IActionHandler
// display msg with good color
// TDataSetIndex dsi; // not used ....
PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA());
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(finalMsg);
}
};
REGISTER_ACTION_HANDLER( CHandlerTell, "tell");

View file

@ -1271,6 +1271,30 @@ NLMISC_COMMAND(7,"talk in 7th dynamic chat channel","<channel_nb> <sentence>")
{
return talkInChan(7,args);
}
NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc..","<sheet_id> <name> <desc> <desc2>")
{
if (args.size() < 2) return false;
CSheetId id(args[0]);
ucstring name;
name.fromUtf8(args[1]);
ucstring desc;
ucstring desc2;
if (args.size() > 2)
desc.fromUtf8(args[2]);
if (args.size() > 2)
desc2.fromUtf8(args[3]);
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
if (pSMC)
pSMC->replaceSBrickName(id, name, desc, desc2);
else
return false;
return true;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

View file

@ -550,7 +550,9 @@ void checkUnderCursor()
if (!instref.ContextText.empty())
{
selectedInstanceURL = instref.ContextURL;
if(ContextCur.context("WEBIG", 0.f, ucstring(instref.ContextText)))
ucstring contextText;
contextText.fromUtf8(instref.ContextText);
if(ContextCur.context("WEBIG", 0.f, contextText))
return;
}
}

View file

@ -1326,7 +1326,7 @@ void postlogInit()
ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) );
CSBrickManager::getInstance()->init(); // Must be done after sheet loading
STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init
//STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init
initLast = initCurrent;
initCurrent = ryzomGetLocalTime();

View file

@ -1761,7 +1761,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if (pCS->getInventoryIndex()==INVENTORIES::bag)
{
bool isTextEditionActive = false;
static const string itemTextEditionPriv = ":DEV:SGM:EM:";
static const string itemTextEditionPriv = ":DEV:SGM:GM:EM:";
if (!UserPrivileges.empty() && itemTextEditionPriv.find(UserPrivileges)!=std::string::npos)
{
isTextEditionActive = true;

View file

@ -60,6 +60,7 @@ void launchPhraseComposition(bool creation);
const std::string PhraseComposition="ui:interface:phrase_composition";
const std::string PhraseCompositionGroup="ui:interface:phrase_composition:header_opened";
const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s";
const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s";
// **********************************************************************************************************
@ -129,7 +130,11 @@ public:
if(pCSDst && pCSDst->isSPhraseId() && pCSDst->isSPhraseIdMemory())
{
// then will auto-memorize it in this slot
if (pCSDst->isShortCut())
pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB();
else
pPM->CompositionPhraseMemoryLineDest= 0;
pPM->CompositionPhraseMemorySlotDest= pCSDst->getIndexInDB();
}
// else no auto memorize
@ -1110,7 +1115,11 @@ public:
return;
// Ok, the user try to cast a phrase slot.
sint32 memoryLine= pPM->getSelectedMemoryLineDB();
sint32 memoryLine;
if (pCSDst->isShortCut())
memoryLine = pPM->getSelectedMemoryLineDB();
else
memoryLine = 0;
if(memoryLine<0)
return;
@ -1249,12 +1258,16 @@ public:
{
sint shortcut;
fromString(Params, shortcut);
if (shortcut>=0 && shortcut <= RYZOM_MAX_SHORTCUT)
if (shortcut>=0 && shortcut <= 2*RYZOM_MAX_SHORTCUT)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
// get the control
CInterfaceElement *elm= pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) );
CInterfaceElement *elm;
if (shortcut < RYZOM_MAX_SHORTCUT)
elm = pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) );
else
elm = pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(shortcut-RYZOM_MAX_SHORTCUT) );
CDBCtrlSheet *ctrl= dynamic_cast<CDBCtrlSheet*>(elm);
if(ctrl)
{
@ -1491,7 +1504,11 @@ public:
return;
// Ok, the user try to cast a phrase slot.
sint32 memoryLine= pPM->getSelectedMemoryLineDB();
sint32 memoryLine;
if (pCSDst->isShortCut())
memoryLine = pPM->getSelectedMemoryLineDB();
else
memoryLine = 0;
if(memoryLine<0)
return;

View file

@ -313,7 +313,7 @@ void CChatTargetFilter::msgEntered(const ucstring &msg, CChatWindow *chatWindow)
// the target must be a player, make a tell on him
ChatMngr.tell(_TargetPlayer.toString(), msg);
// direct output in the chat
chatWindow->displayLocalPlayerTell(msg);
chatWindow->displayLocalPlayerTell(_TargetPlayer.toString(), msg);
}
else
{

View file

@ -199,7 +199,7 @@ bool CChatWindow::isVisible() const
}
//=================================================================================
void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType /* gt */, uint32 /* dynamicChatDbIndex */, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/)
void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType gt, uint32 dynamicChatDbIndex, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/)
{
if (!_Chat)
{
@ -466,7 +466,7 @@ void CChatWindow::setHeaderColor(const std::string &n)
}
//=================================================================================
void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= 0*/)
void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/)
{
ucstring finalMsg;
CInterfaceProperty prop;
@ -484,7 +484,12 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*=
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
encodeColorTag(prop.getRGBA(), finalMsg, true);
finalMsg += msg;
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks);
CInterfaceManager::getInstance()->log(finalMsg);
}
void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append)
@ -797,14 +802,6 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c
}
}
// Create the free teller in all the desktops
uint8 nMode = pIM->getMode();
pGC->setActive(false);
for (uint8 m = 0; m < MAX_NUM_MODES; ++m)
{
if (m != nMode)
pIM->updateGroupContainerImage(*pGC, m);
}
// the group is only active on the current desktop
pGC->setActive(true);
}
@ -812,7 +809,7 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c
if (!winColor.empty())
_FreeTellers[i]->setHeaderColor(winColor);
updateFreeTellerHeader(*_FreeTellers[i]);
// updateFreeTellerHeader(*_FreeTellers[i]);
return _FreeTellers[i];
}

View file

@ -143,7 +143,7 @@ public:
void setAHOnCloseButtonParams(const std::string &n);
void setHeaderColor(const std::string &n);
//
void displayLocalPlayerTell(const ucstring &msg, uint numBlinks = 0);
void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0);
/// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text
static void encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append=true);

View file

@ -114,7 +114,7 @@ public:
/// \name Handlers
// @{
// Event part
void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); }
void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClickString = actionHandlerName; _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); }
void setActionOnRightClick (const std::string &actionHandlerName) { _AHOnRightClick = getAH(actionHandlerName, _AHRightClickParams); }
void setActionOnClockTick (const std::string &ahName) { _AHOnClockTick = getAH(ahName, _AHClockTickParams); }
void setParamsOnLeftClick (const std::string &paramsHandlerName) { _AHLeftClickParams = paramsHandlerName; }
@ -203,6 +203,7 @@ protected:
//@{
IActionHandler *_AHOnOver;
CStringShared _AHOverParams;
std::string _AHOnLeftClickString;
IActionHandler *_AHOnLeftClick;
CStringShared _AHLeftClickParams;
IActionHandler *_AHOnLeftDblClick;

View file

@ -333,4 +333,16 @@ void CCtrlButton::fitTexture()
setH(h);
}
// ***************************************************************************
bool CCtrlButton::getMouseOverShape(string &texName, uint8 &rot, CRGBA &col)
{
if (_AHOnLeftClickString == "browse")
{
texName = "curs_pick.tga";
rot= 0;
col = CRGBA::White;
return true;
}
return false;
}

View file

@ -50,6 +50,8 @@ public:
virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); }
virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */);
// Display part
virtual void draw();

View file

@ -21,6 +21,7 @@
#include "group_editbox.h"
#include "interface_manager.h"
#include "input_handler_manager.h"
#include "nel/misc/command.h"
#include "view_text.h"
#include "game_share/xml_auto_ptr.h"
#include "interface_options.h"
@ -56,6 +57,7 @@ CGroupEditBox::CGroupEditBox(const TCtorParam &param) :
_MaxCharsSize(32768),
_FirstVisibleChar(0),
_LastVisibleChar(0),
_SelectingText(false),
_ViewText(NULL),
_MaxHistoric(0),
_CurrentHistoricIndex(-1),
@ -354,16 +356,27 @@ void CGroupEditBox::paste()
if (Driver->pasteTextFromClipboard(sString))
{
// append string now
appendString(sString);
appendStringFromClipboard(sString);
}
}
// ----------------------------------------------------------------------------
void CGroupEditBox::appendString(const ucstring &str)
void CGroupEditBox::appendStringFromClipboard(const ucstring &str)
{
stopParentBlink();
makeTopWindow();
writeString(str, true, false);
nlinfo ("Chat input was pasted from the clipboard");
triggerOnChangeAH();
_CursorAtPreviousLineEnd = false;
}
// ----------------------------------------------------------------------------
void CGroupEditBox::writeString(const ucstring &str, bool replace, bool atEnd)
{
sint length = (sint)str.length();
ucstring toAppend;
@ -500,13 +513,41 @@ void CGroupEditBox::appendString(const ucstring &str)
length = _MaxNumChar - (sint)_InputString.length();
}
ucstring toAdd = toAppend.substr(0, length);
_InputString = _InputString.substr(0, _CursorPos) + toAdd + _InputString.substr(_CursorPos);
_CursorPos += (sint32)toAdd.length();
nlinfo ("Chat input was pasted from the clipboard");
sint32 minPos;
sint32 maxPos;
if (_CurrSelection == this)
{
minPos = min(_CursorPos, _SelectCursorPos);
maxPos = max(_CursorPos, _SelectCursorPos);
}
else
{
minPos = _CursorPos;
maxPos = _CursorPos;
}
triggerOnChangeAH();
nlinfo("%d, %d", minPos, maxPos);
if (replace)
{
_InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(maxPos);
_CursorPos = minPos+(sint32)toAdd.length();
}
else
{
if (atEnd)
{
_InputString = _InputString.substr(0, maxPos) + toAdd + _InputString.substr(maxPos);
_CursorPos = maxPos;
_SelectCursorPos = _CursorPos;
_CursorAtPreviousLineEnd = false;
}
else
{
_InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(minPos);
_CursorPos = minPos+(sint32)toAdd.length();
_SelectCursorPos = maxPos+(sint32)toAdd.length();
}
}
}
// ----------------------------------------------------------------------------
@ -862,6 +903,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Frozen)
{
_SelectingText = true;
stopParentBlink();
pIM->setCaptureKeyboard (this);
// set the right cursor position
@ -872,6 +914,31 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
_CursorPos = newCurPos;
_CursorPos -= (sint32)_Prompt.length();
_CursorPos = std::max(_CursorPos, sint32(0));
_SelectCursorPos = _CursorPos;
_CurrSelection = NULL;
return true;
}
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove && !_Frozen && _SelectingText)
{
// set the right cursor position
uint newCurPos;
bool cursorAtPreviousLineEnd;
_CurrSelection = this;
_ViewText->getCharacterIndexFromPosition(eventDesc.getX() - _ViewText->getXReal(), eventDesc.getY() - _ViewText->getYReal(), newCurPos, cursorAtPreviousLineEnd);
_SelectCursorPos = newCurPos;
_SelectCursorPos -= (sint32)_Prompt.length();
_SelectCursorPos = std::max(_SelectCursorPos, sint32(0));
return true;
}
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !_Frozen)
{
_SelectingText = false;
if (_SelectCursorPos == _CursorPos)
_CurrSelection = NULL;
return true;
}

View file

@ -125,6 +125,8 @@ public:
void copy();
// Paste the selection into buffer
void paste();
// Write the string into buffer
void writeString(const ucstring &str, bool replace = true, bool atEnd = true);
// Expand the expression (true if there was a '/' at the start of the line)
bool expand();
@ -217,6 +219,7 @@ protected:
// Text selection
static sint32 _SelectCursorPos;
static CGroupEditBox *_CurrSelection; // the edit box for which the selection is currently active, or NULL if there's none
bool _SelectingText;
NLMISC::CRGBA _TextSelectColor;
NLMISC::CRGBA _BackSelectColor;
@ -291,7 +294,7 @@ private:
void handleEventString(const CEventDescriptorKey &event);
void setup();
void triggerOnChangeAH();
void appendString(const ucstring &str);
void appendStringFromClipboard(const ucstring &str);
ucstring getSelection();

View file

@ -442,6 +442,9 @@ void CGroupHTML::addText (const char * buf, int len)
{
if (_Browsing)
{
if (_IgnoreText)
return;
// Build a UTF8 string
string inputString(buf, buf+len);
// inputString.resize (len);
@ -525,6 +528,11 @@ void CGroupHTML::addLink (uint element_number, uint /* attribute_number */, HTCh
// in ah: command we don't respect the uri standard so the HTAnchor_address doesn't work correctly
_Link.push_back (suri);
}
else if (suri[0] == '#')
{
// Direct url (hack for lua beginElement)
_Link.push_back (suri.substr(1));
}
else
{
HTAnchor * dest = HTAnchor_followMainLink((HTAnchor *) anchor);
@ -839,6 +847,14 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
}
}
break;
case HTML_DIV:
{
if (present[MY_HTML_DIV_NAME] && value[MY_HTML_DIV_NAME])
{
_DivName = value[MY_HTML_DIV_NAME];
}
}
break;
case HTML_FONT:
{
bool found = false;
@ -1372,6 +1388,9 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
_ObjectAction = value[HTML_OBJECT_STANDBY];
_Object = true;
break;
case HTML_STYLE:
_IgnoreText = true;
break;
}
}
@ -1409,6 +1428,10 @@ void CGroupHTML::endElement (uint element_number)
case HTML_PRE:
popIfNotEmpty (_PRE);
break;
case HTML_DIV:
_DivName = "";
break;
case HTML_TABLE:
popIfNotEmpty (_CellParams);
popIfNotEmpty (_TR);
@ -1493,6 +1516,9 @@ void CGroupHTML::endElement (uint element_number)
popIfNotEmpty (_UL);
}
break;
case HTML_STYLE:
_IgnoreText = false;
break;
case HTML_OBJECT:
if (_ObjectType=="application/ryzom-data")
{
@ -1560,6 +1586,7 @@ CGroupHTML::CGroupHTML(const TCtorParam &param)
// init
_ParsingLua = false;
_IgnoreText = false;
_BrowseNextTime = false;
_PostNextTime = false;
_Browsing = false;
@ -2506,6 +2533,7 @@ void CGroupHTML::clearContext()
_Cells.clear();
_TR.clear();
_Forms.clear();
_Groups.clear();
_CellParams.clear();
_Title = false;
_TextArea = false;
@ -2584,6 +2612,12 @@ void CGroupHTML::addGroup (CInterfaceGroup *group, uint beginSpace)
_Paragraph = NULL;
}
if (!_DivName.empty())
{
group->setName(_DivName);
_Groups.push_back(group);
}
group->setSizeRef(CInterfaceElement::width);
// Compute begin space between paragraph and tables
@ -3337,6 +3371,171 @@ int CGroupHTML::luaRefresh(CLuaState &ls)
return 0;
}
// ***************************************************************************
int CGroupHTML::luaRemoveContent(CLuaState &ls)
{
const char *funcName = "refresh";
CLuaIHM::checkArgCount(ls, funcName, 0);
removeContent();
return 0;
}
// ***************************************************************************
int CGroupHTML::luaInsertText(CLuaState &ls)
{
const char *funcName = "insertText";
CLuaIHM::checkArgCount(ls, funcName, 3);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN);
string name = ls.toString(1);
ucstring text;
text.fromUtf8(ls.toString(2));
if (!_Forms.empty()) {
for (uint i=0; i<_Forms.back().Entries.size(); i++)
{
if (_Forms.back().Entries[i].TextArea && _Forms.back().Entries[i].Name == name)
{
// Get the edit box view
CInterfaceGroup *group = _Forms.back().Entries[i].TextArea->getGroup ("eb");
if (group)
{
// Should be a CGroupEditBox
CGroupEditBox *editBox = dynamic_cast<CGroupEditBox*>(group);
if (editBox)
editBox->writeString(text, false, ls.toBoolean(3));
}
}
}
}
return 0;
}
// ***************************************************************************
int CGroupHTML::luaAddString(CLuaState &ls)
{
const char *funcName = "addString";
CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
addString(ucstring(ls.toString(1)));
return 0;
}
// ***************************************************************************
int CGroupHTML::luaAddImage(CLuaState &ls)
{
const char *funcName = "addImage";
CLuaIHM::checkArgCount(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN);
if (!_Paragraph)
{
newParagraph(0);
paragraphChange();
}
string url = getLink();
if (!url.empty()) {
string params = "name=" + getId() + "|url=" + getLink ();
addButton(CCtrlButton::PushButton, ls.toString(1), ls.toString(1), ls.toString(1),
"", ls.toBoolean(2), "browse", params.c_str(), "");
} else {
addImage(ls.toString(1), ls.toBoolean(2));
}
return 0;
}
// ***************************************************************************
int CGroupHTML::luaBeginElement(CLuaState &ls)
{
const char *funcName = "beginElement";
CLuaIHM::checkArgCount(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE);
uint element_number = (uint)ls.toNumber(1);
std::vector<BOOL> present;
std::vector<const char *> value;
present.resize(30, false);
value.resize(30);
CLuaObject params;
params.pop(ls);
uint max_idx = 0;
ENUM_LUA_TABLE(params, it)
{
if (!it.nextKey().isNumber())
{
nlwarning("%s : bad key encountered with type %s, number expected.", funcName, it.nextKey().getTypename());
continue;
}
if (!it.nextValue().isString())
{
nlwarning("%s : bad value encountered with type %s for key %s, string expected.", funcName, it.nextValue().getTypename(), it.nextKey().toString().c_str());
continue;
}
uint idx = (uint)it.nextKey().toNumber();
present.insert(present.begin() + (uint)it.nextKey().toNumber(), true);
string str = it.nextValue().toString();
size_t size = str.size() + 1;
char * buffer = new char[ size ];
strncpy(buffer, str.c_str(), size );
value.insert(value.begin() + (uint)it.nextKey().toNumber(), buffer);
}
beginElement(element_number, &present[0], &value[0]);
if (element_number == HTML_A)
addLink(element_number, 0, NULL, &present[0], &value[0]);
return 0;
}
// ***************************************************************************
int CGroupHTML::luaEndElement(CLuaState &ls)
{
const char *funcName = "endElement";
CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
uint element_number = (uint)ls.toNumber(1);
endElement(element_number);
return 0;
}
// ***************************************************************************
int CGroupHTML::luaShowDiv(CLuaState &ls)
{
const char *funcName = "showDiv";
CLuaIHM::checkArgCount(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN);
if (!_Groups.empty()) {
for (uint i=0; i<_Groups.size(); i++)
{
CInterfaceGroup *group = _Groups[i];
if (group->getName() == ls.toString(1))
{
group->setActive(ls.toBoolean(2));
}
}
}
return 0;
}
// ***************************************************************************
void CGroupHTML::setURL(const std::string &url)
{

View file

@ -165,10 +165,24 @@ public:
int luaBrowse(CLuaState &ls);
int luaRefresh(CLuaState &ls);
int luaRemoveContent(CLuaState &ls);
int luaInsertText(CLuaState &ls);
int luaAddString(CLuaState &ls);
int luaAddImage(CLuaState &ls);
int luaBeginElement(CLuaState &ls);
int luaEndElement(CLuaState &ls);
int luaShowDiv(CLuaState &ls);
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
REFLECT_LUA_METHOD("browse", luaBrowse)
REFLECT_LUA_METHOD("refresh", luaRefresh)
REFLECT_LUA_METHOD("removeContent", luaRemoveContent)
REFLECT_LUA_METHOD("insertText", luaInsertText)
REFLECT_LUA_METHOD("addString", luaAddString)
REFLECT_LUA_METHOD("addImage", luaAddImage)
REFLECT_LUA_METHOD("beginElement", luaBeginElement)
REFLECT_LUA_METHOD("endElement", luaEndElement)
REFLECT_LUA_METHOD("showDiv", luaShowDiv)
REFLECT_STRING("url", getURL, setURL)
REFLECT_FLOAT("timeout", getTimeout, setTimeout)
REFLECT_EXPORT_END
@ -290,6 +304,7 @@ protected :
// element has been found
// True when the <lua> element has been encountered
bool _ParsingLua;
bool _IgnoreText;
// the script to execute
std::string _LuaScript;
@ -303,6 +318,7 @@ protected :
class CLibWWWData *_LibWWW;
// Current paragraph
std::string _DivName;
CGroupParagraph* _Paragraph;
inline CGroupParagraph *getParagraph()
{
@ -442,6 +458,7 @@ protected :
std::vector<CEntry> Entries;
};
std::vector<CForm> _Forms;
std::vector<CInterfaceGroup *> _Groups;
// Cells parameters
class CCellParams

View file

@ -278,8 +278,11 @@ void CGroupQuickHelp::browse (const char *url)
_IsQuickHelp = false;
string completeURL = url;
if (completeURL.substr(completeURL.size()-5, 5) == ".html")
{
completeURL = completeURL.substr(0, completeURL.size()-5); // Substract the ".html"
completeURL += "_" + ClientCfg.getHtmlLanguageCode() + ".html";
}
CGroupHTML::browse (completeURL.c_str());
}

View file

@ -250,6 +250,9 @@ public:
/// Accessors : SET
void setId (const std::string &newID) { _Id = newID; }
inline void setName(const std::string &name) { _Name = name; }
inline const std::string& getName() { return _Name; }
virtual void setIdRecurse(const std::string &newID);
void setParent (CInterfaceGroup *pIG) { _Parent = pIG; }
@ -510,6 +513,8 @@ protected:
///the id of the element
std::string _Id;
std::string _Name;
///is the element active?
bool _Active;

View file

@ -113,6 +113,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet *
effects += "\n";
}
if ( name == "SP_LIFE_AURA2" )
{
uint16 regenMod;
fromString(params[0].c_str(), regenMod);
uint32 bonus = regenMod * itemQuality;
uint32 duration;
fromString(params[1].c_str(), duration);
uint32 radius;
fromString(params[2].c_str(), radius);
uint32 targetDisableTime;
fromString(params[3].c_str(), targetDisableTime);
uint32 userDisableTime;
fromString(params[4].c_str(), userDisableTime);
ucstring result = CI18N::get("uiItemConsumableEffectLifeAura");
strFindReplace(result, "%modifier", toString(bonus));
strFindReplace(result, "%minutes", toString(duration/60));
strFindReplace(result, "%secondes", toString(duration%60));
strFindReplace(result, "%radius", toString(radius));
strFindReplace(result, "%targetDisableTime", toString(targetDisableTime));
strFindReplace(result, "%userDisableTime", toString(userDisableTime));
effects += result;
effects += "\n";
}
if ( name == "SP_STAMINA_AURA" )
{
@ -139,6 +166,34 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet *
effects += "\n";
}
if ( name == "SP_STAMINA_AURA2" )
{
uint16 regenMod;
fromString(params[0].c_str(), regenMod);
uint32 bonus = regenMod * itemQuality;
uint32 duration;
fromString(params[1].c_str(), duration);
uint32 radius;
fromString(params[2].c_str(), radius);
uint32 targetDisableTime;
fromString(params[3].c_str(), targetDisableTime);
uint32 userDisableTime;
fromString(params[4].c_str(), userDisableTime);
ucstring result = CI18N::get("uiItemConsumableEffectStaminaAura");
strFindReplace(result, "%modifier", toString(regenMod));
strFindReplace(result, "%minutes", toString(duration/60));
strFindReplace(result, "%secondes", toString(duration%60));
strFindReplace(result, "%radius", toString(radius));
strFindReplace(result, "%targetDisableTime", toString(targetDisableTime));
strFindReplace(result, "%userDisableTime", toString(userDisableTime));
effects += result;
effects += "\n";
}
if ( name == "SP_SAP_AURA" )
{
@ -165,6 +220,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet *
effects += "\n";
}
if ( name == "SP_SAP_AURA2" )
{
uint16 regenMod;
fromString(params[0].c_str(), regenMod);
uint32 bonus = regenMod * itemQuality;
uint32 duration;
fromString(params[1].c_str(), duration);
uint32 radius;
fromString(params[2].c_str(), radius);
uint32 targetDisableTime;
fromString(params[3].c_str(), targetDisableTime);
uint32 userDisableTime;
fromString(params[4].c_str(), userDisableTime);
ucstring result = CI18N::get("uiItemConsumableEffectSapAura");
strFindReplace(result, "%modifier", toString(bonus));
strFindReplace(result, "%minutes", toString(duration/60));
strFindReplace(result, "%secondes", toString(duration%60));
strFindReplace(result, "%radius", toString(radius));
strFindReplace(result, "%targetDisableTime", toString(targetDisableTime));
strFindReplace(result, "%userDisableTime", toString(userDisableTime));
effects += result;
effects += "\n";
}
// skill modifier consumables
//---------------------------
ucstring result("");

View file

@ -115,6 +115,7 @@
#include "game_share/scenario_entry_points.h"
#include "game_share/bg_downloader_msg.h"
#include "game_share/constants.h"
#include "game_share/visual_slot_manager.h"
#ifdef LUA_NEVRAX_VERSION
#include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger
@ -1368,6 +1369,8 @@ void CLuaIHM::registerIHM(CLuaState &ls)
ls.registerFunc("isPlayerNewbie", isPlayerNewbie);
ls.registerFunc("isInRingMode", isInRingMode);
ls.registerFunc("getUserRace", getUserRace);
ls.registerFunc("getSheet2idx", getSheet2idx);
// Through LUABind API
lua_State *L= ls.getStatePointer();
@ -4412,3 +4415,25 @@ int CLuaIHM::getUserRace(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHM::getSheet2idx(CLuaState &ls)
{
CLuaIHM::checkArgCount(ls, "getSheet2idx", 2);
CLuaIHM::checkArgType(ls, "getSheet2idx", 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, "getSheet2idx", 2, LUA_TNUMBER);
const std::string & sheedtName = ls.toString(1);
uint32 slotId = (uint32)ls.toNumber(2);
NLMISC::CSheetId sheetId;
if (sheetId.buildSheetId(sheedtName))
{
uint32 idx = CVisualSlotManager::getInstance()->sheet2Index(sheetId, (SLOTTYPE::EVisualSlot)slotId);
ls.push((lua_Number)idx);
}
else
return 0;
return 1;
}

View file

@ -351,6 +351,7 @@ private:
static int isPlayerNewbie(CLuaState &ls);
static int isInRingMode(CLuaState &ls);
static int getUserRace(CLuaState &ls);
static int getSheet2idx(CLuaState &ls);
// LUA functions exported for Dev only (debug)

View file

@ -999,7 +999,7 @@ class CHandlerChatGroupFilter : public IActionHandler
}
rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup());
rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup(), PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex());
}
else
{
@ -1813,8 +1813,6 @@ void CPeopleInterraction::setupUserChatFromSummary(const CFilteredChatSummary &s
//=================================================================================================================
void CPeopleInterraction::setupUserDynChatFromSummary(const CFilteredDynChatSummary &summary, CFilteredChat &dest)
{
// User Dest
dest.Filter.setTargetGroup(summary.Target, 0, false);
// src
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
{
@ -2666,12 +2664,12 @@ class CHandlerChatTargetSelected : public IActionHandler
// Case of user chat in grouped chat window
if (cw == PeopleInterraction.ChatGroup.Window)
{
PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup());
PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex());
CInterfaceManager::getInstance()->runActionHandler("chat_group_filter", NULL, "user");
}
if (cw == PeopleInterraction.TheUserChat.Window)
{
PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup());
PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex());
CInterfaceManager::getInstance()->runActionHandler("user_chat_active", NULL, "");
}

View file

@ -441,7 +441,7 @@ void CPeopleList::setContactId(uint index, uint32 contactId)
}
//==================================================================
void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint numBlinks /*=0*/)
void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg,uint numBlinks /*=0*/)
{
if (_ContactType == CPeopleListDesc::Ignore)
{
@ -475,7 +475,12 @@ void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint num
// display msg with good color
CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA()));
CInterfaceManager::getInstance()->log(finalMsg);
// if the group is closed, make it blink
if (!gc->isOpen())
@ -924,7 +929,7 @@ class CHandlerContactEntry : public IActionHandler
uint index;
if (PeopleInterraction.getPeopleFromContainerID(str, peopleList, index))
{
peopleList->displayLocalPlayerTell(index, text);
peopleList->displayLocalPlayerTell(str2, index, text);
}
}
else
@ -948,6 +953,11 @@ class CHandlerContactEntry : public IActionHandler
CChatWindow::encodeColorTag(prop.getRGBA(), final, true);
final += text;
pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str));
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", pWin->getFreeTellerName(str));
strFindReplace(final, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(final);
}
}

View file

@ -111,7 +111,7 @@ public:
* If the window is closed, it causes it to blink (and also the parent window)
*/
void displayMessage(uint index, const ucstring &msg, NLMISC::CRGBA col, uint numBlinks = 0);
void displayLocalPlayerTell(uint index, const ucstring &msg, uint numBlinks = 0);
void displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg, uint numBlinks = 0);
// Is the given people window visible ?
bool isPeopleChatVisible(uint index) const;
// reset remove everything from the interface

View file

@ -57,6 +57,7 @@ const std::string PhraseMemoryViewNextAction= "ui:interface:gestionsets:shortcu
const std::string PhraseMemoryViewCycleAction= "ui:interface:gestionsets:shortcuts:view_cycle_action";
const std::string PhraseMemoryViewSlotBase= "ui:interface:gestionsets:shortcuts:s";
const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s";
const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s";
const std::string PhraseMemoryPhraseMenu= "ui:interface:cm_memory_phrase";
const std::string PhraseMemoryPhraseAction= "cast_phrase_or_create_new";
@ -118,11 +119,16 @@ void CSPhraseManager::initInGame()
_BookDbLeaves[i]= node;
}
_MemoryDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL);
_MemoryAltDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL);
for(i=0;i<PHRASE_MAX_MEMORY_SLOT;i++)
{
CCDBNodeLeaf *node= pIM->getDbProp(PHRASE_DB_MEMORY + ":" + toString(i) + ":PHRASE");
node->setValue32(0);
_MemoryDbLeaves[i]= node;
CCDBNodeLeaf *node_alt= pIM->getDbProp(PHRASE_DB_MEMORY_ALT + ":" + toString(i) + ":PHRASE");
node_alt->setValue32(0);
_MemoryAltDbLeaves[i]= node_alt;
}
// Progression Db leaves
@ -497,6 +503,7 @@ void CSPhraseManager::updateMemoryDBAll()
for(uint i=0;i<PHRASE_MAX_MEMORY_SLOT;i++)
{
_MemoryDbLeaves[i]->setValue32(0);
_MemoryAltDbLeaves[i]->setValue32(0);
}
}
else
@ -508,6 +515,12 @@ void CSPhraseManager::updateMemoryDBAll()
_MemoryDbLeaves[i]->setValue32(0);
else
_MemoryDbLeaves[i]->setValue32(slot.Id);
CMemorySlot &slotAlt= _Memories[0].Slot[i];
if(!slotAlt.isPhrase())
_MemoryAltDbLeaves[i]->setValue32(0);
else
_MemoryAltDbLeaves[i]->setValue32(slotAlt.Id);
}
}
}
@ -530,6 +543,15 @@ void CSPhraseManager::updateMemoryDBSlot(uint32 memorySlot)
else
_MemoryDbLeaves[memorySlot]->setValue32(slot.Id);
}
if (_SelectedMemoryDB == 0)
{
CMemorySlot &slotAlt= _Memories[0].Slot[memorySlot];
if(!slotAlt.isPhrase())
_MemoryAltDbLeaves[memorySlot]->setValue32(0);
else
_MemoryAltDbLeaves[memorySlot]->setValue32(slotAlt.Id);
}
}
// ***************************************************************************
@ -873,6 +895,7 @@ void CSPhraseManager::reset()
_LastProgressionNumDbFill[i]= 0;
}
_MemoryDbLeaves.clear();
_MemoryAltDbLeaves.clear();
_NextExecuteLeaf= NULL;
_NextExecuteIsCyclicLeaf= NULL;
@ -2645,7 +2668,13 @@ static sint getRightHandEnchantValue()
void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot, CDBCtrlSheet *ctrl)
{
//
uint memoryLine= getSelectedMemoryLineDB();
sint32 memoryLine;
if (ctrl->isShortCut())
memoryLine = getSelectedMemoryLineDB();
else
memoryLine = 0;
if (memoryLine < 0)
return;
sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot);
//
if(phraseId)
@ -2780,8 +2809,12 @@ void CSPhraseManager::updateMemoryCtrlState(uint memorySlot, CDBCtrlSheet *ctrl,
CSBrickManager *pBM = CSBrickManager::getInstance();
CSkillManager *pSM = CSkillManager::getInstance();
uint memoryLine;
// get the slot info
uint memoryLine= getSelectedMemoryLineDB();
if (ctrl->isShortCut()) // No memoryLine defined
memoryLine= getSelectedMemoryLineDB();
else
memoryLine= 0;
bool newIsMacro= isMemorizedMacro(memoryLine, memorySlot);
sint32 macroId= getMemorizedMacro(memoryLine, memorySlot);
sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot);
@ -3004,6 +3037,9 @@ void CSPhraseManager::updateAllMemoryCtrlState()
// update the valid state.
updateMemoryCtrlState(i, ctrl, itemSkill);
}
CDBCtrlSheet *ctrlAlt= dynamic_cast<CDBCtrlSheet*>(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(i)) );
if(ctrlAlt)
updateMemoryCtrlState(i, ctrlAlt, itemSkill);
}
TTicks endTime = CTime::getPerformanceTime();
//nldebug("***** %d ms for CSPhraseManager::updateAllMemoryCtrlState", (int) (1000 * CTime::ticksToSecond(endTime - startTime)));
@ -3030,26 +3066,49 @@ CDBCtrlSheet *CSPhraseManager::getMemorySlotCtrl(uint memorySlot)
return dynamic_cast<CDBCtrlSheet*>(pIM->getElementFromId(PhraseMemoryCtrlBase + toString(memorySlot)));
}
// ***************************************************************************
CDBCtrlSheet *CSPhraseManager::getMemoryAltSlotCtrl(uint memorySlot)
{
if(memorySlot>=PHRASE_MAX_MEMORY_SLOT)
return NULL;
// Get the ctrl
CInterfaceManager *pIM= CInterfaceManager::getInstance();
return dynamic_cast<CDBCtrlSheet*>(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(memorySlot)));
}
// ***************************************************************************
void CSPhraseManager::updateMemoryCtrlState(uint memorySlot)
{
CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot);
CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot);
if(ctrl)
{
// update the valid state.
updateMemoryCtrlState(memorySlot, ctrl, getRightHandItemSkill());
}
if(ctrlAlt)
{
// update the valid state.
updateMemoryCtrlState(memorySlot, ctrlAlt, getRightHandItemSkill());
}
}
// ***************************************************************************
void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot)
{
CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot);
CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot);
if(ctrl)
{
// update the valid state.
updateMemoryCtrlRegenTickRange(memorySlot, ctrl);
}
if(ctrlAlt)
{
// update the valid state.
updateMemoryCtrlRegenTickRange(memorySlot, ctrlAlt);
}
}
// ***************************************************************************

View file

@ -34,6 +34,7 @@
const std::string PHRASE_DB_BOOK="UI:PHRASE:BOOK";
const std::string PHRASE_DB_PROGRESSION[2]= {"UI:PHRASE:PROGRESS_ACTIONS", "UI:PHRASE:PROGRESS_UPGRADES"};
const std::string PHRASE_DB_MEMORY="UI:PHRASE:MEMORY";
const std::string PHRASE_DB_MEMORY_ALT="UI:PHRASE:MEMORY_ALT";
const std::string PHRASE_DB_EXECUTE_NEXT="UI:PHRASE:EXECUTE_NEXT:PHRASE";
const std::string PHRASE_DB_EXECUTE_NEXT_IS_CYCLIC="UI:PHRASE:EXECUTE_NEXT:ISCYCLIC";
const std::string PHRASE_DB_BOTCHAT="LOCAL:TRADING";
@ -458,6 +459,7 @@ private:
// Shortcut To Phrases Leaves
std::vector<CCDBNodeLeaf*> _BookDbLeaves;
std::vector<CCDBNodeLeaf*> _MemoryDbLeaves;
std::vector<CCDBNodeLeaf*> _MemoryAltDbLeaves;
CCDBNodeLeaf *_NextExecuteLeaf;
CCDBNodeLeaf *_NextExecuteIsCyclicLeaf;
@ -698,6 +700,7 @@ private:
void updateMemoryCtrlRegenTickRange(uint memorySlot);
CDBCtrlSheet *getMemorySlotCtrl(uint memorySlot);
CDBCtrlSheet *getMemoryAltSlotCtrl(uint memorySlot);
CTickRange getRegenTickRange(const CSPhraseCom &phrase) const;

View file

@ -218,6 +218,14 @@ HTAttr p_attr[] =
HTML_ATTR(P,QUICK_HELP_CONDITION),
HTML_ATTR(P,QUICK_HELP_EVENTS),
HTML_ATTR(P,QUICK_HELP_LINK),
HTML_ATTR(P,NAME),
{ 0 }
};
HTAttr div_attr[] =
{
HTML_ATTR(DIV,NAME),
{ 0 }
};
@ -684,6 +692,8 @@ void initLibWWW()
HTML_DTD->tags[HTML_A].number_of_attributes = sizeof(a_attr) / sizeof(HTAttr) - 1;
//HTML_DTD->tags[HTML_I].attributes = a_attr;
HTML_DTD->tags[HTML_I].number_of_attributes = 0;
HTML_DTD->tags[HTML_DIV].attributes = div_attr;
HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1;
// Set a request timeout
// HTHost_setEventTimeout (30000);

View file

@ -201,8 +201,15 @@ enum
HTML_ATTR(P,QUICK_HELP_CONDITION) = 0,
HTML_ATTR(P,QUICK_HELP_EVENTS),
HTML_ATTR(P,QUICK_HELP_LINK),
HTML_ATTR(P,NAME),
};
enum
{
HTML_ATTR(DIV,NAME) = 0,
};
#undef HTML_ATTR
// ***************************************************************************

View file

@ -619,6 +619,7 @@ void CUserControls::commonMove()
// MOUSE WHEEL //
CEventsListener::TWheelState wheelState = EventsListener.getWheelState(); // Done all the time, to reset the state
View.changeCameraDist((wheelState == CEventsListener::foreward), (wheelState == CEventsListener::backward));
View.changeCameraDist(Actions.valide("camera_foreward"), Actions.valide("camera_backward"));
// Camera Up/Down.
View.changeCameraHeight(Actions.valide("camera_up"), Actions.valide("camera_down"));
//////////////////

View file

@ -895,6 +895,7 @@ void CInterfaceChatDisplayer::displayTell(/*TDataSetIndex senderIndex, */const u
colorizeSender(finalString, senderPart, prop.getRGBA());
PeopleInterraction.ChatInput.Tell.displayTellMessage(/*senderIndex, */finalString, goodSenderName, prop.getRGBA(), 2, &windowVisible);
CInterfaceManager::getInstance()->log(finalString);
// Open the free teller window
CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
@ -3216,9 +3217,13 @@ private:
// get the content string (should have been received!)
ucstring contentStr;
ucstring titleStr;
if(!pSMC->getDynString(_TextId[ContentType], contentStr))
return;
if(!pSMC->getDynString(_TextId[TitleType], titleStr))
return;
// if the string start with a @{Wxxxx} code, remove it and get the wanted window size
sint w = 256; // default size to 256 !!
bool is_webig = false;
@ -3273,18 +3278,30 @@ private:
if (is_webig)
{
CGroupHTML *groupHtml = dynamic_cast<CGroupHTML*>(pIM->getElementFromId("ui:interface:webig:content:html"));
CGroupHTML *groupHtml;
string group = titleStr.toString();
// <missing:XXX>
group = group.substr(9, group.size()-10);
nlinfo("group = %s", group.c_str());
groupHtml = dynamic_cast<CGroupHTML*>(pIM->getElementFromId("ui:interface:"+group+":content:html"));
if (!groupHtml)
{
groupHtml = dynamic_cast<CGroupHTML*>(pIM->getElementFromId("ui:interface:webig:content:html"));
group = "webig";
}
if (groupHtml)
{
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface:webig"));
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface:"+group));
if (pGC)
{
if (contentStr.empty())
{
pGC->setActive(false);
}
else
{
if (group == "webig")
pGC->setActive(true);
string url = contentStr.toString();
addWebIGParams(url);
@ -3293,6 +3310,7 @@ private:
}
}
}
}
else
{
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface:server_message_box"));

View file

@ -1641,8 +1641,6 @@ const ucchar *CStringManagerClient::getSquadLocalizedDescription(NLMISC::CSheetI
// ***************************************************************************
void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstring &name, const ucstring &desc, const ucstring &desc2)
{
nlassert(!_SpecItem_MemoryCompressed);
std::string label= id.toString();
if (label.empty())
{
@ -1654,15 +1652,58 @@ void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstrin
lwrLabel= label;
strlwr(lwrLabel);
map<string, CItem>::iterator it(_SpecItem_TempMap.find(lwrLabel));
if (it == _SpecItem_TempMap.end())
return;
if (_SpecItem_MemoryCompressed)
{
ucchar *strName = (ucchar *)name.c_str();
ucchar *strDesc = (ucchar *)desc.c_str();
ucchar *strDesc2 = (ucchar *)desc2.c_str();
CItemLight tmp;
tmp.Label = (char*)lwrLabel.c_str();
vector<CItemLight>::iterator it = lower_bound(_SpecItems.begin(), _SpecItems.end(), tmp, CItemLightComp());
// Then replace
if (it != _SpecItems.end())
{
if (strcmp(it->Label, lwrLabel.c_str()) == 0)
{
it->Name = strName;
it->Desc = strDesc;
it->Desc2 = strDesc2;
}
else
{
it->Label = tmp.Label;
it->Name = strName;
it->Desc = strDesc;
it->Desc2 = strDesc2;
}
}
else
{
tmp.Name = strName;
tmp.Desc = strDesc;
tmp.Desc2 = strDesc2;
_SpecItems.push_back(tmp);
}
}
else
{
map<string, CItem>::iterator it(_SpecItem_TempMap.find(lwrLabel));
if (it != _SpecItem_TempMap.end())
{
it->second.Name= name;
it->second.Desc= desc;
it->second.Desc2= desc2;
}
else
{
CItem newItem;
newItem.Name = name;
newItem.Desc = desc;
newItem.Desc2 = desc2;
_SpecItem_TempMap.insert(pair<string,CItem>(lwrLabel,newItem));
}
}
}
} // namespace STRING_MANAGER