Global_Reg.RegInit("item_msg_pre_init");
function item_msg_pre_init()
NL.RegMakeItemString(nil,"item_msg_pre")
return 0;
end
function item_msg_pre(CharIndex, ItemPos, ItemIndex, ItemString)
--print("\n"..ItemString)
ItemString=ItemString_pre(CharIndex, ItemPos, ItemIndex, ItemString)
local msg = Split(ItemString,"|")
--print("\n"..msg[1])
--msg[4] = string.gsub(msg[4],"\\S"," ")
--msg[4] = string.gsub(msg[4],"\\\\","\\")
local fixmsg = msg[4]
local newmsg = ""
local endmsg = ""
if fixmsg then
if string.find(fixmsg,"①") then
--print(fixmsg)
local b= string.find(fixmsg,"②")
if b then
local c=string.sub(fixmsg,1,b-1)
local d=string.sub(fixmsg,b-1,-1)
fixmsg=c.." "..d
--print(fixmsg)
end
local b= string.find(fixmsg,"③")
if b then
local c=string.sub(fixmsg,1,b-1)
local d=string.sub(fixmsg,b-1,-1)
fixmsg=c.." "..d
--print(fixmsg)
end
local b= string.find(fixmsg,"④")
if b then
local c=string.sub(fixmsg,1,b-1)
local d=string.sub(fixmsg,b-1,-1)
fixmsg=c.." "..d
--print(fixmsg)
end
end
newmsg = newmsg..fixmsg
end
if newmsg~="" then
local long2 = tablength(msg)
if long2>0 then
for i=1,long2 do
if i==4 then
endmsg=endmsg..newmsg.."|"
elseif i~=long2 then
endmsg=endmsg..msg[i].."|"
else
endmsg=endmsg..msg[i]
end
end
end
--endmsg = string.gsub(endmsg,"\\c",",")
--endmsg = string.gsub(endmsg,"\\n","\n")
--print("\n"..endmsg)
return endmsg
end
return nil
end
function paiban_item_msg(str,num)
str = tostring(str)
for i =string.len(str),num do
str=str.." "
end
return str
end
|
|