Compare commits

...

82 Commits

Author SHA1 Message Date
Nimetu ddd0a7507e Fixed: Invalid array access. Crash in gcc with aggressive loop optimizations enabled.
--HG--
branch : patches-from-atys
5 years ago
Nimetu 249ce945f1 Fixed: Calling member function on null object is undefined behavior.
--HG--
branch : patches-from-atys
5 years ago
Nimetu a6a8cb99f5 Fixed: Truncated pointer on 64bit system
--HG--
branch : patches-from-atys
5 years ago
ulukyn f11bc06541 Changed: updated database_plr.h
--HG--
branch : patches-from-atys
6 years ago
Nimetu 460eb92969 Changed: database_plr.h sync for number of animal
--HG--
branch : patches-from-atys
5 years ago
Nimetu ae68b543b8 Merge with develop
--HG--
branch : patches-from-atys
5 years ago
Inky a5a6c321af Changed: added language text label translation
--HG--
branch : patches-from-atys
6 years ago
Inky 89fa8ca0ac Changed: added language support per profiles
--HG--
branch : patches-from-atys
6 years ago
Inky 9c82a0436f Changed: added QComboBox widget to change profile language
--HG--
branch : patches-from-atys
6 years ago
Inky fb60e00acc Changed: allow tab to select all widgets before been captured by editBox
--HG--
branch : patches-from-atys
6 years ago
Inky 0a48c4a6e3 Fixed: prevent bad index and duplicata after profile deletion
--HG--
branch : patches-from-atys
6 years ago
Nimetu 1eb1b118f3 Fixed: Shield, tools buffs not displayed in tooltip
--HG--
branch : patches-from-atys
6 years ago
Nimetu 3b0324ad08 Fixed: Range/melee weapon buffs not displayed in tooltip
--HG--
branch : patches-from-atys
6 years ago
Inky 4baed9c664 Changed: unsupported language code default fallback
--HG--
branch : patches-from-atys
6 years ago
Inky 41c3d0cbe0 Changed: check locale is supported under linux
--HG--
branch : patches-from-atys
6 years ago
Inky ccfffe0a8c Added: macro context help
--HG--
branch : patches-from-atys
6 years ago
Inky 17b96e4819 Fixed: tooltip item buff update
--HG--
branch : patches-from-atys
6 years ago
Inky 00d31f09c6 Changed: use one lua bind to retrieve itemInfo
--HG--
branch : patches-from-atys
6 years ago
ulukyn 89c22b04a2 Changed: remove nlinfo of Register EId (made lof of useless logs...)
--HG--
branch : patches-from-atys
6 years ago
ulukyn cf4cb55f3e Fixed: remove Zig enter/leave bag menu option when not a pet
--HG--
branch : patches-from-atys
6 years ago
ulukyn 1b19cb4809 Changed: Ctrl tooltips can now display utf8 text
--HG--
branch : patches-from-atys
6 years ago
Inky fe4c58df42 Fixed: other_hand_slot error when macro window is opened
--HG--
branch : patches-from-atys
6 years ago
ulukyn 498c02fa4d Fixed: remove Zig enter/leave bag menu option when not a pet
--HG--
branch : patches-from-atys
6 years ago
ulukyn a7e75b1c6c Added: setTargetAsInterlocutor and unsetTargetAsInterlocutor lua functions
--HG--
branch : patches-from-atys
6 years ago
Inky d73ea16682 Fixed: register lua bind
--HG--
branch : patches-from-atys
6 years ago
Inky 64987e8ed6 Changed: increment packed_sheets version
sitem, item

--HG--
branch : patches-from-atys
6 years ago
Inky 7230a84031 Changed: introduce new proprieties menu and action handler
--HG--
branch : patches-from-atys
6 years ago
Inky 36918ac919 Added: CGroup menu set action handler
--HG--
branch : patches-from-atys
6 years ago
Inky 0683604ada Added: item sheets scroll properties
--HG--
branch : patches-from-atys
6 years ago
Inky 038a3bca96 Added: load xml tp_interface
--HG--
branch : patches-from-atys
6 years ago
Nimetu a3bdd3dda5 Changed: Remove call to old GroupHTML function
--HG--
branch : patches-from-atys
6 years ago
Inky 4121a61c85 Added: display local chat message
--HG--
branch : patches-from-atys
6 years ago
Inky 2f2329c67f Added: get and set rgba database entry
--HG--
branch : patches-from-atys
6 years ago
ulukyn 9780decca0 Added: Player can now ask a pet (zig) to enter/leave from his bag (an icon is displayed when pet is on the bag)
--HG--
branch : patches-from-atys
6 years ago
Inky cad47321a3 Added: set auto-pacts lua bind
--HG--
branch : patches-from-atys
6 years ago
Inky 417865bb3a Added: Store user created channels in xml file
--HG--
branch : patches-from-atys
6 years ago
Ulukyn 36036faffd Added: home propertie of html group (so lua scripts can setup the home)
Fixed: adding new landmarks with lua don't remove respawn points if player is not in an island

--HG--
branch : patches-from-atys
6 years ago
ulukyn c0037fc55a Fixed: removed nlstop when 2 same commands runs (in services)
removed nlassert when factory not found (who crash the fes)

--HG--
branch : patches-from-atys
6 years ago
Inky f96289dfbe Fixed: LevelDesign AI script documentation and few incode typos
--HG--
branch : patches-from-atys
6 years ago
Riasan e794b5dd01 Added: Team Invite button by Guild Member List and Friend List
--HG--
branch : patches-from-atys
6 years ago
ulukyn 11132f08e6 Changed: Players when Outpost is in active war (OutpostInFire) can't be Neutrals
--HG--
branch : patches-from-atys
6 years ago
Riasan 2d83507b55 Changed: active teleport option via map on r2 for privs
--HG--
branch : patches-from-atys
6 years ago
ulukyn 0debc7e6d6 Removed: cacert.pem file from client datas
--HG--
branch : patches-from-atys
6 years ago
ulukyn 698c71f137 Fixed: Added a check for https:// npc web pages
--HG--
branch : patches-from-atys
6 years ago
ulukyn dcf959fe3d Added: luaGetElement for CInterface3DScene and getBBoxSize* for CInterface3DShape
--HG--
branch : patches-from-atys
6 years ago
Nimetu 892d11d2be Fixed: trimSeparators function
--HG--
branch : patches-from-atys
6 years ago
kervala 8f61819d43 Changed: Minor changes
--HG--
branch : patches-from-atys
6 years ago
ulukyn 0e7380599e Added: Ctrl DB Sheet tooltip can be overwrited
--HG--
branch : patches-from-atys
7 years ago
kervala cf1df3e4de Fixed: Warning
--HG--
branch : patches-from-atys
7 years ago
ulukyn 4beecdc81b Eapply: CTypeVersion incremented for sitem and item (because the client don't crash again and i found why )
--HG--
branch : patches-from-atys
7 years ago
ulukyn 0b970371a3 Fixed: check ClientCfg.CurlCABundle is not empty before check the first char (thx nimetu)
--HG--
branch : patches-from-atys
7 years ago
ulukyn 48f3d3b244 Added: add a way to prefix CurlCABundle file with defaultConfigFileName using "%"
Use added cacert.pem from mozilla like default CA file

--HG--
branch : patches-from-atys
7 years ago
ulukyn e9e2590d53 Added: getSheetFamily lua bind
--HG--
branch : patches-from-atys
7 years ago
ulukyn f7f1a6035e Added: getSheetLocalizedName and getSheetLocalizedDesc lua bind
--HG--
branch : patches-from-atys
7 years ago
ulukyn 4f75f92610 Added: Add "@LUA " prefix to url set on shapes with text. When player click on shape, run the lua code
getDbProp64 return a variable instead of node->getValue64() return value.

--HG--
branch : patches-from-atys
7 years ago
ulukyn a50bd10b84 Added: setDbProp64 lua function
--HG--
branch : patches-from-atys
7 years ago
ulukyn 57406f6a8c Added: luaSetModalParentList method for container
--HG--
branch : patches-from-atys
7 years ago
ulukyn 65acd3bf9d Added: Fix a bug with web textures on view_bitmap. The texture must keep the case, only texture from bnp can be convert to lower case
--HG--
branch : patches-from-atys
7 years ago
ulukyn 16ce2e454c Added: add an prefiex "u:" to ask tooltip and hardcode_text to use utf8 strings
--HG--
branch : patches-from-atys
7 years ago
ulukyn c7bdaf513c Changed: use trimSeparators to remove spaces and tabs in html styles args values
--HG--
branch : patches-from-atys
7 years ago
ulukyn 724158c74c Added: trimSeparators function to prevent trim of utf8 special chars. Currently trimSeparators only trim spaces and tabs.
--HG--
branch : patches-from-atys
7 years ago
Nuno Gonçalves ed798cb62a Add new Mektoub type used for new pets companions
--HG--
branch : patches-from-atys
7 years ago
ulukyn 971287ae78 Changed: Added new fame for marauder (generated from database.xml)
--HG--
branch : patches-from-atys
7 years ago
ulukyn c56d2e136d Changed: Increse MAX_INVENTORY_ANIMAL to 7 to add 3 pets companions (ingame named ZIGs)
--HG--
branch : patches-from-atys
7 years ago
ulukyn 3652b23bbb Added: Race shape properties of sitems (!!! sitems.packed_sheets must be regenerated with freshly complilated sheets_packer tool !!!)
--HG--
branch : patches-from-atys
7 years ago
ulukyn 8b1ead9e77 Fixed: getGroundZ uses now float instead of int
--HG--
branch : patches-from-atys
7 years ago
ulukyn 5d7c8777a1 Added: Ability to add icons on the map and setup the handler by left and right click with lua
--HG--
branch : patches-from-atys
7 years ago
ulukyn 1a52cc3cb1 Changed: move /url command to FINAL_VERSION section
--HG--
branch : patches-from-atys
7 years ago
ulukyn 0093170ee9 Added: onclick_r and onover Lua reflect properties. Setup id to buttonGroup to access it
--HG--
branch : patches-from-atys
7 years ago
ulukyn 50d6ae91ae Changed: Increase max number of virtual desktops to use with special apps (like powo creator)
--HG--
branch : patches-from-atys
7 years ago
ulukyn af6975ae11 Added: onclick_r and onover Lua reflect properties. Setup id to buttonGroup to access it
--HG--
branch : patches-from-atys
7 years ago
ulukyn 0b0b980510 Changed: Fix @WEB customtext items
--HG--
branch : patches-from-atys
7 years ago
ulukyn f917d22b71 Changed: Fix @WEB customtext items
--HG--
branch : patches-from-atys
7 years ago
ulukyn 61cee990fc Changed: Fix @WEB customtext items
--HG--
branch : patches-from-atys
7 years ago
ulukyn fd458d5751 Added: setBackground lua method for group_html
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com 5c41e79ce0 Added: Add new html properties of group_html
--HG--
branch : patches-from-atys
7 years ago
Riasan 0b27a27a4c Fixed: Old Custom Text what used @WEB have no space after command "@WEBxxx"
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com 4f33715b06 Added: We can now set Item Custom Text with "@LUA xxx" to run lua code when players click on "OPEN" menu
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com b623bb11f5 Fixed: Adding translation to bots names (with tags) when displaying "xxx says: ..."
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com 3baf7fdb12 Fixed: First try to add translation tags into Bot names and Titles: translating target name and sys infos
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com 4c91c418d4 Fixed: First try to add translation tags into Bot names and Titles (will help rename of player to be translated and events npcs)
--HG--
branch : patches-from-atys
7 years ago
ulukyn@gmail.com 99a949b889 Changed: First try to add translation tags into Bot names and Titles (will help rename of player to be translated and events npcs)
--HG--
branch : patches-from-atys
7 years ago

@ -124,9 +124,11 @@ namespace NLGUI
// Event part
void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClickString = actionHandlerName; _AHOnLeftClick = CAHManager::getInstance()->getAH(actionHandlerName, _AHLeftClickParams); }
void setActionOnLeftClickParams(const std::string &params) { _AHOnLeftClickStringParams = params; }
void setActionOnOver (const std::string &actionHandlerName) { _AHOnOver = CAHManager::getInstance()->getAH(actionHandlerName, _AHOverParams); }
void setActionOnRightClick (const std::string &actionHandlerName) { _AHOnRightClick = CAHManager::getInstance()->getAH(actionHandlerName, _AHRightClickParams); }
void setActionOnClockTick (const std::string &ahName) { _AHOnClockTick = CAHManager::getInstance()->getAH(ahName, _AHClockTickParams); }
void setParamsOnLeftClick (const std::string &paramsHandlerName) { _AHLeftClickParams = paramsHandlerName; }
void setParamsOnOver (const std::string &paramsHandlerName) { _AHOverParams = paramsHandlerName; }
void setParamsOnRightClick (const std::string &paramsHandlerName) { _AHRightClickParams = paramsHandlerName; }
void setParamsOnClockTick (const std::string &ahParamsName) { _AHClockTickParams = ahParamsName; }
@ -141,14 +143,16 @@ namespace NLGUI
IActionHandler *getActionOnLeftClick () const { return _AHOnLeftClick; }
IActionHandler *getActionOnRightClick () const { return _AHOnRightClick; }
IActionHandler *getActionOnClockTick () const { return _AHOnClockTick; }
std::string _getParamsOnOver() const{ return _AHOverParams.toString(); }
std::string _getParamsOnOver() const{ return _AHOverParams.toString(); }
std::string _getParamsOnLeftClick () const { return _AHLeftClickParams.toString(); }
std::string _getParamsOnRightClick () const { return _AHRightClickParams.toString(); }
const std::string &getParamsOnLeftClick () const { return _AHLeftClickParams; }
const std::string &getParamsOnRightClick () const { return _AHRightClickParams; }
const std::string &getParamsOnClockTick () const { return _AHClockTickParams; }
// run action on left click
void runLeftClickAction();
void runRightClickAction();
// Context menu accessor/ One for each button
void setListMenuLeft (const std::string &cm) { _ListMenuLeft = cm; }
@ -161,6 +165,7 @@ namespace NLGUI
int luaRunLeftClickAction(CLuaState &ls);
int luaRunRightClickAction(CLuaState &ls);
REFLECT_EXPORT_START(CCtrlBaseButton, CCtrlBase)
REFLECT_BOOL("pushed", getPushed, setPushed);
REFLECT_STRING("col_normal", getColorAsString, setColorAsString);
@ -174,6 +179,11 @@ namespace NLGUI
REFLECT_STRING("onclick_l", _getActionOnLeftClick, setActionOnLeftClick);
REFLECT_STRING("params_l", _getParamsOnLeftClick, setParamsOnLeftClick);
REFLECT_LUA_METHOD("runLeftClickAction", luaRunLeftClickAction);
REFLECT_STRING("onclick_r", _getActionOnRightClick, setActionOnRightClick);
REFLECT_STRING("params_r", _getParamsOnRightClick, setParamsOnRightClick);
REFLECT_LUA_METHOD("runRightClickAction", luaRunRightClickAction);
REFLECT_STRING("onover", _getActionOnOver, setActionOnOver);
REFLECT_STRING("params_over", _getParamsOnOver, setParamsOnOver);
REFLECT_EXPORT_END
protected:

@ -274,10 +274,13 @@ namespace NLGUI
// Lua exports
int luaBlink(CLuaState &ls);
int luaSetHeaderColor(CLuaState &ls);
int luaSetModalParentList(CLuaState &ls);
REFLECT_EXPORT_START(CGroupContainer, CGroupContainerBase)
REFLECT_LUA_METHOD("blink", luaBlink);
REFLECT_LUA_METHOD("setHeaderColor", luaSetHeaderColor);
REFLECT_LUA_METHOD("setModalParentList", luaSetModalParentList);
REFLECT_STRING("title", getTitle, setTitle);
REFLECT_STRING("title_opened", getTitleOpened, setTitleOpened);
REFLECT_STRING("title_closed", getTitleClosed, setTitleClosed);

