Răsfoiți Sursa

Merge branch 'localizetexture' of ssh://192.168.0.8:29418/xianjing into hy_dny_localized

# Conflicts:
#	Assets/Lua/Managers/SDKEventReportMgr.lua
gdl_123 2 luni în urmă
părinte
comite
119f003590

Fișier diff suprimat deoarece este prea mare
+ 125 - 145
Assets/Content/Prefabs/UI/UICommonTips/UINoticeTips.prefab


Fișier diff suprimat deoarece este prea mare
+ 918 - 18
Assets/Content/Prefabs/UI/UISettings/UISettings.prefab


+ 5 - 0
Assets/Lua/Core/Constant.lua

@@ -9,6 +9,11 @@ local Constant = {
 
 
     DeleteAccount = false, -- 删除账户
     DeleteAccount = false, -- 删除账户
 
 
+    OpenSystemLink = false,
+    OpenSdkGameStartNtf = false,
+    OpenLanguageSetting = true,
+    LanguageNames = {'cn','en','vi','th'},
+
     HeroLeaderIcon = "FrameNew/label_main",
     HeroLeaderIcon = "FrameNew/label_main",
     HeroBattleIcon = "FrameNew/label_battling",
     HeroBattleIcon = "FrameNew/label_battling",
 
 

+ 2 - 0
Assets/Lua/Enum/Enum.lua

@@ -1059,6 +1059,8 @@ local Enum = {
         IdolGiftBroad = 16, -- 偶像馈赠播报
         IdolGiftBroad = 16, -- 偶像馈赠播报
         LuckyEgg = 17, -- 砸蛋奖励播报
         LuckyEgg = 17, -- 砸蛋奖励播报
 
 
+        SdkLink = 18, 
+
         TimeLimitDel = 100,
         TimeLimitDel = 100,
     },
     },
 
 

+ 20 - 1
Assets/Lua/Logic/ChatData.lua

@@ -31,7 +31,9 @@ function ChatData:Init()
 
 
     table.insert(self.data.systemDatas, 1, welcomeSystemData)
     table.insert(self.data.systemDatas, 1, welcomeSystemData)
     table.insert(self.data.chatDatas.worldChats, 1, welcomeSystemData)
     table.insert(self.data.chatDatas.worldChats, 1, welcomeSystemData)
-
+    if Constant.OpenSystemLink then
+         ManagerContainer.LuaTimerMgr:AddTimer(5000, 1, self, self.AddSdkLink, nil)      
+    end
     if not privateChatPersistentSystem then
     if not privateChatPersistentSystem then
         privateChatPersistentSystem = require("PrivateChatPersistentSystem"):new()
         privateChatPersistentSystem = require("PrivateChatPersistentSystem"):new()
     end
     end
@@ -661,4 +663,21 @@ function ChatData:GetChatChannelType()
 	return self.data.channelType or Enum.ChatChannel.World
 	return self.data.channelType or Enum.ChatChannel.World
 end
 end
 
 
