|
类似于这样
添加什么代码可以实现给队友的面板添加武功
elseif xuan ==12 then
local k = JY.Wugong;
local menuwai = {}
local menu = {}
local kftype = JYMsgBox("请选择", "请选择武功类型 ", {"拳法","指法","剑法","刀法","奇门","内功","轻功"}, 7, 347)
for i = 1, JY.WugongNum - 1 do
local kfname = k[i]["名称"]
if string.len(kfname) == 8 then
kfname = kfname.." "
elseif string.len(kfname) == 6 then
kfname = kfname.." "
elseif string.len(kfname) == 4 then
kfname = kfname.." "
end
menuwai[i] = {kfname,nil,2}
if k[i]["武功类型"] == kftype then
menuwai[i][3] = 1
end
end
local nexty = CC.ScreenH/2-CC.DefaultFont*4 + CC.SingleLineHeight
local r = ShowMenu2(menuwai, #menuwai, 3, 9, CC.ScreenW/2-CC.DefaultFont*10-20, nexty, 0, 0, 1, 1, CC.DefaultFont, C_ORANGE, C_WHITE,"选择武功")
if r == 0 then
return
end
for j = 1, CC.Kungfunum do
if JY.Person[diyid]["武功"..j] > 0 then
local wg = JY.Person[diyid]["武功"..j]
menu[#menu+1] = {JY.Wugong[wg]["名称"], nil, 1, wg, j}
end
end
local geizi = ShowMenu2(menu, #menu, 3,10, CC.MainSubMenuX, CC.MainSubMenuY, 0, 0, 1, 1, CC.DefaultFont, C_ORANGE, C_WHITE)
if geizi < 0 then
return
end
if r > 0 then
JY.Person[diyid]["武功"..geizi] = r
JY.Person[diyid]["武功等级"..geizi] = 999
end
|
|