@ -78,7 +78,7 @@ namespace NLGUI
// ImageDownload system
enum TDataType {ImgType= 0, BnpType, StylesheetType};
enum TImageType {NormalImage=0, OverImage};
// Constructor
CGroupHTML(const TCtorParam &param);
~CGroupHTML();
@ -122,7 +122,7 @@ namespace NLGUI
// End of the paragraph
void endParagraph();
// add image download (used by view_bitmap.cpp to load web images)
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage);
// remove image from download list if present
@ -211,6 +211,8 @@ namespace NLGUI
// Browser home
std::string Home;
// Get Home URL
virtual std::string home();
// Undo browse: Browse the precedent url browsed. no op if none
void browseUndo ();
@ -225,6 +227,10 @@ namespace NLGUI
std::string getURL() const { return _URL; }
void setURL(const std::string &url);
std::string getHTML() const { return _DocumentHtml; }
void setHTML(const std::string &html);
void setHome(const std::string &home);
int luaClearRefresh(CLuaState &ls);
int luaClearUndoRedo(CLuaState &ls);
@ -237,6 +243,7 @@ namespace NLGUI
int luaShowDiv(CLuaState &ls);
int luaParseHtml(CLuaState &ls);
int luaRenderHtml(CLuaState &ls);
int luaSetBackground(CLuaState &ls);
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
REFLECT_LUA_METHOD("browse", luaBrowse)
@ -250,7 +257,10 @@ namespace NLGUI
REFLECT_LUA_METHOD("showDiv", luaShowDiv)
REFLECT_LUA_METHOD("parseHtml", luaParseHtml)
REFLECT_LUA_METHOD("renderHtml", luaRenderHtml)
REFLECT_LUA_METHOD("setBackground", luaSetBackground)
REFLECT_STRING("url", getURL, setURL)
REFLECT_STRING("html", getHTML, setHTML)
REFLECT_STRING("home", home, setHome)
REFLECT_FLOAT("timeout", getTimeout, setTimeout)
REFLECT_STRING("title", getTitle, setTitle)
REFLECT_EXPORT_END
@ -280,9 +290,6 @@ namespace NLGUI
// Add POST params to the libwww list
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
// Get Home URL
virtual std::string home();
// parse dom node and all child nodes recursively
void renderDOM(CHtmlElement &elm);
@ -355,7 +362,7 @@ namespace NLGUI
// Current URL
std::string _DocumentUrl;
std::string _DocumentDomain;
std::string _DocumentHtml; // not updated, only set by first render
std::string _DocumentHtml; // not updated only set by first render
// If true, then render _DocumentHtml on next update (replaces content)
bool _RenderNextTime;
// true if renderer is waiting for css files to finish downloading (link rel=stylesheet)
@ -712,7 +719,7 @@ namespace NLGUI
return 0;
return _Indent.back();
}
// Current node is a title
@ -804,7 +811,7 @@ namespace NLGUI
// decode all HTML entities
static ucstring decodeHTMLEntities(const ucstring &str);
struct CDataImageDownload
{
public:

@ -137,6 +137,9 @@ namespace NLGUI
const std::string getActionHandler(uint lineIndex) const;
const std::string getActionHandlerParam(uint lineIndex) const;
void setActionHandler(uint lineIndex, const std::string &ah = "");
void setActionHandlerParam(uint lineIndex, const std::string &params = "");
void openSubMenu (sint32 nb);
void hideSubMenus ();
@ -330,6 +333,8 @@ namespace NLGUI
const std::string getActionHandler(uint lineIndex) const;
const std::string getActionHandlerParam(uint lineIndex) const;
void setActionHandler(uint lineIndex, const std::string &ah = "");
void setActionHandlerParam(uint lineIndex, const std::string &params = "");
void addLine (const ucstring &name, const std::string &ah = "", const std::string &params = "",
const std::string &id = std::string(),

@ -276,6 +276,19 @@ template <class T> T trimRightWhiteSpaces (const T &str)
return str.substr (0, end);
}
// remove spaces and tabs at the begin and end of the string
template <class T> T trimSeparators (const T &str)
{
typename T::size_type start = 0;
typename T::size_type size = str.size();
while (start < size && (str[start] == ' ' || str[start] == '\t'))
start++;
typename T::size_type end = size;
while (end > start && (str[end-1] == ' ' || str[end-1] == '\t'))
end--;
return str.substr (start, end-start);
}
// if both first and last char are quotes (' or "), then remove them
template <class T> T trimQuotes (const T &str)
{

@ -14,12 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef FACTORY_H
#define FACTORY_H
@ -78,8 +72,11 @@ public:
*/
void registerClass(const KeyType &key, IFactoryRegister<BaseClass> *factoryRegister)
{
nlassert(_FactoryRegisters.find(key) == _FactoryRegisters.end());
_FactoryRegisters.insert(std::make_pair(key, factoryRegister));
// TODO: Removed assert because of crash of fes in 2019. We need found why... (ulukyn)
//nlassert(_FactoryRegisters.find(key) == _FactoryRegisters.end());
//_FactoryRegisters.insert(std::make_pair(key, factoryRegister));
if (_FactoryRegisters.find(key) == _FactoryRegisters.end())
_FactoryRegisters.insert(std::make_pair(key, factoryRegister));
}
/** Create a new instance of a factorable object.

@ -123,8 +123,11 @@ namespace NLGUI
if (prop)
{
const char *propPtr = prop;
_ContextHelp = ucstring(propPtr);
if (strlen(propPtr) > 2 && propPtr[0] == 'u' && propPtr[1] == ':')
_ContextHelp = ucstring::makeFromUtf8(std::string(propPtr).substr(2));
else
_ContextHelp = ucstring(propPtr);
if( !editorMode && ( strlen(propPtr) > 2 ) )
{
@ -256,7 +259,7 @@ namespace NLGUI
{
if( name == "tooltip" )
{
_ContextHelp = value;
_ContextHelp = ucstring::makeFromUtf8(value);
return;
}
else

@ -996,5 +996,27 @@ namespace NLGUI
return 0;
}
// ***************************************************************************
void CCtrlBaseButton::runRightClickAction()
{
if(_AHOnRightClick != NULL)
{
CAHManager::getInstance()->submitEvent( "button_click:" + getId() );
CAHManager::getInstance()->runActionHandler (_AHOnRightClick, this, _AHRightClickParams);
}
}
// ***************************************************************************
int CCtrlBaseButton::luaRunRightClickAction(CLuaState &ls)
{
const char *funcName = "onRightClick";
CLuaIHM::checkArgCount(ls, funcName, 0);
runRightClickAction();
return 0;
}
}

@ -4756,6 +4756,7 @@ namespace NLGUI
if (_Resizer[k]) _Resizer[k]->HMax = maxH;
}
}
// ***************************************************************************
int CGroupContainer::luaSetHeaderColor(CLuaState &ls)
{
@ -4765,6 +4766,16 @@ namespace NLGUI
_HeaderColor.link(ls.toString(1));
return 0;
}
// ***************************************************************************
int CGroupContainer::luaSetModalParentList(CLuaState &ls)
{
const char *funcName = "setModalParentList";
CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
setModalParentList(ls.toString(1));
return 0;
}
// ***************************************************************************
CRGBA CGroupContainer::getDrawnHeaderColor () const

@ -318,10 +318,10 @@ namespace NLGUI
sint32 height = style.Height;
sint32 maxw = style.MaxWidth;
sint32 maxh = style.MaxHeight;
sint32 imageWidth, imageHeight;
bool changed = true;
// get image texture size
// if image is being downloaded, then correct size is set after thats done
CCtrlButton *btn = dynamic_cast<CCtrlButton*>(view);
@ -346,14 +346,14 @@ namespace NLGUI
return;
}
}
// if width/height is not requested, then use image size
// else recalculate missing value, keep image ratio
if (width == -1 && height == -1)
{
width = imageWidth;
height = imageHeight;
changed = false;
}
else
@ -364,7 +364,7 @@ namespace NLGUI
else
height = width / ratio;
}
// apply max-width, max-height rules if asked
if (maxw > -1 || maxh > -1)
{
@ -1001,7 +1001,7 @@ namespace NLGUI
string fullstyle = style[1];
for (uint j=2; j < style.size(); j++)
fullstyle += ":"+style[j];
styles[trim(style[0])] = trim(fullstyle);
styles[trim(style[0])] = trimSeparators(fullstyle);
}
}
@ -1578,12 +1578,12 @@ namespace NLGUI
}
else
if( name == "error_color_global_color" )
{
{
return toString( ErrorColorGlobalColor );
}
else
if( name == "link_color_global_color" )
{
{
return toString( LinkColorGlobalColor );
}
else
@ -1593,67 +1593,67 @@ namespace NLGUI
}
else
if( name == "h1_color_global_color" )
{
{
return toString( H1ColorGlobalColor );
}
else
if( name == "h2_color_global_color" )
{
{
return toString( H2ColorGlobalColor );
}
else
if( name == "h3_color_global_color" )
{
{
return toString( H3ColorGlobalColor );
}
else
if( name == "h4_color_global_color" )
{
{
return toString( H4ColorGlobalColor );
}
else
if( name == "h5_color_global_color" )
{
{
return toString( H5ColorGlobalColor );
}
else
if( name == "h6_color_global_color" )
{
{
return toString( H6ColorGlobalColor );
}
else
if( name == "text_font_size" )
{
{
return toString( TextFontSize );
}
else
if( name == "h1_font_size" )
{
{
return toString( H1FontSize );
}
else
if( name == "h2_font_size" )
{
{
return toString( H2FontSize );
}
else
if( name == "h3_font_size" )
{
{
return toString( H3FontSize );
}
else
if( name == "h4_font_size" )
{
{
return toString( H4FontSize );
}
else
if( name == "h5_font_size" )
{
{
return toString( H5FontSize );
}
else
if( name == "h6_font_size" )
{
{
return toString( H6FontSize );
}
else
@ -1862,7 +1862,7 @@ namespace NLGUI
}
else
if( name == "error_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
ErrorColorGlobalColor = b;
@ -1870,7 +1870,7 @@ namespace NLGUI
}
else
if( name == "link_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
LinkColorGlobalColor = b;
@ -1886,7 +1886,7 @@ namespace NLGUI
}
else
if( name == "h1_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H1ColorGlobalColor = b;
@ -1894,7 +1894,7 @@ namespace NLGUI
}
else
if( name == "h2_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H2ColorGlobalColor = b;
@ -1902,7 +1902,7 @@ namespace NLGUI
}
else
if( name == "h3_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H3ColorGlobalColor = b;
@ -1910,7 +1910,7 @@ namespace NLGUI
}
else
if( name == "h4_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H4ColorGlobalColor = b;
@ -1918,7 +1918,7 @@ namespace NLGUI
}
else
if( name == "h5_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H5ColorGlobalColor = b;
@ -1926,7 +1926,7 @@ namespace NLGUI
}
else
if( name == "h6_color_global_color" )
{
{
bool b;
if( fromString( value, b ) )
H6ColorGlobalColor = b;
@ -1934,7 +1934,7 @@ namespace NLGUI
}
else
if( name == "text_font_size" )
{
{
uint i;
if( fromString( value, i ) )
TextFontSize = i;
@ -1942,7 +1942,7 @@ namespace NLGUI
}
else
if( name == "h1_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H1FontSize = i;
@ -1950,7 +1950,7 @@ namespace NLGUI
}
else
if( name == "h2_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H2FontSize = i;
@ -1958,7 +1958,7 @@ namespace NLGUI
}
else
if( name == "h3_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H3FontSize = i;
@ -1966,7 +1966,7 @@ namespace NLGUI
}
else
if( name == "h4_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H4FontSize = i;
@ -1974,7 +1974,7 @@ namespace NLGUI
}
else
if( name == "h5_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H5FontSize = i;
@ -1982,7 +1982,7 @@ namespace NLGUI
}
else
if( name == "h6_font_size" )
{
{
uint i;
if( fromString( value, i ) )
H6FontSize = i;
@ -2167,7 +2167,7 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "h4_color", BAD_CAST toString( H4Color ).c_str() );
xmlSetProp( node, BAD_CAST "h5_color", BAD_CAST toString( H5Color ).c_str() );
xmlSetProp( node, BAD_CAST "h6_color", BAD_CAST toString( H6Color ).c_str() );
xmlSetProp( node, BAD_CAST "error_color_global_color",
BAD_CAST toString( ErrorColorGlobalColor ).c_str() );
xmlSetProp( node, BAD_CAST "link_color_global_color",
@ -2772,17 +2772,19 @@ namespace NLGUI
string buttonTemplate = DefaultButtonGroup;
// Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name"
string param = "name=" + this->_Id + "|url=" + getLink();
string name;
if (!_AnchorName.empty())
name = _AnchorName.back();
typedef pair<string, string> TTmplParam;
vector<TTmplParam> tmplParams;
tmplParams.push_back(TTmplParam("id", ""));
tmplParams.push_back(TTmplParam("onclick", "browse"));
tmplParams.push_back(TTmplParam("onclick_param", param));
tmplParams.push_back(TTmplParam("active", "true"));
CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams);
CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, getId()+":"+name, tmplParams);
if (buttonGroup)
{
buttonGroup->setId(getId()+":"+name);
// Add the ctrl button
CCtrlTextButton *ctrlButton = dynamic_cast<CCtrlTextButton*>(buttonGroup->getCtrl("button"));
if (!ctrlButton) ctrlButton = dynamic_cast<CCtrlTextButton*>(buttonGroup->getCtrl("b"));
@ -2802,7 +2804,7 @@ namespace NLGUI
getParagraph()->addChild (buttonGroup);
paragraphChange ();
}
}
else
{
@ -4532,15 +4534,32 @@ namespace NLGUI
return 0;
}
// ***************************************************************************
int CGroupHTML::luaSetBackground(CLuaState &ls)
{
const char *funcName = "setBackground";
CLuaIHM::checkArgCount(ls, funcName, 3);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN);
std::string image = ls.toString(1);
bool scale = ls.toBoolean(2);
bool repeat = ls.toBoolean(3);
setBackground(image, scale, repeat);
return 0;
}
// ***************************************************************************
int CGroupHTML::luaInsertText(CLuaState &ls)
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;
@ -4638,6 +4657,16 @@ namespace NLGUI
browse(url.c_str());
}
void CGroupHTML::setHTML(const std::string &html)
{
renderHtmlString(html);
}
void CGroupHTML::setHome(const std::string &home)
{
Home = home;
}
// ***************************************************************************
void CGroupHTML::parseStylesheetFile(const std::string &fname)
{
@ -4939,7 +4968,7 @@ namespace NLGUI
css += "progress::-webkit-progress-value { background-color: rgb(0, 100, 180);}";
_Style.parseStylesheet(css);
}
// ***************************************************************************
std::string CGroupHTML::HTMLOListElement::getListMarkerText() const
{

@ -1663,6 +1663,28 @@ namespace NLGUI
return _Lines[lineIndex].AHParams;
}
// ------------------------------------------------------------------------------------------------
void CGroupSubMenu::setActionHandler(uint lineIndex, const std::string &ah)
{
if (lineIndex > _Lines.size())
{
nlwarning("Bad index");
return;
}
_Lines[lineIndex].AHName = ah;
}
// ------------------------------------------------------------------------------------------------
void CGroupSubMenu::setActionHandlerParam(uint lineIndex, const std::string &params)
{
if (lineIndex > _Lines.size())
{
nlwarning("Bad index");
return;
}
_Lines[lineIndex].AHParams = params;
}
// ------------------------------------------------------------------------------------------------
void CGroupSubMenu::setSelectable(uint lineIndex, bool selectable)
{
@ -2596,6 +2618,20 @@ namespace NLGUI
return _RootMenu ? _RootMenu->getActionHandlerParam(lineIndex) : "";
}
// ------------------------------------------------------------------------------------------------
void CGroupMenu::setActionHandler(uint lineIndex, const std::string &ah)
{
if (_RootMenu)
_RootMenu->setActionHandler(lineIndex, ah);
}
// ------------------------------------------------------------------------------------------------
void CGroupMenu::setActionHandlerParam(uint lineIndex, const std::string &params)
{
if (_RootMenu)
_RootMenu->setActionHandlerParam(lineIndex, params);
}
// ------------------------------------------------------------------------------------------------
void CGroupMenu::setUserGroupRight(uint line, CInterfaceGroup *gr, bool ownerShip /*=true*/)
{

@ -323,7 +323,7 @@ namespace NLGUI
prop = (char*) xmlGetProp( cur, (xmlChar*)"texture" );
if (prop)
{
string TxName = toLower((const char *) prop);
string TxName = (const char *) prop;
setTexture (TxName);
//CInterfaceManager *pIM = CInterfaceManager::getInstance();
//CViewRenderer &rVR = *CViewRenderer::getInstance();
@ -478,7 +478,7 @@ namespace NLGUI
}
}
else
_TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false);
_TextureId.setTexture (toLower(TxName).c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false);
}
// ----------------------------------------------------------------------------

@ -993,7 +993,10 @@ namespace NLGUI
if (_MultiLine)
{
setTextFormatTaged(CI18N::get(propPtr));
if (strlen(propPtr) > 2 && propPtr[0] == 'u' && propPtr[1] == ':')
setTextFormatTaged(ucstring::makeFromUtf8(std::string(propPtr).substr(2)));
else
setTextFormatTaged(CI18N::get(propPtr));
}
else
{

@ -49,8 +49,9 @@ ICommand::ICommand(const char *categoryName, const char *commandName, const char
if (comm != LocalCommands->end ())
{
nlinfo("command with same name: %s", commandName);
// 2 commands have the same name
nlstopex (("There are 2 commands that have the same name in the project (command name '%s'), skip the second definition", commandName));
// nlstopex (("There are 2 commands that have the same name in the project (command name '%s'), skip the second definition", commandName));
}
else
{

@ -285,7 +285,7 @@ void CEntityIdTranslator::registerEntity (const CEntityId &eid, const ucstring &
return;
}
nlinfo ("EIT: Register EId %s EntityName '%s' UId %d UserName '%s'", reid.toString().c_str(), entityName.toString().c_str(), uid, userName.c_str());
//nlinfo ("EIT: Register EId %s EntityName '%s' UId %d UserName '%s'", reid.toString().c_str(), entityName.toString().c_str(), uid, userName.c_str());
RegisteredEntities.insert (make_pair(reid, CEntityIdTranslator::CEntity(entityName, uid, userName, entitySlot, shardId)));
NameIndex.insert(make_pair(toLower(entityName), reid));
}

@ -382,9 +382,15 @@ std::string CI18N::getSystemLanguageCode ()
}
}
#else
// only keep 2 first characters
if (lang.size() > 1)
_SystemLanguageCode = NLMISC::toLower(lang).substr(0, 2);
{
// only keep 2 first characters
lang = NLMISC::toLower(lang).substr(0, 2);
// language code supported?
if (isLanguageCodeSupported(lang))
_SystemLanguageCode = lang;
}
#endif
}
}

@ -334,12 +334,12 @@ void CLog::displayNL (const char *format, ...)
}
char *str;
NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/);
NLMISC_CONVERT_VARGS (str, format, 1024/*NLMISC::MaxCStringSize*/);
if (strlen(str)<256/*NLMISC::MaxCStringSize*/-1)
if (strlen(str)<1024/*NLMISC::MaxCStringSize*/-1)
strcat (str, "\n");
else
str[256/*NLMISC::MaxCStringSize*/-2] = '\n';
str[1024/*NLMISC::MaxCStringSize*/-2] = '\n';
displayString (str);
}
@ -359,7 +359,7 @@ void CLog::display (const char *format, ...)
}
char *str;
NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/);
NLMISC_CONVERT_VARGS (str, format, 1024/*NLMISC::MaxCStringSize*/);
displayString (str);
}
@ -453,12 +453,12 @@ void CLog::displayRawNL( const char *format, ... )
}
char *str;
NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/);
NLMISC_CONVERT_VARGS (str, format, 1024/*NLMISC::MaxCStringSize*/);
if (strlen(str)<256/*NLMISC::MaxCStringSize*/-1)
if (strlen(str)<1024/*NLMISC::MaxCStringSize*/-1)
strcat (str, "\n");
else
str[256/*NLMISC::MaxCStringSize*/-2] = '\n';
str[1024/*NLMISC::MaxCStringSize*/-2] = '\n';
displayRawString(str);
}
@ -478,7 +478,7 @@ void CLog::displayRaw( const char *format, ... )
}
char *str;
NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/);
NLMISC_CONVERT_VARGS (str, format, 1024/*NLMISC::MaxCStringSize*/);
displayRawString(str);
}
@ -496,7 +496,7 @@ void CLog::forceDisplayRaw (const char *format, ...)
}
char *str;
NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/);
NLMISC_CONVERT_VARGS (str, format, 1024/*NLMISC::MaxCStringSize*/);
TDisplayInfo args;
CDisplayers::iterator idi;

@ -56,7 +56,8 @@ InstallWebPage = "";
// cacert.pem file can be downloaded from https://curl.haxx.se/docs/caextract.html
// and added to client data path or system specific bundle can be used
// Ubuntu has "/etc/ssl/certs/ca-certificates.crt"
//CurlCABundle = "cacert.pem";
// % = defaultConfigFilePath
CurlCABundle = "%cacert.pem";
////////////////
// INTERFACES //
@ -506,7 +507,8 @@ XMLInterfaceFiles = {
"ring_access_point_filter.xml",
"ring_window.xml",
"bg_downloader.xml",
"ryzhome_toolbar.xml"
"ryzhome_toolbar.xml",
"tp_interface.xml"
};
XMLR2EDInterfaceFiles =

@ -8306,10 +8306,53 @@ std::string CCharacterCL::currentAnimationSetName(TAnimationType animType) const
//---------------------------------------------------
std::string CCharacterCL::shapeFromItem(const CItemSheet &itemSheet) const
{
if(_Gender == GSGENDER::female && !itemSheet.getShapeFemale().empty())
return itemSheet.getShapeFemale();
string sheet = "";
if(_Gender == GSGENDER::male)
{
if(_Sheet)
switch(_Sheet->Race)
{
case EGSPD::CPeople::Fyros:
sheet = itemSheet.getShapeFyros();
break;
case EGSPD::CPeople::Matis:
sheet = itemSheet.getShapeMatis();
break;
case EGSPD::CPeople::Tryker:
sheet = itemSheet.getShapeTryker();
break;
case EGSPD::CPeople::Zorai:
sheet = itemSheet.getShapeZorai();
break;
}
}
else
return itemSheet.getShape();
{
if(_Sheet)
switch(_Sheet->Race)
{
case EGSPD::CPeople::Fyros:
sheet = itemSheet.getShapeFyrosFemale();
break;
case EGSPD::CPeople::Matis:
sheet = itemSheet.getShapeMatisFemale();
break;
case EGSPD::CPeople::Tryker:
sheet = itemSheet.getShapeTrykerFemale();
break;
case EGSPD::CPeople::Zorai:
sheet = itemSheet.getShapeZoraiFemale();
break;
}
if (sheet.empty())
sheet = itemSheet.getShapeFemale();
}
if (sheet.empty())
sheet = itemSheet.getShape();
return sheet;
}// shapeFromItem //

@ -1108,7 +1108,13 @@ void CClientConfig::setValues()
ClientCfg.CurlMaxConnections = 2;
READ_STRING_FV(CurlCABundle);
if (!ClientCfg.CurlCABundle.empty() && ClientCfg.CurlCABundle[0] == '%') // Path is relative to client_default.cfg path (used by ryzom patch)
{
string defaultConfigFileName;
if (ClientCfg.getDefaultConfigLocation(defaultConfigFileName))
ClientCfg.CurlCABundle = CFile::getPath(defaultConfigFileName)+ClientCfg.CurlCABundle.substr(1);
}
///////////////
// ANIMATION //
// AnimatedAngleThreshold
@ -2023,30 +2029,43 @@ void CClientConfig::init(const string &configFileName)
// now we can continue loading and parsing the config file
// if the config file will be modified, it calls automatically the function setValuesOnFileChange()
ClientCfg.ConfigFile.setCallback (CClientConfig::setValuesOnFileChange);
// load the config files
ClientCfg.ConfigFile.load (configFileName);
CConfigFile::CVar *pCV;
// check language code is supported
pCV = ClientCfg.ConfigFile.getVarPtr("LanguageCode");
if (pCV)
{
std::string lang = pCV->asString();
if (!CI18N::isLanguageCodeSupported(lang))
{
nlinfo("Unsupported language code \"%s\" fallback on default", lang.c_str());
// fallback to default language
ClientCfg.LanguageCode = CI18N::getSystemLanguageCode();
// update ConfigFile variable
pCV->setAsString(ClientCfg.LanguageCode);
ClientCfg.ConfigFile.save();
}
}
// update the ConfigFile variable in the config file
CConfigFile::CVar *varPtr = ClientCfg.ConfigFile.getVarPtr ("ClientVersion");
if (varPtr)
pCV = ClientCfg.ConfigFile.getVarPtr("ClientVersion");
if (pCV)
{
string str = varPtr->asString ();
std::string str = pCV->asString ();
if (str != getVersion() && ClientCfg.SaveConfig)
{
nlinfo ("Update and save the ClientVersion variable in config file %s -> %s", str.c_str(), getVersion().c_str());
varPtr->setAsString (getVersion());
ClientCfg.ConfigFile.save ();
pCV->setAsString(getVersion());
ClientCfg.ConfigFile.save();
}
}
else
{
nlwarning ("There's no ClientVersion variable in the config file!");
}
}// init //