+
+function  ChatData:AddSdkLink()
+     local SdkLinkSystemData = {}
+    SdkLinkSystemData.type = Enum.ChatSystemType.SdkLink
+    SdkLinkSystemData.isSystem = true
+    SdkLinkSystemData.nickname = "SdkLinkTxt"
+    SdkLinkSystemData.sendTime = 0
+
+    --if #self.data.systemDatas >1 then
+    --     local lastData = self.data.systemDatas[#self.data.systemDatas]
+         --SdkLinkSystemData.sendTime = lastData.sendTime + 1 
+    --end
+   
+
+    table.insert(self.data.systemDatas, #self.data.systemDatas + 1, SdkLinkSystemData)
+    table.insert(self.data.chatDatas.worldChats, #self.data.chatDatas.worldChats + 1, SdkLinkSystemData)
+end
 return ChatData
 return ChatData

+ 27 - 0
Assets/Lua/Managers/SDKEventReportMgr.lua

@@ -218,4 +218,31 @@ end
 function SDKEventReportMgr:SendClickGoods()
 function SDKEventReportMgr:SendClickGoods()
 	self:SendEvent(self.EventType.ClickGoods)
 	self:SendEvent(self.EventType.ClickGoods)
 end
 end
+
+function SDKEventReportMgr:GetSDKNtfAndShow()
+	if not Constant.OpenSdkGameStartNtf then
+		return
+	end
+	local url = PlatformPack.NOTIFY_URL.."SdkGameStartNotice.json"--"http://192.168.0.8:8060/res/Notice/SdkGameStartNotice.json"--
+	local OnRequestHttpCb = function (noticeInfo)
+		local noticesJson
+		local ok, errors = RO_XPCALL(function()  noticesJson = JSON:decode(noticeInfo) end, debug.traceback)
+		if ok then
+			LogError(Inspect(noticesJson))	
+			local copyUrl = noticesJson.url
+			local scb = nil
+			if noticesJson.HasSureCb then
+				scb	 = function ()
+					LogError("url = "..copyUrl)
+					UnityEngine.GUIUtility.systemCopyBuffer = copyUrl
+				 end
+			end
+			 local data = {noticesJson, {}, nil, nil, scb}
+				ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
+		else
+			LogError(errors)			
+		end
+	end
+	ManagerContainer.LuaGameMgr:RequestHttpServer(url,OnRequestHttpCb)
+end
 return SDKEventReportMgr
 return SDKEventReportMgr

+ 8 - 0
Assets/Lua/UI/Common/ChatTextItemCtr.lua

@@ -28,6 +28,14 @@ function ChatTextItemCtr:SetData(wnd, item, logicData, enterType, onClickOwner,
             --if item.text.symbolTextEvent then
             --if item.text.symbolTextEvent then
             --    item.text.symbolTextEvent:RegisterClickEvent(wnd, wnd.SystemChatHyperClick)
             --    item.text.symbolTextEvent:RegisterClickEvent(wnd, wnd.SystemChatHyperClick)
             --end
             --end
+        elseif  logicData.type == Enum.ChatSystemType.SdkLink then
+            item.text.symbolText.raycastTarget = true
+            item.text.symbolText.text = I18N.T(logicData.nickname)
+            item.text.symbolTextEvent:RegisterClickEvent(nil, function (hyperParam)
+                    local lurl = hyperParam
+                    --LogError("SdkLink hyperParam = "..hyperParam)
+                    UnityEngine.Application.OpenURL(lurl)
+                end)
         elseif logicData.type == Enum.ChatSystemType.PassMap then
         elseif logicData.type == Enum.ChatSystemType.PassMap then
             local levelData = ManagerContainer.CfgMgr:GetLevelDataById(logicData.paramIds[1])
             local levelData = ManagerContainer.CfgMgr:GetLevelDataById(logicData.paramIds[1])
             if levelData ~= nil then
             if levelData ~= nil then

+ 32 - 11
Assets/Lua/UI/UICommonTips/UINoticeTipsView.lua

@@ -150,21 +150,26 @@ function UINoticeTipsView:Init()
 	local params1 = data[7]
 	local params1 = data[7]
 	local cost = data[8]
 	local cost = data[8]
 
 
-	self.noticeTitle.uILocalizeScript:SetContent(NoticeList[idx].title)
-    self.questionTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice1, params1)
-	self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice, params)
-	self.btnSure.uILocalizeScript:SetContent(NoticeList[idx].btnSure)
-	if NoticeList[idx].btnCancle then
-		self.btnCancleText.uILocalizeScript:SetContent(NoticeList[idx].btnCancle)
+	local curNotice = self:GitCurNotice(idx)
+	if curNotice == nil then
+		return	 
+	end
+
+	self.noticeTitle.uILocalizeScript:SetContent(curNotice.title)
+    self.questionTxt.uILocalizeScript:SetContentAndValues(curNotice.notice1, params1)
+	self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(curNotice.notice, params)
+	self.btnSure.uILocalizeScript:SetContent(curNotice.btnSure)
+	if curNotice.btnCancle then
+		self.btnCancleText.uILocalizeScript:SetContent(curNotice.btnCancle)
 	else
 	else
 		self.btnCancleText.uILocalizeScript:SetContent("BtnCancle")
 		self.btnCancleText.uILocalizeScript:SetContent("BtnCancle")
 	end
 	end
 
 
-	if NoticeList[idx].hideCancel then
+	if curNotice.hideCancel then
 		self.btnClose:SetActive(false)
 		self.btnClose:SetActive(false)
 		self.btnCancle:SetActive(false)
 		self.btnCancle:SetActive(false)
 	else
 	else
-		if NoticeList[idx].hideClose then
+		if curNotice.hideClose then
 			self.btnClose:SetActive(false)
 			self.btnClose:SetActive(false)
 		else
 		else
 			self.btnClose:SetActive(true)
 			self.btnClose:SetActive(true)
@@ -172,7 +177,7 @@ function UINoticeTipsView:Init()
 		self.btnCancle:SetActive(true)
 		self.btnCancle:SetActive(true)
 	end
 	end
 
 
-	if NoticeList[idx].needCost then
+	if curNotice.needCost then
 		self.btnClose:SetActive(false)
 		self.btnClose:SetActive(false)
 		self.btnCancle:SetActive(false)
 		self.btnCancle:SetActive(false)
 		self.btnRight:SetActive(false)
 		self.btnRight:SetActive(false)
@@ -199,7 +204,7 @@ function UINoticeTipsView:Init()
 		self.btnOpen:SetActive(false)
 		self.btnOpen:SetActive(false)
 	end
 	end
 
 
-	self.questionTxt:SetActive(NoticeList[idx].notice1~=nil and NoticeList[idx].notice1~="")
+	self.questionTxt:SetActive(curNotice.notice1~=nil and curNotice.notice1~="")
 end
 end
 
 
 function UINoticeTipsView:OnBtnSureClick()
 function UINoticeTipsView:OnBtnSureClick()
@@ -238,7 +243,11 @@ end
 function UINoticeTipsView:OnBtnCloseClick()
 function UINoticeTipsView:OnBtnCloseClick()
 	local data = self.controller:GetData()
 	local data = self.controller:GetData()
 	local idx = data[1]
 	local idx = data[1]
-	if NoticeList[idx].hideClose then
+	local curNotice = self:GitCurNotice(idx)
+	if curNotice == nil then
+		return
+	end
+	if curNotice.hideClose then
 		return
 		return
 	end
 	end
 	self:CloseUI()
 	self:CloseUI()
@@ -280,5 +289,17 @@ function UINoticeTipsView:OnDispose()
 
 
 end
 end
 
 
+function UINoticeTipsView:GitCurNotice(idx)
+	local curNotice = nil
+	if type(idx) == "table" then
+		curNotice = idx
+	elseif type(idx) == "number" or type(idx) == "string" then
+		 curNotice = NoticeList[idx]
+	else
+		curNotice = nil	 
+	end
+	return curNotice
+end
+
 return UINoticeTipsView
 return UINoticeTipsView
 
 

+ 5 - 0
Assets/Lua/UI/UIMain/UIMainView.lua

@@ -207,6 +207,11 @@ function UIMainView:Init()
 	--统一刷新数据
 	--统一刷新数据
 	self:RefreshData()
 	self:RefreshData()
 	self:RefreshBoliShopState()
 	self:RefreshBoliShopState()
+
+	if ManagerContainer.SDKEventReportMgr ~= nil then
+		ManagerContainer.SDKEventReportMgr:GetSDKNtfAndShow()
+	end
+  
 end
 end
 
 
 function UIMainView:RefreshBoliShopState()
 function UIMainView:RefreshBoliShopState()

+ 26 - 0
Assets/Lua/UI/UISettings/UISettingsView.lua

@@ -32,6 +32,7 @@ function UISettingsView:Init()
 	self:RefreshMusic()
 	self:RefreshMusic()
 	self:RefreshSound()
 	self:RefreshSound()
 	self:RefreshDeleteAcount()
 	self:RefreshDeleteAcount()
+	self:InitLanguageSelect()
 end
 end
 
 
 function UISettingsView:RemoveEventListener()
 function UISettingsView:RemoveEventListener()
@@ -285,5 +286,30 @@ function UISettingsView:OnDeleteSuc()
 				ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
 				ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
             end, nil)
             end, nil)
 end
 end
