|
function MapMoveOBJ:updateUI()
local cfgnpc=self.cfgnpc
local cfgdel=self.cfgdel
local nparent = self.ui.SlV_jieshao
GUI:removeAllChildren(nparent)
for i=1,#cfgnpc do
if true then
self.csid = cfgnpc[i]["Id"]
local hanld = self.ui.tx_mapname --最上面的名称
GUI:Text_setString(hanld,cfgnpc[i]["npc"])
if cfgdel[cfgnpc[i]["Id"]]["cost"] ~= nil then
hanld = self.ui.tx_xiaohao --显示价格
local itemname = SL:GetMetaValue("ITEM_NAME",cfgdel[cfgnpc[i]["Id"]]["cost"][1][1])
GUI:Text_setString(hanld,itemname..":"..cfgdel[cfgnpc[i]["Id"]]["cost"][1][2])
else
hanld = self.ui.tx_xiaohao --显示价格
GUI:Text_setString(hanld,"免费进入")
end
local str = cfgnpc[i]["mapDesc"]
local text = GUI:RichText_Create(nparent, "p_xh_pos", 115, 20, str, ssrConstCfg.width)
local size = GUI:getContentSize(nparent)
GUI:setAnchorPoint(text, 0.5, 0)
GUI:setPosition(text, size.width/2, -size.height/2)
local itemparent = self.ui.lv_item
GUI istView_setItemsMargin(itemparent, 12)
for j=1,#cfgnpc[i]["yulan"] do
local itemdata = {}
itemdata.index = cfgnpc[i]["yulan"][j]
itemdata.look = true
itemdata.bgVisible = true
itemdata.count = 1
itemdata.color = 225
GUI:ItemShow_Create(itemparent, "item_"..j, 190+(120*j), 0, itemdata)
end
GUI:Text_setString(self.ui.tx_title,cfgnpc[i]["mapname"])
break
end
end
end
你这循环也不变啊点谁都是太湖密道 哪不对了 |
|