Merge with ark

--HG--
branch : atys
hg/atys
Ulu Kyn 5 years ago
commit b5b8de283b

@ -223,6 +223,31 @@ bool CActionsManager::valide(const CAction::CName &name) const
return false;
}// valide //
// ***************************************************************************
void CActionsManager::validate(const CAction::CName &name)
{
// Recover the pointer on "actionName" if it exists.
TActionsMap::iterator it = _Actions.find(name);
if(it != _Actions.end())
{
it->second.Valide = true;
}
}
// ***************************************************************************
void CActionsManager::unvalidate(const CAction::CName &name)
{
// Recover the pointer on "actionName" if it exists.
TActionsMap::iterator it = _Actions.find(name);
if(it != _Actions.end())
{
it->second.Valide = false;
}
}
// ***************************************************************************
bool CActionsManager::isActionPresentInContext(const CAction::CName &name) const
{

@ -364,6 +364,8 @@ public:
/// Return if the Action is valide.
bool valide(const CAction::CName &name) const;
void validate(const CAction::CName &name);
void unvalidate(const CAction::CName &name);
// Return true if the action is present in current (global) context
bool isActionPresentInContext(const CAction::CName &name) const;

@ -295,6 +295,31 @@ class CAHRearView : public IActionHandler
};
REGISTER_ACTION_HANDLER (CAHRearView, "rear_view");
// ------------------------------------------------------------------------------------------------
class CAHRunAction : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
CActionsManager *pAM = &Actions;
pAM->validate(CAction::CName(Params.c_str(), ""));
}
};
REGISTER_ACTION_HANDLER (CAHRunAction, "run_action");
// ------------------------------------------------------------------------------------------------
class CAHStopAction : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
CActionsManager *pAM = &Actions;
pAM->unvalidate(CAction::CName(Params.c_str(), ""));
}
};
REGISTER_ACTION_HANDLER (CAHStopAction, "stop_action");
// ------------------------------------------------------------------------------------------------
class CAHCameraUp : public IActionHandler
{

@ -2513,6 +2513,14 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal;
CRGBA color = CRGBA::White;
// If broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A')
{
string code = str.substr(4, str.size()-4).toString();
if (!code.empty())
CLuaManager::getInstance().executeLuaScript(code);
return;
}
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end())
@ -2543,6 +2551,7 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2);
}
// ***************************************************************************

@ -111,6 +111,7 @@
#include "../r2/tool.h"
#include "../entities.h"
#include "../misc.h"
#include "../gabarit.h"
#include "bot_chat_page_all.h"
#include "bot_chat_page_ring_sessions.h"
@ -126,6 +127,8 @@
#include "game_share/visual_slot_manager.h"
#include "nel/gui/lua_manager.h"
#include "pacs_client.h"
#include "character_3d.h"
#ifdef LUA_NEVRAX_VERSION
#include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger
@ -576,6 +579,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(getSheetId),
LUABIND_FUNC(getCharacterSheetRegionForce),
LUABIND_FUNC(getCharacterSheetRegionLevel),
LUABIND_FUNC(setChar3dDBfromVPX),
LUABIND_FUNC(getRefHeightScale),
LUABIND_FUNC(getRegionByAlias),
LUABIND_FUNC(getGroundZ),
LUABIND_FUNC(tell),
@ -587,10 +592,16 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(getPlayerVpa),
LUABIND_FUNC(getPlayerVpb),
LUABIND_FUNC(getPlayerVpc),
LUABIND_FUNC(getPlayerVpaHex),
LUABIND_FUNC(getPlayerVpbHex),
LUABIND_FUNC(getPlayerVpcHex),
LUABIND_FUNC(getTargetLevel),
LUABIND_FUNC(getTargetForceRegion),
LUABIND_FUNC(getTargetLevelForce),
LUABIND_FUNC(getTargetSheet),
LUABIND_FUNC(getTargetVpaHex),
LUABIND_FUNC(getTargetVpbHex),
LUABIND_FUNC(getTargetVpcHex),
LUABIND_FUNC(getTargetVpa),
LUABIND_FUNC(getTargetVpb),
LUABIND_FUNC(getTargetVpc),
@ -3589,6 +3600,31 @@ sint CLuaIHMRyzom::getCharacterSheetRegionLevel(const std::string &sheet)
return charSheet->RegionForce;
}
float CLuaIHMRyzom::setChar3dDBfromVPX(const std::string &branch, const std::string &people, const std::string &vpa, const std::string &vpb, const std::string &vpc)
{
CCharacterSummary cs;
cs.VisualPropA.fromString(vpa);
cs.VisualPropB.fromString(vpb);
cs.VisualPropC.fromString(vpc);
cs.People = EGSPD::CPeople::fromString(people);
SCharacter3DSetup::setupDBFromCharacterSummary(branch, cs);
return cs.VisualPropC.PropertySubData.CharacterHeight;
}
float CLuaIHMRyzom::getRefHeightScale(const std::string &people, const std::string &vpa)
{
CCharacterSummary cs;
cs.VisualPropA.fromString(vpa);
cs.People = EGSPD::CPeople::fromString(people);
float fyrosRefScale = GabaritSet.getRefHeightScale(cs.VisualPropA.PropertySubData.Sex, EGSPD::CPeople::Fyros);
if (fyrosRefScale == 0) return 1.f;
return GabaritSet.getRefHeightScale(cs.VisualPropA.PropertySubData.Sex, cs.People) / fyrosRefScale;
}
// ***************************************************************************
string CLuaIHMRyzom::getRegionByAlias(uint32 alias)
{
@ -3713,6 +3749,27 @@ sint32 CLuaIHMRyzom::getPlayerLevel()
return sint32(maxskill);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpaHex()
{
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpbHex()
{
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpcHex()
{
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
sint64 CLuaIHMRyzom::getPlayerVpa()
{
@ -3734,6 +3791,7 @@ sint64 CLuaIHMRyzom::getPlayerVpc()
return prop;
}
// ***************************************************************************
sint32 CLuaIHMRyzom::getTargetLevel()
{
@ -3773,6 +3831,36 @@ ucstring CLuaIHMRyzom::getTargetSheet()
return target->sheetId().toString();
}
// ***************************************************************************
std::string CLuaIHMRyzom::getTargetVpaHex()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getTargetVpbHex()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
std::string CLuaIHMRyzom::getTargetVpcHex()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop);
}
// ***************************************************************************
sint64 CLuaIHMRyzom::getTargetVpa()
{
@ -3923,7 +4011,6 @@ 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)
{

@ -227,6 +227,8 @@ private:
static sint32 getSheetId(const std::string &itemName);
static sint getCharacterSheetRegionForce(const std::string &sheet);
static sint getCharacterSheetRegionLevel(const std::string &sheet);
static float setChar3dDBfromVPX(const std::string &branch, const std::string &people, const std::string &vpa, const std::string &vpb, const std::string &vpc);
static float getRefHeightScale(const std::string &people, const std::string &vpa);
static std::string getRegionByAlias(uint32 alias);
static float getGroundZ(float x, float y);
static int getGroundAtMouse(CLuaState &ls);
@ -257,6 +259,9 @@ private:
static std::string encodeURLUnicodeParam(const ucstring &text);
static sint32 getPlayerLevel(); // get max level among player skills (magi, combat, crafting ,foraging)
static std::string getPlayerVpaHex();
static std::string getPlayerVpbHex();
static std::string getPlayerVpcHex();
static sint64 getPlayerVpa();
static sint64 getPlayerVpb();
static sint64 getPlayerVpc();
@ -264,6 +269,9 @@ private:
static sint32 getTargetForceRegion(); // get 'force region' for current target, or -1 if there's no selected target
static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target
static ucstring getTargetSheet(); // get the name of the target sheet (like 'zoha2old.creature')
static std::string getTargetVpaHex();
static std::string getTargetVpbHex();
static std::string getTargetVpcHex();
static sint64 getTargetVpa();
static sint64 getTargetVpb();
static sint64 getTargetVpc();

@ -23,6 +23,11 @@
std::string SPropVisualA::toString( ) const { return NLMISC::toString( PropertyA ); }
std::string SPropVisualB::toString( ) const { return NLMISC::toString( PropertyB ); }
std::string SPropVisualC::toString( ) const { return NLMISC::toString( PropertyC ); }
void SPropVisualA::fromString(const std::string &value) { NLMISC::fromString(value, PropertyA); }
void SPropVisualB::fromString(const std::string &value) { NLMISC::fromString(value, PropertyB); }
void SPropVisualC::fromString(const std::string &value) { NLMISC::fromString(value, PropertyC); }
std::string SAltLookProp::toString( ) const { return NLMISC::toString( Summary ); }
std::string SAltLookProp2::toString( ) const { return NLMISC::toString( Summary ); }

@ -88,6 +88,7 @@ struct SPropVisualA
}
std::string toString() const;
void fromString(const std::string &value);
};
struct SPropVisualB
@ -138,6 +139,7 @@ struct SPropVisualB
}
std::string toString() const;
void fromString(const std::string &value);
};
struct SPropVisualC
@ -223,6 +225,7 @@ struct SPropVisualC
}
std::string toString() const;
void fromString(const std::string &value);
};
/**

Loading…
Cancel
Save