+
+
+function UISettingsView:InitLanguageSelect()
+	if not Constant.OpenLanguageSetting then
+		self.languageSetting:SetActive(false)
+		return
+	end
+	self.languageSetting:SetActive(true)
+	self.uiBase:AddDropdownEventListener(self.lgsDropdown.dropdown, function (dropdown, value)
+		LogError("lgs dropdown value = "..value)
+		ManagerContainer.LuaLocalizedTextureCfgMgr:SetLanguageByKey(Constant.LanguageNames[value+1])
+	end)
+	local curLanguageKey = string.sub(tostring(ManagerContainer.LuaLocalizedTextureCfgMgr.CurLanguageKey),2)
+	local curV = 1
+	DropDownHelper.ClearDropDown(self.lgsDropdown.dropdown);
+	DropDownHelper.SetStartName(self.lgsDropdown.dropdown, I18N.T('lgn_'..Constant.LanguageNames[1]))
+	for i = 1, #Constant.LanguageNames do		
+		if curLanguageKey ==  Constant.LanguageNames[i] then
+			curV = i - 1
+		end
+		DropDownHelper.SetDropDownItems(self.lgsDropdown.dropdown, I18N.T('lgn_'..Constant.LanguageNames[i]));
+	end
+	self.lgsDropdown.dropdown.value = 0
+end
+
 return UISettingsView
 return UISettingsView
 
 

