New functions added in version 1.021
Total RP 2 :: Development :: Discussion
Page 1 of 1
New functions added in version 1.021
These function will be added to totalRP2_API.lua
- TRP2_DeleteColorCode(chaine):
- Code:
function TRP2_DeleteColorCode(chaine)
if (chaine == nil) then
return "";
else
return string.gsub(chaine, "{%w*}", "");
end;
end
I changed Zax's code from string.gsub(chaine, "{.*}", "") to string.gsub(chaine, "{%w*}", ""), to make sure it doesn't delete new lines token.
This function is used for displaying name using %t in /emote, and for disabling color for names in chat and color in the entire tooltip.
It is also used when sending informations to other RP addons using Mary Sue Protocol.
- TRP2_GetInt(value):
- Code:
function TRP2_GetInt(value)
return math.floor(tonumber(value));
end
This function is used for bulletproofing Total RP agains't the corruption caused by patch 5.4. Sliders were returning float values instead of int, that were inserted into the creation files and made the addon crash when trying to open it. Using this, even if incorrect float values are inserted, Total RP will cast them to int.
I like to think of this as a divine shield
Ellypse- Admin
- Posts : 215
Join date : 2013-09-26
Age : 33
Location : Paris, France
Total RP 2 :: Development :: Discussion
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|