@ -1052,6 +1052,7 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde
}
}
senderName = STRING_MANAGER::CStringManagerClient::getLocalizedName(senderName);
switch(type)
{
case CChatGroup::shout:

@ -75,6 +75,15 @@ CItemSheet::CItemSheet()
{
IdShape = 0;
IdShapeFemale = 0;
IdShapeFyros = 0;
IdShapeFyrosFemale = 0;
IdShapeMatis = 0;
IdShapeMatisFemale = 0;
IdShapeTryker = 0;
IdShapeTrykerFemale = 0;
IdShapeZorai = 0;
IdShapeZoraiFemale = 0;
MapVariant = 0;
ItemType = ITEM_TYPE::UNDEFINED;
Family = ITEMFAMILY::UNDEFINED;
@ -173,6 +182,57 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item)
debug("key '3d.shape_female' not found.");
IdShapeFemale = ClientSheetsStrings.add(ShapeFemale);
// Load the name fyros.
string ShapeFyros;
if(!item.getValueByName(ShapeFyros, "3d.shape_fyros"))
debug("key '3d.shape_fyros' not found.");
IdShapeFyros = ClientSheetsStrings.add(ShapeFyros);
// Load the name fyros .
string ShapeFyrosFemale;
if(!item.getValueByName(ShapeFyrosFemale, "3d.shape_fyros_female"))
debug("key '3d.shape_fyros_female' not found.");
IdShapeFyrosFemale = ClientSheetsStrings.add(ShapeFyrosFemale);
// Load the name matis.
string ShapeMatis;
if(!item.getValueByName(ShapeMatis, "3d.shape_matis"))
debug("key '3d.shape_matis' not found.");
IdShapeMatis = ClientSheetsStrings.add(ShapeMatis);
// Load the name matis .
string ShapeMatisFemale;
if(!item.getValueByName(ShapeMatisFemale, "3d.shape_matis_female"))
debug("key '3d.shape_matis_female' not found.");
IdShapeMatisFemale = ClientSheetsStrings.add(ShapeMatisFemale);
// Load the name tryker.
string ShapeTryker;
if(!item.getValueByName(ShapeTryker, "3d.shape_tryker"))
debug("key '3d.shape_tryker' not found.");
IdShapeTryker = ClientSheetsStrings.add(ShapeTryker);
// Load the name tryker .
string ShapeTrykerFemale;
if(!item.getValueByName(ShapeTrykerFemale, "3d.shape_tryker_female"))
debug("key '3d.shape_tryker_female' not found.");
IdShapeTrykerFemale = ClientSheetsStrings.add(ShapeTrykerFemale);
// Load the name zorai.
string ShapeZorai;
if(!item.getValueByName(ShapeZorai, "3d.shape_zorai"))
debug("key '3d.shape_zorai' not found.");
IdShapeZorai = ClientSheetsStrings.add(ShapeZorai);
// Load the name zorai .
string ShapeZoraiFemale;
if(!item.getValueByName(ShapeZoraiFemale, "3d.shape_zorai_female"))
debug("key '3d.shape_zorai_female' not found.");
IdShapeZoraiFemale = ClientSheetsStrings.add(ShapeZoraiFemale);
// Get the icon associated.
string IconMain;
if(!item.getValueByName (IconMain, "3d.icon"))
@ -367,6 +427,11 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item)
if (!val.empty())
CraftPlan = CSheetId(val);
// commands and menu label
TRANSLATE_VAL( Scroll.LuaCommand, "basics.Scroll.LuaCommand" );
TRANSLATE_VAL( Scroll.WebCommand, "basics.Scroll.WebCommand" );
TRANSLATE_VAL( Scroll.Label, "basics.Scroll.Label" );
// Special according to Family;
switch(Family)
{
@ -615,6 +680,14 @@ void CItemSheet::serial(NLMISC::IStream &f)
{
ClientSheetsStrings.serial(f, IdShape);
ClientSheetsStrings.serial(f, IdShapeFemale);
ClientSheetsStrings.serial(f, IdShapeFyros);
ClientSheetsStrings.serial(f, IdShapeFyrosFemale);
ClientSheetsStrings.serial(f, IdShapeMatis);
ClientSheetsStrings.serial(f, IdShapeMatisFemale);
ClientSheetsStrings.serial(f, IdShapeTryker);
ClientSheetsStrings.serial(f, IdShapeTrykerFemale);
ClientSheetsStrings.serial(f, IdShapeZorai);
ClientSheetsStrings.serial(f, IdShapeZoraiFemale);
f.serial(SlotBF); // Serialize Slots used.
f.serial(MapVariant); // Serialize Map Variant.
f.serialEnum(Family); // Serialize Family.
@ -658,6 +731,9 @@ void CItemSheet::serial(NLMISC::IStream &f)
// **** Serial Help Infos
f.serialEnum(ItemOrigin);
// item commands
f.serial(Scroll);
// Different Serial according to family
switch(Family)
{
@ -697,8 +773,9 @@ void CItemSheet::serial(NLMISC::IStream &f)
case ITEMFAMILY::TELEPORT:
f.serial(Teleport);
break;
// keep for readability
case ITEMFAMILY::SCROLL:
f.serial(Scroll);
//f.serial(Scroll);
break;
case ITEMFAMILY::CONSUMABLE:
f.serial(Consumable);

@ -255,10 +255,16 @@ public:
struct CScroll
{
std::string Texture;
std::string LuaCommand;
std::string WebCommand;
std::string Label;
void serial(NLMISC::IStream &f)
{
f.serial(Texture);
f.serial(LuaCommand);
f.serial(WebCommand);
f.serial(Label);
}
};
@ -288,6 +294,22 @@ public:
NLMISC::TSStringId IdShape;
/// Female shape file name
NLMISC::TSStringId IdShapeFemale;
/// shape file name for fyros
NLMISC::TSStringId IdShapeFyros;
/// Female shape file name for fyros
NLMISC::TSStringId IdShapeFyrosFemale;
/// shape file name for matis
NLMISC::TSStringId IdShapeMatis;
/// Female shape file name for matis
NLMISC::TSStringId IdShapeMatisFemale;
/// shape file name for tryker
NLMISC::TSStringId IdShapeTryker;
/// Female shape file name for tryker
NLMISC::TSStringId IdShapeTrykerFemale;
/// shape file name for zorai
NLMISC::TSStringId IdShapeZorai;
/// Female shape file name for zorai
NLMISC::TSStringId IdShapeZoraiFemale;
/// Equipment slot. This is a bitField matching each bit to SLOTTYPE::TSlotType
uint64 SlotBF;
/// texture variant.
@ -385,6 +407,14 @@ public:
std::string getShape() const { return ClientSheetsStrings.get(IdShape); }
std::string getShapeFemale() const { return ClientSheetsStrings.get(IdShapeFemale); }
std::string getShapeFyros() const { return ClientSheetsStrings.get(IdShapeFyros); }
std::string getShapeFyrosFemale() const { return ClientSheetsStrings.get(IdShapeFyrosFemale); }
std::string getShapeMatis() const { return ClientSheetsStrings.get(IdShapeMatis); }
std::string getShapeMatisFemale() const { return ClientSheetsStrings.get(IdShapeMatisFemale); }
std::string getShapeTryker() const { return ClientSheetsStrings.get(IdShapeTryker); }
std::string getShapeTrykerFemale() const { return ClientSheetsStrings.get(IdShapeTrykerFemale); }
std::string getShapeZorai() const { return ClientSheetsStrings.get(IdShapeZorai); }
std::string getShapeZoraiFemale() const { return ClientSheetsStrings.get(IdShapeZoraiFemale); }
std::string getIconBack() const { return ClientSheetsStrings.get(IdIconBack); }
std::string getIconMain() const { return ClientSheetsStrings.get(IdIconMain); }
std::string getIconOver() const { return ClientSheetsStrings.get(IdIconOver); }

@ -1386,7 +1386,7 @@ NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc..","<sheet_id> <name
ucstring desc2;
if (args.size() > 2)
desc.fromUtf8(args[2]);
if (args.size() > 2)
if (args.size() > 3)
desc2.fromUtf8(args[3]);
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
@ -4031,15 +4031,6 @@ NLMISC_COMMAND(displayActionCounter, "display the action counters", "")
return true;
}
NLMISC_COMMAND (url, "launch a browser to the specified url", "<url>")
{
if (args.size () != 1)
return false;
return openURL(args[0]);
}
NLMISC_COMMAND( reconnect, "Reconnect to the same shard (self Far TP)", "")
{
// If the server is up, the egs will begin the quit sequence (shortened only if we are in edition or animation mode).
@ -5855,6 +5846,14 @@ NLMISC_COMMAND(failMission, "clear the content of a mission", "<mission index>")
// ***************************************************************************
NLMISC_COMMAND (url, "launch a browser to the specified url", "<url>")
{
if (args.size () != 1)
return false;
return openURL(args[0]);
}
NLMISC_COMMAND(em, "emote command", "<emote phrase>")
{

@ -897,8 +897,18 @@ void contextWebIG(bool rightClick, bool dblClick)
{
if (pGC != NULL)
pGC->setActive(false);
CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL);
if (selectedInstanceURL.substr(0, 5) == "@LUA ")
{
string header = toString("doubleClick = %s\nrightClick = %s\nSelectedInstanceId = %u\n", dblClick?"true":"false", rightClick?"true":"false", InstanceId);
CLuaManager::getInstance().executeLuaScript(header+selectedInstanceURL.substr(5), true);
}
else
{
CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL);
}
}
}// contextWebIG //
//-----------------------------------------------
@ -906,15 +916,9 @@ void contextWebIG(bool rightClick, bool dblClick)
//-----------------------------------------------
void contextARKitect(bool rightClick, bool dblClick)
{
string header;
if (rightClick)
{
header = toString("rightClick = true\nSelectedInstanceId = %u\n", InstanceId);
} else {
header = toString("rightClick = false\nSelectedInstanceId = %u\n", InstanceId);
}
string header = toString("doubleClick = %s\nrightClick = %s\nSelectedInstanceId = %u\n", dblClick?"true":"false", rightClick?"true":"false", InstanceId);
CLuaManager::getInstance().executeLuaScript(string(header)+selectedInstanceURL, true);
CLuaManager::getInstance().executeLuaScript(header+selectedInstanceURL, true);
}// contextARKitect //

@ -2296,7 +2296,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value)
if (pos != ucstring::npos)
{
ucstring sn = replacement;
_EntityName = sn.substr(0, pos);
_EntityName = STRING_MANAGER::CStringManagerClient::getLocalizedName(sn.substr(0, pos));
ucstring::size_type pos2 = sn.find('$', pos + 1);
_TitleRaw = sn.substr(pos+1, pos2 - pos - 1);
replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, womanTitle);
@ -2309,7 +2309,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value)
{
// build the final name
p1 = _EntityName.find('$');
_EntityName = _EntityName.substr(0, p1); // + _Name.substr(p2+1)
_EntityName = STRING_MANAGER::CStringManagerClient::getLocalizedName(_EntityName.substr(0, p1)); // + _Name.substr(p2+1)
// Get extended name
_NameEx = replacement;
newtitle = _NameEx;
@ -2327,6 +2327,10 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value)
_HasReservedTitle = true;
}
}
else
{
_EntityName = STRING_MANAGER::CStringManagerClient::getLocalizedName(_EntityName);
}
}
// Is the first title or a new title ?

@ -190,6 +190,7 @@ void CGameContextMenu::init(const std::string &srcMenuId)
_TextPAStop= "ui:interface:" + menuId + ":pa_stop";
_TextPAFree= "ui:interface:" + menuId + ":pa_free";
_TextPAEnterStable= "ui:interface:" + menuId + ":pa_enter_stable";
_TextPAEnterBag= "ui:interface:" + menuId + ":pa_enter_bag";
// Forage source
_TextExtractRM= "ui:interface:" + menuId + ":extract_rm";
@ -557,7 +558,7 @@ void CGameContextMenu::update()
// Enable/disable various menu items
bool ok = testMenuOptionForPackAnimal( selection, animalIndex, true, _TextPAFollow, _TextPAStop, _TextPAFree,
_TextPAEnterStable, NULL /*no 'leave stable' in context menu*/, pTextMount,
NULL /*unmount always active in context menu when the character is riding*/);
NULL /*unmount always active in context menu when the character is riding*/, _TextPAEnterBag, NULL);
// Follow & assist special case
if ( _TextFollow )
@ -581,12 +582,17 @@ void CGameContextMenu::update()
_TextPAFollow->setActive(false);
if (_TextPAStop)
_TextPAStop->setActive(false);
if (_TextPAFree)
_TextPAFree->setActive(false);
if (_TextPAEnterStable)
_TextPAEnterStable->setActive(false);
if (_TextPAEnterBag)
_TextPAEnterBag->setActive(false);
}
// Remove Free option to prevent miss click
if (_TextPAFree)
_TextPAFree->setActive(false);
// build spire
if(_TextBuildTotem)
{
@ -940,7 +946,8 @@ void CGameContextMenu::applyTextTalk()
bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index, bool clearAll,
CViewTextMenu *pFollow, CViewTextMenu *pStop, CViewTextMenu *pFree,
CViewTextMenu *pEnterStable, CViewTextMenu *pLeaveStable,
CViewTextMenu *pMount, CViewTextMenu *pUnmount )
CViewTextMenu *pMount, CViewTextMenu *pUnmount,
CViewTextMenu *pEnterBag, CViewTextMenu *pLeaveBag)
{
if ( clearAll )
{
@ -950,6 +957,8 @@ bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index,
if(pFree) { pFree->setActive(false); pFree->setGrayed(true); }
if(pEnterStable) { pEnterStable->setActive(false); pEnterStable->setGrayed(true); }
if(pLeaveStable) { pLeaveStable->setActive(false); pLeaveStable->setGrayed(true); }
if(pEnterBag) { pEnterBag->setActive(false); pEnterBag->setGrayed(true); }
if(pLeaveBag) { pLeaveBag->setActive(false); pLeaveBag->setGrayed(false); }
if(pMount) { pMount->setActive(false); pMount->setGrayed(true); }
if(pUnmount) { pUnmount->setActive(false); pUnmount->setGrayed(true); }
}
@ -967,6 +976,14 @@ bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index,
if(!node) return false;
ANIMAL_TYPE::EAnimalType anitype= (ANIMAL_TYPE::EAnimalType)node->getValue32();
if (anitype != ANIMAL_TYPE::Pet)
{
if (pEnterBag)
pEnterBag->setActive(false);
if (pLeaveBag)
pLeaveBag->setActive(false);
}
// COMMON PART FOR ALL TYPES OF ANIMAL
// Is the character mounted on the animal?
@ -986,6 +1003,7 @@ bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index,
distanceSquare = pow(vect1.x-vect2.x,2) + pow(vect1.y-vect2.y,2);
}
bool onBag = ANIMAL_STATUS::isInBag(status);
// Enable option only if pack animal present
if(ANIMAL_STATUS::isSpawned(status))
@ -1017,7 +1035,15 @@ bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index,
if(pFollow) pFollow->setGrayed(false);
if(pStop) pStop->setGrayed(false);
if(pEnterStable) pEnterStable->setGrayed(false);
if (pEnterBag && !onBag)
pEnterBag->setGrayed(false);
}
if (pLeaveBag && onBag)
pLeaveBag->setActive(true);
if (pEnterBag && !onBag && anitype == ANIMAL_TYPE::Pet)
pEnterBag->setActive(true);
if(pLeaveStable) pLeaveStable->setGrayed(false);
}
}

@ -128,6 +128,7 @@ private:
CViewTextMenuPtr _TextPAStop;
CViewTextMenuPtr _TextPAFree;
CViewTextMenuPtr _TextPAEnterStable;
CViewTextMenuPtr _TextPAEnterBag;
// BotChat and player talk
CViewTextMenuPtr _TextNews;
@ -199,7 +200,8 @@ class CEntityCL;
bool testMenuOptionForPackAnimal( CEntityCL* selectedAnimalInVision, uint index, bool clearAll,
CViewTextMenu *pFollow, CViewTextMenu *pStop, CViewTextMenu *pFree,
CViewTextMenu *pEnterStable, CViewTextMenu *pLeaveStable,
CViewTextMenu *pMount, CViewTextMenu *pUnmount );
CViewTextMenu *pMount, CViewTextMenu *pUnmount,
CViewTextMenu *pEnterBag, CViewTextMenu *pLeaveBag );
#endif // NL_GAME_CONTEXT_MENU_H