+ 66 - 0
Assets/Lua/UI/UISettings/UISettingsView_Generate.lua

@@ -2,6 +2,14 @@
 ---@field public gameObject UnityEngine.GameObject
 ---@field public gameObject UnityEngine.GameObject
 ---@field public text UnityEngine.UI.Text
 ---@field public text UnityEngine.UI.Text
 
 
+---@class UISettings__Generate_lgsDropdown
+---@field public gameObject UnityEngine.GameObject
+---@field public dropdown UnityEngine.UI.Dropdown
+
+---@class UISettings__Generate_languageSelectTxt
+---@field public gameObject UnityEngine.GameObject
+---@field public text UnityEngine.UI.Text
+
 ---@class UISettings__Generate_sound_toggle
 ---@class UISettings__Generate_sound_toggle
 ---@field public gameObject UnityEngine.GameObject
 ---@field public gameObject UnityEngine.GameObject
 ---@field public toggle UnityEngine.UI.Toggle
 ---@field public toggle UnityEngine.UI.Toggle
@@ -81,6 +89,9 @@
 ---@field private deleteTimeTxt UISettings__Generate_deleteTimeTxt
 ---@field private deleteTimeTxt UISettings__Generate_deleteTimeTxt
 ---@field private music UISettings__Generate_music
 ---@field private music UISettings__Generate_music
 ---@field private sound UISettings__Generate_sound
 ---@field private sound UISettings__Generate_sound
+---@field private languageSetting UnityEngine.GameObject
+---@field private languageSelectTxt UISettings__Generate_languageSelectTxt
+---@field private lgsDropdown UISettings__Generate_lgsDropdown
 ---@field private verText UISettings__Generate_verText
 ---@field private verText UISettings__Generate_verText
 local UISettingsView = class("UISettingsView", require("UIViewBase"))
 local UISettingsView = class("UISettingsView", require("UIViewBase"))
 
 
@@ -121,6 +132,9 @@ function UISettingsView:InitGenerate(Root, data)
 	self:InitGenerate__18(Root,data)
 	self:InitGenerate__18(Root,data)
 	self:InitGenerate__19(Root,data)
 	self:InitGenerate__19(Root,data)
 	self:InitGenerate__20(Root,data)
 	self:InitGenerate__20(Root,data)
+	self:InitGenerate__21(Root,data)
+	self:InitGenerate__22(Root,data)
+	self:InitGenerate__23(Root,data)
 
 
 
 
 end
 end
@@ -377,6 +391,46 @@ end
 
 
 ---@private
 ---@private
 function UISettingsView:InitGenerate__20(Root, data)
 function UISettingsView:InitGenerate__20(Root, data)
+--[[
+	UIAnimator/Window/Bg/LanguageSetting
+--]]
+	local tmp = Root:Find("UIAnimator/Window/Bg/LanguageSetting").gameObject
+	if tolua.getpeer(tmp) == nil then
+		tolua.setpeer(tmp, {})
+	end
+	self.languageSetting = tmp
+end
+
+---@private
+function UISettingsView:InitGenerate__21(Root, data)
+--[[
+	UIAnimator/Window/Bg/LanguageSetting/languageSelectTxt
+--]]
+	local tmp = Root:Find("UIAnimator/Window/Bg/LanguageSetting/languageSelectTxt").gameObject
+	if tolua.getpeer(tmp) == nil then
+		tolua.setpeer(tmp, {})
+	end
+	self.languageSelectTxt = tmp
+
+	tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
+end
+
+---@private
+function UISettingsView:InitGenerate__22(Root, data)
+--[[
+	UIAnimator/Window/Bg/LanguageSetting/LgsDropdown
+--]]
+	local tmp = Root:Find("UIAnimator/Window/Bg/LanguageSetting/LgsDropdown").gameObject
+	if tolua.getpeer(tmp) == nil then
+		tolua.setpeer(tmp, {})
+	end
+	self.lgsDropdown = tmp
+
+	tmp.dropdown = tmp:GetComponent(Enum.TypeInfo.Dropdown)
+end
+
+---@private
+function UISettingsView:InitGenerate__23(Root, data)
 --[[
 --[[
 	UIAnimator/Window/Bg/VerBox/VerText
 	UIAnimator/Window/Bg/VerBox/VerText
 --]]
 --]]
