gdl_123 3 месяцев назад
Родитель
Сommit
6afa55f02e

+ 5 - 0
Assets/Lua/Managers/LuaLocalizedTextureCfgMgr.lua

@@ -0,0 +1,5 @@
+local LuaLocalizedTextureCfgMgr = class("LocalizedTextureCfgMgr", function()
+    return LocalizedTextureCfgMgr.Instance
+end)
+
+return LuaLocalizedTextureCfgMgr

+ 7 - 0
Assets/Lua/Managers/LuaLocalizedTextureCfgMgr.lua.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: bcc81e6d71de8904fa84132094634dc3
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Assets/Lua/Managers/ManagerContainer.lua

@@ -48,6 +48,7 @@ function ManagerContainer:InitMgr()
     self.LoginMgr = require('LoginMgr'):new()
     self.OpenPayMgr = require('OpenPayMgr'):new()
     self.AccountInfoMgr = require('AccountInfoMgr'):new()
+    self.LuaLocalizedTextureCfgMgr = require('LuaLocalizedTextureCfgMgr'):new()
 end
 
 function ManagerContainer:Update()

+ 7 - 0
Assets/Lua/Util/CommonUtil.lua

@@ -653,6 +653,13 @@ function LoadIcon(wnd, name, cb, itemLua, key)
     if name == "" or name == nil then
         return -1
     end
+
+     local _name = ManagerContainer.LuaLocalizedTextureCfgMgr:GetLocalize(name)
+
+    if _name ~= nil and _name ~= "" then
+        name = _name
+    end
+
     seqId = ManagerContainer.ResMgr:LuaLoadAssets(Enum.ResourceType.SingleSprite, Constants.IconDir, {name}, nil, cb)
     if not ManagerContainer.ResMgr:SeqIdEquals(seqId, 0) then
         if itemLua and key then

+ 8 - 1
Assets/ToLua/Source/Generate/LuaBinder.cs

@@ -118,7 +118,14 @@ public static class LuaBinder
 		SingletonMono_CameraMgrWrap.Register(L);
 		SlideHorizontalOrVerticalLayoutGroupWrap.Register(L);
 		Singleton_AvatarRTMgrWrap.Register(L);
-		L.RegFunction("ResourceLoadCallback_System_Collections_Generic_List_UnityEngine_TextAsset", ResourceLoadCallback_System_Collections_Generic_List_UnityEngine_TextAsset);
+
+        Singleton_LocalizedTextureCfgMgrWrap.Register(L);
+        LocalizedTextureCfgMgrWrap.Register(L);
+        LocalizedSpriteCfgWrap.Register(L);
+        UILocalizeTextureWrap.Register(L);
+
+
+        L.RegFunction("ResourceLoadCallback_System_Collections_Generic_List_UnityEngine_TextAsset", ResourceLoadCallback_System_Collections_Generic_List_UnityEngine_TextAsset);
 		L.RegFunction("ResourceLoadCallbackWithSeqId_UnityEngine_Sprite", ResourceLoadCallbackWithSeqId_UnityEngine_Sprite);
 		L.RegFunction("ResourceLoadCallbackWithSeqId_System_Collections_Generic_List_UnityEngine_Sprite", ResourceLoadCallbackWithSeqId_System_Collections_Generic_List_UnityEngine_Sprite);
 		L.RegFunction("ResourceLoadCallbackWithSeqId_UnityEngine_GameObject", ResourceLoadCallbackWithSeqId_UnityEngine_GameObject);