Author Topic: Temporary fix for Mac Font Bug.  (Read 444 times)

Made 99% by Greek2me.

Code: [Select]
$AxolotlMods::TextLimit = 20; //keep on 20

function parseML(%flag)
{
for(%i=0; %i < strLen(%flag); %i++)
{
%char = getSubStr(%flag,%i,1);

if(%char $= "<")
%start = %i;

if(%char $= ">" && %start !$= "")
{
%end = %i;

%full = getSubStr(%flag,%start,%end-%start+1);
%contents = getSubStr(%full,1,strLen(%full) - 2);

%search = %contents;
%pos = -1;
%numValues = 0;
while(strPos(%search,":") >= 0)
{
%search = getSubStr(%search,%pos+1,strLen(%search));

%pos = strPos(%search,":");
if(%pos >= 0)
{
%value[%numValues] = getSubStr(%search,0,%pos);
}
else
{
%value[%numValues] = %search;
}
%numValues ++;
}

if(%numValues <= 0)
{
if(%contents !$= "")
{
%value[0] = %contents;
%numValues = 1;
}
}

%replace = parseMLReplace(%value0,%value1,%value2,%value3,%value4,%value5,%value6,%value7,%value8,%value9,%value10,%value11,%value12,%value13,%value14,%value15);

if(%replace !$= "")
{
%flag = strReplace(%flag,%full,%replace);
%i = %start-1;
}

%start = "";
%end = "";
%full = "";
%contents = "";
%search = "";
%replace = "";
for(%e=0; %e < %numValues; %e++)
%value[%e] = "";
%numValues = "";
}
}

return %flag;
}

function parseMLReplace(%value0,%value1,%value2,%value3,%value4,%value5,%value6,%value7,%value8,%value9,%value10,%value11,%value12,%value13,%value14,%value15)
{
switch$(%value[0])
{
case "font":
if(%value[2] > $AxolotlMods::TextLimit)
{
%replace = "<font:" @ %value[1] @ ":" @ $AxolotlMods::TextLimit @ ">";
}
}

return %replace;
}

package AxolotlClient
{
function clientCmdCenterPrint(%text,%duration){parent::clientCmdCenterPrint(parseML(%text),%duration);}
function clientCmdBottomPrint(%text,%duration){parent::clientCmdBottomPrint(parseML(%text),%duration);}
function newChatHud_AddLine(%text){parent::newChatHud_AddLine(parseML(%text));}

};


deactivatepackage(AxolotlClient);
activatepackage(AxolotlClient);



Are we supposed to copy that whole thing into the console?
Or what?
Instructions want.

Are we supposed to copy that whole thing into the console?
Or what?
Instructions want.
No, lol. You have to package that into a client sided mod (?)

I just released an add-on for this on RTB.

Click this link (once it is approved):
http://forum.returntoblockland.com/dlm/viewFile.php?id=4379