@ -1556,6 +1556,8 @@ public:
CViewTextMenu *pFree = dynamic_cast<CViewTextMenu*>(pMenu->getView("free"));
CViewTextMenu *pEnterStable = dynamic_cast<CViewTextMenu*>(pMenu->getView("enter_stable"));
CViewTextMenu *pLeaveStable = dynamic_cast<CViewTextMenu*>(pMenu->getView("leave_stable"));
CViewTextMenu *pEnterBag = dynamic_cast<CViewTextMenu*>(pMenu->getView("enter_bag"));
CViewTextMenu *pLeaveBag = dynamic_cast<CViewTextMenu*>(pMenu->getView("leave_bag"));
CViewTextMenu *pMount = dynamic_cast<CViewTextMenu*>(pMenu->getView("mount"));
CViewTextMenu *pUnseat = dynamic_cast<CViewTextMenu*>(pMenu->getView("unseat"));
@ -1582,7 +1584,7 @@ public:
// Enable menu items
testMenuOptionForPackAnimal(selectedAnimalInVision, i, (i==0),
pFollow, pStop, pFree, pEnterStable, pLeaveStable, pMount, pUnseat);
pFollow, pStop, pFree, pEnterStable, pLeaveStable, pMount, pUnseat, pEnterBag, pLeaveBag);
}
}
else if(selected>=1 && selected<=MAX_INVENTORY_ANIMAL)
@ -1598,7 +1600,7 @@ public:
// Enable menu items
testMenuOptionForPackAnimal(selectedAnimalInVision, selected-1, true,
pFollow, pStop, pFree, pEnterStable, pLeaveStable, pMount, pUnseat);
pFollow, pStop, pFree, pEnterStable, pLeaveStable, pMount, pUnseat, pEnterBag, pLeaveBag);
}
}
};
@ -2067,6 +2069,7 @@ class CActionHandlerSetTargetName : public IActionHandler
}
// Set to target
CInterfaceExprValue evUCStr;
TargetName = STRING_MANAGER::CStringManagerClient::getLocalizedName(TargetName);
evUCStr.setUCString(TargetName);
CInterfaceLink::setTargetProperty(sNameTarget, evUCStr);
evUCStr.setUCString(TargetTitle);
@ -3527,6 +3530,15 @@ class CHandlerGameConfigApply : public IActionHandler
}
}
// save user created channels options
CCtrlBaseButton *pCS = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromDefine("game_config_save_channel_cb"));
if (pCS)
NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SAVE_CHANNEL")->setValue32(pCS->getPushed());
pCS = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromDefine("game_config_auto_channel_cb"));
if (pCS)
NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:AUTO_CHANNEL")->setValue32(pCS->getPushed());
CCtrlBaseButton *pBut = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromId(GAME_CONFIG_VR_ENABLE_BUTTON));
if (pBut)
{

@ -152,27 +152,35 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived()
// Select all the text for easier selection
editBoxShort->setSelectionAll();
}
group->setActive(true);
}
else
{
ucstring localDesc = ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id));
if (itemInfo.CustomText.empty())
display->setTextFormatTaged(ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id)));
display->setTextFormatTaged(localDesc);
else
{
ucstring text = itemInfo.CustomText;
string::size_type delimiter = text.find(' ');
if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
if (text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html"));
if (pGH)
pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str());
if (delimiter == string::npos)
group->setActive(false);
else
text = text.substr(delimiter, text.size()-delimiter);
pGH->browse(text.substr(4, text.size()-4).toString().c_str());
text = localDesc;
}
else if (text.size() > 3 && text[0]=='@' && text[1]=='L' && text[2]=='U' && text[3]=='A')
{
string code = text.substr(4, text.size()-4).toString();
if (!code.empty())
CLuaManager::getInstance().executeLuaScript(code);
text = localDesc;
}
if (!text.empty())
{
display->setTextFormatTaged(text);
group->setActive(true);
}
display->setTextFormatTaged(text);
}
}
}
@ -283,7 +291,7 @@ void CInterfaceItemEdition::CItemEditionWindow::begin()
display->setActive(true);
editButtons->setActive(false);
closeButton->setActive(true);
group->setActive(true);
group->setActive(false);
editBoxShort->setInputString(ucstring());
editBoxLarge->setInputString(ucstring());
@ -292,24 +300,28 @@ void CInterfaceItemEdition::CItemEditionWindow::begin()
// Finish the display or add the waiter
if (getInventory().isItemInfoUpToDate(ItemSlotId))
{
// If we already have item info
ucstring localDesc = ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id));
if (itemInfo.CustomText.empty())
display->setTextFormatTaged(ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id)));
display->setTextFormatTaged(localDesc);
else
{
ucstring text = itemInfo.CustomText;
string::size_type delimiter = text.find(' ');
if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
if (text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html"));
if (pGH)
pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str());
if (delimiter == string::npos)
group->setActive(false);
else
text = text.substr(delimiter, text.size()-delimiter);
pGH->browse(text.substr(4, text.size()-4).toString().c_str());
text = localDesc;
}
display->setTextFormatTaged(text);
else if (text.size() > 3 && text[0]=='@' && text[1]=='L' && text[2]=='U' && text[3]=='A')
{
string code = text.substr(4, text.size()-4).toString();
if (!code.empty())
CLuaManager::getInstance().executeLuaScript(code);
text = localDesc;
}
if (!text.empty())
display->setTextFormatTaged(text);
}
}
else
@ -430,7 +442,7 @@ static TStackMode CurrentStackMode;
static void validateStackItem(CDBCtrlSheet *src, CDBCtrlSheet *dest, sint32 quantity, TStackMode stackMode);
static void checkItemCommand(const CItemSheet *itemSheet);
//=====================================================================================================================
/** Send a swap item msg to the server
@ -1672,6 +1684,10 @@ class CHandlerItemCristalReload : public IActionHandler
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getCtrlLaunchingModal());
if (pCS == NULL) return;
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS && pIS->Scroll.Label.empty())
checkItemCommand(pIS);
sendToServerEnchantMessage((uint8)pCS->getInventoryIndex(), (uint16)pCS->getIndexInDB());
}
};
@ -1749,6 +1765,7 @@ class CHandlerItemMenuCheck : public IActionHandler
CViewTextMenu *pCrisReload = dynamic_cast<CViewTextMenu*>(pMenu->getView("cris_reload"));
CViewTextMenu *pTeleportUse = dynamic_cast<CViewTextMenu*>(pMenu->getView("teleport_use"));
CViewTextMenu *pItemConsume = dynamic_cast<CViewTextMenu*>(pMenu->getView("item_consume"));
CViewTextMenu *pItemExecute = dynamic_cast<CViewTextMenu*>(pMenu->getView("item_execute"));
CViewTextMenu *pXpCatalyserUse = dynamic_cast<CViewTextMenu*>(pMenu->getView("xp_catalyser_use"));
CViewTextMenu *pDrop = dynamic_cast<CViewTextMenu*>(pMenu->getView("drop"));
CViewTextMenu *pDestroy = dynamic_cast<CViewTextMenu*>(pMenu->getView("destroy"));
@ -1776,6 +1793,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pCrisReload) pCrisReload->setActive(false);
if(pTeleportUse) pTeleportUse->setActive(false);
if(pItemConsume) pItemConsume->setActive(false);
if(pItemExecute) pItemExecute->setActive(false);
if(pXpCatalyserUse) pXpCatalyserUse->setActive(false);
if(pItemTextDisplay) pItemTextDisplay->setActive(false);
if(pItemTextEdition) pItemTextEdition->setActive(false);
@ -1850,6 +1868,61 @@ class CHandlerItemMenuCheck : public IActionHandler
{
pItemInfos->setActive(true);
}
// item has a label?
if (!pIS->Scroll.Label.empty())
{
CGroupMenu *menu = dynamic_cast<CGroupMenu *>(
CWidgetManager::getInstance()->getElementFromId("ui:interface:item_menu_in_bag")
);
// add the label to default menu
if (!pIS->Scroll.LuaCommand.empty() || !pIS->Scroll.WebCommand.empty())
menu->setActionHandler(4, menu->getActionHandler(4));
else
{
// replace default menu and redirect action handler
if (pCrisEnchant && pCrisEnchant->getActive())
{
pCrisEnchant->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(0));
}
if (pCrisReload && pCrisReload->getActive())
{
pCrisReload->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(1));
}
if (pTeleportUse && pTeleportUse->getActive())
{
pTeleportUse->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(2));
}
if (pItemConsume && pItemConsume->getActive())
{
pItemConsume->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(3));
}
if (pXpCatalyserUse && pXpCatalyserUse->getActive())
{
pXpCatalyserUse->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(5));
}
if (pItemTextDisplay && pItemTextDisplay->getActive())
{
pItemTextDisplay->setActive(false);
menu->setActionHandler(4, menu->getActionHandler(6));
menu->setActionHandlerParam(4, menu->getActionHandlerParam(6));
}
}
if (!bIsLockedByOwner)
{
if (pCS->getInventoryIndex() == INVENTORIES::bag)
pItemExecute->setActive(true);
// enchant and reload can be used from anywhere
if (pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL || pIS->Family == ITEMFAMILY::ITEM_SAP_RECHARGE)
pItemExecute->setActive(true);
pItemExecute->setText(CI18N::get(pIS->Scroll.Label));
}
}
}
CInventoryManager &invMngr= getInventory();
@ -1980,6 +2053,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pCrisReload) pCrisReload->setGrayed(true);
if(pTeleportUse) pTeleportUse->setGrayed(true);
if(pItemConsume) pItemConsume->setGrayed(true);
if(pItemExecute) pItemExecute->setGrayed(true);
if(pXpCatalyserUse) pXpCatalyserUse->setGrayed(true);
if(pDrop) pDrop->setGrayed(true);
if(pDestroy) pDestroy->setGrayed(true);
@ -1999,6 +2073,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pCrisReload) pCrisReload->setGrayed(false);
if(pTeleportUse) pTeleportUse->setGrayed(false);
if(pItemConsume) pItemConsume->setGrayed(false);
if(pItemExecute) pItemExecute->setGrayed(false);
if(pXpCatalyserUse) pXpCatalyserUse->setGrayed(false);
if(pDrop) pDrop->setGrayed(false);
if(pDestroy) pDestroy->setGrayed(false);
@ -2179,6 +2254,24 @@ static void sendMsgStopUseXpCat( bool isRingCatalyser )
}
}
// ***************************************************************************
static void checkItemCommand(const CItemSheet *itemSheet)
{
if (itemSheet)
{
if (!itemSheet->Scroll.LuaCommand.empty())
CLuaManager::getInstance().executeLuaScript(itemSheet->Scroll.LuaCommand);
// webig
if (!itemSheet->Scroll.WebCommand.empty())
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(
CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html")
);
if (pGH) pGH->browse(itemSheet->Scroll.WebCommand.c_str());
}
}
return;
}
// ***************************************************************************
class CHandlerTeleportUse : public IActionHandler
@ -2207,6 +2300,8 @@ class CHandlerTeleportUse : public IActionHandler
LoadingBackground = TeleportKaravanBackground;
break;
}
if (pIS->Scroll.Label.empty())
checkItemCommand(pIS);
}
}
};
@ -2221,12 +2316,28 @@ class CHandlerItemConsume : public IActionHandler
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getCtrlLaunchingModal());
if (pCS == NULL) return;
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS && pIS->Scroll.Label.empty())
checkItemCommand(pIS);
// use the item
sendMsgUseItem(uint16(pCS->getIndexInDB()));
}
};
REGISTER_ACTION_HANDLER( CHandlerItemConsume, "item_consume" );
// ***************************************************************************
class CHandlerItemExecute : public IActionHandler
{
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
{
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getCtrlLaunchingModal());
if (pCS)
checkItemCommand(pCS->asItemSheet());
return;
}
};
REGISTER_ACTION_HANDLER( CHandlerItemExecute, "item_execute" );
// ***************************************************************************
class CHandlerValidateItemTextEdition : public IActionHandler
@ -2250,6 +2361,10 @@ class CHandlerItemTextDisplay : public IActionHandler
if (pCSItem == NULL || windowName.empty())
return;
const CItemSheet *pIS = pCSItem->asItemSheet();
if (pIS && pIS->Scroll.Label.empty())
checkItemCommand(pIS);
CInterfaceItemEdition::getInstance()->setCurrWindow(pCSItem, windowName, false);
}
};
@ -2291,6 +2406,10 @@ class CHandlerXpCatalyserUse : public IActionHandler
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getCtrlLaunchingModal());
if (pCS == NULL) return;
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS && pIS->Scroll.Label.empty())
checkItemCommand(pIS);
// use the item
sendMsgUseItem(uint16(pCS->getIndexInDB()));
}

@ -436,9 +436,45 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo
Parts[part].Quality = item->MapVariant;
if (Male)
Parts[part].Name = item->getShape();
{
switch(People)
{
case EGSPD::CPeople::Fyros:
Parts[part].Name = item->getShapeFyros();
break;
case EGSPD::CPeople::Matis:
Parts[part].Name = item->getShapeMatis();
break;
case EGSPD::CPeople::Tryker:
Parts[part].Name = item->getShapeTryker();
break;
case EGSPD::CPeople::Zorai:
Parts[part].Name = item->getShapeZorai();
break;
}
if (Parts[part].Name.empty())
Parts[part].Name = item->getShape();
}
else
Parts[part].Name = item->getShapeFemale();
{
switch(People)
{
case EGSPD::CPeople::Fyros:
Parts[part].Name = item->getShapeFyrosFemale();
break;
case EGSPD::CPeople::Matis:
Parts[part].Name = item->getShapeMatisFemale();
break;
case EGSPD::CPeople::Tryker:
Parts[part].Name = item->getShapeTrykerFemale();
break;
case EGSPD::CPeople::Zorai:
Parts[part].Name = item->getShapeZoraiFemale();
break;
}
if (Parts[part].Name.empty())
Parts[part].Name = item->getShapeFemale();
}
// use the right type of boots if wearing a caster dress
if ((s == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS || item->ItemType == ITEM_TYPE::MEDIUM_BOOTS || item->ItemType == ITEM_TYPE::HEAVY_BOOTS))

@ -135,54 +135,40 @@ int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls)
}
// ***************************************************************************
int CDBCtrlSheet::luaGetHpBuff(CLuaState &ls)
int CDBCtrlSheet::luaGetItemInfo(CLuaState &ls)
{
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ls.push(itemInfo.HpBuff);
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetSapBuff(CLuaState &ls)
{
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ls.push(itemInfo.SapBuff);
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetFocusBuff(CLuaState &ls)
{
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
uint32 itemSlotId = getInventory().getItemSlotId(ctrlSheet);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ls.push(itemInfo.FocusBuff);
ls.newTable();
CLuaObject out(ls);
// for now all but magic
out.setValue("CurrentDamage", itemInfo.CurrentDamage);
out.setValue("MaxDamage", itemInfo.MaxDamage);
out.setValue("DodgeModifier", itemInfo.DodgeModifier);
out.setValue("ParryModifier", itemInfo.ParryModifier);
out.setValue("AdversaryDodgeModifier", itemInfo.AdversaryDodgeModifier);
out.setValue("AdversaryParryModifier", itemInfo.AdversaryParryModifier);
out.setValue("Hp", itemInfo.Hp);
out.setValue("HpMax", itemInfo.HpMax);
out.setValue("Range", itemInfo.Range);
out.setValue("HpBuff", itemInfo.HpBuff);
out.setValue("SapBuff", itemInfo.SapBuff);
out.setValue("StaBuff", itemInfo.StaBuff);
out.setValue("FocusBuff", itemInfo.FocusBuff);
out.setValue("SapLoadCurrent", itemInfo.SapLoadCurrent);
out.setValue("SapLoadMax", itemInfo.SapLoadMax);
out.setValue("ProtectionFactor", itemInfo.ProtectionFactor);
out.setValue("MaxSlashingProtection", itemInfo.MaxSlashingProtection);
out.setValue("MaxPiercingProtection", itemInfo.MaxPiercingProtection);
out.setValue("MaxBluntProtection", itemInfo.MaxBluntProtection);
out.setValue("WearEquipmentMalus", itemInfo.WearEquipmentMalus);
out.push();
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetStaBuff(CLuaState &ls)
{
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ls.push(itemInfo.StaBuff);
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetName(CLuaState &ls)
{
@ -902,7 +888,7 @@ uint CDBCtrlSheet::getInventorySlot( const string &dbBranchId )
return INVENTORIES::bag;
break;
case 'P':
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
if( strncmp( "PACK_ANIMAL", szName2, 11 ) )
break;
switch( szName2[11] )
@ -915,6 +901,12 @@ uint CDBCtrlSheet::getInventorySlot( const string &dbBranchId )
return INVENTORIES::pet_animal3;
case '3':
return INVENTORIES::pet_animal4;
case '4':
return INVENTORIES::pet_animal5;
case '5':
return INVENTORIES::pet_animal6;
case '6':
return INVENTORIES::pet_animal7;
default:
break;
}
@ -991,11 +983,10 @@ void CDBCtrlSheet::updateCoords ()
{
if (getActive())
{
if(!_SetupInit)
setupInit();
if (_Type != CCtrlSheetInfo::SheetType_Macro)
{
if (!_SetupInit) setupInit();
if (_LastSheetId != _SheetId.getSInt32())
{
updateActualType();
@ -1091,6 +1082,20 @@ void CDBCtrlSheet::setupPact()
}
}
// ***************************************************************************
bool CDBCtrlSheet::useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const
{
return family == ITEMFAMILY::CRYSTALLIZED_SPELL
|| family == ITEMFAMILY::JEWELRY
|| family == ITEMFAMILY::ARMOR
|| family == ITEMFAMILY::MELEE_WEAPON
|| family == ITEMFAMILY::RANGE_WEAPON
|| family == ITEMFAMILY::SHIELD
|| family == ITEMFAMILY::CRAFTING_TOOL
|| family == ITEMFAMILY::HARVEST_TOOL
|| family == ITEMFAMILY::TAMING_TOOL
|| family == ITEMFAMILY::TRAINING_TOOL;
}
// ***************************************************************************
void CDBCtrlSheet::setupItem ()
@ -3120,18 +3125,61 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
}
else if(getType() == CCtrlSheetInfo::SheetType_Macro)
{
// TODO Find the name + params of the action
help = _ContextHelp;
const CMacroCmd *macro = CMacroCmdManager::getInstance()->getMacroFromMacroID(getMacroId());
if (!macro)
return;
ucstring macroName = macro->Name;
if (macroName.empty())
macroName = CI18N::get("uiNotAssigned");
ucstring assignedTo = macro->Combo.toUCString();
if (assignedTo.empty())
assignedTo = CI18N::get("uiNotAssigned");
ucstring dispText;
ucstring dispCommands;
const CMacroCmdManager *pMCM = CMacroCmdManager::getInstance();
uint nb = 0;
for (uint i = 0; i < macro->Commands.size(); ++i)
{
ucstring commandName;
for (uint j = 0; j < pMCM->ActionManagers.size(); ++j)
{
CAction::CName c(macro->Commands[i].Name.c_str(), macro->Commands[i].Params.c_str());
if (pMCM->ActionManagers[j]->getBaseAction(c) != NULL)
{
commandName = pMCM->ActionManagers[j]->getBaseAction(c)->getActionLocalizedText(c);
// display a few commands
if (nb < 5)
dispCommands += "\n" + commandName;
++nb;
break;
}
}
}
// formats
dispText = ucstring("%n (@{6F6F}%k@{FFFF})\n%c");
if (nb > 5) // more?
dispCommands += toString(" ... @{6F6F}%i@{FFFF}+", nb-5);
strFindReplace(dispText, ucstring("%n"), macroName);
strFindReplace(dispText, ucstring("%k"), assignedTo);
strFindReplace(dispText, ucstring("%c"), dispCommands);
help = dispText;
}
else if(getType() == CCtrlSheetInfo::SheetType_Item)
{
const CItemSheet *item= asItemSheet();
if(item)
{
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL || item->Family == ITEMFAMILY::JEWELRY || item->Family == ITEMFAMILY::ARMOR)
if (useItemInfoForFamily(item->Family))
{
string luaMethodName = ( (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip");
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
CCtrlBase *ctrlBase = const_cast<CDBCtrlSheet*>(this);
if ( ! getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(ctrlSheet)))
{
// Prepare the waiter
@ -3144,12 +3192,19 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
getInventory().addItemInfoWaiter(&ControlSheetTooltipUpdater);
}
help = ControlSheetTooltipUpdater.infoValidated(ctrlSheet, luaMethodName);
if (!_ContextHelp.empty())
{
help= _ContextHelp;
ctrlBase->setDefaultContextHelp(ucstring());
}
else
help = ControlSheetTooltipUpdater.infoValidated(ctrlSheet, luaMethodName);
}
else
help= getItemActualName();
if (!_ContextHelp.empty())
help= _ContextHelp;
else
help= getItemActualName();
}
else
help= _ContextHelp;
@ -3265,9 +3320,8 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const
const CItemSheet *item = asItemSheet();
if (item)
{
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL
|| item->Family == ITEMFAMILY::JEWELRY || item->Family == ITEMFAMILY::ARMOR)
{
if (useItemInfoForFamily(item->Family))
{
string luaMethodName = (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip";
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
if ( ! getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(ctrlSheet)))
@ -4421,13 +4475,13 @@ std::string CDBCtrlSheet::getContextHelpWindowName() const
if (getType() == CCtrlSheetInfo::SheetType_Item)
{
const CItemSheet *item= asItemSheet();
if(item)
if(item && useItemInfoForFamily(item->Family))
{
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL)
{
return "crystallized_spell_context_help";
}
else if (item->Family == ITEMFAMILY::JEWELRY || item->Family == ITEMFAMILY::ARMOR)
else
{
return "buff_item_context_help";
}

@ -34,6 +34,7 @@
#include "game_share/skills.h"
#include "game_share/slot_types.h"
#include "game_share/rm_family.h"
#include "game_share/item_family.h"
//
#include "../time_client.h"
@ -279,22 +280,16 @@ public:
REFLECT_STRING ("on_drop_params", getParamsOnDrop, setParamsOnDrop);
REFLECT_STRING ("on_can_drop", getActionOnCanDrop, setActionOnCanDrop);
REFLECT_STRING ("on_can_drop_params", getParamsOnCanDrop, setParamsOnCanDrop);
REFLECT_LUA_METHOD("getDraggedSheet", luaGetDraggedSheet)
REFLECT_LUA_METHOD("getHpBuff", luaGetHpBuff)
REFLECT_LUA_METHOD("getSapBuff", luaGetSapBuff)
REFLECT_LUA_METHOD("getFocusBuff", luaGetFocusBuff)
REFLECT_LUA_METHOD("getStaBuff", luaGetStaBuff)
REFLECT_LUA_METHOD("getName", luaGetName)
REFLECT_LUA_METHOD("getCreatorName", luaGetCreatorName)
REFLECT_LUA_METHOD("waitInfo", luaWaitInfo)
REFLECT_LUA_METHOD("buildCrystallizedSpellListBrick", luaBuildCrystallizedSpellListBrick)
REFLECT_LUA_METHOD("getDraggedSheet", luaGetDraggedSheet);
REFLECT_LUA_METHOD("getItemInfo", luaGetItemInfo);
REFLECT_LUA_METHOD("getName", luaGetName);
REFLECT_LUA_METHOD("getCreatorName", luaGetCreatorName);
REFLECT_LUA_METHOD("waitInfo", luaWaitInfo);
REFLECT_LUA_METHOD("buildCrystallizedSpellListBrick", luaBuildCrystallizedSpellListBrick);
REFLECT_EXPORT_END
int luaGetDraggedSheet(CLuaState &ls);
int luaGetHpBuff(CLuaState &ls);
int luaGetSapBuff(CLuaState &ls);
int luaGetFocusBuff(CLuaState &ls);
int luaGetStaBuff(CLuaState &ls);
int luaGetItemInfo(CLuaState &ls);
int luaGetName(CLuaState &ls);
int luaGetCreatorName(CLuaState &ls);
int luaWaitInfo(CLuaState &ls);
@ -587,6 +582,8 @@ public:
protected:
inline bool useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const;
void setupItem();
void setupPact();
void setupMacro();

@ -32,6 +32,7 @@
#include "nel/gui/action_handler.h"
#include "../dummy_progress.h"
#include "group_compas.h"
#include "group_html_cs.h"
#include "../connection.h"
#include "../net_manager.h"
#include "people_interraction.h" // for MaxNumPeopleInTeam
@ -120,10 +121,10 @@ static void popupLandMarkNameDialog()
gc->center();
CWidgetManager::getInstance()->setTopWindow(gc);
gc->enableBlink(1);
CGroupEditBox *eb = dynamic_cast<CGroupEditBox *>(gc->getGroup("eb"));
if (!eb) return;
if (!eb) return;
// Load ComboBox for Landmarks & sort entries
CDBGroupComboBox *cb = dynamic_cast<CDBGroupComboBox *>(gc->getGroup("landmarktypes"));
cb->sortText();
@ -132,7 +133,7 @@ static void popupLandMarkNameDialog()
{
CGroupMap *map = dynamic_cast<CGroupMap *>(LastSelectedLandMark->getParent());
if (!map) return;
const CUserLandMark userLM = map->getUserLandMark(LastSelectedLandMark);
NLGUI::CDBManager::getInstance()->getDbProp( "UI:TEMP:LANDMARKTYPE" )->setValue8(cb->getTextPos(userLM.Type));
@ -1213,41 +1214,81 @@ void CGroupMap::checkCoords()
// **** retrieve pos of respawn and update it, or hide it if there's no target
uint i;
if (_RespawnPos.size() < _RespawnLM.size())
uint offset = 0;
if (!_ArkPoints.empty())
{
for (i = (uint)_RespawnPos.size(); i < _RespawnLM.size(); i++)
offset = _ArkPoints.size();
if (_ArkPoints.size() < _RespawnLM.size())
{
for (i = (uint)_ArkPoints.size(); i < _RespawnLM.size(); i++)
{
delCtrl(_RespawnLM[i]);
_RespawnLM[i] = NULL;
}
}
_RespawnLM.resize(_ArkPoints.size(), NULL);
for(i = 0; i < _ArkPoints.size(); i++)
{
delCtrl(_RespawnLM[i]);
_RespawnLM[i] = NULL;
if (_RespawnLM[i] == NULL)
{
_RespawnLM[i] = createArkPointButton(_ArkPoints[i]);
_RespawnLM[i]->setId(this->getId() + ":arklm_" + NLMISC::toString(i));
_RespawnLM[i]->setParent(this);
ucstring title;
title.fromUtf8(_ArkPoints[i].Title);
_RespawnLM[i]->setDefaultContextHelp(title);
_RespawnLM[i]->HandleEvents = true;
addCtrl(_RespawnLM[i]);
updateLMPosFromDBPos(_RespawnLM[i], _ArkPoints[i].x, _ArkPoints[i].y);
}
}
}
_RespawnLM.resize(_RespawnPos.size(), NULL);
for(i = 0; i < _RespawnPos.size(); ++i)
if (_ArkPoints.empty() || !isIsland())
{
if (_RespawnLM[i] == NULL)
if (offset + _RespawnPos.size() < _RespawnLM.size())
{
_RespawnLM[i] = createLandMarkButton(_RespawnLMOptions);
_RespawnLM[i]->setId(this->getId() + ":rplm_" + NLMISC::toString(i));
_RespawnLM[i]->setParent(this);
if (_MapMode == MapMode_SpawnSquad)
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiSquadSpawnPoint") + NLMISC::toString(" %u", i+1));
else
for (i = offset + _RespawnPos.size(); i < _RespawnLM.size(); i++)
{
if (isIsland())
{
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiR2EntryPoint"));
}
delCtrl(_RespawnLM[i]);
_RespawnLM[i] = NULL;
}
}
_RespawnLM.resize(offset + _RespawnPos.size(), NULL);
for(int j = 0; j < _RespawnPos.size(); ++j)
{
i = offset + j;
if (_RespawnLM[i] == NULL)
{
_RespawnLM[i] = createLandMarkButton(_RespawnLMOptions);
_RespawnLM[i]->setId(this->getId() + ":rplm_" + NLMISC::toString(i));
_RespawnLM[i]->setParent(this);
if (_MapMode == MapMode_SpawnSquad)
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiSquadSpawnPoint") + NLMISC::toString(" %u", i+1));
else
{
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiRespawnPoint"));
if (isIsland())
{
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiR2EntryPoint"));
}
else
{
_RespawnLM[i]->setDefaultContextHelp(NLMISC::CI18N::get("uiRespawnPoint"));
}
_RespawnLM[i]->HandleEvents = R2::getEditor().getMode() != R2::CEditor::EditionMode;
}
_RespawnLM[i]->HandleEvents = R2::getEditor().getMode() != R2::CEditor::EditionMode;
addCtrl(_RespawnLM[i]);
}
addCtrl(_RespawnLM[i]);
if (_RespawnLM[i])
updateLMPosFromDBPos(_RespawnLM[i], _RespawnPos[j].x, _RespawnPos[j].y);
}
if (_RespawnLM[i])
updateLMPosFromDBPos(_RespawnLM[i], _RespawnPos[i].x, _RespawnPos[i].y);
}
if ((_MapMode == MapMode_Death) || (_MapMode == MapMode_SpawnSquad))
{
if (_RespawnPosReseted)
@ -1352,7 +1393,7 @@ void CGroupMap::checkCoords()
{
if (_TeammateLM[i])
{
{
sint32 px, py;
if (_TeammatePosStates[i]->getPos(px, py))
@ -1605,7 +1646,7 @@ void CGroupMap::draw()
if (_FrustumView)
{
if (R2::getEditor().getMode() == R2::CEditor::EditionMode)
if (getArkPowoMode() == "editor" || R2::getEditor().getMode() == R2::CEditor::EditionMode)
{
static volatile bool wantFrustum = true;
if (wantFrustum)
@ -1653,7 +1694,7 @@ void CGroupMap::draw()
Driver->setScissor(newScissor);
if (R2::getEditor().getMode() != R2::CEditor::EditionMode)
if (getArkPowoMode() == "editor" || R2::getEditor().getMode() != R2::CEditor::EditionMode)
{
// Draw the player TODO : replace with a CViewQuad
if (!_PlayerPosLoadFailure)
@ -1694,7 +1735,7 @@ void CGroupMap::draw()
// draw border of frustum
if (_FrustumView)
{
if (R2::getEditor().getMode() == R2::CEditor::EditionMode)
if (getArkPowoMode() == "editor" || R2::getEditor().getMode() == R2::CEditor::EditionMode)
{
if (_FrustumMaterial.empty())
{
@ -2242,6 +2283,19 @@ void CGroupMap::setMap(SMap *map)
invalidateCoords();
createContinentLandMarks();
nlinfo("setMap (%f,%f) (%f,%f)", _CurMap->MinX, _CurMap->MinY, _CurMap->MaxX, _CurMap->MaxY);
delArkPoints();
CGroupHTML *groupHtml = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:lm_events:html"));
if (groupHtml)
{
groupHtml->setHome(groupHtml->Home+toString("&min_x=%f&min_y=%f&max_x=%f&max_y=%f", _CurMap->MinX, _CurMap->MinY, _CurMap->MaxX, _CurMap->MaxY));
groupHtml->browse(groupHtml->Home.c_str());
}
if (_CurContinent != NULL)
_MapMaterial.setTexture(1, _CurContinent->FoW.Tx);
else
@ -2454,6 +2508,14 @@ void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm)
lm.clear();
}
//============================================================================================================
void CGroupMap::removeUserLandMarks()
{
removeLandMarks(_UserLM);
}
//============================================================================================================
void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
{
@ -2590,6 +2652,9 @@ static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv()
CInterfaceElement *ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:map_menu:teleport");
if(ie) ie->setActive(showTeleport);
ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:map_menu_island:teleport");
if(ie) ie->setActive(showTeleport);
ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:land_mark_menu:lmteleport");
if(ie) ie->setActive(showTeleport);
@ -2664,6 +2729,30 @@ CGroupMap::CLandMarkButton *CGroupMap::createLandMarkButton(const CLandMarkOptio
lmb->setPosRef(Hotspot_MM);
return lmb;
}
//============================================================================================================
CGroupMap::CLandMarkButton *CGroupMap::createArkPointButton(const CArkPoint &point)
{
CLandMarkButton *lmb = new CLandMarkButton(CViewBase::TCtorParam());
static int statFool = 0;
lmb->setId(this->getId()+":lm"+toString(statFool++));
lmb->setTexture(point.Texture);
lmb->setTextureOver(point.Texture);
lmb->setTexturePushed(point.Texture);
lmb->setType(CCtrlButton::PushButton);
lmb->setActionOnLeftClick(point.LeftClickAction);
lmb->setParamsOnLeftClick(point.LeftClickParam);
lmb->setActionOnRightClick(point.RightClickAction);
lmb->setParamsOnRightClick(point.RightClickParam);
lmb->setColor(point.Color);
lmb->setColorOver(point.Color);
lmb->setColorPushed(point.Color);
lmb->setModulateGlobalColorAll(false);
lmb->setPosRef(Hotspot_MM);
return lmb;
}
//============================================================================================================
void CGroupMap::updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOptions &options)
{
@ -2721,6 +2810,50 @@ void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector
addCtrl(lmb);
}
//============================================================================================================
void CGroupMap::addUserLandMark(const NLMISC::CVector2f &pos, const ucstring &title, NLMISC::CRGBA color)
{
if (_CurContinent == NULL) return;
CUserLandMark ulm;
mapToWorld(ulm.Pos, pos);
ulm.Title = title;
ulm.Type = 5;
_CurContinent->UserLandMarks.push_back(ulm);
CLandMarkOptions options(_UserLMOptions);
options.ColorNormal = options.ColorOver = options.ColorPushed = color;
// create a new button and add it to the list
CLandMarkButton *lmb = createLandMarkButton(options);
lmb->setParent(this);
lmb->Pos = pos;
lmb->setDefaultContextHelp(title);
_UserLM.push_back(lmb);
addCtrl(lmb);
invalidateCoords();
}
//============================================================================================================
void CGroupMap::delArkPoints()
{
for (uint i = 0; i < _RespawnLM.size(); i++)
{
delCtrl(_RespawnLM[i]);
_RespawnLM[i] = NULL;
}
_ArkPoints.clear();
}
//============================================================================================================
void CGroupMap::addUserRespawnPoint(const NLMISC::CVector2f &pos)
{
CRespawnPointsMsg rpm;
rpm.NeedToReset = false;
rpm.RespawnPoints.push_back(CRespawnPointsMsg::SRespawnPoint(pos.x*1000,pos.y*1000));
addRespawnPoints(rpm);
}
//============================================================================================================
CCtrlButton *CGroupMap::addUserLandMark(const NLMISC::CVector2f &pos, const ucstring &title, const CUserLandMark::EUserLandMarkType lmType)
{
@ -2803,7 +2936,7 @@ CUserLandMark CGroupMap::getUserLandMark(CCtrlButton *button) const
}
}
return ulm;
}
@ -2816,7 +2949,7 @@ uint CGroupMap::getNumUserLandMarks() const
//============================================================================================================
CLandMarkOptions CGroupMap::getUserLandMarkOptions(uint32 lmindex) const
{
if (_CurContinent == NULL || _CurContinent->UserLandMarks.size() < lmindex)
if (_CurContinent == NULL || _CurContinent->UserLandMarks.size() < lmindex)
return _UserLMOptions;
CLandMarkOptions clmo(_UserLMOptions);
@ -3425,6 +3558,38 @@ void CGroupMap::addRespawnPoints(const CRespawnPointsMsg &rpm)
}
}
//=========================================================================================================
void CGroupMap::addArkPoint(const CArkPoint &point) {
_ArkPoints.push_back(point);
if (_MapMode != MapMode_Death) return;
if (_ArkPoints.empty()) return;
CWorldSheet *pWS = dynamic_cast<CWorldSheet*>(SheetMngr.get(CSheetId("ryzom.world")));
if (pWS == NULL) return;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (pIM == NULL) return;
NLMISC::CVector2f rpWorldPos(point.x * 0.001f, point.y * 0.001f);
for (uint32 i = 0; i < pWS->Maps.size(); ++i)
{
SMap &rMap = pWS->Maps[i];
if (rMap.ContinentName.empty()) continue;
if ((rpWorldPos.x >= rMap.MinX) &&
(rpWorldPos.x <= rMap.MaxX) &&
(rpWorldPos.y >= rMap.MinY) &&
(rpWorldPos.y <= rMap.MaxY))
{
setMap(rMap.Name);
break;
}
}
}
//=========================================================================================================
void CGroupMap::serialConfig(NLMISC::IStream &f)
{
@ -3872,7 +4037,10 @@ class CAHWorldMapRightClick : public IActionHandler
}
else
{
CAHManager::getInstance()->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu_island");
if (gm->getArkPowoMode() == "editor")
CAHManager::getInstance()->runActionHandler("active_menu", pCaller, "menu="+gm->getArkPowoMapMenu());
else
CAHManager::getInstance()->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu_island");
}
}
};
@ -3933,9 +4101,9 @@ REGISTER_ACTION_HANDLER(CAHMapTeleport, "map_teleport");
//=========================================================================================================
// update LandMarks Colors
class CUpdateLandMarksColor : public IActionHandler{public: virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
class CUpdateLandMarksColor : public IActionHandler{public: virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CUserLandMark::_LandMarksColor[CUserLandMark::Misc] = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:LANDMARK:COLORS:MISC")->getValueRGBA();
CUserLandMark::_LandMarksColor[CUserLandMark::Tribe] = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:LANDMARK:COLORS:TRIBE")->getValueRGBA();
@ -3969,10 +4137,10 @@ class CUpdateLandMarksColor : public IActionHandler{public: virtual void execute
CUserLandMark::_LandMarksColor[CUserLandMark::Teleporter] = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:LANDMARK:COLORS:TELEPORTER")->getValueRGBA();
CGroupMap *pGM = dynamic_cast<CGroupMap *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pGM == NULL) return;
pGM->updateUserLandMarks();
CGroupMap *pGM = dynamic_cast<CGroupMap *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pGM == NULL) return;
pGM->updateUserLandMarks();
}};
REGISTER_ACTION_HANDLER (CUpdateLandMarksColor, "update_landmarks_color");

@ -81,6 +81,27 @@ public:
}
};
class CArkPoint
{
public:
sint32 x, y;
std::string Texture;
NLMISC::CRGBA Color;
std::string Title;
std::string LeftClickAction;
std::string LeftClickParam;
std::string RightClickAction;
std::string RightClickParam;
public:
CArkPoint()
{
Color = NLMISC::CRGBA::White;
x = 0;
y = 0;
}
};
/**
* Display of map and landmarks.
*
@ -100,6 +121,7 @@ public:
class CGroupMap : public CInterfaceGroup
{
public:
// external element to be displayed on the map
struct IDeco
{
@ -198,7 +220,12 @@ public:
void getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos);
//Remove and re-create UserLandMarks
void removeUserLandMarks();
void updateUserLandMarks();
void addUserLandMark(const NLMISC::CVector2f &pos, const ucstring &title, NLMISC::CRGBA color);
void addUserRespawnPoint(const NLMISC::CVector2f &pos);
void delArkPoints();
// set landmarks visibility based text query
void setLandmarkFilter(const std::string &s);
@ -247,6 +274,14 @@ public:
// Server set all valid respawn points
void addRespawnPoints(const CRespawnPointsMsg &rpm);
// add Ark landscape point
void addArkPoint(const CArkPoint &point);
std::string getArkPowoMode() const { return _ArkPowoMode; }
void setArkPowoMode(const std::string &mode) { _ArkPowoMode = mode; }
std::string getArkPowoMapMenu() const { return _ArkPowoMapMenu; }
void setArkPowoMapMenu(const std::string &menu) { _ArkPowoMapMenu = menu; }
bool isInDeathMode() { return _MapMode == MapMode_Death; }
sint32 getRespawnSelected() const;
@ -401,6 +436,8 @@ private:
sint32 _MapW;
sint32 _MapH;
std::string _ArkPowoMode;
std::string _ArkPowoMapMenu;
NLMISC::CRGBA _FrustumViewColor;
NLMISC::CRGBA _FrustumViewColorOver;
float _FrustumOverBlendFactor;
@ -507,6 +544,7 @@ private:
};
TMapMode _MapMode;
std::vector<CArkPoint> _ArkPoints;
CLandMarkOptions _RespawnLMOptions;
// landmark for respawn
TLandMarkButtonVect _RespawnLM;
@ -548,6 +586,9 @@ private:
void addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector2f &pos, const ucstring &title, const CLandMarkOptions &options);
// Create a landmark button, but do not add it to this group
CLandMarkButton *createLandMarkButton(const CLandMarkOptions &options);
// Create a Ark landmark button, but do not add it to this group
CLandMarkButton *createArkPointButton(const CArkPoint &point);
// update a landmark button
void updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOptions &options);

@ -60,13 +60,13 @@ NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupListAscensor, std::string, "list_sheet
#define WIN_GUILD "ui:interface:guild"
#define WIN_GUILD_CHAT "ui:interface:guild_chat"
#define WIN_GUILD_FORUM "ui:interface:guild_forum"
#define VIEW_TEXT_GUILD_QUIT "ui:interface:guild:content:tab_guild:quit_guild"
#define CTRL_SHEET_GUILD_BLASON "ui:interface:guild:content:tab_guild:blason"
#define VIEW_TEXT_GUILD_MEMBER_COUNT "ui:interface:guild:content:tab_guild:member_count"
#define VIEW_TEXT_GUILD_QUIT "ui:interface:guild:content:tab_guild_info:quit_guild"
#define CTRL_SHEET_GUILD_BLASON "ui:interface:guild:content:tab_guild_info:blason"
#define VIEW_TEXT_GUILD_MEMBER_COUNT "ui:interface:guild:content:tab_guild_info:member_count"
#define LIST_GUILD_MEMBERS "ui:interface:guild:content:tab_guild:list_member:guild_members"
#define CTRL_QUIT_GUILD "ui:interface:guild:content:tab_guild:quit_guild"
#define CTRL_QUIT_GUILD "ui:interface:guild:content:tab_guild_info:quit_guild"
#define TEMPLATE_GUILD_MEMBER "member_template"
#define TEMPLATE_GUILD_MEMBER_NAME "name"
#define TEMPLATE_GUILD_MEMBER_GRADE "grade"
@ -867,6 +867,10 @@ class CAHGuildSheetOpen : public IActionHandler
break;
}
}
CCtrlBase *inviteButton = pLine->getCtrl("invite_button");
if (inviteButton != NULL)
inviteButton->setActive(rGuildMembers[i].Online != ccs_offline && rGuildMembers[i].Name != UserEntity->getEntityName());
// Enter Date
CViewText *pViewEnterDate = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_ENTER_DATE));

@ -661,24 +661,25 @@ CInterfaceElement* CInterface3DScene::getElement (const string &id)
return this;
string sTmp = id.substr(0, getId().size());
if (sTmp != getId()) return NULL;
//if (sTmp != getId()) return NULL;
uint i;
for (i = 0; i < _Characters.size(); ++i)
if (id == _Characters[i]->getId())
if (id == _Characters[i]->getId() || id == toString("character#%d", i))
return _Characters[i];
for (i = 0; i < _IGs.size(); ++i)
if (id == _IGs[i]->getId())
return _IGs[i];
for (i = 0; i < _Shapes.size(); ++i)
if (id == _Shapes[i]->getId())
for (i = 0; i < _Shapes.size(); ++i) {
if (id == _Shapes[i]->getId() || id == toString("shape#%d", i))
return _Shapes[i];
}
for (i = 0; i < _Cameras.size(); ++i)
if (id == _Cameras[i]->getId())
if (id == _Cameras[i]->getId() || id == toString("camera#%d", i))
return _Cameras[i];
for (i = 0; i < _Lights.size(); ++i)
@ -691,6 +692,24 @@ CInterfaceElement* CInterface3DScene::getElement (const string &id)
return NULL;
}
int CInterface3DScene::luaGetElement(CLuaState &ls)
{
CLuaIHM::checkArgCount(ls, "CInterfaceGroup::find", 1);
CLuaIHM::checkArgType(ls, "CInterfaceGroup::find", 1, LUA_TSTRING);
std::string id = ls.toString(1);
CInterfaceElement* element = getElement(id);
if (!element)
{
ls.pushNil();
}
else
{
CLuaIHM::pushUIOnStack(ls, element);
}
return 1;
}
// ----------------------------------------------------------------------------
string CInterface3DScene::getCurrentCamera() const
{
@ -1237,6 +1256,7 @@ CInterface3DShape::~CInterface3DShape()
// ----------------------------------------------------------------------------
bool CInterface3DShape::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
{
nlinfo("SHAPE ID PARENT = %s", parentGroup->getId().c_str());
if (!CInterfaceElement::parse(cur, parentGroup))
return false;
@ -1260,6 +1280,39 @@ bool CInterface3DShape::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
return true;
}
float CInterface3DShape::getBBoxSizeX () const
{
CAABBox bbox;
_Instance.getShapeAABBox(bbox);
if (bbox.getCenter() == CVector::Null)
return -0.5f;
return bbox.getMax().x - bbox.getMin().x;
}
float CInterface3DShape::getBBoxSizeY () const
{
CAABBox bbox;
_Instance.getShapeAABBox(bbox);
if (bbox.getCenter() == CVector::Null)
return -0.5f;
return bbox.getMax().y - bbox.getMin().y;
}
float CInterface3DShape::getBBoxSizeZ () const
{
CAABBox bbox;
_Instance.getShapeAABBox(bbox);
if (bbox.getCenter() == CVector::Null)
return -0.5f;
return bbox.getMax().z - bbox.getMin().z;
}
// ----------------------------------------------------------------------------
float CInterface3DShape::getPosX () const
{

@ -83,7 +83,10 @@ public:
float getDistLimitMax() const { return _DistLimitMax;}
void setDistLimitMax(float limitMax) { _DistLimitMax = limitMax;}
int luaGetElement(CLuaState &ls);
REFLECT_EXPORT_START(CInterface3DScene, CInterfaceGroup)
REFLECT_LUA_METHOD ("getElement", luaGetElement);
REFLECT_STRING ("curcam", getCurrentCamera, setCurrentCamera);
REFLECT_STRING ("curcs", getCurrentClusterSystem, setCurrentClusterSystem);
REFLECT_FLOAT ("rotzfactor", getRotFactor, setRotFactor);
@ -259,7 +262,15 @@ public:
std::string getName() const;
void setName (const std::string &ht);
float getBBoxSizeX () const;
float getBBoxSizeY () const;
float getBBoxSizeZ () const;
REFLECT_EXPORT_START(CInterface3DShape, CInterfaceElement)
REFLECT_FLOAT("getBBoxSizeX", getBBoxSizeX, setPosX);
REFLECT_FLOAT("getBBoxSizeY", getBBoxSizeY, setPosX);
REFLECT_FLOAT("getBBoxSizeZ", getBBoxSizeZ, setPosX);
REFLECT_FLOAT ("posx", getPosX, setPosX);
REFLECT_FLOAT ("posy", getPosY, setPosY);
REFLECT_FLOAT ("posz", getPosZ, setPosZ);

@ -878,6 +878,23 @@ static DECLARE_INTERFACE_USER_FCT(isAnimalStatusInStable)
}
REGISTER_INTERFACE_USER_FCT("isAnimalStatusInStable", isAnimalStatusInStable)
// ***************************************************************************
static DECLARE_INTERFACE_USER_FCT(isAnimalStatusInBag)
{
if (args.size() != 1)
{
nlwarning("<isAnimalStatusInStable> Expecting 1 args.");
return false;
}
// According to server status, change the inventory text
uint status= (uint)args[0].getInteger();
result.setBool(ANIMAL_STATUS::isInBag(status));
return true;
}
REGISTER_INTERFACE_USER_FCT("isAnimalStatusInBag", isAnimalStatusInBag)
// ***************************************************************************
static DECLARE_INTERFACE_USER_FCT(isSkillAtMax)
{

@ -2356,6 +2356,7 @@ void CInterfaceManager::processServerIDString()
if (bValid)
{
ucstrToAffect = STRING_MANAGER::CStringManagerClient::getLocalizedName(ucstrToAffect);
val.setUCString (ucstrToAffect);
CInterfaceLink::setTargetProperty (pISW->Target, val);
}

@ -66,7 +66,7 @@ extern bool g_hidden;
///max botchat distance
#define MAX_BOTCHAT_DISTANCE_SQUARE 25
#define MAX_NUM_MODES 4
#define MAX_NUM_MODES 6
#define RZ_CATEGORY_EDIT "edit"

@ -80,6 +80,9 @@ const std::string CInventoryManager::InventoryDBs[]=
"INVENTORY:PACK_ANIMAL1",
"INVENTORY:PACK_ANIMAL2",
"INVENTORY:PACK_ANIMAL3",
"INVENTORY:PACK_ANIMAL4",
"INVENTORY:PACK_ANIMAL5",
"INVENTORY:PACK_ANIMAL6",
"INVENTORY:TEMP",
"EXCHANGE:GIVE",
"EXCHANGE:RECEIVE",
@ -92,7 +95,7 @@ const std::string CInventoryManager::InventoryDBs[]=
static void dummyCheck()
{
// if this raise, correct the 2 tables above and below
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
}
const uint CInventoryManager::InventoryIndexes[]=
@ -103,6 +106,9 @@ const uint CInventoryManager::InventoryIndexes[]=
INVENTORIES::pet_animal2,
INVENTORIES::pet_animal3,
INVENTORIES::pet_animal4,
INVENTORIES::pet_animal5,
INVENTORIES::pet_animal6,
INVENTORIES::pet_animal7,
INVENTORIES::temporary,
INVENTORIES::exchange,
INVENTORIES::exchange_proposition,
@ -1511,7 +1517,7 @@ void CInventoryManager::getBranchSlotCounts(const std::string &basePath, uint& n
// ***************************************************************************
double CInventoryManager::getBagBulk(uint32 inventoryIndex)
{
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
if (inventoryIndex == 0)
return getBranchBulk(LOCAL_INVENTORY ":BAG", 0, MAX_BAGINV_ENTRIES);
else if (inventoryIndex == 1)
@ -1523,10 +1529,16 @@ double CInventoryManager::getBagBulk(uint32 inventoryIndex)
else if (inventoryIndex == 4)
return getBranchBulk(LOCAL_INVENTORY ":PACK_ANIMAL3", 0, MAX_ANIMALINV_ENTRIES);
else if (inventoryIndex == 5)
return 0;
return getBranchBulk(LOCAL_INVENTORY ":PACK_ANIMAL4", 0, MAX_ANIMALINV_ENTRIES);
else if (inventoryIndex == 6)
return 0;
return getBranchBulk(LOCAL_INVENTORY ":PACK_ANIMAL5", 0, MAX_ANIMALINV_ENTRIES);
else if (inventoryIndex == 7)
return getBranchBulk(LOCAL_INVENTORY ":PACK_ANIMAL6", 0, MAX_ANIMALINV_ENTRIES);
else if (inventoryIndex == 8)
return 0;
else if (inventoryIndex == 9)
return 0;
else if (inventoryIndex == 10)
return getBranchBulk(LOCAL_INVENTORY ":TEMP", 0, MAX_TEMPINV_ENTRIES);
return 0;
}
@ -1543,7 +1555,7 @@ double CInventoryManager::getItemBulk(uint32 sheetID)
// ***************************************************************************
double CInventoryManager::getMaxBagBulk(uint32 inventoryIndex)
{
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CCDBNodeLeaf *pNL=NULL;
if (inventoryIndex == 0)
@ -1556,6 +1568,12 @@ double CInventoryManager::getMaxBagBulk(uint32 inventoryIndex)
pNL = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:PACK_ANIMAL:BEAST2:BULK_MAX");
else if (inventoryIndex == 4)
pNL = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:PACK_ANIMAL:BEAST3:BULK_MAX");
else if (inventoryIndex == 5)
pNL = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:PACK_ANIMAL:BEAST4:BULK_MAX");
else if (inventoryIndex == 6)
pNL = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:PACK_ANIMAL:BEAST5:BULK_MAX");
else if (inventoryIndex == 7)
pNL = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:PACK_ANIMAL:BEAST6:BULK_MAX");
if (pNL != NULL)
return pNL->getValue32();
return 0;
@ -2756,7 +2774,10 @@ class CHandlerInvCanDropTo : public IActionHandler
if ((pListDstIcon->getInvType() == CInventoryManager::InvPA0) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA1) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA2) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA3))
(pListDstIcon->getInvType() == CInventoryManager::InvPA3) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA4) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA5) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA6))
{
INVENTORIES::TInventory e = (INVENTORIES::TInventory)(INVENTORIES::pet_animal1 + (pListDstIcon->getInvType()-CInventoryManager::InvPA0));
if (!pInv->isInventoryAvailable(e))
@ -2768,7 +2789,10 @@ class CHandlerInvCanDropTo : public IActionHandler
if ((pListDstText->getInvType() == CInventoryManager::InvPA0) ||
(pListDstText->getInvType() == CInventoryManager::InvPA1) ||
(pListDstText->getInvType() == CInventoryManager::InvPA2) ||
(pListDstText->getInvType() == CInventoryManager::InvPA3))
(pListDstText->getInvType() == CInventoryManager::InvPA3) ||
(pListDstText->getInvType() == CInventoryManager::InvPA4) ||
(pListDstText->getInvType() == CInventoryManager::InvPA5) ||
(pListDstText->getInvType() == CInventoryManager::InvPA6))
{
INVENTORIES::TInventory e = (INVENTORIES::TInventory)(INVENTORIES::pet_animal1 + (pListDstText->getInvType()-CInventoryManager::InvPA0));
if (!pInv->isInventoryAvailable(e))
@ -2891,17 +2915,24 @@ class CHandlerInvDropTo : public IActionHandler
else if (((pListDstText != NULL) && ((pListDstText->getInvType() == CInventoryManager::InvPA0) ||
(pListDstText->getInvType() == CInventoryManager::InvPA1) ||
(pListDstText->getInvType() == CInventoryManager::InvPA2) ||
(pListDstText->getInvType() == CInventoryManager::InvPA3)
(pListDstText->getInvType() == CInventoryManager::InvPA3) ||
(pListDstText->getInvType() == CInventoryManager::InvPA4) ||
(pListDstText->getInvType() == CInventoryManager::InvPA5) ||
(pListDstText->getInvType() == CInventoryManager::InvPA6)
)) ||
((pListDstIcon != NULL) && ((pListDstIcon->getInvType() == CInventoryManager::InvPA0) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA1) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA2) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA3)
(pListDstIcon->getInvType() == CInventoryManager::InvPA3) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA4) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA5) ||
(pListDstIcon->getInvType() == CInventoryManager::InvPA6)
)))
{
string sTmp;
if (pListDstText != NULL) sTmp = toString("%d",pListDstText->getInvType()-CInventoryManager::InvPA0);
if (pListDstIcon != NULL) sTmp = toString("%d",pListDstIcon->getInvType()-CInventoryManager::InvPA0);
nlinfo("ici :%s", sTmp.c_str());
CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_pa|"+sTmp);
}
else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvGuild)) ||
@ -3084,7 +3115,7 @@ class CHandlerInvTempAll : public IActionHandler
vector <pair <double, double> > BagsBulk;
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(0), pInv->getMaxBagBulk(0)));
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal1))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(1), pInv->getMaxBagBulk(1)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal2))
@ -3093,6 +3124,12 @@ class CHandlerInvTempAll : public IActionHandler
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(3), pInv->getMaxBagBulk(3)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal4))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(4), pInv->getMaxBagBulk(4)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal5))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(5), pInv->getMaxBagBulk(4)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal6))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(6), pInv->getMaxBagBulk(4)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal7))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(7), pInv->getMaxBagBulk(4)));
bool bPlaceFound = true;
@ -3675,6 +3712,9 @@ CInventoryManager::TInvType CInventoryManager::invTypeFromString(const string &s
if (sTmp == "inv_pa1") return InvPA1;
if (sTmp == "inv_pa2") return InvPA2;
if (sTmp == "inv_pa3") return InvPA3;
if (sTmp == "inv_pa4") return InvPA4;
if (sTmp == "inv_pa5") return InvPA5;
if (sTmp == "inv_pa6") return InvPA6;
if (sTmp == "inv_guild") return InvGuild;
if (sTmp == "inv_room") return InvRoom;
return InvUnknown;

@ -291,7 +291,7 @@ public:
bool isInventoryEmpty (INVENTORIES::TInventory invId);
enum TInvType { InvBag, InvPA0, InvPA1, InvPA2, InvPA3, InvGuild, InvRoom, InvUnknown };
enum TInvType { InvBag, InvPA0, InvPA1, InvPA2, InvPA3, InvPA4, InvPA5, InvPA6, InvGuild, InvRoom, InvUnknown };
static TInvType invTypeFromString(const std::string &str);

@ -93,6 +93,7 @@
#include "../zone_util.h"
#include "../motion/user_controls.h"
#include "group_html_cs.h"
#include "group_map.h"
#include "bonus_malus.h"
#include "nel/gui/group_editbox.h"
#include "../entities.h"
@ -117,6 +118,8 @@
#include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h"
#include "nel/misc/polygon.h"
#include "nel/misc/i_xml.h"
#include "nel/misc/o_xml.h"
#include "game_share/scenario_entry_points.h"
#include "game_share/bg_downloader_msg.h"
#include "game_share/constants.h"
@ -456,6 +459,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getTargetTitle", getTargetTitle);
ls.registerFunc("addSearchPathUser", addSearchPathUser);
ls.registerFunc("displaySystemInfo", displaySystemInfo);
ls.registerFunc("displayChatMessage", displayChatMessage);
ls.registerFunc("disableContextHelpForControl", disableContextHelpForControl);
ls.registerFunc("disableContextHelp", disableContextHelp);
ls.registerFunc("setWeatherValue", setWeatherValue);
@ -470,6 +474,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getUserRace", getUserRace);
ls.registerFunc("getSheet2idx", getSheet2idx);
ls.registerFunc("getTargetSlot", getTargetSlot);
ls.registerFunc("setTargetAsInterlocutor", setTargetAsInterlocutor);
ls.registerFunc("unsetTargetAsInterlocutor", unsetTargetAsInterlocutor);
ls.registerFunc("getSlotDataSetId", getSlotDataSetId);
ls.registerFunc("addShape", addShape);
ls.registerFunc("moveShape", moveShape);
@ -482,7 +488,16 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getShapeColOrient", getShapeColOrient);
ls.registerFunc("deleteShape", deleteShape);
ls.registerFunc("setupShape", setupShape);
ls.registerFunc("removeLandMarks", removeLandMarks);
ls.registerFunc("addLandMark", addLandMark);
ls.registerFunc("updateUserLandMarks", updateUserLandMarks);
ls.registerFunc("delArkPoints", delArkPoints);
ls.registerFunc("addRespawnPoint", addRespawnPoint);
ls.registerFunc("setArkPowoOptions", setArkPowoOptions);
ls.registerFunc("saveUserChannels", saveUserChannels);
ls.registerFunc("readUserChannels", readUserChannels);
ls.registerFunc("getMaxDynChan", getMaxDynChan);
lua_State *L = ls.getStatePointer();
LUABIND_ENUM(PVP_CLAN::TPVPClan, "game.TPVPClan", PVP_CLAN::NbClans, PVP_CLAN::toString);
@ -493,8 +508,11 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(getDbProp),
LUABIND_FUNC(getDbProp64),
LUABIND_FUNC(setDbProp),
LUABIND_FUNC(setDbProp64),
LUABIND_FUNC(addDbProp),
LUABIND_FUNC(delDbProp),
LUABIND_FUNC(getDbRGBA),
LUABIND_FUNC(setDbRGBA),
LUABIND_FUNC(debugInfo),
LUABIND_FUNC(rawDebugInfo),
LUABIND_FUNC(dumpCallStack),
@ -519,6 +537,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(getPlayerSelectedSlot),
LUABIND_FUNC(isInGame),
LUABIND_FUNC(isPlayerSlotNewbieLand),
LUABIND_FUNC(getSheetLocalizedName),
LUABIND_FUNC(getSheetLocalizedDesc),
LUABIND_FUNC(getSkillIdFromName),
LUABIND_FUNC(getSkillLocalizedName),
LUABIND_FUNC(getMaxSkillValue),
@ -531,6 +551,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isDynStringAvailable),
LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex),
LUABIND_FUNC(getFameName),
@ -540,6 +561,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(getClientCfg),
LUABIND_FUNC(sendMsgToServer),
LUABIND_FUNC(sendMsgToServerPvpTag),
LUABIND_FUNC(sendMsgToServerAutoPact),
LUABIND_FUNC(sendMsgToServerUseItem),
LUABIND_FUNC(isGuildQuitAvailable),
LUABIND_FUNC(sortGuildMembers),
@ -1571,6 +1593,22 @@ int CLuaIHMRyzom::getTargetSlot(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHMRyzom::setTargetAsInterlocutor(CLuaState &ls)
{
uint32 slot = (uint32)getTargetSlotNr();
UserEntity->interlocutor(slot);
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::unsetTargetAsInterlocutor(CLuaState &ls)
{
uint32 slot = (uint32)getTargetSlotNr();
UserEntity->interlocutor(CLFECOMMON::INVALID_SLOT);
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::getSlotDataSetId(CLuaState &ls)
{
@ -2585,10 +2623,13 @@ sint64 CLuaIHMRyzom::getDbProp64(const std::string &dbProp)
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false);
if (node)
return node->getValue64();
{
sint64 prop = node->getValue64();
return prop;
}
else
{
debugInfo(toString("getDbProp(): '%s' dbProp Not found", dbProp.c_str()));
debugInfo(toString("getDbProp64(): '%s' dbProp Not found", dbProp.c_str()));
return 0;
}
}
@ -2623,6 +2664,36 @@ void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value)
debugInfo(toString("setDbProp(): '%s' dbProp Not found", dbProp.c_str()));
}
void CLuaIHMRyzom::setDbProp64(const std::string &dbProp, sint64 value)
{
//H_AUTO(Lua_CLuaIHM_setDbProp)
// Do not allow Write on SERVER: or LOCAL:
static const std::string dbServer = "SERVER:";
static const std::string dbLocal = "LOCAL:";
static const std::string dbLocalR2 = "LOCAL:R2";
if ((dbProp.compare(0, dbServer.size(), dbServer) == 0) ||
(dbProp.compare(0, dbLocal.size(), dbLocal) == 0)
)
{
if (dbProp.compare(0, dbLocalR2.size(), dbLocalR2) != 0)
{
nlstop;
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
}
}
// Write to the DB if found
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false);
if (node)
node->setValue64(value);
else
debugInfo(toString("setDbProp(): '%s' dbProp Not found", dbProp.c_str()));
}
void CLuaIHMRyzom::delDbProp(const string &dbProp)
{
//H_AUTO(Lua_CLuaIHM_setDbProp)
@ -3072,6 +3143,20 @@ bool CLuaIHMRyzom::isPlayerSlotNewbieLand(uint32 slot)
return CharacterSummaries[slot].InNewbieland;
}
// ***************************************************************************
ucstring CLuaIHMRyzom::getSheetLocalizedName(const std::string &sheet)
{
return ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedName(CSheetId(sheet)));
}
// ***************************************************************************
ucstring CLuaIHMRyzom::getSheetLocalizedDesc(const std::string &sheet)
{
return ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(CSheetId(sheet)));
}
// ***************************************************************************
sint32 CLuaIHMRyzom::getSkillIdFromName(const std::string &def)
{
@ -3151,7 +3236,7 @@ void CLuaIHMRyzom::browseNpcWebPage(const std::string &htmlId, const std::string
if (groupHtml)
{
// if true, it means that we want to display a web page that use webig auth
bool webig = urlIn.find("http://") == 0;
bool webig = urlIn.find("http://") == 0 || urlIn.find("https://") == 0;
string url;
@ -3264,6 +3349,21 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet)
}
// ***************************************************************************
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
{
CEntitySheet *pES = SheetMngr.get ( CSheetId(sheet) );
if ((pES != NULL) && (pES->type() == CEntitySheet::ITEM))
{
CItemSheet *pIS = (CItemSheet*)pES;
if (pIS)
return ITEMFAMILY::toString(pIS->Family);
}
return "";
}
// ***************************************************************************
std::string CLuaIHMRyzom::getSheetName(uint32 sheetId)
{
@ -3332,6 +3432,14 @@ void CLuaIHMRyzom::sendMsgToServerPvpTag(bool pvpTag)
::sendMsgToServer("PVP:PVP_TAG", tag);
}
// ***************************************************************************
void CLuaIHMRyzom::sendMsgToServerAutoPact(bool bval)
{
//H_AUTO(Lua_CLuaIHM_sendMsgToServerAutoPact)
uint8 dopact = (uint8)bval;
::sendMsgToServer("COMMAND:AUTOPACT", dopact);
}
// ***************************************************************************
void CLuaIHMRyzom::sendMsgToServerUseItem(sint32 slot)
{
@ -3480,7 +3588,7 @@ string CLuaIHMRyzom::getRegionByAlias(uint32 alias)
return ContinentMngr.getRegionNameByAlias(alias);
}
sint32 CLuaIHMRyzom::getGroundZ(uint32 x, sint32 y)
float CLuaIHMRyzom::getGroundZ(float x, float y)
{
CVector vect = UserEntity->pos();
vect.x = x;
@ -3807,6 +3915,225 @@ bool CLuaIHMRyzom::isTargetInPVPMode()
return (target->getPvpMode() & PVP_MODE::PvpFaction || target->getPvpMode() & PVP_MODE::PvpFactionFlagged || target->getPvpMode() & PVP_MODE::PvpZoneFaction) != 0;
}
// ***************************************************************************
int CLuaIHMRyzom::removeLandMarks(CLuaState &ls)
{
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->removeUserLandMarks();
return 0;
}
// ***************************************************************************
// addLandMark(10000, -4000, "Hello Atys!", "ico_over_homin.tga","","","","")
int CLuaIHMRyzom::addLandMark(CLuaState &ls)
{
const char* funcName = "addLandMark";
CLuaIHM::checkArgMin(ls, funcName, 4);
CLuaIHM::checkArgMax(ls, funcName, 9);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); // x
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); // y
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); // title
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); // texture
CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING); // left click action
CLuaIHM::checkArgType(ls, funcName, 6, LUA_TSTRING); // left click param
CLuaIHM::checkArgType(ls, funcName, 7, LUA_TSTRING); // right click action
CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING); // right click params
CArkPoint point;
point.x = (sint32)(ls.toNumber(1)*1000.f);
point.y = (sint32)(ls.toNumber(2)*1000.f);
point.Title = ls.toString(3);
point.Texture = ls.toString(4);
point.LeftClickAction = ls.toString(5);
point.LeftClickParam = ls.toString(6);
point.RightClickAction = ls.toString(7);
point.RightClickParam = ls.toString(8);
point.Color = CRGBA(255,255,255,255);
if (ls.getTop() >= 9)
CLuaIHM::pop(ls, point.Color);
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->addArkPoint(point);
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::delArkPoints(CLuaState &ls)
{
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->delArkPoints();
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::addRespawnPoint(CLuaState &ls)
{
const char* funcName = "addRespawnPoint";
CLuaIHM::checkArgMin(ls, funcName, 2);
float x = (float) ls.toNumber(1);
float y = (float) ls.toNumber(2);
CVector2f pos(x, y);
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->addUserRespawnPoint(pos);
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::updateUserLandMarks(CLuaState &ls)
{
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->updateUserLandMarks();
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::setArkPowoOptions(CLuaState &ls)
{
const char* funcName = "setArkPowoOptions";
CLuaIHM::checkArgMin(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL) {
pMap->setArkPowoMode(ls.toString(1));
pMap->setArkPowoMapMenu(ls.toString(2));
}
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::readUserChannels(CLuaState &ls)
{
std::string filename = CInterfaceManager::getInstance()->getSaveFileName("channels", "xml");
try
{
CIFile fd;
if (fd.open(CPath::lookup(filename)))
{
CIXml stream;
stream.init(fd);
xmlKeepBlanksDefault(0);
xmlNodePtr root = stream.getRootNode();
if (!root)
return 0;
CXMLAutoPtr prop;
// table
ls.newTable();
CLuaObject output(ls);
uint nb = 0;
xmlNodePtr node = root->children;
while (node)
{
prop = xmlGetProp(node, (xmlChar*)"name");
if (!prop)
return 0;
std::string name = (const char*)prop;
prop = xmlGetProp(node, (xmlChar*)"passwd");
if (!prop)
return 0;
std::string pass = (const char*)prop;
output.setValue(name.c_str(), pass.c_str());
node = node->next;
nb++;
}
// no exception
fd.close();
// release lua table
output.push();
}
nlinfo("parse %s", filename.c_str());
}
catch (const Exception &e)
{
nlwarning("Error while parsing xml file %s : %s", filename.c_str(), e.what());
return 0;
}
return 1;
}
// ***************************************************************************
int CLuaIHMRyzom::saveUserChannels(CLuaState &ls)
{
const char *funcName = "saveUserChannels";
CLuaIHM::check(ls, ls.getTop()==1 || ls.getTop()==2, funcName);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TTABLE);
bool verbose = false;
if (ls.getTop() > 1)
{
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN);
verbose = ls.toBoolean(2);
ls.pop();
}
CLuaObject params;
params.pop(ls);
std::string filename = CInterfaceManager::getInstance()->getSaveFileName("channels", "xml");
try
{
COFile fd;
if (fd.open(filename, false, false, true))
{
COXml stream;
stream.init(&fd);
xmlDocPtr doc = stream.getDocument();
xmlNodePtr node = xmlNewDocNode(doc, NULL, (const xmlChar*)"interface_config", NULL);
xmlDocSetRootElement(doc, node);
ENUM_LUA_TABLE(params, it)
{
if (!it.nextKey().isString())
continue;
if (!it.nextValue().isString())
continue;
std::string name = it.nextKey().toString();
std::string pass = it.nextValue().toString();
xmlNodePtr newNode = xmlNewChild(node, NULL, (const xmlChar*)"channels", NULL);
xmlSetProp(newNode, (const xmlChar*)"name", (const xmlChar*)name.c_str());
xmlSetProp(newNode, (const xmlChar*)"passwd", (const xmlChar*)pass.c_str());
}
stream.flush();
// no exception
fd.close();
}
nlinfo("save %s", filename.c_str());
if (verbose)
CInterfaceManager::getInstance()->displaySystemInfo("Saving " + filename);
}
catch (const Exception &e)
{
nlwarning("Error while writing the file %s : %s", filename.c_str(), e.what());
return 0;
}
return 1;
}
// ***************************************************************************
int CLuaIHMRyzom::getMaxDynChan(CLuaState &ls)
{
ls.push((sint32)CChatGroup::MaxDynChanPerPlayer);
return 1;
}
// ***************************************************************************
std::string CLuaIHMRyzom::createGotoFileButtonTag(const char *fileName, uint line)
{
@ -3826,3 +4153,100 @@ std::string CLuaIHMRyzom::createGotoFileButtonTag(const char *fileName, uint lin
return "";
}
// ***************************************************************************
void CLuaIHMRyzom::setDbRGBA(const std::string &dbProp, const NLMISC::CRGBA &color)
{
//H_AUTO(Lua_CLuaIHM_setDbRGBA)
static const std::string dbServer = "SERVER:";
static const std::string dbLocal = "LOCAL:";
static const std::string dbLocalR2 = "LOCAL:R2";
// do not allow write on SERVER: or LOCAL:
if ((dbProp.compare(0, dbServer.size(), dbServer) == 0) || (dbProp.compare(0, dbLocal.size(), dbLocal) == 0))
{
if (dbProp.compare(0, dbLocalR2.size(), dbLocalR2) != 0)
{
nlstop;
throw ELuaIHMException("setDbRGBA(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
}
}
// write to the db
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, true);
if (node)
node->setValue64(color.R+(color.G<<8)+(color.B<<16)+(color.A<<24));
return;
}
// ***************************************************************************
std::string CLuaIHMRyzom::getDbRGBA(const std::string &dbProp)
{
//H_AUTO(Lua_CLuaIHM_getDbRGBA)
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false);
if (node)
{
CRGBA color = CRGBA::White;
sint64 rgba = (sint64)node->getValue64();
color.R = (sint8)(rgba & 0xff);
color.G = (sint8)((rgba >> 8) & 0xff);
color.B = (sint8)((rgba >> 16) & 0xff);
color.A = (sint8)((rgba >> 24) & 0xff);
return toString("%i %i %i %i", color.R, color.G, color.B, color.A);
}
return "";
}
// ***************************************************************************
int CLuaIHMRyzom::displayChatMessage(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_displayChatMessage)
const char *funcName = "displayChatMessage";
CLuaIHM::checkArgMin(ls, funcName, 2);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CInterfaceProperty prop;
CChatStdInput &ci = PeopleInterraction.ChatInput;
std::string msg = ls.toString(1);
const std::string dbPath = "UI:SAVE:CHAT:COLORS";
if (ls.type(2) == LUA_TSTRING)
{
std::string input = toLower(ls.toString(2));
std::unordered_map<std::string, std::string> sParam;
// input should match chat_group_filter sParam
sParam.insert(make_pair(string("around"), string(dbPath+":SAY")));
sParam.insert(make_pair(string("region"), string(dbPath+":REGION")));
sParam.insert(make_pair(string("guild"), string(dbPath+":CLADE")));
sParam.insert(make_pair(string("team"), string(dbPath+":GROUP")));
sParam.insert(make_pair(string("universe"), string(dbPath+":UNIVERSE_NEW")));
for (const auto& db : sParam)
{
if (db.first.c_str() == input)
{
prop.readRGBA(db.second.c_str(), " ");
if (input == "around")
ci.AroundMe.displayMessage(ucstring(msg), prop.getRGBA());
if (input == "region")
ci.Region.displayMessage(ucstring(msg), prop.getRGBA());
if (input == "universe")
ci.Universe.displayMessage(ucstring(msg), prop.getRGBA());
if (input == "guild")
ci.Guild.displayMessage(ucstring(msg), prop.getRGBA());
if (input == "team")
ci.Team.displayMessage(ucstring(msg), prop.getRGBA());
break;
}
}
}
if (ls.type(2) == LUA_TNUMBER)
{
sint64 id = ls.toInteger(2);
prop.readRGBA(toString("%s:DYN:%i", dbPath.c_str(), id).c_str(), " ");
if (id >= 0 && id < CChatGroup::MaxDynChanPerPlayer)
ci.DynamicChat[id].displayMessage(ucstring(msg), prop.getRGBA());
}
return 1;
}

@ -60,6 +60,7 @@ private:
static int getMainPageURL(CLuaState &ls);
static int getCharSlot(CLuaState &ls);
static int displaySystemInfo(CLuaState &ls);
static int displayChatMessage(CLuaState &ls);
static int setWeatherValue(CLuaState &ls); // first value is a boolean to say automatic, second value ranges from of to 1 and gives the weather
static int getWeatherValue(CLuaState &ls); // get current real weather value (blend between server driven value & predicted value). Manual weather value is ignored
static int disableContextHelpForControl(CLuaState &ls); // params: CCtrlBase*. return: none
@ -97,7 +98,13 @@ private:
static int getUserRace(CLuaState &ls);
static int getSheet2idx(CLuaState &ls);
static int getTargetSlot(CLuaState &ls);
static int setTargetAsInterlocutor(CLuaState &ls);
static int unsetTargetAsInterlocutor(CLuaState &ls);
static int getSlotDataSetId(CLuaState &ls);
//
static int getMaxDynChan(CLuaState &ls);
static int readUserChannels(CLuaState &ls);
static int saveUserChannels(CLuaState &ls); // { name = "pass" }
// LUA functions exported for Dev only (debug)
static int dumpUI(CLuaState &ls); // params: CInterfaceElement*.... return: none
@ -122,8 +129,11 @@ private:
static sint32 getDbProp(const std::string &dbProp); // return 0 if not found.
static sint64 getDbProp64(const std::string &dbProp); // return 0 if not found.
static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present.
static void setDbProp64(const std::string &dbProp, sint64 value); // Nb: the db prop is not created if not present.
static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present.
static void delDbProp(const std::string &dbProp);
static void setDbRGBA(const std::string &dbProp, const NLMISC::CRGBA &color); // the db prop is created if not present
static std::string getDbRGBA(const std::string &dbProp); // empty string if not found
public:
// Print a message in the log.
@ -177,6 +187,8 @@ private:
static bool isPlayerSlotNewbieLand(uint32 slot); // test if one of the player slot is a newbieland one, if not so, client must be patched in order to continue
// GameInfo
static ucstring getSheetLocalizedName(const std::string &sheet);
static ucstring getSheetLocalizedDesc(const std::string &sheet);
static sint32 getSkillIdFromName(const std::string &def);
static ucstring getSkillLocalizedName(sint32 skillId);
static sint32 getMaxSkillValue(sint32 skillId);
@ -189,6 +201,7 @@ private:
static bool isDynStringAvailable(sint32 dynStringId);
static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet);
static std::string getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName);
static std::string getFameName(sint32 fameIndex);
@ -198,6 +211,7 @@ private:
static std::string getClientCfg(const std::string &varName);
static void sendMsgToServer(const std::string &msgName);
static void sendMsgToServerPvpTag(bool pvpTag);
static void sendMsgToServerAutoPact(bool bval);
static void sendMsgToServerUseItem(sint32 slot);
static bool isGuildQuitAvailable();
static void sortGuildMembers();
@ -214,7 +228,7 @@ private:
static sint getCharacterSheetRegionForce(const std::string &sheet);
static sint getCharacterSheetRegionLevel(const std::string &sheet);
static std::string getRegionByAlias(uint32 alias);
static sint getGroundZ(uint32 x, sint32 y);
static float getGroundZ(float x, float y);
static int getGroundAtMouse(CLuaState &ls);
static int getMousePos(CLuaState &ls);
static int getMouseDown(CLuaState &ls);
@ -223,6 +237,15 @@ private:
static int getShapeIdAt(CLuaState &ls);
static int setupShape(CLuaState &ls);
static void setMouseCursor(const std::string &texture);
static int removeLandMarks(CLuaState &ls);
static int addLandMark(CLuaState &ls);
static int updateUserLandMarks(CLuaState &ls);
static int addRespawnPoint(CLuaState &ls);
static int delArkPoints(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
// else, current command of the chat window will be replaced with tell 'player'
static void tell(const ucstring &player, const ucstring &msg);

@ -774,6 +774,10 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online)
CCtrlBase *chatButton = hc->getCtrl("chat_button");
if (chatButton != NULL)
chatButton->setActive(online != ccs_offline);
CCtrlBase *inviteButton = hc->getCtrl("invite_button");
if (inviteButton != NULL)
inviteButton->setActive(online != ccs_offline);
}
_Peoples[index].Online = online;

@ -3196,8 +3196,10 @@ void impulseUserBars(NLMISC::CBitMemStream &impulse)
void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse)
{
// read message
bool outpostInFire;
bool playerGuildInConflict;
bool playerGuildIsAttacker;
impulse.serial(outpostInFire);
impulse.serial(playerGuildInConflict);
impulse.serial(playerGuildIsAttacker);
uint32 ownerGuildNameId;
@ -3208,7 +3210,7 @@ void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse)
impulse.serial( declTimer );
// start
OutpostManager.startPvpJoinProposal(playerGuildInConflict, playerGuildIsAttacker,
OutpostManager.startPvpJoinProposal(outpostInFire, playerGuildInConflict, playerGuildIsAttacker,
ownerGuildNameId, attackerGuildNameId, declTimer);
}

@ -37,7 +37,7 @@ COutpostManager::COutpostManager()
// ***************************************************************************
void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool playerGuildIsAttacker,
void COutpostManager::startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker,
uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer)
{
// reset counter that force player to be neutral (eg: 10 seconds)
@ -55,9 +55,17 @@ void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool play
node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_DEFENDER");
if(node) node->setValue32(ownerGuildNameId);
node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_TICK_END");
if(node) node->setValue32(_EndTickForPvpJoinProposal);
if(node) node->setValue32(_EndTickForPvpJoinProposal);
// open Popup
CCtrlBase *ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:random"));
if (ctrl)
ctrl->setActive(outpostInFire);
ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral"));
if (ctrl)
ctrl->setActive(!outpostInFire);
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal"));
if (pGC)
{

@ -40,7 +40,7 @@ public:
COutpostManager();
/// Called when the server ask to join for PVP in a Outpost Zone
void startPvpJoinProposal(bool playerGuildInConflict, bool playerGuildIsAttacker,
void startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker,
uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer);
/// Called when the client answer to the join for PVP in a Outpost Zone

@ -540,7 +540,48 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color)
{
const CItemSheet *item = _Items[slot].Sheet;
std::string shapeName = _Gender == GSGENDER::female ? item->getShapeFemale():item->getShape();
std::string shapeName = "";
if(_Gender == GSGENDER::male)
{
switch(_PlayerSheet->People)
{
case EGSPD::CPeople::Fyros:
shapeName = item->getShapeFyros();
break;
case EGSPD::CPeople::Matis:
shapeName = item->getShapeMatis();
break;
case EGSPD::CPeople::Tryker:
shapeName = item->getShapeTryker();
break;
case EGSPD::CPeople::Zorai:
shapeName = item->getShapeZorai();
break;
}
}
else
{
switch(_PlayerSheet->People)
{
case EGSPD::CPeople::Fyros:
shapeName = item->getShapeFyrosFemale();
break;
case EGSPD::CPeople::Matis:
shapeName = item->getShapeMatisFemale();
break;
case EGSPD::CPeople::Tryker:
shapeName = item->getShapeTrykerFemale();
break;
case EGSPD::CPeople::Zorai:
shapeName = item->getShapeZoraiFemale();
break;
}
if (shapeName.empty())
shapeName = item->getShapeFemale();
}
if (shapeName.empty())
shapeName = item->getShape();
// use the right type of boots if wearing a caster dress
if ((slot == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS || item->ItemType == ITEM_TYPE::MEDIUM_BOOTS || item->ItemType == ITEM_TYPE::HEAVY_BOOTS))

@ -93,14 +93,16 @@ public:
CTypeVersion(std::string type, uint version) {Type=type; Version=version;}
};
// if you change these values please rebuild the packed_sheets with an updated sheets_packer binary.
// This is the only way to have correct version in both client and packed_sheets
CTypeVersion TypeVersion [] =
{
CTypeVersion("creature", 17),
// CTypeVersion("player", 0),
CTypeVersion("fx", 0),
CTypeVersion("building", 2),
CTypeVersion("sitem", 42),
CTypeVersion("item", 42),
CTypeVersion("sitem", 44),
CTypeVersion("item", 44),
CTypeVersion("plant", 5),
CTypeVersion("death_impact", 0),
// CTypeVersion("mission", 0),

@ -716,6 +716,12 @@ restartLoop:
if (!getString(param.StringId, str))
return false;
ucstring::size_type p1 = str.find('[');
if (p1 != ucstring::npos)
{
str = str.substr(0, p1)+STRING_MANAGER::CStringManagerClient::getLocalizedName(str.substr(p1));
}
// If the string is a player name, we may have to remove the shard name (if the string looks like a player name)
if(!str.empty() && !PlayerSelectedHomeShardNameWithParenthesis.empty())
{
@ -1411,8 +1417,7 @@ const ucchar * CStringManagerClient::getSpecialWord(const std::string &label, bo
if (label[0] == '#')
{
static ucstring rawString;
rawString = label.substr(1, label.size()-1);
return rawString.c_str();
return getLocalizedName(label.substr(1, label.size()-1));
}
// avoid case problems
@ -1615,14 +1620,44 @@ const ucchar *CStringManagerClient::getSPhraseLocalizedDescription(NLMISC::CShee
const ucchar *CStringManagerClient::getTitleLocalizedName(const ucstring &titleId, bool women)
{
vector<ucstring> listInfos = getTitleInfos(titleId, women);
if (!listInfos.empty())
{
_TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str();
return getLocalizedName(_TitleWords.back());
}
return titleId.c_str();
return getLocalizedName(titleId);
}
const ucchar *CStringManagerClient::getLocalizedName(const ucstring &uctext)
{
string text = uctext.toUtf8();
if (text[0] == '[')
{
vector<string> textLocalizations;
static ucstring defaultText;
splitString(text.substr(1), "[", textLocalizations);
if (!textLocalizations.empty())
{
for(uint i = 0; i<textLocalizations.size(); i++)
{
if (textLocalizations[i].substr(0, 3) == CI18N::getCurrentLanguageCode()+"]")
{
defaultText.fromUtf8(textLocalizations[i].substr(3));
return defaultText.c_str();
}
else if (textLocalizations[i].substr(0, 3) == "wk]")
{
defaultText.fromUtf8(textLocalizations[i].substr(3));
}
}
}
if (!defaultText.empty()) {
return defaultText.c_str();
}
}
return uctext.c_str();
}
// ***************************************************************************

@ -107,6 +107,7 @@ public:
// Get the Localized Title name
static const ucchar *getTitleLocalizedName(const ucstring &titleId, bool women);
static const ucchar *getLocalizedName(const ucstring &text);
static std::vector<ucstring> getTitleInfos(const ucstring &titleId, bool women);
// Get the Localized name of a classification type

@ -90,7 +90,7 @@
type="I32" />
</branch>
<branch name="FACTION_POINTS_"
count="6">
count="7">
<!-- game_share/pvp_clan.h (0 is BeginClans and size is EndClans-BeginClans+1 -->
<leaf name="VALUE"
type="I32" />
@ -504,7 +504,7 @@
</branch>
<!-- MAX_INVENTORY_ANIMAL -->
<branch name="PACK_ANIMAL"
count="4"
count="7"
clientonly="1">
<branch name=""
count="500">
@ -602,7 +602,7 @@
type="I1" />
<!-- Used only in forage -->
</branch>
<!-- used to share items between team members (up to 8 players)
<!-- used to share items between team members (up to 8 players)
DO NOT FORGET if you modify this to do the the same modification in local database file -->
<branch name="SHARE">
<leaf name="SESSION"
@ -810,8 +810,8 @@
<!-- are there pages left ? -->
<branch name=""
count="8">
<!--
if high order bit == 0 : guild icon : 58 low order bits - back:3 bits, symbol:6 bits, Invert:1 bit, color1&2:24 bits each
<!--
if high order bit == 0 : guild icon : 58 low order bits - back:3 bits, symbol:6 bits, Invert:1 bit, color1&2:24 bits each
if high order bit == 1 : low order bits = entry in the LIFT_ICONS::TLiftIcon enum
-->
<leaf name="ICON"
@ -1117,7 +1117,7 @@
type="I3" />
<!-- Guild civilization allegiance (CF TPVPClan enum (pvp_clan.h) -->
<branch name=""
count="6">
count="7">
<!-- from fame.h & cpp -->
<leaf name="VALUE"
type="S8" />
@ -1292,7 +1292,7 @@
</branch>
<branch name="SQUADS">
<!-- Squad -->
<!-- 24 max squads: The First 12th are the squads that spawn at start
<!-- 24 max squads: The First 12th are the squads that spawn at start
The second 12th are the one that spawn after
-->
<branch name="SP"
@ -1527,7 +1527,7 @@
<!-- beasts -->
<!-- MAX_INVENTORY_ANIMAL -->
<branch name="BEAST"
count="4"
count="7"
atomic="1">
<!-- Atomic, for correct Bar Management on client -->
<leaf name="UID"
@ -1625,7 +1625,7 @@
type="S8" />
<!-- value where the guards kill you on sight -->
<branch name="PLAYER"
count="6">
count="7">
<!-- from fame.h & cpp -->
<leaf name="VALUE"
type="S8" />

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Ryzom AI service: Le script d&apos;AI</title>
<title>Ryzom AI service: AI Scripting</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<div class="header">
@ -19,7 +19,7 @@
</div>
<div class="maindox">
<!-- Generated by Doxygen 1.5.2 -->
<h1><a class="anchor" name="code">Le script d'AI</a></h1><h2><a class="anchor" name="general">
<h1><a class="anchor" name="code">AI Scripting</a></h1><h2><a class="anchor" name="general">
General information</a></h2>
Its a C like code.<p>
Comments are defined after two slashes like this: <div class="fragment"><pre class="fragment"><span class="comment">// my comment</span>
@ -1464,9 +1464,9 @@ Arguments: f(botIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:
()setAggroListTarget(4, $playerId);
</pre></div><h3><a class="anchor" name="getAggroListElement_ff_s">
getAggroListElement_ff_s</a></h3>
Get a player entity id (as string) from the aggro list of a bot by it aggro list index.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A aggro list index is used to identified the player in the aggro list. The size of the aggro list is given by getAggroListSize_f_s )<p>
Get a player entity id (as string) from the aggro list of a bot by its aggro list index.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawned) the function returns an empty string and display a warning message. You can use this with isBotAlived to be sure that the bot index is still a valid value.<p>
A aggro list index is used to identify the player in the aggro list. The size of the aggro list is given by getAggroListSize_f_s<p>
Arguments: f(botIndex), f(aggroListIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
@ -1474,47 +1474,47 @@ Arguments: f(botIndex), f(aggroListIndex) -&gt; s(playerEidAsString) <dl compact
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(aggroSize)getAggorListSize(0);
<span class="comment">// to much player are attacking the boss</span>
<span class="keywordflow">if</span> (aggoroSize &gt; 10)
<div class="fragment"><pre class="fragment">(aggroSize)getAggroListSize(0);
<span class="comment">// to much players are attacking the boss</span>
<span class="keywordflow">if</span> (aggroSize &gt; 10)
{
($player1)getAggroListElement(0);
($player2)getAggroListElement(1);
($player3)getAggroListElement(2);
<span class="comment">// so the boss teleport 3 person from its aggro list at the end of the world</span>
teleportPlayer($player1, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
clearAggroList();
&#9;($player1)getAggroListElement(0,0);
&#9;($player2)getAggroListElement(1,0);
&#9;($player3)getAggroListElement(2,0);
<span class="comment">&#9;// so the boss teleport 3 players from its aggro list at the end of the world</span>
&#9;teleportPlayer($player1, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;clearAggroList();
}
</pre></div><h3><a class="anchor" name="getAggroListSize_f_f">
getAggroListSize_f_f</a></h3>
Get a size of the aggro lsit of a bot (list of aggroable PLAYER)<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A number is used to indicate the size of the aggro lsit<p>
Get a size of the aggro list of a bot (list of aggroable PLAYER)<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawned) the function returns an empty string and display a warning message. You can use this with isBotAlived to be sure that the bot index is still a valid value.<p>
A number is used to indicate the size of the aggro list<p>
Arguments: f(aggroListIndex) -&gt; f(sizeOfAggroList) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group. </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sizeOfAggroList</em>&nbsp;</td><td>The size of the aggro list index.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(aggroSize)getAggorListSize(0);
<span class="comment">// to much player are attacking the boss</span>
<span class="keywordflow">if</span> (aggoroSize &gt; 10)
<div class="fragment"><pre class="fragment">(aggroSize)getAggroListSize(0);
<span class="comment">// to much players are attacking the boss</span>
<span class="keywordflow">if</span> (aggroSize &gt; 10)
{
($player1)getAggroListElement(0);
($player2)getAggroListElement(1);
($player3)getAggroListElement(2);
<span class="comment">// so the boss teleport 3 person from its aggro list at the end of the world</span>
teleportPlayer($player1, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
clearAggroList();
&#9;($player1)getAggroListElement(0,0);
&#9;($player2)getAggroListElement(1,0);
&#9;($player3)getAggroListElement(2,0);
<span class="comment">&#9;// so the boss teleport 3 players from its aggro list at the end of the world</span>
&#9;teleportPlayer($player1, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;clearAggroList();
}
</pre></div><h3><a class="anchor" name="setAggroListTarget_fs_">
setAggroListTarget_fs_</a></h3>
Maximize the Aggro of a target from the Aggro list of one bot (this id can be given by getRandomPlayerAggroListTarget)..<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawned) the function returns an empty string and display a warning message. You can use this with isBotAlived to be sure that the bot index is still a valid value.<p>
A player EntityId is used to identify the player. If the entityId is not from the aggro list then a warning message is shown in the log. If the entityId is a empty string nothing no message are displayed.<p>
Arguments: f(botIndex) &gt;s(playerEidAsString) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
@ -1561,8 +1561,7 @@ Arguments:, s(botName) &gt; f(botIndex)<p>
</dl>
<div class="fragment"><pre class="fragment">(botIndex)getBotIndexByName(<span class="stringliteral">"boss_random_aggro"</span>);
($playerId)getRandomPlayerAggroListTarget(botIndex);
()setAggroListTarget(botIndex, $playerId);
}
()setAggroListTarget(botIndex, $playerId);
</pre></div><h3><a class="anchor" name="isGroupAlived__f">
isGroupAlived__f</a></h3>
Test if a group is alived (at least one member is alived)<p>
@ -1808,7 +1807,7 @@ Arguments: s(botIndex), s(query), c(groupThatWillBeTriggered), f(idOfTheUserEven
</table>
</dl>
Answer will be given by the getParam<p>
<div class="fragment"><pre class="fragment"> <span class="comment">//Sening msg to EGS</span>
<div class="fragment"><pre class="fragment"> <span class="comment">//Sending msg to EGS</span>
(@groupToNotify)boss_group.context();
()queryEgs(<span class="stringliteral">"Name"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"MSG_NAME"</span>);
()queryEgs(<span class="stringliteral">"Hp"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg1"</span>);

@ -31,10 +31,11 @@ namespace ANIMAL_STATUS
/* There is no PresentFlag: the animal is not present if AliveFlag and InLandscapeFlag are not set (cause an animal cannot be dead in a stable!)
"Present" is tested if not all 0!
*/
AliveFlag= 0x0001, // if set, the animal is alive
InLandscapeFlag= 0x0002, // if set, the animal is in Landscape. not set: in Stable
InventoryAvailableFlag= 0x0004, // if set, the animal inventory is available
CanEnterLeaveStableFlag= 0x0008, // if set, an order "Leave" or "Enter Stable" can be issued
AliveFlag= 1, // if set, the animal is alive
InLandscapeFlag= 2, // if set, the animal is in Landscape. not set: in Stable
InventoryAvailableFlag= 4, // if set, the animal inventory is available
CanEnterLeaveStableFlag= 8, // if set, an order "Leave" or "Enter Stable" can be issued
InBagFlag= 16, // if set, an order "Enter Bag" or "Leave Bag" can be issued (only for pets)
};
// true if the animal is present and spawned
@ -67,6 +68,12 @@ namespace ANIMAL_STATUS
return isSpawned(e) && (e&InLandscapeFlag)!=0;
}
// true if the animal is present, spawned, and in bag (dead or not, and whatever the inventory state)
inline bool isInBag(EAnimalStatus e)
{
return isSpawned(e) && (e&InBagFlag)!=0;
}
// true if the animal is present, spawned, and in a stable
inline bool isInStable(EAnimalStatus e)
{

@ -26,7 +26,7 @@ namespace ANIMAL_TYPE
{
enum EAnimalType
{
All = 0,
All, Pet = 0,
Mount,
Packer,
Demon,

@ -35,6 +35,8 @@ const std::string BeastOrders[] =
"attack",
"mount",
"unmount",
"enter_bag",
"leave_bag"
};
//-----------------------------------------------

@ -38,6 +38,8 @@ namespace ANIMALS_ORDERS
ATTACK,
MOUNT, // For animal of type : Mount
UNMOUNT, // For animal of type : Mount
ENTER_BAG, // For animal of type : Creature (pet)
LEAVE_BAG, // For animal of type : Creature (pet)
// the number of size existing
BEAST_ORDERS_SIZE,

@ -38,6 +38,9 @@ namespace INVENTORIES
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal2)
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal3)
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal4)
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal5)
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal6)
NL_STRING_CONVERSION_TABLE_ENTRY(pet_animal7)
// NL_STRING_CONVERSION_TABLE_ENTRY(bot_gift)
NL_STRING_CONVERSION_TABLE_ENTRY(UNDEFINED)
NL_STRING_CONVERSION_TABLE_ENTRY(exchange)
@ -52,7 +55,7 @@ namespace INVENTORIES
const std::string& toString( TInventory inv )
{
// if this raise, correct the table above
nlctassert(MAX_INVENTORY_ANIMAL==4);
nlctassert(MAX_INVENTORY_ANIMAL==7);
return InventoryToString.toString(inv);
}
@ -72,6 +75,12 @@ namespace INVENTORIES
inv = pet_animal3;
else if (str == "pack_animal4")
inv = pet_animal4;
else if (str == "pack_animal5")
inv = pet_animal5;
else if (str == "pack_animal6")
inv = pet_animal6;
else if (str == "pack_animal7")
inv = pet_animal7;
}
return inv;
@ -90,6 +99,9 @@ namespace INVENTORIES
"", // pack_animal2
"", // pack_animal3
"", // pack_animal4
"", // pack_animal5
"", // pack_animal6
"", // pack_animal7
"", // harvest
// "", // bot_gift
"", // exchange
@ -102,9 +114,9 @@ namespace INVENTORIES
//
const char *CInventoryCategoryForCharacter::InventoryStr [CInventoryCategoryForCharacter::NbInventoryIds] =
{ "BAG", "PACK_ANIMAL0", "PACK_ANIMAL1", "PACK_ANIMAL2", "PACK_ANIMAL3", "ROOM" };
{ "BAG", "PACK_ANIMAL0", "PACK_ANIMAL1", "PACK_ANIMAL2", "PACK_ANIMAL3", "PACK_ANIMAL4", "PACK_ANIMAL5", "PACK_ANIMAL6", "ROOM" };
const uint CInventoryCategoryForCharacter::InventoryNbSlots [CInventoryCategoryForCharacter::NbInventoryIds] =
{ NbBagSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbRoomSlots };
{ NbBagSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbPackerSlots, NbRoomSlots };
// Other values to change according to these InventoryNbSlots:
// - game_share.h/inventories.h: CInventoryCategoryForCharacter::SlotBitSize
// - data_common/database.xml: INVENTORY:BAG count