@@ -459,6 +513,18 @@ function UISettingsView:GenerateDestroy()
 		tolua.setpeer(self.sound, nil)
 		tolua.setpeer(self.sound, nil)
 	end
 	end
 	self.sound = nil
 	self.sound = nil
+	if tolua.getpeer(self.languageSetting) ~= nil then
+		tolua.setpeer(self.languageSetting, nil)
+	end
+	self.languageSetting = nil
+	if tolua.getpeer(self.languageSelectTxt) ~= nil then
+		tolua.setpeer(self.languageSelectTxt, nil)
+	end
+	self.languageSelectTxt = nil
+	if tolua.getpeer(self.lgsDropdown) ~= nil then
+		tolua.setpeer(self.lgsDropdown, nil)
+	end
+	self.lgsDropdown = nil
 	if tolua.getpeer(self.verText) ~= nil then
 	if tolua.getpeer(self.verText) ~= nil then
 		tolua.setpeer(self.verText, nil)
 		tolua.setpeer(self.verText, nil)
 	end
 	end

+ 1 - 0
Assets/Src/Core/Config/LocalizedTextureCfgMgr.cs

@@ -51,6 +51,7 @@ public class LocalizedTextureCfgMgr : Singleton<LocalizedTextureCfgMgr>
     private string baseKey;
     private string baseKey;
 
 
     private string curLanguageKey;
     private string curLanguageKey;
+    public string CurLanguageKey { get => curLanguageKey; }
     private string oldLanguageKey;
     private string oldLanguageKey;
     private Dictionary<string, Dictionary<string, LocalizedSpriteCfg>> cfgs = new Dictionary<string, Dictionary<string, LocalizedSpriteCfg>>();
     private Dictionary<string, Dictionary<string, LocalizedSpriteCfg>> cfgs = new Dictionary<string, Dictionary<string, LocalizedSpriteCfg>>();
     private Dictionary<string, LocalizedSpriteCfg> curCfg;
     private Dictionary<string, LocalizedSpriteCfg> curCfg;

+ 20 - 0
Assets/ToLua/Source/Generate/LocalizedTextureCfgMgrWrap.cs

@@ -20,6 +20,7 @@ public class LocalizedTextureCfgMgrWrap
 		L.RegFunction("__tostring", ToLua.op_ToString);
 		L.RegFunction("__tostring", ToLua.op_ToString);
 		L.RegVar("baseName", get_baseName, set_baseName);
 		L.RegVar("baseName", get_baseName, set_baseName);
 		L.RegVar("IsOpen", get_IsOpen, null);
 		L.RegVar("IsOpen", get_IsOpen, null);
+		L.RegVar("CurLanguageKey", get_CurLanguageKey, null);
 		L.EndClass();
 		L.EndClass();
 	}
 	}
 
 
@@ -262,6 +263,25 @@ public class LocalizedTextureCfgMgrWrap
 		}
 		}
 	}
 	}
 
 
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int get_CurLanguageKey(IntPtr L)
+	{
+		object o = null;
+
+		try
+		{
+			o = ToLua.ToObject(L, 1);
+			LocalizedTextureCfgMgr obj = (LocalizedTextureCfgMgr)o;
+			string ret = obj.CurLanguageKey;
+			LuaDLL.lua_pushstring(L, ret);
+			return 1;
+		}
+		catch(Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e, o, "attempt to index CurLanguageKey on a nil value");
+		}
+	}
+
 	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
 	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
 	static int set_baseName(IntPtr L)
 	static int set_baseName(IntPtr L)
 	{
 	{

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff