1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-20 19:57:12 +01:00

Adjust the Blip entity methods to use the new method of receiving formatted strings.

This commit is contained in:
Sandu Liviu Catalin 2016-11-16 14:48:11 +02:00
parent 91bb7ef7ba
commit 85079a28d2
2 changed files with 23 additions and 3 deletions

View File

@ -51,9 +51,23 @@ const String & CBlip::GetTag() const
}
// ------------------------------------------------------------------------------------------------
void CBlip::SetTag(CSStr tag)
void CBlip::SetTag(const StackStrF & tag)
{
m_Tag.assign(tag);
if (tag.mLen > 0)
{
m_Tag.assign(tag.mPtr, tag.mLen);
}
else
{
m_Tag.clear();
}
}
// ------------------------------------------------------------------------------------------------
CBlip & CBlip::ApplyTag(StackStrF & tag)
{
SetTag(tag);
return *this;
}
// ------------------------------------------------------------------------------------------------
@ -303,6 +317,7 @@ void Register_CBlip(HSQUIRRELVM vm)
.Prop(_SC("Active"), &CBlip::IsActive)
// Core Methods
.Func(_SC("Bind"), &CBlip::BindEvent)
.FmtFunc(_SC("SetTag"), &CBlip::ApplyTag)
.Func(_SC("CustomEvent"), &CBlip::CustomEvent)
// Core Overloads
.Overload< bool (CBlip::*)(void) >(_SC("Destroy"), &CBlip::Destroy)

View File

@ -119,7 +119,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
*/
void SetTag(CSStr tag);
void SetTag(const StackStrF & tag);
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
*/
CBlip & ApplyTag(StackStrF & tag);
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.