@ -34,8 +34,8 @@ WARNING!!!!! If you change MAX_INVENTORY_ANIMAL value, you'll have to:
* ******/
#define MAX_PACK_ANIMAL 3
#define MAX_MEKTOUB_MOUNT 1
#define MAX_OTHER_PET 0
#define MAX_INVENTORY_ANIMAL ( MAX_PACK_ANIMAL + MAX_MEKTOUB_MOUNT )
#define MAX_OTHER_PET 3
#define MAX_INVENTORY_ANIMAL ( MAX_PACK_ANIMAL + MAX_MEKTOUB_MOUNT + MAX_OTHER_PET)
// This give by which value the WEIGHT in database must be divided to get the value in Kg
// valueKg= valueDb / DB_WEIGHT_SCALE
@ -159,22 +159,25 @@ namespace INVENTORIES
temporary, // 1
equipment, // 2
bag, // 3
pet_animal, // 4 Character can have 5 pack animal
pet_animal, // 4 Character can have 7 pack animal
pet_animal1 = pet_animal, // for toString => TInventory convertion
pet_animal2,
pet_animal3,
pet_animal4,
max_pet_animal, // 8
NUM_INVENTORY = max_pet_animal, // 8
UNDEFINED = NUM_INVENTORY, // 8
exchange, // 9 This is not a bug : exchange is a fake inventory
exchange_proposition, // 10 and should not count in the number of inventory
pet_animal5,
pet_animal6,
pet_animal7,
max_pet_animal, // 11
NUM_INVENTORY = max_pet_animal, // 11
UNDEFINED = NUM_INVENTORY, // 11
exchange, // 12 This is not a bug : exchange is a fake inventory
exchange_proposition, // 13 and should not count in the number of inventory
// same for botChat trading.
trading, // 11
reward_sharing, // 12 fake inventory, not in database.xml. Used by the item info protocol only
guild, // 13 (warning: number stored in guild saved file)
player_room, // 14
trading, // 14
reward_sharing, // 15 fake inventory, not in database.xml. Used by the item info protocol only
guild, // 16 (warning: number stored in guild saved file)
player_room, // 17
NUM_ALL_INVENTORY // warning: distinct from NUM_INVENTORY
};

