瀏覽代碼

挂机界面和抽卡显示皮肤

gltfxe 1 年之前
父節點
當前提交
be220ab6eb

+ 1 - 1
script/module/drawCard/DrawCardLogic.lua

@@ -304,7 +304,7 @@ function sendDrawOp(human, id, op, heroList, items, heroNewList, heroIndexList,i
         local heroID = heroList[i]
         local isNew = heroNewList and heroNewList[i]
         local index = heroIndexList and heroIndexList[i]
-        HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index)      
+        HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index, human)      
     end
     dataNet.items[0] = 0
     if items and type(items) == "table" then

+ 8 - 1
script/module/hero/HeroGrid.lua

@@ -323,7 +323,7 @@ function makeHeroSimpleByGeneral(net, id)
 	end
 end
 
-function makeHeroNice(net, id, cnt, isNew, index)
+function makeHeroNice(net, id, cnt, isNew, index, human)
 	net.itemData[0] = 0 
 	net.heroSimple[0] = 0 
 	net.heroStatic[0] = 0
@@ -337,6 +337,13 @@ function makeHeroNice(net, id, cnt, isNew, index)
 		net.heroSimple[0] = 1
 		makeHeroSimpleByID(net.heroSimple[1], id, index)
 
+		if human then
+			local skinbody = SkinLogic.getBodyByHeroId(human, id)
+			if skinbody then
+				net.heroSimple[1].body = skinbody
+			end
+		end
+
 		net.heroStatic[0] = 1
 		makeHeroStatic(net.heroStatic[1], id)
 	end

+ 1 - 1
script/module/hero/HeroLogic.lua

@@ -1425,7 +1425,7 @@ function getHeroGridByUuid(human, uuid)
        local heroGrid = human.db.heroBag[index]
        if heroGrid and type(heroGrid) == "table" then
           if heroGrid.uuid == uuid then
-             return heroGrid
+             return heroGrid, index
           end
        end
     end

+ 9 - 0
script/module/skin/SkinLogic.lua

@@ -304,6 +304,15 @@ function getHeroSkin(human,heroInd)
 	end]=]
 end
 
+function getBodyByHeroId(human, heroid)
+    if not human then return end
+    local list = HeroLogic.getHeroListById(human, heroid)
+    if #list > 0 then
+        local heroIdx = list[1]
+        return getBody(human, heroIdx)
+    end
+end
+
 local function calcSkinAttr(human)
     local skinBag = human.db.skinBag
     if not skinBag then