@ -88,6 +88,7 @@ namespace ITEM_TYPE
{ "CAMPSFIRE", CAMPSFIRE },
{ "MEKTOUB_PACKER_TICKET", MEKTOUB_PACKER_TICKET },
{ "MEKTOUB_MOUNT_TICKET", MEKTOUB_MOUNT_TICKET },
{ "ANIMAL_TICKET", ANIMAL_TICKET },
{ "FOOD", FOOD },
{ "MAGICIAN_STAFF", MAGICIAN_STAFF },
{ "HAIR_MALE", HAIR_MALE },

@ -83,6 +83,7 @@ namespace ITEM_TYPE
CAMPSFIRE,
MEKTOUB_PACKER_TICKET,
MEKTOUB_MOUNT_TICKET,
ANIMAL_TICKET,
FOOD,
MAGICIAN_STAFF,
HAIR_MALE,

@ -85,11 +85,12 @@ inline uint8 getCivilisationId(CPeople::TPeople people)
return 0xFF;
}
/// Return the pet type, 1 for Mount, 2 for Packer (otherwise 0)
/// Return the pet type, 1 for Mount, 2 for Packer, 3 for Creature (pets) (otherwise 0)
inline uint getPetType( CPeople::TPeople peopleType )
{
switch ( peopleType )
{
case CPeople::Creature: return 3;
case CPeople::MektoubPacker: return 2;
case CPeople::MektoubMount: return 1;
default: return 0;

@ -595,6 +595,7 @@ COutpostSquadManager::COutpostSquadManager(COutpost* parent, uint32 alias, std::
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -618,6 +619,7 @@ COutpostSquadManager::COutpostSquadManager(COutpost* parent, uint32 alias, std::
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -641,6 +643,7 @@ COutpostSquadManager::COutpostSquadManager(COutpost* parent, uint32 alias, std::
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -675,6 +678,7 @@ COutpostSquadManager::COutpostSquadManager(COutpost* parent, uint32 alias, std::
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);

@ -759,6 +759,7 @@ CSpireSquadManager::CSpireSquadManager(CSpire* parent, uint32 alias, std::string
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -782,6 +783,7 @@ CSpireSquadManager::CSpireSquadManager(CSpire* parent, uint32 alias, std::string
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -805,6 +807,7 @@ CSpireSquadManager::CSpireSquadManager(CSpire* parent, uint32 alias, std::string
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);
@ -839,6 +842,7 @@ CSpireSquadManager::CSpireSquadManager(CSpire* parent, uint32 alias, std::string
eventAction = NULL;
// Register event handler
// FIXME: 0 == CAIAliasDescriptionNode instance
event = new CAIEventReaction(getStateMachine(), 0, eventDescription.EventType);
event->processEventDescription(&eventDescription, getStateMachine());
getStateMachine()->eventReactions().addChild(event);

@ -2688,7 +2688,7 @@ CAILogicActionCode::CAILogicActionCode (const std::vector<std::string> &args, c
const CAIAliasDescriptionNode *eventNode, CStateMachine *container)
{
nldebug("loadActionCode");
_byteCode=CCompiler::getInstance().compileCode (args, eventNode->fullName());
_byteCode=CCompiler::getInstance().compileCode (args, eventNode ? eventNode->fullName() : "NULL");
}
bool CAILogicActionCode::executeAction(CStateInstance *entity,const IAIEvent *event)

@ -368,7 +368,7 @@ CScriptStack::CStackEntry& CScriptStack::CStackEntry::operator=(std::string cons
{
clean();
std::string* const strPt = new std::string(str);
_valp = *((int*)&strPt);
_valp = *((uintptr_t*)&strPt);
_type = EString;
return *this;
}
@ -376,7 +376,7 @@ inline
CScriptStack::CStackEntry& CScriptStack::CStackEntry::operator=(IScriptContext* sc)
{
clean();
_valp = *((int*)&sc);
_valp = *((uintptr_t*)&sc);
_type = EContext;
return *this;
}

@ -88,9 +88,9 @@ I16x16Layer *I16x16Layer::compress(I16x16Layer *layer, sint32 blank)
map<sint32, uint> count;
for (i=0; i<256; ++i)
for (i=0; i<16; ++i) for (j=0;j<16;++j)
{
sint32 val = flayer->Array[0][i];
sint32 val = flayer->Array[i][j];
if (val == blank)
continue;

@ -141,7 +141,11 @@ public:
void set(uint i, uint j, sint value) { nlassert(i<16 && j<16); Array[i][j] = value; }
protected:
void serial(NLMISC::IStream &f) { for (uint i=0; i<16*16; ++i) f.serial(Array[0][i]); }
void serial(NLMISC::IStream &f) {
for (uint i=0; i<16; ++i)
for (uint j=0; j<16; ++j)
f.serial(Array[i][j]);
}
};
/**
@ -166,8 +170,9 @@ protected:
void serial(NLMISC::IStream &f)
{
f.serial(Mean);
for (uint i=0; i<16*16; ++i)
f.serial(Array[0][i]);
for (uint i=0; i<16; ++i)
for(uint j=0; j<16; ++j)
f.serial(Array[i][j]);
}
};
@ -193,8 +198,9 @@ protected:
void serial(NLMISC::IStream &f)
{
f.serial(Mean);
for (uint i=0; i<16*2; ++i)
f.serial(Array[0][i]);
for (uint i=0; i<16; ++i)
for (uint j=0; j<2; ++j)
f.serial(Array[i][j]);
}
};

@ -1984,7 +1984,7 @@ void cbClientSendWhere( NLNET::CMessage& msgin, const std::string &serviceName,
CZoneManager::getInstance().answerWhere(id);
}
// client send a command where for known where is it
// client send a command afk to set the player as 'away from keyboard'
void cbClientSendAfk( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
{
H_AUTO(cbClientSendAfk);
@ -2057,7 +2057,7 @@ void cbClientSit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
if( !c->isInWater() && c->getMode()!=MBEHAV::MOUNT_NORMAL && c->getMode()!=MBEHAV::DEATH )
{
c->setMode( MBEHAV::SIT );
// only if player is'nt equipping an item
// only if player isn't equipping an item
//( to prevent exploit "sit to reduce equip latency time")
if( !c->getGearLatency().isLatent() )
{

@ -1,3 +1,4 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
@ -15,8 +16,20 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
//
/////////////////////////////////////////////////////////////////
#include "stdpch.h"
#include "database_guild.h"
@ -138,7 +151,7 @@ void CBankAccessor_GUILD::TGUILD::TFAME::init(ICDBStructNode *parent)
// branch init
for (uint i=0; i<6; ++i)
for (uint i=0; i<7; ++i)
{
node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("%u", i)), false );
nlassert(node != NULL);
@ -509,7 +522,7 @@ void CBankAccessor_GUILD::TGUILD::TOUTPOST::TO::TSQUADS::init(ICDBStructNode *pa
{
node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("SP%u", i)), false );
nlassert(node != NULL);
__SP[i].init(node, i);
_SP[i].init(node, i);
}
for (uint i=0; i<24; ++i)

@ -1,3 +1,7 @@
#ifndef INCLUDED_database_GUILD_H
#define INCLUDED_database_GUILD_H
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
@ -14,11 +18,19 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef INCLUDED_database_GUILD_H
#define INCLUDED_database_GUILD_H
/////////////////////////////////////////////////////////////////
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
//
/////////////////////////////////////////////////////////////////
#include "nel/misc/string_common.h"
@ -28,16 +40,13 @@
#include "game_share/far_position.h"
inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, TCharConnectionState value, bool forceSending = false)
{
db.x_setProp(node, uint64(value), forceSending);
}
inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, TCharConnectionState &value)
{
value = (TCharConnectionState)db.x_getProp(node);
}
inline void _setProp(CCDBSynchronised &db,
ICDBStructNode *node, TCharConnectionState value, bool
forceSending = false) { db.x_setProp(node, uint64(value),
forceSending); } inline void _getProp(const CCDBSynchronised
&db, ICDBStructNode *node, TCharConnectionState
&value) { value =
(TCharConnectionState)db.x_getProp(node); }
#ifndef _SET_PROP_ACCESSOR_
@ -151,15 +160,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
class TGUILD
{
{
public:
class TFAME
{
{
public:
class TArray
{
{
public:
@ -249,7 +258,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
ICDBStructNode *_CULT_ALLEGIANCE;
ICDBStructNode *_CIV_ALLEGIANCE;
TArray _Array[6];
TArray _Array[7];
public:
@ -309,18 +318,18 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
}
TArray &getArray(uint32 index)
{
nlassert(index < 6);
nlassert(index < 7);
return _Array[index];
}
};
class TMEMBERS
{
{
public:
class TArray
{
{
public:
@ -465,7 +474,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TINVENTORY
{
{
public:
@ -529,6 +538,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
void setMONEY(CCDBGroup &dbGroup, uint64 value, bool forceSending = false)
{
_setProp(dbGroup.Database, _MONEY, value, forceSending);
}
@ -548,15 +559,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TOUTPOST
{
{
public:
class TO
{
{
public:
class TGUILD
{
{
public:
@ -686,11 +697,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TSQUAD_SPAWN_ZONE
{
{
public:
class TArray
{
{
public:
@ -778,11 +789,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TSQUAD_SHOP
{
{
public:
class TArray
{
{
public:
@ -849,11 +860,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TSQUADS
{
{
public:
class TSP
{
{
public:
@ -896,7 +907,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TT
{
{
public:
@ -961,17 +972,19 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
}
};
private:
ICDBStructNode *_BranchNode;
TSP __SP[24];
TSP _SP[24];
TT _T[24];
public:
void init(ICDBStructNode *parent);
// accessors to branch node
// accessor to branch node
ICDBStructNode *getCDBNode()
{
return _BranchNode;
@ -980,7 +993,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
TSP &getSP(uint32 index)
{
nlassert(index < 24);
return __SP[index];
return _SP[index];
}
TT &getT(uint32 index)
{
@ -991,11 +1004,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
class TBUILDINGS
{
{
public:
class TArray
{
{
public:

@ -1,3 +1,4 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
@ -15,8 +16,20 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
//
/////////////////////////////////////////////////////////////////
#include "stdpch.h"
#include "database_plr.h"
@ -377,7 +390,7 @@ void CBankAccessor_PLR::TUSER::init(ICDBStructNode *parent)
_SKILL_POINTS_[i].init(node, i);
}
for (uint i=0; i<6; ++i)
for (uint i=0; i<7; ++i)
{
node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("FACTION_POINTS_%u", i)), false );
nlassert(node != NULL);
@ -3130,7 +3143,7 @@ void CBankAccessor_PLR::TPACK_ANIMAL::init(ICDBStructNode *parent)
// branch init
for (uint i=0; i<4; ++i)
for (uint i=0; i<7; ++i)
{
node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("BEAST%u", i)), false );
nlassert(node != NULL);
@ -3180,7 +3193,7 @@ void CBankAccessor_PLR::TPACK_ANIMAL::TBEAST::init(ICDBStructNode *parent, uint
nlassert(node != NULL);
_DESPAWN = node;
node = parent->getNode( ICDBStructNode::CTextId("NAME"), true );
node = parent->getNode( ICDBStructNode::CTextId("NAME"), false );
nlassert(node != NULL);
_NAME = node;
@ -3363,7 +3376,7 @@ void CBankAccessor_PLR::TFAME::init(ICDBStructNode *parent)
// branch init
for (uint i=0; i<6; ++i)
for (uint i=0; i<7; ++i)
{
node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("PLAYER%u", i)), false );
nlassert(node != NULL);

@ -1,3 +1,7 @@
#ifndef INCLUDED_database_PLR_H
#define INCLUDED_database_PLR_H
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
@ -14,11 +18,19 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef INCLUDED_DATABASE_PLR_H
#define INCLUDED_DATABASE_PLR_H
/////////////////////////////////////////////////////////////////
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
// WARNING : this is a generated file, don't change it !
//
//
//
//
//
//
/////////////////////////////////////////////////////////////////
#include "nel/misc/string_common.h"
@ -493,7 +505,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
ICDBStructNode *_IS_INVISIBLE;
ICDBStructNode *_COUNTER;
TSKILL_POINTS_ _SKILL_POINTS_[4];
TFACTION_POINTS_ _FACTION_POINTS_[6];
TFACTION_POINTS_ _FACTION_POINTS_[7];
TRRPS_LEVELS _RRPS_LEVELS[6];
TNPC_CONTROL _NPC_CONTROL;
@ -1003,7 +1015,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
}
TFACTION_POINTS_ &getFACTION_POINTS_(uint32 index)
{
nlassert(index < 6);
nlassert(index < 7);
return _FACTION_POINTS_[index];
}
TRRPS_LEVELS &getRRPS_LEVELS(uint32 index)
@ -1805,7 +1817,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
{
// Check that the value is not out of database precision
STOP_IF(value > (1<<4)-1, "setCOUNTER : Value out of bound : trying to store "<<value<<" in a unsigned field limited to 4 bits");
STOP_IF(value > (1<<5)-1, "setCOUNTER : Value out of bound : trying to store "<<value<<" in a unsigned field limited to 5 bits");
_setProp(dbGroup, _COUNTER, value, forceSending);
@ -9299,7 +9311,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
private:
ICDBStructNode *_BranchNode;
TBEAST _BEAST[4];
TBEAST _BEAST[7];
public:
@ -9313,7 +9325,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
TBEAST &getBEAST(uint32 index)
{
nlassert(index < 4);
nlassert(index < 7);
return _BEAST[index];
}
@ -9978,7 +9990,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
ICDBStructNode *_CIV_ALLEGIANCE;
ICDBStructNode *_THRESHOLD_TRADE;
ICDBStructNode *_THRESHOLD_KOS;
TPLAYER _PLAYER[6];
TPLAYER _PLAYER[7];
TTRIBE _TRIBE[53];
@ -10079,7 +10091,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
}
TPLAYER &getPLAYER(uint32 index)
{
nlassert(index < 6);
nlassert(index < 7);
return _PLAYER[index];
}
TTRIBE &getTRIBE(uint32 index)
@ -10714,4 +10726,4 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C
};
#endif // INCLUDED_DATABASE_PLR_H
#endif // INCLUDED_database_PLR_H

@ -252,7 +252,7 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
// load character of player
PlayerManager.loadPlayer( player );
// set status connexion of player to connected
// set status connection of player to connected
player->setPlayerConnection( true );
// set player cookie, for later web activation
@ -2935,7 +2935,7 @@ void cbAnimalMount( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
}
else
{
nlwarning("<cbAnimalMount> %d Target %s %s is not moutable !! sheeter or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
nlwarning("<cbAnimalMount> %d Target %s %s is not moutable !! sheet or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
}
}
else

@ -877,6 +877,8 @@ bool COperationDialog::createDefaultProfile()
profile.comments = "Default profile created by Ryzom Installer";
profile.desktopShortcut = false;
profile.menuShortcut = false;
// default use locale
profile.language = config->getLanguage();
#ifdef Q_OS_WIN32
QStringList paths;

@ -33,6 +33,7 @@ void CProfile::loadFromSettings(const QSettings &settings)
executable = settings.value("executable").toString();
arguments = settings.value("arguments").toString();
comments = settings.value("comments").toString();
language = settings.value("language").toString();
desktopShortcut = settings.value("desktop_shortcut").toBool();
menuShortcut = settings.value("menu_shortcut").toBool();
}
@ -45,6 +46,7 @@ void CProfile::saveToSettings(QSettings &settings) const
settings.setValue("executable", executable);
settings.setValue("arguments", arguments);
settings.setValue("comments", comments);
settings.setValue("language", language);
settings.setValue("desktop_shortcut", desktopShortcut);
settings.setValue("menu_shortcut", menuShortcut);
}
@ -175,7 +177,7 @@ bool CProfile::createClientConfig() const
// create the 2 initial lines of client.cfg
QString rootConfigFilenameLine = QString("RootConfigFilename = \"%1\";").arg(s.getDefaultClientConfigFullPath());
QString languageCodeline = QString("LanguageCode = \"%1\";\n").arg(CConfigFile::getInstance()->getLanguage());
QString languageCodeline = QString("LanguageCode = \"%1\";\n").arg(language);
QString content;

@ -34,6 +34,7 @@ public:
QString executable;
QString arguments;
QString comments;
QString language;
bool desktopShortcut;
bool menuShortcut;

@ -108,6 +108,7 @@ void CProfilesDialog::displayProfile(int index)
serverComboBox->setEnabled(enabled);
argumentsEdit->setEnabled(enabled);
commentsEdit->setEnabled(enabled);
langComboBox->setEnabled(enabled);
if (index < 0) return;
@ -134,6 +135,7 @@ void CProfilesDialog::displayProfile(int index)
directoryPathLabel->setText(profileDirectory);
desktopShortcutCheckBox->setChecked(profile.desktopShortcut);
menuShortcutCheckBox->setChecked(profile.menuShortcut);
langComboBox->setCurrentIndex(getIndexFromProfileLanguage(profile.language));
// disable click on button if directory doesn't exist
directoryButton->setEnabled(QFile::exists(profileDirectory));
@ -155,6 +157,7 @@ void CProfilesDialog::saveProfile(int index)
profile.comments = commentsEdit->toPlainText();
profile.desktopShortcut = desktopShortcutCheckBox->isChecked();
profile.menuShortcut = menuShortcutCheckBox->isChecked();
profile.language = getProfileLanguageFromIndex(langComboBox->currentIndex());
}
void CProfilesDialog::deleteProfile(int index)
@ -170,7 +173,9 @@ void CProfilesDialog::deleteProfile(int index)
profilesListView->setCurrentIndex(m_model->index(index, 0));
displayProfile(index);
// TODO: delete files for delete profile
// delete files for delete profile
COperationDialog dialog(this);
dialog.setOperation(OperationUpdateProfiles);
}
void CProfilesDialog::addProfile()
@ -214,6 +219,7 @@ void CProfilesDialog::addProfile()
// set default parameters
profile.id = QString::number(nextId);
profile.server = server.id;
profile.language = config->getLanguage(); // locale
profilesListView->setCurrentIndex(m_model->index(index, 0));
displayProfile(index);
@ -310,3 +316,25 @@ void CProfilesDialog::onProfileDirectoryClicked()
QDesktopServices::openUrl(QUrl::fromLocalFile(profileDirectory));
}
int CProfilesDialog::getIndexFromProfileLanguage(const QString &lang) const
{
if (lang == "en") return 0;
if (lang == "fr") return 1;
if (lang == "de") return 2;
if (lang == "es") return 3;
if (lang == "ru") return 4;
return -1;
}
QString CProfilesDialog::getProfileLanguageFromIndex(int index) const
{
if (index == 0) return "en";
if (index == 1) return "fr";
if (index == 2) return "de";
if (index == 3) return "es";
if (index == 4) return "ru";
// locale
return CConfigFile::getInstance()->getLanguage();
}

@ -54,6 +54,10 @@ private slots:
void onExecutableDefaultClicked();
void onExecutableBrowseClicked();
int getIndexFromProfileLanguage(const QString &langId) const;
QString getProfileLanguageFromIndex(int index) const;
private:
CProfilesModel *m_model;
CServersModel *m_serversModel;

@ -828,18 +828,23 @@ Drücke Weiter und folge den verschiedenen Schritten bis zum Ende.</translation>
<source>Open</source>
<translation>Öffnen</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Sprache :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Create shortcuts:</source>
<translation>Erstelle Verknüpfungen:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Desktop</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>Start-Menü</translation>
</message>

@ -635,16 +635,21 @@ Just press Continue button and follow the different steps until everything is do
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation type="unfinished"></translation>
</message>

@ -841,16 +841,21 @@ Vous n&apos;avez qu&apos;à cliquer sur Suivant et suivre les différentes étap
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Langage :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation>Créer les raccourcis :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Bureau</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>Menu Démarrer</translation>
</message>

@ -807,16 +807,21 @@ Just press Continue button and follow the different steps until everything is do
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Язык:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation>Создать ярлыки:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Рабочий стол</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>меню Пуск</translation>
</message>

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>583</width>
<height>329</height>
<width>631</width>
<height>356</height>
</rect>
</property>
<property name="windowTitle">
@ -202,13 +202,20 @@
</layout>
</item>
<item row="7" column="0">
<widget class="QLabel" name="langLabel">
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="shortcutsLabel">
<property name="text">
<string>Create shortcuts:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<layout class="QVBoxLayout" name="shortcutsLayout">
<item>
<widget class="QCheckBox" name="desktopShortcutCheckBox">
@ -226,6 +233,35 @@
</item>
</layout>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="langComboBox">
<item>
<property name="text">
<string>English</string>
</property>
</item>
<item>
<property name="text">
<string>Francais</string>
</property>
</item>
<item>
<property name="text">
<string>Deutsch</string>
</property>
</item>
<item>
<property name="text">
<string>Español</string>
</property>
</item>
<item>
<property name="text">
<string>Russian (РУССКИЙ)</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
@ -250,10 +286,11 @@
<tabstop>serverComboBox</tabstop>
<tabstop>executableBrowseButton</tabstop>
<tabstop>argumentsEdit</tabstop>
<tabstop>commentsEdit</tabstop>
<tabstop>directoryButton</tabstop>
<tabstop>langComboBox</tabstop>
<tabstop>desktopShortcutCheckBox</tabstop>
<tabstop>menuShortcutCheckBox</tabstop>
<tabstop>commentsEdit</tabstop>
</tabstops>
<resources/>
<connections>

Loading…
Cancel
Save